octo/fhir
open source · Apache-2.0 / MIT

FHIR tooling in Rust, held to the spec.

A FHIR server you can drive from the keyboard, and the libraries it is built from: FHIRPath, CQL, FHIR Mapping Language, FHIR Shorthand, SQL on FHIR, validation, terminology and UCUM. Each one is checked against the official test suites.

conformanceofficial suites
serverFHIR262●98.7%
cqlcqframework/cql-tests●1693 / 1693
sofSQL on FHIR v2 content tests●144 / 144
fmlHL7 reference compiler parity●1659 maps
fmlfhir-test-cases mapping●12 / 12
ucumUCUM functional tests●100%
fhirpathfhir-test-cases R5 · R6●FHIRPath 3.0 + 3.1
Numbers come from each repository's CI and README.
octo/server

The FHIR server you can drive from the keyboard

One Rust binary on PostgreSQL with a web console for REST, SQL, GraphQL, FHIRPath and CQL. FHIR R4, R4B, R5 and R6. Resource tables are created on demand, so loading an Implementation Guide needs no migrations.

GitHub stars Last commit
OctoFHIR console: Patient resources with the JSON of the selected one OctoFHIR console in the light theme

REST & search

CRUD, history, conditional operations, transactions. Chains, _include, composites, modifiers, sorting.

SQL on FHIR

ViewDefinitions run in the database, plus $sql-export and a SQL console with a Postgres language server.

GraphQL

Schema generated from the FHIR definitions of every loaded package.

Terminology & validation

$expand, $lookup, $validate-code, $translate; $validate against the base spec or any profile.

Subscriptions & bulk

Topic-based rest-hook, WebSocket and email; Bulk Data $export and $import.

SMART on FHIR

OAuth 2.0, external identity providers, access policies as scripts, audit trail, Prometheus metrics.

docker pull ghcr.io/octofhir/octofhir-server:latest
libraries

Use the parts on their own

Every engine inside the server is a separate crate with its own CLI, docs and release cycle. Versions below are live from crates.io and GitHub releases.

Languages

FHIRPath for Rust, held to the spec text.

FHIRPath 3.0 with the 3.1 additions, FHIR functions such as resolve() and memberOf(), %terminologies, %server, and the SQL on FHIR key functions. Library, CLI, REPL and HTTP server.

cargo add octofhir-fhirpath

Clinical Quality Language, native to Rust.

Parse CQL 1.5, translate it to ELM and evaluate it against FHIR data or your own. Passes 1693 of 1693 tests of cqframework/cql-tests. Embeddable library and a single cql binary.

cargo install octofhir-cql

FHIR Mapping Language, checked before it runs.

Parser, formatter, type checker, StructureMap compiler and engine. Builds the same StructureMap as the HL7 reference compiler on 1,659 public maps and converts FHIR R4 to R5 with the cross-version maps.

cargo install fml-cli

FHIR Shorthand, built, linted, formatted.

A SUSHI-compatible FSH compiler, GoFSH (FHIR resources back to FSH), a linter and a formatter in one fast toolchain.

Data & SQL

SQL on FHIR v2, with or without a database.

Run ViewDefinitions in memory or compile them to PostgreSQL and DuckDB SQL, with terminology functions, a linter and a CLI. Both paths pass the official content tests, 144 of 144.

cargo install octofhir-sof-cli

PostgreSQL SQL, parsed, formatted, linted.

A lossless syntax tree with error recovery, a formatter, migration-safety lints with autofixes, and a language server that reads your live schema. Powers the server's SQL console.

cargo install banshee

Validation, packages & terminology

FHIR validation, driven by FHIRSchema.

Compile StructureDefinitions to FHIRSchema and validate R4 to R6 resources against the base spec or any profile.

cargo add octofhir-fhirschema

FHIR packages, resolved by canonical URL.

Install Implementation Guide packages, then resolve and search their canonical resources. Library and CLI.

cargo add octofhir-canonical-manager

One FHIR model contract, many engines.

The shared model, terminology and server traits (ModelProvider) that let FHIRPath, CQL, FML and SQL on FHIR plug into the same data.

cargo add octofhir-fhir-model

Units of measure, by the UCUM book.

Parse, validate and convert UCUM units; passes 100% of the official UCUM functional tests. Used by FHIRPath and CQL for quantity arithmetic.

cargo add octofhir-ucum

A FHIR terminology server on Rust and PostgreSQL.

$lookup, $expand, $validate-code, $subsumes and $translate, with a CLI for loading CodeSystems, ValueSets and ConceptMaps. R4 is the first conformance target.

Developer tools

Typed FHIR SDKs, generated from packages.

Resolves a FHIR package once into a language-neutral IR, then emits deterministic, inspectable code. Full TypeScript backend and a reference Rust backend.

FHIRPath in VS Code, powered by fhirpath-rs.

Highlighting, validation, evaluation and debugging for .fhirpath files and for expressions embedded in JSON, YAML and TypeScript.

hosted

Try it without installing

Public endpoints for experiments. They are reset from time to time; do not store real patient data.

fhir.octofhir.com

A demo instance of the OctoFHIR server.

fhirpath.octofhir.com

The FHIRPath engine behind a FHIRPath Lab–compatible API, for R4 to R6.

  • POST/r4 · /r4b · /r5 · /r6
  • bodyParameters { expression, resource }