Skip to content

Longitudinal Patient Timeline UI & Aggregator #117

Description

@inteee

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)

  1. Build a heavy aggregation endpoint GET /api/v1/patients/:id/history.
  2. 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])

  1. Build the Medical History view featuring a vertical timeline connecting the visits.
  2. Implement lazy-loading/pagination. Only load the last 5 encounters, fetch more when the user scrolls to the bottom.
  3. Design expandable accordion cards for past visits. Clicking a visit expands it to show the vitals and notes from that day.

Acceptance Criteria

  • The backend aggregation endpoint completes in under 300ms (ensure proper MongoDB indexing on patientId).
  • The frontend successfully renders nested data and handles pagination smoothly.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions