feat(frontend): show Active Consultations count on doctor cards in Assign Doctor flow(requires backend)
Summary
In the Assign Doctor page, after entering a patient book number and loading doctors, each doctor card currently shows only the doctor’s name and specialization. We need to display each doctor's current pending load as Active Consultations.
This change involves both frontend and backend updates:
- Backend will expose additional active consultation metrics in the existing doctors list API.
- Frontend will render the active load inside doctor selection cards.
Problem
Without queue load visibility, coordinators cannot quickly choose the least-busy doctor during assignment.
Additionally, the current API response lacks stage-wise active consultation counts needed for better workload visibility.
Required Change
Backend
Update the existing endpoint:
GET /api/v1/doctors/registered
Enhance the response to include active consultation metrics:
-
pending_queue_count(existing) -
vitals_count(new) -
waiting_count(new) -
in_consultation_count(new)
These values should be calculated from the active consultation/patient flow queue.
Frontend
Show Active Consultations in each doctor card using:
pending_queue_count
Display format example:
Active Consultations: <pending_queue_count>
Data Source
Existing API:
GET /api/v1/doctors/registered
Fields used:
doctor_namespecializationpending_queue_count- (New backend fields for future load visibility)
vitals_countwaiting_countin_consultation_count
Expected UI
Each doctor card should include:
- Doctor name
- Specialization
- Active Consultations:
<pending_queue_count>
Example:
Dr. Yatin Rastogi
Pediatrician
Active Consultations: 3
Acceptance Criteria
- After typing a valid book number and loading the doctor list, every doctor card shows Active Consultations.
- Displayed value must match
pending_queue_countfrom the API response. - If the value is missing/null, show
0. - Backend response includes new active consultation stage counts.
- UI remains clean and readable on mobile and desktop.
Out of Scope
- No new API endpoints.
- No UI redesign beyond adding the Active Consultations field.