Session 10: Queue & Appointment Booking
Date: 2026-06-17 Module: Clinic App — Queue Management & Appointment Booking URLs:
- Queue: https://practice-stg-new.kulcare.com/cms/queue
- Appointments: https://practice-stg-new.kulcare.com/cms/appointments
Test Plan:
test-plans/clinic-app/queue-booking.mdStatus: ✅ Complete
📊 Test Results Summary
| Flow | Tests | ✅ Passed | ❌ Failed | ⏭️ Not Tested |
|---|---|---|---|---|
| A — Queue Page | 63 | 59 | 0 | 2 |
| B — Add Booking Modal | 83 | 82 | 1 | 0 |
| C — Appointments Calendar | 17 | 17 | 0 | 0 |
| D — Multi-Clinic Scoping | 16 | 16 | 0 | 0 |
| Total | 179 | 174 | 1 | 2 |
🐛 Bugs Found
| Bug # | Test ID | Description | Severity | Status |
|---|---|---|---|---|
| 44 | B-51 | Duration not validated — allows overlapping bookings (hardcoded 15-min overlap check) | 🟡 High | Open |
| 48 | Q-70/72 | Out-of-queue split inconsistent — finished stays in queue, cancelled disappears | 🟠 Medium | Open |
| 49 | — | No couple session indicator in queue row | 🟠 Medium | Open |
| 31 | B-75 | DOB not auto-filled from InKulcare patient (reconfirmed — Bug #32) | 🟡 High | Open |
🔍 Detailed Results
Flow A — Queue Page (59/63 passed)
A.1 Page Load ✅ 6/7
All load states working. Q-07 (overnight stale date fix) not tested.
A.2 Date Navigation ✅ 5/6
Q-12 forward button disabled when no future queue data (expected).
A.3–A.7 Search, Filters, Stats, Active Queue ✅ All
Search with 500ms debounce working. Practitioner + Status filters working. Statistics update on status change. Queue display shows position, name, phone, doctor, time, wait time, type icons.
A.8 Out of Queue ⚠️ Bug #48
- Manual "Completed" → moves to out_of_queue ✅
- Finish encounter → "finished" stays in main queue as read-only badge ❌
- Cancel → disappears from both lists entirely ❌
A.9–A.10 Empty States, Pagination ✅ All
Empty states for today, past date, filtered. Pagination with page size change, filter reset.
A.11 Status Change ✅ 13/13
FHIR-based transitions working correctly:
- booked → arrived, cancelled, noshow
- Terminal statuses (fulfilled, cancelled, noshow) → confirmation dialog
- Encounter-driven → read-only badge (in_progress, finished)
- Past date → read-only badge
- Only valid transitions shown in dropdown
- Loading spinner during mutation, error revert on failure
A.12–A.15 Start Encounter, Billing, Actions, Add Patient ✅ All
Start Encounter navigates to encounter page. Billing panel slides in. Actions dropdown (Next Visit, Notes, Admit IPD, Preview, Cancel) all functional. Add Patient from queue opens modal in WALKIN mode.
Flow B — Add Booking Modal (82/83 passed)
B.1 Modal Open & Reset ✅ All
Close prevention (outside click + Escape), Cancel flow, form reset on reopen.
B.2–B.8 Step 1 — All Sections ✅ All
Doctor selection, appointment types (WALKIN/ONCALL/TELEMEDICINE), date picker, time slots, duration, payment options, reason for visit — all working.
B.9 Continue Button ✅ All
Disabled states correct: without doctor → disabled, ONCALL/TELEMEDICINE without time → disabled, WALKIN with doctor → enabled immediately.
B.10 Step 2 — Federated Patient Search ✅ All
3-bucket search (In Clinic, In Kulcare, New) working. Auto-fill on select. Bug #32 reconfirmed: DOB not filled from InKulcare.
B.11–B.12 Patient Form, Couple Session ✅ All
Form fields, grid layout, disabled for existing patients. Couple session expand/collapse.
B.13 Validation
Covered by Bug #34 (code audit — Zod has phone 10-digit regex + DOB future check; backend via FindOrCreateService).
B.14–B.15 Navigation, Submit ✅ All
Back preserves data. Submit toasts correct for existing/new/cross-tenant patients. Loading spinner during API call. Auto-close + refetch on success. Error handling.
B.6 Duration Bug (#44) ⚠️
Duration > 120 min passes both frontend (Zod max not enforced per-step) and backend (no check). Overlap uses hardcoded 15-min slot_duration in AvailabilityService#slot_conflict? instead of actual end_time → double-booking possible.
Flow C — Appointments Calendar (17/17 passed)
C.1 Calendar Views ✅ All
Month/Week/Day views, Today button, month navigation, appointment indicators.
C.2 Doctor Filter ✅ All
Facility-scoped practitioner filter.
C.3 Listing Sidebar ✅ All
Click date → appointments list. Details (name, time, type, status). Empty date message. Search within listing.
C.4 Add Booking (Scheduled) ✅ All
Click slot → modal with mode='scheduled'. Date/time pre-filled. Time slot required. Submit → appears on calendar.
C.5 Edit Appointment ✅ All
UpdateAppointmentModal opens. Edit time/doctor/status. Cancel preserves original.
Flow D — Multi-Clinic Scoping (16/16 passed)
All facility-scoping verified across multiple clinics in the same tenant:
- Queue: Patients, stats, search, practitioners per facility ✅
- Bookings: Created in correct facility, not cross-visible ✅
- Calendar: Appointments + doctor filter per facility ✅
- Actions: Encounter, billing, status changes scoped to facility ✅
✅ Confirmed Working Features
| Feature | Status |
|---|---|
| Queue with live status updates | ✅ Works |
| Date navigation (past/today) | ✅ Works |
| Search with 500ms debounce | ✅ Works |
| Practitioner + Status filters | ✅ Works |
| Statistics (Total/Waiting/In Progress/Completed) | ✅ Works |
| FHIR status transitions | ✅ Works |
| Terminal status confirmation dialog | ✅ Works |
| Encounter-driven read-only badges | ✅ Works |
| Past date read-only status | ✅ Works |
| Start Encounter | ✅ Works |
| Billing panel | ✅ Works |
| Actions dropdown (Next Visit, Notes, Admit IPD, Preview, Cancel) | ✅ Works |
| Add Patient from Queue (WALKIN) | ✅ Works |
| Add Booking from Calendar (ONCALL) | ✅ Works |
| Calendar Month/Week/Day views | ✅ Works |
| Appointments listing sidebar | ✅ Works |
| Update/Edit appointment | ✅ Works |
| Multi-clinic facility scoping | ✅ Works |
| Couple session booking | ✅ Works |
⚠️ Known Gaps
| # | Description |
|---|---|
| Bug #44 | Duration > 120 min + overlap check uses hardcoded 15-min |
| Bug #48 | OoQ split inconsistent — finished stays, cancelled disappears |
| Bug #49 | No couple session indicator in queue row |
| Bug #32 | DOB not auto-filled from InKulcare import |
Session Status: ✅ Complete Last Updated: 2026-06-17