Inspiration
A clinical trial visit is more than an appointment on a calendar. It must happen within a protocol-defined window, fit the participant's availability, and have the right staff and equipment available together.
When equipment becomes unavailable or a participant needs to reschedule, one change can affect several later visits. Inspired by Regeneron's challenge to improve clinical trials, we built Inside the Window to help coordinators create valid schedules and respond to disruptions with fewer changes.
What it does
Inside the Window is an interactive clinical trial scheduling prototype built with synthetic data.
Coordinators can:
- Generate schedules using a greedy baseline or a constraint-based optimizer.
- Respect visit windows, participant availability, clinic hours, resource capacity, and visit dependencies.
- Explore daily timelines grouped by participant or resource.
- Inspect visit details, window calculations, and resource assignments.
- Simulate equipment outages and participant rescheduling requests.
- Pin appointments that must keep their exact time and resources.
- Review proposed repairs through before-and-after timelines and lists of added, moved, or cancelled appointments.
- Confirm or discard proposals, preserve schedule versions, and export results as CSV.
When a visit cannot be scheduled, the application reports it instead of silently relaxing the constraints.
How we built it
We built the application in Python with Streamlit for the interface, Google OR-Tools CP-SAT for optimization, SQLite for persistence, and Pandas and Altair for tables and timeline visualizations.
Our optimizer works through three priorities: maximize the number of scheduled visits, minimize changes to existing appointments, and then minimize deviation from target dates.
We separated the scheduling engine from the interface and storage. An independent validator checks proposed schedules, while explicit confirmation keeps draft changes separate from committed appointments. Each saved version includes its scenario inputs so that confirmed outages and availability changes survive a reload.
Our two-person team divided the work between scheduling and optimization logic, and the interactive workflow and persistence, then integrated and tested the complete application together.
Challenges we ran into
The hardest part was handling disruptions without unnecessarily rearranging the entire schedule. Scheduling more visits and preserving existing appointments can compete, so we made those priorities explicit.
Visit dependencies added another challenge: moving an earlier visit can affect whether a later visit remains valid. We also needed pinned appointments to remain fixed and infeasible repairs to be reported clearly.
Keeping the review workflow consistent was equally important. A proposal can become stale when disruption inputs, pinned appointments, or the committed schedule change. We added proposal invalidation and atomic version checks to prevent outdated changes from overwriting newer work.
Accomplishments that we're proud of
We completed an end-to-end workflow: generate, validate, review, confirm, disrupt, repair, and compare.
The project includes 80 passing automated tests covering scheduling constraints, optimization priorities, repair behavior, persistence, and interface workflows.
We are especially proud that users can inspect proposed changes before accepting them, and that the application distinguishes a valid solution from one whose optimality has been proven.
What we learned
We learned that a useful scheduler needs both optimization and a clear review process. Finding a mathematically valid schedule is only part of the problem; users also need to understand what changed and why.
We also learned the value of independent validation, reproducible synthetic scenarios, and versioned state when integrating an optimization engine into an interactive application.
What's next for Inside the Window
We want to add configurable protocol imports, richer participant preferences, and comparisons across larger synthetic scenarios.
We would also like feedback from clinical trial coordinators to improve the review workflow and understand which scheduling decisions need the most explanation.
This prototype uses synthetic data. Real-world use would require further validation, privacy and security work, and integration with existing clinical trial systems.
Log in or sign up for Devpost to join the conversation.