Context: LumenHealth EHR
When a doctor opens a patient's file, they need to see their entire medical history (all past encounters, vitals, and notes) on one scrollable, chronological screen.
Concurrent Boundary (How to work unblocked)
Create a complex mock JSON object representing 3 past encounters with fake nested vitals and notes. Do not wait for the real data to be generated.
Backend Scope (apps/api/src/modules/patients/history.controller.ts)
- Build a heavy aggregation endpoint
GET /api/v1/patients/:id/history.
- It must fetch the Patient, all past Encounters, and
$lookup (join) the Vitals, Notes, and Diagnoses for each encounter, sorted newest to oldest.
Frontend Scope (apps/web/src/app/dashboard/patients/[id])
- Build the Medical History view featuring a vertical timeline connecting the visits.
- Implement lazy-loading/pagination. Only load the last 5 encounters, fetch more when the user scrolls to the bottom.
- Design expandable accordion cards for past visits. Clicking a visit expands it to show the vitals and notes from that day.
Acceptance Criteria
Context: LumenHealth EHR
When a doctor opens a patient's file, they need to see their entire medical history (all past encounters, vitals, and notes) on one scrollable, chronological screen.
Concurrent Boundary (How to work unblocked)
Create a complex mock JSON object representing 3 past encounters with fake nested vitals and notes. Do not wait for the real data to be generated.
Backend Scope (
apps/api/src/modules/patients/history.controller.ts)GET /api/v1/patients/:id/history.$lookup(join) the Vitals, Notes, and Diagnoses for each encounter, sorted newest to oldest.Frontend Scope (
apps/web/src/app/dashboard/patients/[id])Acceptance Criteria
patientId).