# medplum/foomedical architecture

> Architecture diagram of the GitHub repository medplum/foomedical, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/medplum/foomedical
- Repository: https://github.com/medplum/foomedical

## Overview

Foo Medical is a patient-facing medical-practice sample app backed by Medplum, with patient and health data represented as FHIR resources. The principal workflow is a patient signing in, navigating routed care features, and viewing or updating records, questionnaires, care plans, or messages. Scheduling and SMART Health Links are separate capabilities. The graph follows the visible app/router structure and sampled page behavior; several major features are documented or routed but their implementations were not sampled, so their internal relationships are not inferred.

Main entry points: [`src/Router.tsx`](https://github.com/medplum/foomedical/blob/main/src/Router.tsx) (Page router), [`src/App.tsx`](https://github.com/medplum/foomedical/blob/main/src/App.tsx) (App shell), [`src/pages/health-record/Measurement.tsx`](https://github.com/medplum/foomedical/blob/main/src/pages/health-record/Measurement.tsx) (Measurements), [`src/pages/CheckInPage.tsx`](https://github.com/medplum/foomedical/blob/main/src/pages/CheckInPage.tsx) (Check-in)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and access"]
  node_app["App shell<br/>[App.tsx]"]
  node_router["Page router<br/>[Router.tsx]"]
  node_sign_in["Sign in<br/>[SignInPage.tsx]"]
  node_registration["Registration<br/>[RegisterPage.tsx]"]
  node_home["Patient home<br/>[HomePage.tsx]"]
  node_account["Account settings"]
end

subgraph group_records["Health records"]
  node_health_record["Health record"]
  node_measurement["Measurements<br/>[Measurement.tsx]"]
  node_measurement_config["Measurement definitions"]
  node_chart["Measurement chart<br/>[LineChart.tsx]"]
  node_observation["Observation detail"]
end

subgraph group_care["Care workflows"]
  node_care_plan["Care plan"]
  node_action_items["Action items<br/>[ActionItems.tsx]"]
  node_get_care["Scheduling<br/>[GetCarePage.tsx]"]
  node_check_in["Check-in<br/>[CheckInPage.tsx]"]
  node_check_in_data["Check-in content"]
  node_save_check_in["Save check-in<br/>[save-check-in.ts]"]
  node_screening["Screening questionnaire"]
  node_intake["Patient intake"]
  node_questionnaire["Questionnaire"]
end

subgraph group_engagement["Patient engagement"]
  node_messages["Messaging<br/>[MessagesPage.tsx]"]
  node_message_search["Message search"]
  node_smart_links["SMART Health Links"]
end

node_patient(("Patient"))
node_medplum[("Medplum service")]

node_patient -->|"opens"| node_app
node_app -->|"renders"| node_router
node_app -->|"routes unauthenticated"| node_sign_in
node_app -->|"routes unauthenticated"| node_registration
node_router -->|"routes"| node_home
node_router -->|"routes"| node_account
node_router -->|"routes"| node_health_record
node_router -->|"routes"| node_measurement
node_router -->|"routes"| node_care_plan
node_router -->|"routes"| node_action_items
node_router -->|"routes"| node_get_care
node_router -->|"routes"| node_check_in
node_router -->|"routes"| node_screening
node_router -->|"routes"| node_intake
node_router -->|"routes"| node_questionnaire
node_router -->|"routes"| node_messages
node_router -->|"routes"| node_smart_links
node_router -->|"routes"| node_observation
node_measurement -->|"searches and creates observations"| node_medplum
node_measurement -->|"reads definitions"| node_measurement_config
node_measurement -->|"renders"| node_chart
node_action_items -->|"searches care plans"| node_medplum
node_check_in -->|"uses questionnaire content"| node_check_in_data
node_check_in -->|"saves through"| node_save_check_in
node_messages -->|"normalizes search"| node_message_search
node_medplum -.->|"hosts FHIR records"| node_patient

click node_app "https://github.com/medplum/foomedical/blob/main/src/App.tsx"
click node_router "https://github.com/medplum/foomedical/blob/main/src/Router.tsx"
click node_sign_in "https://github.com/medplum/foomedical/blob/main/src/pages/SignInPage.tsx"
click node_registration "https://github.com/medplum/foomedical/blob/main/src/pages/RegisterPage.tsx"
click node_home "https://github.com/medplum/foomedical/blob/main/src/pages/HomePage.tsx"
click node_account "https://github.com/medplum/foomedical/tree/main/src/pages/account"
click node_health_record "https://github.com/medplum/foomedical/tree/main/src/pages/health-record"
click node_measurement "https://github.com/medplum/foomedical/blob/main/src/pages/health-record/Measurement.tsx"
click node_measurement_config "https://github.com/medplum/foomedical/blob/main/src/pages/health-record/Measurement.data.ts"
click node_chart "https://github.com/medplum/foomedical/blob/main/src/components/LineChart.tsx"
click node_care_plan "https://github.com/medplum/foomedical/tree/main/src/pages/care-plan"
click node_action_items "https://github.com/medplum/foomedical/blob/main/src/pages/care-plan/ActionItems.tsx"
click node_get_care "https://github.com/medplum/foomedical/blob/main/src/pages/GetCarePage.tsx"
click node_check_in "https://github.com/medplum/foomedical/blob/main/src/pages/CheckInPage.tsx"
click node_check_in_data "https://github.com/medplum/foomedical/blob/main/src/pages/CheckInPage.data.ts"
click node_save_check_in "https://github.com/medplum/foomedical/blob/main/src/utils/save-check-in.ts"
click node_screening "https://github.com/medplum/foomedical/blob/main/src/pages/ScreeningQuestionnairePage.tsx"
click node_intake "https://github.com/medplum/foomedical/blob/main/src/pages/PatientIntakeQuestionnairePage.tsx"
click node_questionnaire "https://github.com/medplum/foomedical/blob/main/src/pages/QuestionnairePage.tsx"
click node_messages "https://github.com/medplum/foomedical/blob/main/src/pages/MessagesPage.tsx"
click node_message_search "https://github.com/medplum/foomedical/blob/main/src/utils/communication-search.ts"
click node_smart_links "https://github.com/medplum/foomedical/blob/main/src/pages/SmartHealthLinksPage.tsx"
click node_observation "https://github.com/medplum/foomedical/blob/main/src/pages/ObservationPage.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_router,node_sign_in,node_registration,node_home,node_account toneBlue
class node_health_record,node_measurement,node_measurement_config,node_chart,node_observation,node_medplum toneAmber
class node_care_plan,node_action_items,node_get_care,node_check_in,node_check_in_data,node_save_check_in,node_screening,node_intake,node_questionnaire toneMint
class node_messages,node_message_search,node_smart_links toneRose
class node_patient toneIndigo
```

## Components

### App and access

- [App shell](https://github.com/medplum/foomedical/blob/main/src/App.tsx): `src/App.tsx`
- [Page router](https://github.com/medplum/foomedical/blob/main/src/Router.tsx): `src/Router.tsx`
- [Sign in](https://github.com/medplum/foomedical/blob/main/src/pages/SignInPage.tsx): `src/pages/SignInPage.tsx`
- [Registration](https://github.com/medplum/foomedical/blob/main/src/pages/RegisterPage.tsx): `src/pages/RegisterPage.tsx`
- [Patient home](https://github.com/medplum/foomedical/blob/main/src/pages/HomePage.tsx): `src/pages/HomePage.tsx`
- [Account settings](https://github.com/medplum/foomedical/tree/main/src/pages/account): `src/pages/account`

### Health records

- [Health record](https://github.com/medplum/foomedical/tree/main/src/pages/health-record): `src/pages/health-record`
- [Measurements](https://github.com/medplum/foomedical/blob/main/src/pages/health-record/Measurement.tsx): `src/pages/health-record/Measurement.tsx`
- [Measurement definitions](https://github.com/medplum/foomedical/blob/main/src/pages/health-record/Measurement.data.ts): `src/pages/health-record/Measurement.data.ts`
- [Measurement chart](https://github.com/medplum/foomedical/blob/main/src/components/LineChart.tsx): `src/components/LineChart.tsx`
- [Observation detail](https://github.com/medplum/foomedical/blob/main/src/pages/ObservationPage.tsx): `src/pages/ObservationPage.tsx`

### Care workflows

- [Care plan](https://github.com/medplum/foomedical/tree/main/src/pages/care-plan): `src/pages/care-plan`
- [Action items](https://github.com/medplum/foomedical/blob/main/src/pages/care-plan/ActionItems.tsx): `src/pages/care-plan/ActionItems.tsx`
- [Scheduling](https://github.com/medplum/foomedical/blob/main/src/pages/GetCarePage.tsx): `src/pages/GetCarePage.tsx`
- [Check-in](https://github.com/medplum/foomedical/blob/main/src/pages/CheckInPage.tsx): `src/pages/CheckInPage.tsx`
- [Check-in content](https://github.com/medplum/foomedical/blob/main/src/pages/CheckInPage.data.ts): `src/pages/CheckInPage.data.ts`
- [Save check-in](https://github.com/medplum/foomedical/blob/main/src/utils/save-check-in.ts): `src/utils/save-check-in.ts`
- [Screening questionnaire](https://github.com/medplum/foomedical/blob/main/src/pages/ScreeningQuestionnairePage.tsx): `src/pages/ScreeningQuestionnairePage.tsx`
- [Patient intake](https://github.com/medplum/foomedical/blob/main/src/pages/PatientIntakeQuestionnairePage.tsx): `src/pages/PatientIntakeQuestionnairePage.tsx`
- [Questionnaire](https://github.com/medplum/foomedical/blob/main/src/pages/QuestionnairePage.tsx): `src/pages/QuestionnairePage.tsx`

### Patient engagement

- [Messaging](https://github.com/medplum/foomedical/blob/main/src/pages/MessagesPage.tsx): `src/pages/MessagesPage.tsx`
- [Message search](https://github.com/medplum/foomedical/blob/main/src/utils/communication-search.ts): `src/utils/communication-search.ts`
- [SMART Health Links](https://github.com/medplum/foomedical/blob/main/src/pages/SmartHealthLinksPage.tsx): `src/pages/SmartHealthLinksPage.tsx`

### Other components

- **Patient**
- **Medplum service**

## Connections

- Patient → App shell: opens (evidence: `src/App.tsx`)
- App shell → Page router: renders (evidence: `src/App.tsx`)
- App shell → Sign in: routes unauthenticated (evidence: `src/App.tsx`)
- App shell → Registration: routes unauthenticated (evidence: `src/App.tsx`)
- Page router → Patient home: routes (evidence: `src/Router.tsx`)
- Page router → Account settings: routes (evidence: `src/Router.tsx`)
- Page router → Health record: routes (evidence: `src/Router.tsx`)
- Page router → Measurements: routes (evidence: `src/Router.tsx`)
- Page router → Care plan: routes (evidence: `src/Router.tsx`)
- Page router → Action items: routes (evidence: `src/Router.tsx`)
- Page router → Scheduling: routes (evidence: `src/Router.tsx`)
- Page router → Check-in: routes (evidence: `src/Router.tsx`)
- Page router → Screening questionnaire: routes (evidence: `src/Router.tsx`)
- Page router → Patient intake: routes (evidence: `src/Router.tsx`)
- Page router → Questionnaire: routes (evidence: `src/Router.tsx`)
- Page router → Messaging: routes (evidence: `src/Router.tsx`)
- Page router → SMART Health Links: routes (evidence: `src/Router.tsx`)
- Page router → Observation detail: routes (evidence: `src/Router.tsx`)
- Measurements → Medplum service: searches and creates observations (evidence: `src/pages/health-record/Measurement.tsx`)
- Measurements → Measurement definitions: reads definitions (evidence: `src/pages/health-record/Measurement.tsx`)
- Measurements → Measurement chart: renders (evidence: `src/pages/health-record/Measurement.tsx`)
- Action items → Medplum service: searches care plans (evidence: `src/pages/care-plan/ActionItems.tsx`)
- Check-in → Check-in content: uses questionnaire content (evidence: `src/pages/CheckInPage.tsx`)
- Check-in → Save check-in: saves through (evidence: `src/pages/CheckInPage.tsx`)
- Messaging → Message search: normalizes search (evidence: `src/pages/MessagesPage.tsx`)
- Medplum service → Patient: hosts FHIR records
