Fix: Repeat medicine patients incorrectly routed to consultation instead of prescription after vitals
Bug Summary
Repeat medicine patients are incorrectly routed to consultation queue instead of directly moving to prescription queue after vitals
Current Behavior
-
Patients who select "Repeat Medicine" during registration are still following the normal flow
-
After completing Vitals, they are moved to:
- Consultation Queue
- In Consultation
-
Instead of directly going to Prescription Queue
-
UI does not update immediately; correct status is only visible after manual refresh
Expected Behavior
- If patient selects Repeat Medicine during registration, flow should be:
Registration → Specialization → Vitals Waiting → Vitals → Prescription Queue
-
System should:
- Skip Consultation Queue
- Skip In Consultation
- Directly move patient to Prescription Queue after vitals
-
UI should update instantly without requiring refresh
Impact
-
🚨 Critical -
⚠ ️ High -
📌 Medium -
ℹ ️ Low
Affected Users: volunteer, doctor Affected Modules: Patient Registration, Queues, Patient Status
Reproduction Steps
- Login as Volunteer
- Register a patient with Repeat Medicine selected
- Select specialization
- Move patient through Vitals Waiting → Vitals
- Observe next queue
Reproduction Rate: [x] Always
Environment
-
Local development -
Staging -
Production
Test Cases
| Test ID | Description | Expected | Actual | Status |
|---|---|---|---|---|
| TC-BUG-001 | Repeat medicine routing | Moves to Prescription | Moves to Consultation | |
| TC-BUG-002 | UI update | Updates instantly | Updates after refresh |
Root Cause
- Missing condition for
is_repeat_medicineafter vitals - Frontend/state not updating queue immediately
Fix Needed
- Add condition to skip consultation when
is_repeat_medicine = true - Ensure UI updates immediately after queue change
Additional Notes
- No console errors observed
- Likely backend + frontend sync issue
- Manual refresh temporarily fixes UI