fix(patient-status): return only completed stages in patient status response
name: Bug Report
about: Report a bug in the EHRS Backend.
title: "fix(patient-status): return only completed stages in patient status response"
labels: "bug"
assignee: 'koushik'
🐛 Bug Report
Describe the bug
The patient status API was returning workflow stages before they were actually completed.
In particular, vitals and know_your_patient could appear in the response body just because the patient had entered that queue or reached that step. The backend was inferring completion from queue position instead of using true completion signals.
To Reproduce
- Register a patient for the latest camp.
- Move the patient into the
vitalsqueue without completing vitals. - Call the patient status endpoint.
- Observe that
vitalsmay appear in the response before vitals are completed.
Or:
- Complete vitals so the patient moves to
know_your_patient. - Keep the patient actively in the
know_your_patientqueue without completing that stage. - Call the patient status endpoint.
- Observe that
know_your_patientmay appear in the response before it is completed.
Expected behavior
The patient status response should contain only genuinely completed stages.
-
vitalsshould appear only after vitals are completed. -
know_your_patientshould appear only after Know Your Patient is completed. - A stage should not appear only because the patient has entered that queue.
Screenshots
Environment
- OS: Linux
- Backend: EHRS FastAPI backend
- API Area: Patient status endpoint
Edited by Banuri Koushik Reddy

