FHIR Complete

System Architecture

High-level architecture of the FHIR Complete healthcare information system

System Components

┌──────────────────┐     ┌──────────────────┐     ┌──────────────────┐
│  Patient Mobile  │     │   Staff Web GUI   │     │   Patient Web    │
│  (Expo/RN)       │     │   (Next.js 15)    │     │   (Phase 2)      │
└────────┬─────────┘     └────────┬──────────┘     └──────────────────┘
         │                        │
         ▼                        ▼
┌─────────────────────────────────────────────────────────────────────┐
│                          API Services                               │
│  ┌──────────┐ ┌──────────┐ ┌────────┐ ┌───────────┐ ┌───────────┐ │
│  │ fhir-api │ │smart-auth│ │ hr-api │ │inventory  │ │ai-assistant│ │
│  │          │ │          │ │        │ │   -api    │ │           │ │
│  └──────────┘ └──────────┘ └────────┘ └───────────┘ └───────────┘ │
└─────────────────────────────┬───────────────────────────────────────┘


┌─────────────────────────────────────────────────────────────────────┐
│           Managed PostgreSQL — tenant-isolated storage              │
│     Clinical · Identity · Workforce · Inventory · Messaging         │
└─────────────────────────────────────────────────────────────────────┘

API Services

ServicePurposeAuth
fhir-apiAll FHIR resource operations (51 resource types)SMART on FHIR JWT
smart-authAuthentication, token issuance, registrationPublic + credentials
hr-apiHR workforce management (scheduling, timekeeping)SMART on FHIR JWT
inventory-apiGS1 EPCIS 2.0 inventory managementSMART on FHIR JWT
ai-assistantClinical AI assistant with tool-callingSMART on FHIR JWT

Multi-Tenant Architecture

Every data operation is scoped to an organization via org_id from the JWT token:

User Login → Org Selection → JWT with org_id → All queries scoped to org_id
  • 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

LayerTechnology
Patient MobileReact Native + Expo SDK 53
Staff WebNext.js 15, React 19, Tailwind CSS, shadcn/ui
BackendManaged PostgreSQL 15 + serverless functions (Deno/TypeScript)
AuthenticationSMART on FHIR with ES256 JWT
Real-timeSupabase Realtime (messaging, queue updates)
AIAnthropic Claude, OpenAI, Google Gemini (configurable)
Internationalizationnext-intl (EN, SK, ID)
ChartsRecharts
SchedulingFullCalendar

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.