Skip to main content

Visits

Route: /visits
File: memberportal/src/pages/VisitsPage.tsx
FHIR Resource: Encounter

The Visits page shows the patient's upcoming appointments and past encounter history. It is split into two independent tables.

note

/appointments redirects to /visits. They are the same page.

Stat cards​

Three summary cards are shown above the tables:

CardValue
Next AppointmentDate of the nearest future appointment, with type and doctor name
Total VisitsCombined count of upcoming + recent visits
Providers SeenCount of unique provider names across all encounters

Table 1 — Upcoming Visits​

FHIR resource: Appointment

Shows appointments with status booked, proposed, pending, waitlist, arrived, or checked-in.

Columns: Date / time, Visit Type, Doctor, Clinic, Status badge, EHR source Controls: Search (by type, doctor, clinic), sortable columns

Appointment detail drawer: Clicking any row opens a right-side drawer showing:

  • Full date, time range, doctor, clinic, reason, notes, patient instructions
  • Add to Google Calendar button (for future appointments — opens a pre-filled Google Calendar link)
  • Ask ChartChat button — closes the drawer and opens the per-appointment chat

Table 2 — Recent Visits​

FHIR resource: Encounter

Shows all encounters with status other than planned.

Columns: Date / time, Visit Type (with patient-mode translation via usePatientTranslate), Provider, EHR source, Ask ChartChat Controls: Search (by type, provider, reason), page size selector, sortable columns

Encounter quick-view drawer: Clicking any row opens a right-side quick-view drawer showing date, provider, reason, class, and diagnoses. Buttons in the drawer:

  • View Full Visit → navigates to /visits/:encounterId
  • Ask ChartChat → closes the drawer and opens the per-encounter chat

AI Chat​

The page has four independent chat drawers (via ResourceChatDrawer):

TriggerContext
Chatbot icon in "Upcoming Visits" section headerGeneral upcoming appointments chat
Chatbot icon in "Recent Visits" section headerGeneral visit history chat
Ask ChartChat in appointment detail drawerPer-Appointment resource chat
Ask ChartChat in encounter row / quick-view drawerPer-Encounter resource chat

Visit Detail​

Route: /visits/:encounterId File: memberportal/src/pages/VisitDetailPage.tsx

Full detail view for a single encounter. Reached from the quick-view drawer's "View Full Visit" button.

FHIR queries​

GET /fhir/R4/Appointment?
patient={patientId}
&_sort=date
&_total=accurate

GET /fhir/R4/Encounter?
patient={patientId}
&_sort=-date
&_total=accurate

Both are fetched in parallel via searchResourcePages (streaming). The page renders incrementally as data arrives.