Skip to content

3.0.0

Choose a tag to compare

@gasperr gasperr released this 04 Sep 06:40
· 125 commits to develop since this release

openFHIR v3.0.0

Overview

This release centers on openFHIR speaking the FHIR Operations framework natively: two new root-level endpoints, POST /$tofhir and POST /$toopenehr, implement the FHIRconnect REST API specification, exchanging Parameters and Bundle resources with provenance and partial-failure reporting built in. Alongside it, fhirConditions were rewritten from FHIRPath string splicing to programmatic evaluation — the change that makes this a major version — and the entire dependency stack was lifted to current (Spring Boot 3.5, HAPI FHIR 8), closing all 12 HIGH CVEs reported by Trivy. Date/time handling, DV_PROPORTION, DV_DURATION and DV_IDENTIFIER round trips received substantial fixes.


New Features

FHIRconnect REST API operations

New FHIR Operations-framework endpoints are mounted at the server root, alongside the unchanged direct /openfhir/* endpoints (see docs/rest-api-operations.md):

  • POST /$tofhir — input is a FHIR (R4) Parameters resource (composition, templateId, and a nested context carrying ehr_id/patient/who/onBehalfOf). Output is a Bundle that always includes an engine-generated Provenance entry, whose targets cover every mapped entry and whose agent.who comes from context.who or the configured engine device.
  • POST /$toopenehr — input is the FHIR Bundle itself, with no Parameters wrapper; templateId and format=canonical|flat are query parameters. Output is Parameters{composition, outcome?}.
  • Query parameters may supply templateId, format and the short context fields, with the request body taking precedence on conflict. A flat composition without a templateId is rejected with a 400 OperationOutcome (required); all errors on these endpoints are OperationOutcome responses (application/fhir+json).

Partial-failure reporting

A MappingIssueCollector is threaded through both mapping engines, so skipped or unmappable elements are reported as warning/incomplete issues instead of being silently dropped — surfaced as an OperationOutcome Bundle entry on $tofhir, or the outcome parameter on $toopenehr.

Subject population and pluggable patient resolution

On $tofhir, empty — and only empty — top-level subject/patient Reference children of mapped resources are filled from context.patient, falling back to the new pluggable PatientResolverInterface, an engine-side EHR-ID → patient resolution hook (NoOp by default).

DV_DURATION → FHIR Duration

A DV_DURATION can now populate a FHIR Duration, converting the ISO 8601 string to a value plus a UCUM time code.

Configuration and legacy endpoint improvements

  • openfhir.provenance.device-reference / openfhir.provenance.device-display configure the default Provenance agent.
  • The legacy /openfhir/toopenehr endpoint now also accepts format=flat|canonical, taking precedence over the still-supported, deprecated flat= boolean. Responses are byte-for-byte unchanged.

Security

Dependency bumps resolve all 12 HIGH CVEs from the Trivy scan (#182), taken to the newest currently available versions:

  • Spring Boot 3.3.2 → 3.5.16 — pulls Tomcat 10.1.55 (CVE-2025-48988/-48989/-55752), Spring Framework 6.2.19 (CVE-2025-22235/-41249, CVE-2024-38816/-38819) and json-smart 2.5.2 (CVE-2024-57699)
  • HAPI FHIR 7.2.1 → 8.12.0 — pulls org.hl7.fhir.core 6.9.12 (CVE-2024-45294/-51132/-52007)
  • ucum 1.0.9 → 1.0.10, archie 3.11.0 → 3.13.0, springdoc 2.1.0 → 2.8.17
  • jackson-bom pinned to 2.19.4, as jackson-databind 2.20+ removed the deprecated PropertyNamingStrategy constants Archie still uses

HAPI 8 adaptations: Narrative.div instantiation resolves the field's own XhtmlNode type again, and narrative fixtures were updated for HAPI 8's XHTML composer.


Changes

fhirConditions are no longer compiled into the FHIRPath string

Observation.component.where(...)-style splicing is gone. Plain mapping paths are evaluated as written and conditions are applied programmatically. Consequences:

  • All targetAttributes are now evaluated with the OR semantics the schema documents — previously only the first attribute was baked into the where clause — and a type condition compares against all criterias.
  • A fhirCondition without targetAttributes (a bare type condition carrying only targetRoot and criteria) is never treated as path-filtering; it only feeds the type gate.
  • Condition is now plural-only: the deprecated singular targetAttribute/criteria fields were removed from the model. Existing YAML/JSON mappings using the singular keys keep working — they are normalized at deserialization time.

Timezone offsets are preserved

Date/time values now keep their source's timezone offset in both directions, and no longer gain one that was not there. Z stays Z, +00:00 stays +00:00, and +01:00 keeps its wall-clock reading.

Bootstrap extension points widened

BootstrapService's classify, apply, resolveExisting, saveLedgerEntry and relativePath are now protected, and FileType is public, so a distribution can add its own file types to the bootstrap scan rather than running a parallel one — inheriting the directory walk, hash comparison, ledger and summary unchanged. FileType gained a CONCEPTMAP constant so the ledger's entityType and the BootstrapSummary breakdown share one vocabulary across distributions. No behaviour change in this project.


Bug Fixes

toOpenEHR: DV_PROPORTION |type was hardcoded to percent

|type is no longer hardcoded to 2. FHIR has no field naming the kind of proportion, so it is derived from the denominator: 100 → 2, 1 → 1, an otherwise integral pair → 4, anything else → 0. A fraction (3) is never inferred, as a bare Quantity cannot distinguish it from an integer fraction. |type is now written only where a |denominator was, so a non-percent Quantity no longer claims to be a percent with no denominator — an invalid DV_PROPORTION a strict server may reject. A percent is recognised from either the UCUM code or the unit.

toFHIR: a non-percent DV_PROPORTION lost its denominator

Only a percent has a faithful FHIR representation (UCUM %); every other kind was reduced to its numerator, so a 3/4 ratio arrived as a bare 3. The denominator is now carried on a proportion-denominator extension and the openEHR |type on a proportion-kind extension. The return leg prefers a carried |type over deriving one.

toOpenEHR: DV_IDENTIFIER |type and |assigner gained a placeholder system

A |type of Prescription number no longer returns as http://openehr.org/identifier/type::Prescription number. IdentifierParser invents placeholder systems on the way out for parts carrying no system of their own; the return leg re-emitted them as system::value instead of stripping them, as it already did for |issuer. A system that genuinely came from the source FHIR is unaffected.

toFHIR: manual blocks with multiple nested paths overwrote themselves

A manual block with several nested fhir paths sharing a prefix (e.g. code.coding.code + code.coding.system from $fhirRoot) no longer overwrites itself leaving only the last value.

Other fixes

  • toOpenEHR: a FHIR Duration no longer loses its unit on the way into a DV_DURATION or a DV_TEXT.
  • openehrCondition targetAttribute now correctly evaluates empty/not empty even when pinpointing a non-ending path.
  • An openehrCondition targetAttribute referencing a recurring element is now correctly evaluated.
  • toFHIR: FHIRPath casts to primitive types are properly evaluated (as Integer → IntegerType, etc.).
  • A FHIR path with no cast at all no longer throws a NullPointerException when its cast type is looked up.

Upgrade Notes

  • The direct /openfhir/* endpoints are unchanged and remain supported — the operations endpoints are additive.
  • Mappings using the singular targetAttribute/criteria keys continue to work, but the model fields are gone; anything reading the model programmatically should move to targetAttributes/criterias.
  • Mappings that relied on only the first targetAttribute being applied will now see OR semantics across all of them.
  • Deployments that depended on offsets being normalized or added to date/time values should re-verify their expected output.

Full Changelog: 2.2.5...3.0.0