System Architecture
High-level architecture of the FHIR Complete healthcare information system
System Components
API Services
| Service | Purpose | Auth |
|---|---|---|
fhir-api | All FHIR resource operations (51 resource types) | SMART on FHIR JWT |
smart-auth | Authentication, token issuance, registration | Public + credentials |
hr-api | HR workforce management (scheduling, timekeeping) | SMART on FHIR JWT |
inventory-api | GS1 EPCIS 2.0 inventory management | SMART on FHIR JWT |
ai-assistant | Clinical AI assistant with tool-calling | SMART on FHIR JWT |
Multi-Tenant Architecture
Every data operation is scoped to an organization via org_id from the JWT token:
- Staff users can belong to multiple organizations with different roles per org
- Patient users hold separate organization memberships, tracked independently of staff
- National organizations have cross-organization visibility
- Terminology (ICD-10, SNOMED CT) is shared across all organizations — a code is not anybody's private data
Isolation is enforced in the data layer rather than in application code, so it cannot be bypassed by a request: there is no parameter that widens, narrows or changes the tenant.
Technology Stack
| Layer | Technology |
|---|---|
| Patient Mobile | React Native + Expo SDK 53 |
| Staff Web | Next.js 15, React 19, Tailwind CSS, shadcn/ui |
| Backend | Managed PostgreSQL 15 + serverless functions (Deno/TypeScript) |
| Authentication | SMART on FHIR with ES256 JWT |
| Real-time | Supabase Realtime (messaging, queue updates) |
| AI | Anthropic Claude, OpenAI, Google Gemini (configurable) |
| Internationalization | next-intl (EN, SK, ID) |
| Charts | Recharts |
| Scheduling | FullCalendar |
FHIR R4 Compliance
All resources follow the HL7 FHIR R4 specification, stored
and returned as complete FHIR JSON. What the server supports is not described here by
hand — it is published by the server itself as a
CapabilityStatement at
GET /metadata, and the OpenAPI Explorer is generated from it.
Resource IDs
Every resource is addressed by its FHIR logical id — the value that appears in
references such as Practitioner/example-practitioner-hrncar. That is the only
identifier an API client needs or sees.