Skip to main content

Crate fhir_store

Crate fhir_store 

Source
Expand description

fhir-store — the engine-agnostic half of FHIR® persistence.

Everything about storing FHIR that is not specific to one SQL engine: the tamper-evident audit chain, the attribution and disclosure records it commits to, and the value types every port’s operations return.

§Trademarks

HL7®, and FHIR® are the registered trademarks of Health Level Seven International and their use of these trademarks does not constitute an endorsement by HL7.

§Why this crate exists

Six ports — fhir-postgresql, fhir-sqlite, fhir-mysql, fhir-mariadb, fhir-mssql, fhir-oracle — each carried their own copy of this code. chain.rs alone was 618 lines, byte-identical in all six, and unlike the map and generator it was not covered by scripts/check-shared-core.sh: the gate watched map/ and gen/ and left the store’s engine-agnostic half unwatched. That is why closing F-07 (the hash-chain pre-image was derived from jsonb, so chains were not portable) had to be done six times by hand.

What stays in a port is what genuinely differs: the driver, transactions, placeholder syntax, the search-SQL builder, and StoreError — which wraps that port’s own ShredError and so cannot be lifted here.

§What this crate does not do

It does not authenticate. That is the perimeter’s job, and this crate holds the boundary rather than crossing it (§12, PR12.1–PR12.4): “authentication is elsewhere” must not become “the record of who did what is nowhere”, so the types below carry attribution and the chain makes it tamper-evident.

It also opens no sockets and speaks no HTTP. The RESTful surface is fhir-loco.

Modules§

chain
The tamper-evidence hash chain, computed in this process (spec M3.16, M3.16a).

Structs§

AccessRecord
One disclosure record (spec PR12.5).
Audit
Who is responsible for a change, and how we know (spec M3.15, PR12.1–4).
ChainBreak
A break in one resource’s hash chain (spec M3.16, M3.16a).
Got
HistEntry
PurgeReport
What an erasure removed (spec M3.18).
PutOutcome
SearchOutcome
UpgradeOpts
Options for upgrade_with.
UpgradeReport

Enums§

CondCreate
The result of a conditional create (If-None-Exist).
CondDelete
The result of a conditional delete.
ResourceStatus
TxOp
One write inside a FHIR transaction Bundle.
TxOutcome