A pure-Rust openEHR Clinical Data Repository — spec-compliant, measured, built for production.

openEHR separates clinical knowledge from software: applications store and query structured health records through a vendor-neutral REST API and the Archetype Query Language. EHRbase-rs implements that standard natively in Rust — headless, API-first, one static binary on PostgreSQL 18.

No JVM · no runtime dependencies · every compliance claim machine-verified.

Conformance

Compliance you can verify, not just read.

Every release runs the complete conformance catalogue against the live server, in JSON and XML, and computes the openEHR profile verdicts.

341cases executed
315passed
0failed
Platform

Everything the openEHR standard asks for

Generated from the official machine-readable models — a specification update is a regeneration, not a rewrite.

REST API 1.0.3

EHR, EHR_STATUS, COMPOSITION, DIRECTORY, CONTRIBUTION, query, template and admin resources — canonical JSON and XML on the wire.

AQL 1.1 engine

Typed path analysis over a spec-generated Reference Model, compiled to efficient SQL — including ALL_VERSIONS and stored queries.

Full versioning

Contribution-atomic commits, indelible version history, logical delete, attestations and per-version digital signatures.

Templates & validation

OPT 1.4 ingestion, WebTemplate generation and deep composition validation against archetype constraints and terminology bindings.

One static binary

Predictable memory, fast cold starts, a minimal distroless image — no garbage-collection pauses in the write path.

PostgreSQL 18-native

Temporal versioning with database-enforced non-overlap, UUIDv7 keys and canonical openEHR JSON stored verbatim.

Security

OIDC authentication, RBAC/ABAC authorization, multi-tenancy and IHE ATNA audit — production access control, not an afterthought.

Integration

FHIR R4 connectors, AMQP change events and S3 multimedia storage — bridge openEHR into the systems around it.

Quick start

Running in one command

The full stack — server plus PostgreSQL 18 — with Docker Compose.

shell
$ docker compose up --build

# Probe the status endpoint
$ curl http://localhost:8080/ehrbase/rest/status

# Create an EHR (development credentials: ehrbase / ehrbase)
$ curl -u ehrbase:ehrbase -X POST -i \
    http://localhost:8080/ehrbase/rest/openehr/v1/ehr

# Query it with AQL
$ curl -u ehrbase:ehrbase -H 'Content-Type: application/json' \
    -d '{"q":"SELECT e/ehr_id/value FROM EHR e"}' \
    http://localhost:8080/ehrbase/rest/openehr/v1/query/aql
Ecosystem

Fits your stack

PostgreSQL 18 Keycloak / OIDC RabbitMQ / AMQP FHIR R4 S3 / SeaweedFS Kubernetes / Helm Prometheus / OpenTelemetry