The scheduling layer in MindFlow supports both online self-booking and front-desk booking, with real-time sync to Google Calendar and Cal.com. Reminders are queued through the notification_queue and dispatched by cron across email, SMS, and WhatsApp.
appointments table stores start/end datetime, patient_id, user_id (clinician), status, type, and consultation fee. doctor_availability defines per-clinician working hours and slot lengths. appointment_waitlist holds queued patients when all slots are full.
api/appointments.php handles create/update/cancel with status transitions (scheduled → confirmed → completed / cancelled / no-show). All status changes are logged in audit_logs.
The patient portal's booking flow reads available slots in real time from doctor_availability, filtered against existing confirmed appointments, gcal_blocked_slots, and calcom_blocked_slots.
When a patient joins the waitlist (appointment_waitlist), an automated notification is dispatched when a slot opens up (cron-driven check every N minutes, configurable in the cron manager).
OAuth2 flow (api/gcal_oauth_callback.php) stores tokens in user_google_tokens. api/google_calendar.php syncs appointments bi-directionally: new app appointments push to GCal, new GCal events block the corresponding slots in gcal_blocked_slots.
api/calcom.php integrates with the Cal.com scheduling API. user_calcom_tokens stores per-user Cal.com credentials. Blocked slots are mirrored in calcom_blocked_slots. Useful for clinics that use Cal.com as their primary public booking page.
Slot availability always queries all three sources (app schedule + GCal blocks + Cal.com blocks) in a single query using a UNION to avoid showing a slot as free when it's blocked in any calendar.
pages/walkin_kiosk.php is a full-screen, touch-friendly self-registration page for a tablet or spare screen at reception. Patients enter their name or phone; returning patients are matched against existing records. A new walk-in appointment is created and the patient joins the queue.
pages/queue_display.php is a public-facing (unauthenticated, but token-scoped) waiting-room screen. It shows the current token number being seen, tokens waiting, and an estimated wait time calculated from the average consultation duration setting.
pages/walkin_portal.php is an alternative: a lightweight page patients open on their own phone to book a same-day slot, without needing a portal login.
reminder_templates stores per-clinic, per-trigger templates (appointment confirmed, reminder 24h before, reminder 2h before, follow-up due). Each template has separate body fields for email, SMS, and WhatsApp.
Reminders are written to the notification_queue (channel, recipient, content, scheduled_at). The cron job (api/cron.php → includes/notify.php) picks up due notifications and dispatches them via the configured gateway.
The bundled no-show-tracker plugin (plugins/no-show-tracker/) reads the appointments table and ranks patients by no-show count and rate. The data is exposed via a plugin page in the admin UI — no schema changes required, runs on top of the existing data.
The demo has real sample data — appointments, patients, prescriptions — so you can explore freely.