Draft: Feat/patient status
This MR introduces the Patient Login functionality and implements a dynamic, stage-based queue system in the Patient Dashboard.
Implemented patient login using:
Book Number
Password
On successful authentication:
Patient is redirected to the Patient Dashboard
Token-based authentication is used for secure API communication
Book number is displayed in the dashboard header
Added dynamic queue tracking for:
Vitals Queue
Consultation Queue
Queue display is now calculated based on the patient’s current stage, instead of showing only a static queue number.
🧠 Queue Logic (Stage-Based Calculation)
The number of patients ahead is determined dynamically using backend data:
If the patient is in Vitals stage, only patients with status "vitals" ahead of them are counted.
If the patient is in Consultation stage, only patients in:
"waiting"
"in_consultation"
ahead of them are counted.
This ensures the queue reflects the actual stage-specific waiting list.
The dashboard now displays:
“There are X patients ahead of you”
“You are next” when patientsAhead = 0
Proper status indicator (Waiting / In Consultation / Completed)
Queue updates dynamically based on backend API response.
This enhancement improves:
Transparency for patients
Real-time stage awareness
Professional queue management experience
Overall usability of the Patient Dashboard