Repository navigation
3.0.0
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)Parametersresource (composition,templateId, and a nestedcontextcarryingehr_id/patient/who/onBehalfOf). Output is a Bundle that always includes an engine-generatedProvenanceentry, whose targets cover every mapped entry and whoseagent.whocomes fromcontext.whoor the configured engine device.POST /$toopenehr— input is the FHIR Bundle itself, with noParameterswrapper;templateIdandformat=canonical|flatare query parameters. Output isParameters{composition, outcome?}.- Query parameters may supply
templateId,formatand the short context fields, with the request body taking precedence on conflict. A flat composition without atemplateIdis rejected with a400OperationOutcome(required); all errors on these endpoints areOperationOutcomeresponses (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-displayconfigure the default Provenance agent.- The legacy
/openfhir/toopenehrendpoint now also acceptsformat=flat|canonical, taking precedence over the still-supported, deprecatedflat=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
PropertyNamingStrategyconstants 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
targetAttributesare now evaluated with the OR semantics the schema documents — previously only the first attribute was baked into the where clause — and atypecondition compares against allcriterias. - A fhirCondition without
targetAttributes(a baretypecondition carrying only targetRoot and criteria) is never treated as path-filtering; it only feeds the type gate. Conditionis now plural-only: the deprecated singulartargetAttribute/criteriafields 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
Durationno longer loses its unit on the way into aDV_DURATIONor aDV_TEXT. openehrConditiontargetAttributenow correctly evaluates empty/not empty even when pinpointing a non-ending path.- An
openehrConditiontargetAttributereferencing 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
NullPointerExceptionwhen 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/criteriakeys continue to work, but the model fields are gone; anything reading the model programmatically should move totargetAttributes/criterias. - Mappings that relied on only the first
targetAttributebeing 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