Skip to content

frontend


Function: default()

default(): Element

Defined in: src/pages/Home.tsx:103

Home Page

Main application dashboard displaying all patients from the FHIR server. Automatically fetches patients on mount, maps FHIR resources to internal Patient type with computed fields (age, formatted name, NHS number extraction), and displays loading/error states.

FHIR Mapping Logic: - Concatenates given + family names into single display name - Extracts NHS number from identifiers with NHS system URI - Calculates age from birth date accounting for leap years - Maps FHIR gender to sex field

FHIR Readiness: - Uses fhir_ready flag from /patients endpoint (not separate health checks) - Eliminates race conditions during FHIR initialization - Shows "Database is initialising" only when fhir_ready=false

Returns

Element

Example

// Routing configuration
<Route path="/" element={
  <RequireAuth>
    <Home />
  </RequireAuth>
} />