Patient booking systems look simple on the surface — select a time, book it. But healthcare scheduling has constraints that generic booking systems don't handle: appointment types with different durations, practitioner availability that changes weekly, equipment requirements that limit concurrent bookings, and waitlist management when slots fill up. We built Dandaansaz's booking system around an event-driven architecture that handles all of these constraints reliably.
The Scheduling Constraint Model
We modelled scheduling as a constraint satisfaction problem. Each appointment has: a practitioner (must be available), a room (must be available), equipment (must be available), and a time slot (must not overlap with existing bookings). When a booking is requested, the system checks all four constraints simultaneously. If any constraint fails, it suggests alternatives: the same treatment with a different practitioner, a different room, or a different time slot. This constraint-first approach eliminated double-bookings entirely.
Event-Driven Booking Lifecycle
Every booking generates a series of events: BookingRequested → ConstraintsChecked → SlotReserved → ConfirmationSent → ReminderScheduled → AppointmentCompleted → FollowUpTriggered. Each event is persisted and triggers the next step asynchronously. If a step fails (e.g., constraints check fails), the event log shows exactly where and why. This event-driven approach made the booking flow transparent and debuggable — critical for a system that handles patient health data.
Pro Tip
Event-driven booking flows are easier to debug than synchronous ones. When a booking fails, the event log shows the exact failure point without requiring log diving.
Waitlist and Cancellation Handling
When a slot is full, patients can join a waitlist. When a cancellation occurs, the system automatically notifies the first waitlist patient via SMS and email, offering the newly available slot. If the patient doesn't respond within 2 hours, the slot is offered to the next waitlist patient. This automated process recovered 23% of cancelled appointments — previously, cancelled slots went empty because staff didn't have time to manually contact waitlist patients.
Automated Reminder System
We implemented a three-tier reminder system: (1) 7 days before: email with appointment details and pre-visit instructions. (2) 24 hours before: SMS with a confirmation link (tap to confirm or reschedule). (3) 2 hours before: final SMS with clinic address and parking information. Each reminder generates events that track patient engagement. Patients who don't confirm within 24 hours receive a follow-up call from staff. No-show rate dropped from 18% to 6% after implementing this system.
Conclusion
Patient booking systems are constraint satisfaction problems, not simple calendar apps. Event-driven architecture makes the booking flow transparent, debuggable, and auditable. The automated waitlist and reminder systems recovered 23% of cancelled appointments and reduced no-shows by 67% — direct revenue impact from architecture decisions.
Key Takeaways
- Model scheduling as constraint satisfaction: practitioner + room + equipment + time slot
- Event-driven booking lifecycle provides transparency and debuggability
- Automated waitlist notification recovered 23% of cancelled appointments
- Three-tier reminder system reduced no-shows from 18% to 6%