openEHR to FHIR Data Type Mapping
0.1.0 - ci-build International flag

openEHR to FHIR Data Type Mapping, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/openehr-fhir/data-type-mapping-ig/ and changes regularly. See the Directory of published versions

Resource-Locator Data and References

Page standards status: Informative

Resource-locator data and references

This category covers the openEHR types that carry a pointer to something else — an opaque URI (DV_URI, DV_EHR_URI) or a structured link to another node in an EHR or to an external party (LINK, PARTY_IDENTIFIED) — and the FHIR types that play the same role: the URI primitives (uri, url, oid, uuid, canonical) and the structured Reference and CodeableReference data types. DV_IDENTIFIER ↔ Identifier is also here, because an identifier is a pointer at a thing rather than a description of one.

Five facts shape this category.

The FHIR URI target depends on the element, not on the openEHR type. FHIR provides several URI primitives with progressively narrower constraints (uri/canonical, url, oid/uuid), and canonical additionally carries versioning semantics. Which one a DV_URI maps to is decided by the element definition the value is being carried in. openEHR also allows "plain-text" URIs containing characters RFC 3986 forbids, such as spaces, and requires them to be encoded before machine use; a FHIR URI must be valid, so those characters are percent-encoded on the way out.

The ehr: scheme has no FHIR counterpart. DV_EHR_URI constrains the scheme to ehr: and addresses items inside an openEHR EHR — compositions, sections, entries, or sub-elements. No standard FHIR scheme conveys equivalent semantics. The closest analogues are absolute or relative Reference values, which address a resource, not an element within one. Until a LINK.target is resolved to the FHIR resource its target was converted to, it travels as Reference.identifier — the element R5 provides for a target "not available through a FHIR server" — with the system urn:ietf:rfc:3986.

FHIR does not natively address sub-elements. A LINK.target can point at a sub-element of a composition. Reference.reference is a resource-level pointer, with #fragment reserved for contained resources. Two standard extensions cover sub-element addressing when it is genuinely required — targetElement, carrying a target Element.id, and targetPath, carrying a restricted FHIRPath expression — but most consumers do not interpret them, so a mapping into FHIR should avoid producing them unless the source data really needs that granularity.

openEHR splits what FHIR joins. openEHR separates internal record links (LINK) from external party references (PARTY_IDENTIFIED); FHIR uses Reference for both. The working group is investigating consolidating LINK and PARTY_IDENTIFIED onto a common RM class, likely based on OBJECT_REF. This guide maps the Reference Model as published today and records the pending change as an open item rather than anticipating it.

FHIR joins what openEHR splits. CodeableReference combines a coded concept and a reference in one value. openEHR has no direct equivalent; mapping one into openEHR generally means splitting it into a coded element plus a LINK, or into an enclosing CLUSTER.

LINK ↔ Reference is one-way at data-type level. LINK declares meaning, type, and target all 1..1. A FHIR Reference can source the first and the third — from display and reference — and has no field at all that can source type. Only a CodeableReference carries a concept, and deciding to use one is an archetype-level decision a data-type conversion does not make. So a LINK becomes a Reference, and a bare Reference does not become a LINK: the guide publishes that gap rather than inventing a link type nobody sent.

See Coded Data for the coded half of a CodeableReference, Gaps for the FHIR elements with no openEHR home, and Conventions for how to read the tables.

Summary

openEHR typeFHIR type→ FHIR→ openEHRMaturityScope
DV_IDENTIFIERIdentifierlossylossyopendatatype
DV_URI / DV_EHR_URIuri | urllossylossyopendatatype
LINKReference | CodeableReferencelossyunmappedopendatatype

DV_IDENTIFIER and Identifier

Sources: openEHR RM — DV_IDENTIFIER · FHIR R5 — Identifier

openEHR fieldFHIR target→ FHIR→ openEHRMaturityNotes
DV_IDENTIFIER.id 1..1Identifier.valuelosslesslosslesssettledDirect equivalence. A FHIR Identifier with a system and no value has no DV_IDENTIFIER to become, because id is mandatory.
DV_IDENTIFIER.issuer 0..1Identifier.systemlosslesslosslessopenThe system versus issuer mismatch — URI against free text — is the primary transformation challenge in this category. Where the issuer is not a valid URI, the convention is to construct one by prefixing http://openehr.org/identifier/, and to strip that prefix again on the way back. Whether that prefix is a real definition or a placeholder, and whether a URN would be preferable to a URL, is not decided; guidance has been sought from HL7 TSMG.
DV_IDENTIFIER.type 0..1Identifier.typelosslesslossyopen→ openEHR: drops Identifier.type — openEHR carries the type as a single string in system::value notation, so only one coding survives — where several are present the userSelected one is taken, otherwise the first — and every other property of a Coding, including version, display, and userSelected itself, is dropped The system::value convention uses the last occurrence of :: in the string, so no escaping is required even though : is valid in both URLs and codes — http://[2001:db8::1]:8080/path::MR parses correctly. Where no :: is present, http://openehr.org/identifier/type is used as the system.
DV_IDENTIFIER.assigner 0..1Identifier.assignerlosslesslossyopen→ openEHR: drops Identifier.assigner — a FHIR Reference carries more than an identifier — reference, display, and type — and openEHR reduces the whole thing to one system::value string, so everything except the identifier is dropped On the way into openEHR the convention is to read Identifier.assigner.identifier and, where that is absent, the referenced Organization.identifier.
—
no counterpart (inventory)
Identifier.useunmappedunmappedopen→ FHIR: No DV_IDENTIFIER field produces it. (owner: openehr-modelling) → openEHR: Not carried at the data-type level. A cluster archetype providing use, period, and support for several types is drafted by the openEHR modelling team; this guide links it rather than authoring it. (owner: openehr-modelling) As a consumer of an identifier, use and period are rarely significant. They matter mainly for demographic entities, for temporary patient identifiers, and where the EHR is itself the assigner.
—
no counterpart (inventory)
Identifier.periodunmappedunmappedopen→ FHIR: No DV_IDENTIFIER field produces it. (owner: openehr-modelling) → openEHR: Not carried at the data-type level; the extended cluster archetype provides it. (owner: openehr-modelling) Round-tripping therefore loses historic and superseded identifiers where they are distinguished only by their period.

Worked example - a medical record number

{
  "_type": "DV_IDENTIFIER",
  "id": "12345",
  "issuer": "http://example.org/hospital",
  "type": "http://terminology.hl7.org/CodeSystem/v2-0203::MR",
  "assigner": "http://example.org/org::OrgRef123"
}
{
  "use": "usual",
  "type": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
        "code": "MR"
      }
    ]
  },
  "system": "http://example.org/hospital",
  "value": "12345",
  "period": {
    "start": "2020-01-01"
  },
  "assigner": {
    "identifier": {
      "system": "http://example.org/org",
      "value": "OrgRef123"
    }
  }
}

DV_URI / DV_EHR_URI and uri / url

Sources: openEHR RM — DV_URI · openEHR RM — DV_EHR_URI · FHIR R5 — uri · FHIR R5 — url · FHIR R5 — oid · FHIR R5 — uuid · FHIR R5 — canonical

openEHR fieldFHIR target→ FHIR→ openEHRMaturityNotes
DV_URI.value 1..1when the target element is typed uri: uri
when the target element is typed url and the value is a resolvable address: url
when the target element is typed oid and the value is a urn:oid: URI: oid
when the target element is typed uuid and the value is a lowercase urn:uuid: URI: uuid
when the target element is typed canonical and the value is the canonical URL of a resource, with an optional |version: canonical
losslesslosslessopenDirect equivalence for a URI that conforms to RFC 3986, which uri is defined on; url is defined on RFC 1738. Which FHIR primitive is the target is decided by the element definition, not by the openEHR source type: FHIR provides several URI primitives with progressively narrower constraints. canonical reads a | in the value as separating the version of the resource referred to, so a value that is not such a reference does not belong in one. A plain-text URI, and values not in oid or uuid form, are the sub-cases below.
DV_URI.value[plain-text] 1..1urilossylosslessopen→ FHIR: drops DV_URI.value[plain-text] — the RM allows "plain-text URIs" containing characters RFC 3986 forbids, such as spaces, and requires them to be RFC 3986-encoded before machine use; a FHIR uri must be valid, so those characters are percent-encoded and the readable form is not carried A named sub-case of the row above. Only characters RFC 3986 does not allow are encoded, so an existing percent-escape is left as it is; the encoded URI reads back as a valid DV_URI in its encoded form.
DV_URI.value[not-oid] 1..1—
no counterpart (inventory)
unmappedunmappedsettled→ FHIR: A URI in any other form cannot be carried in an element typed oid: the archetype and the FHIR element disagree about the value, and no conversion repairs that. → openEHR: An oid is always in that form, so nothing arrives. archetype scope: the sub-case arises only where the target element is typed oid, which the element decides, not the data type.
DV_URI.value[not-uuid] 1..1—
no counterpart (inventory)
unmappedunmappedsettled→ FHIR: A URI in any other form — an uppercase UUID included — cannot be carried in an element typed uuid: the archetype and the FHIR element disagree about the value, and no conversion repairs that. → openEHR: A uuid is always in that form, so nothing arrives. archetype scope: the sub-case arises only where the target element is typed uuid, which the element decides, not the data type.
DV_EHR_URI.value 1..1urilosslesslosslessopenNo standard FHIR scheme conveys ehr: semantics. Carrying the URI opaquely preserves it exactly but means nothing on the FHIR side can resolve it. Resolving it to a FHIR Reference makes it usable but is a one-way transformation, and is LINK.target’s concern on LINK ↔ Reference.

Worked example - an ehr: URI

{
  "_type": "DV_EHR_URI",
  "value": "ehr:/8f3c6b1e-1e5a-4a6b-9a3e-2b6f0c1d4e77"
}
"ehr:/8f3c6b1e-1e5a-4a6b-9a3e-2b6f0c1d4e77"

Sources: openEHR RM — LINK · FHIR R5 — Reference · FHIR R5 — CodeableReference · FHIR R5 — Identifier