feat(api): Create Unified Patient Dashboard endpoint
Problem
Currently, patient-related information (basic details, vitals, doctor assignment, consultation status, prescription) is exposed through multiple APIs. This requires several API calls to build the patient view and makes the frontend logic complex and slower.
To support the Unified Patient Dashboard, we need one consolidated API endpoint that returns all required patient information using the patient book number.
Proposed Solution
Create a new API endpoint that aggregates patient data from multiple services/tables and returns it as a single structured response.
Proposed Endpoint
GET /api/v1/patients/{book_number}/dashboard
The endpoint should return:
Name
Age
Gender
Book number
Registration date
Registration status
Vitals recorded
Doctor assigned
Consultation status (pending / in-progress / completed)
Pharmacy / counseling status
Blood pressure
Sugar
Pulse
Temperature
Doctor name
Specialty
Consultation status
Prescribed medicines
Dosage & duration
Prescription status (draft / approved)
Endpoint returns all patient-related data in a single response
Fetches data using book number
Handles missing sections gracefully (e.g., no prescription yet)
Response is read-only
Works for both existing and newly registered patients
Proper error response for invalid book number
Linked to: Feature: Unified Patient Dashboard