fix(patient-status): include full queue workflow statuses in patient status response
Updated GET /api/v1/patients/{book_no}/status to return the full workflow status timeline by combining PatientVisitDetails.status with the latest queue progression for the latest camp.
Changes
- Removed the
consultation_completed-only queue filter. - Pulled latest relevant queue record for the patient in the latest camp.
- Added queue progression statuses up to current queue state:
know_your_patientwaiting-
in_consultation(only when consultation actually started) - post-consultation statuses as applicable
- Kept direct
waiting -> consultation_completedbehavior correct by not forcingin_consultationwhenconsultation_started_atis null. - Normalized status output order and preserved unknown/legacy statuses.
Files changed
app/api/v1/routes/patient_routes.pytests/test_api/test_patient_routes.py
Validation
- Passed:
uv run pytest -q tests/test_api/test_patient_routes.py -k "get_patient_status" - Note: full file run still shows pre-existing unrelated
PatientCreatevalidation test failures.