Skip to main content
Docs/Kotlin Multiplatform (KMP) FHIR SDK
On this page ⌄
Component overview

Kotlin Multiplatform (KMP) FHIR SDK

Modular Kotlin Multiplatform libraries for building offline-capable FHIR applications across Android, iOS, desktop, and web from a single codebase.

UPDATED

What it is​

The Kotlin Multiplatform (KMP) FHIR SDK is the active next-generation multiplatform successor to the Maintenance-mode Android FHIR SDK. It brings FHIR data modeling, deterministic clinical rules, on-device offline storage, bidirectional synchronization, and Structured Data Capture forms into shared Kotlin modules that publish under the Maven group dev.ohs.fhir.

Teams write their clinical data handling, validation, and form workflows once and ship across Android, iOS, JVM desktop, and modern web browsers via WebAssembly (wasmJs) and JavaScript (js). Rather than shipping a single monolithic dependency, the SDK is organized as modular libraries that can be adopted individually or used together as a full client stack.

Libraries in the stack​

The FHIR Foundations stack showing Kotlin FHIR Data Capture and Kotlin FHIR Engine as client SDKs layered over Kotlin FHIRPath and Kotlin FHIR.

LibraryArtifactRole
Kotlin FHIRfhir-modelCore FHIR R4, R4B, and R5 data models with JSON serialization
Kotlin FHIRPathfhir-pathClinical expression and search-parameter evaluation engine
Kotlin FHIR Enginefhir-engineOn-device FHIR R4 SQLite storage, typed search, and server sync
Kotlin FHIR Data Capturefhir-data-captureCompose Multiplatform rendering, validation, and template extraction for FHIR Questionnaires
Kotlin FHIR Workflowfhir-workflowClinical workflow execution, including PlanDefinition/$apply care plans
Kotlin FHIR Knowledgefhir-knowledgeOn-device FHIR NPM package installation and canonical resource lookup

Platform coverage​

Every platform shares the same FHIR R4 models, FHIRPath evaluation, and Compose Multiplatform UI components, while storage and scheduling adapt to native platform capabilities.

PlatformStorage and syncUI and forms
AndroidSQLite with optional SQLCipher encryption and WorkManager background syncCompose Multiplatform (minSdk 26)
iOSNative SQLite and BGTaskScheduler background tasks (iosArm64, iosSimulatorArm64)Compose Multiplatform
Web browser (wasmJs and js)WebAssembly SQLite stored in OPFS with foreground syncCompose Multiplatform in modern browsers
Desktop and Server JVMLocal SQLite (~/.fhir-engine or custom directory) and foreground syncCompose Multiplatform on Java 11 or 21+

Browser targets require Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers plus the local SQLite worker setup documented in Run the engine in the browser. For target architecture details across every repository, see Platform support.

Readiness and versions​

The libraries in the stack are at different release stages as the higher-level client SDKs prepare for a coordinated Beta release.

  • Core primitives are furthest along, with kotlin-fhir at 1.0.0 (stable) and kotlin-fhirpath at 1.0.0-beta06 (Beta).
  • Client SDKs and companions (kotlin-fhir-engine and kotlin-fhir-data-capture at 2.0.0-alpha05, plus kotlin-fhir-workflow and kotlin-fhir-knowledge at 2.0.0-alpha01) already run forms, validation, offline persistence, and server sync across Android, iOS, desktop, and web while APIs continue to stabilize toward Beta.
  • Pin lockstep versions declared by the highest library in your dependency tree (fhir-model-r4 1.0.0-rc03 and fhir-path-r4 1.0.0-beta06 alongside 2.0.0-alpha05), as detailed in Versions and compatibility.
  • Check platform-specific behavior before shipping. On-device database encryption via SQLCipher (enableEncryption = true) and WorkManager background scheduling are currently available on Android only.

Migrating from the Android FHIR SDK​

Teams running existing apps on the Android FHIR SDK do not need to rewrite clinical definitions or server integrations. Both generations target HL7 FHIR R4, so FHIR Questionnaire resources, Structured Data Capture rules, FHIRPath expressions, and HAPI FHIR synchronization patterns carry over.

Migration can happen incrementally. Existing Android-only modules can continue running while you migrate shared models, FHIRPath logic, storage, and forms onto dev.ohs.fhir Maven Central artifacts (replacing the earlier com.google.android.fhir and com.google.fhir coordinates listed in Versions and compatibility). Review the Android FHIR SDK migration guide for differences around Compose Multiplatform UI, Android-only SQLCipher, and on-device CQL evaluation.

How OHS Player uses the SDK​

The KMP FHIR SDK powers OHS Player, the Foundation's Pillar 02 reference toolkit. Inside the cross-platform Client App (player-reference), the SDK connects through player-client so teams can configure patient lists and clinical screens from standard FHIR definitions and SQL-on-FHIR ViewDefinitions instead of writing repetitive mapping code.

Teams have two starting points. Adopt individual dev.ohs.fhir libraries inside an existing application, or launch the full OHS Player reference stack to see client, gateway, web portal, and analytics working together.

Next steps​