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
| Page standards status: Informative |
Every mapping in this guide is stated at field level and in both directions. The two directions frequently differ: a field that survives the trip to FHIR intact may have nowhere to return to, and a FHIR element with no openEHR counterpart is a gap in one direction only. A single fidelity verdict per type would hide that, so this guide does not publish one.
The summary tables on Data Type Mapping and on each category page use these columns:
| Column | Meaning |
|---|---|
| openEHR type | The openEHR Reference Model type being mapped |
| FHIR type | The FHIR data type it maps to |
| → FHIR | The aggregate fidelity of the openEHR → FHIR direction |
| → openEHR | The aggregate fidelity of the FHIR → openEHR direction |
| Maturity | How settled the mapping decision is |
| Scope | datatype or archetype — see Scope below |
An aggregate verdict is lossless only when every field row is lossless
in that direction, unmapped only when every row is unmapped, and lossy
otherwise. It is a reading aid; the field table is the normative statement.
Each per-type table uses these columns:
| Column | Meaning |
|---|---|
| openEHR field | The Reference Model attribute, linked to its specification |
| FHIR target | The FHIR element, extension, or resource element, linked to its specification. Where the target depends on the instance, each candidate is listed with the condition under which it applies |
| → FHIR | The fidelity of this field, openEHR → FHIR |
| → openEHR | The fidelity of this field, FHIR → openEHR |
| Maturity | How settled this row is |
| Notes | What is dropped, and any conditions on the mapping |
Above each table, a Sources line names the specification sections the whole mapping is drawn from.
Fidelity is stated per direction, using exactly three values.
| Value | Meaning |
|---|---|
lossless |
The information survives the conversion in that direction |
lossy |
The conversion succeeds but drops named information |
unmapped |
There is nothing to convert to in that direction |
A mapping marked lossless SHALL round-trip: converting openEHR to FHIR and back SHALL yield an equivalent instance. A mapping marked lossy SHALL document exactly which information is dropped.
There is no fourth value. A one-way mapping is expressed as unmapped in its
reverse direction, with a reason — not as "not applicable". An unmapped
verdict on a row that is not yet settled SHALL name an owner, so that every open
gap has somebody it belongs to.
These are not editorial claims. Each is a machine-checked property of the reference implementation — with two scoping rules that are part of the claim rather than exceptions to it:
lossless row must round-trip a paired fixture unchanged, and a lossy
row must drop exactly what it says it drops — no more, and no less.archetype scope are outside the matrix, because their FHIR home
is a resource element and a data-type conversion never sees a resource. That
exemption is itself checked: a row claiming it while targeting an ordinary
data-type element is rejected, so the set of unchecked rows cannot quietly
grow.Every fixture pair is additionally asserted to be a pair — each side producible from the other, modulo the drops the ledger declares — and a pair that holds in one direction only says so, with a reason, in a marker beside it. A pair that holds in neither direction names the test that pins the behaviour instead, because a comparison asserted only to differ pins nothing about what differs.
The two standards disagree about what is optional. Many attributes the openEHR
Reference Model declares 1..1 map to FHIR elements that are 0..1:
DV_QUANTITY.magnitude and .units, DV_COUNT.magnitude,
CODE_PHRASE.code_string, DV_MULTIMEDIA.media_type and .size,
DV_PARSABLE.value and .formalism, and DV_TEXT.value are all of that shape.
A conforming FHIR instance may therefore arrive with nothing to fill a
mandatory openEHR attribute.
A converter SHALL NOT invent a value for an attribute the target standard
declares mandatory. Where the source carries nothing for such an attribute,
the conversion produces no value at all and reports the absent source path.
It does not substitute a zero, an empty string, or a default code and then call
the result lossless: a fabricated magnitude is a safety hazard, and declaring
a fabrication lossless is the single worst statement a fidelity ledger can make.
This is a rule about instances, not a fidelity fact about the two
standards. The mapping tables state what the standards can carry; a row whose
openEHR attribute is mandatory and whose FHIR element is optional stays
lossless, because the field maps exactly when it is present. What the rule
governs is what an implementation does when it is not.
Exactly three substitutions are permitted, and each is recorded on the row that describes it:
| Site | Why it is an exception |
|---|---|
CODE_PHRASE.terminology_id from an absent Coding.system |
The working group has explicitly refused to choose a strategy. The placeholder is substituted and reported, so the conversion is lossy, never lossless |
DV_STATE.is_terminal from a CodeableConcept |
Nothing in a CodeableConcept can source it; it is inferred from the state machine the archetype defines, and the openEHR-only gap is published |
TERM_MAPPING.match from a Coding |
A Coding carries no degree of equivalence and match is 1..1. The Reference Model publishes a value for exactly this case — ?, "the kind of mapping is unknown" — which is substituted and reported, so the conversion is lossy, never lossless, and no equivalence is asserted |
The list is closed. A fourth exception would have to be argued for in the reference implementation's own contract tests, where the three above are pinned and where the published list and the substituting sites are asserted to be the same set.
A conversion that delegates to another — DV_CODED_TEXT ↔ CodeableConcept
calls CODE_PHRASE ↔ Coding for each coding, and DV_STATE ↔ CodeableConcept
calls DV_CODED_TEXT ↔ CodeableConcept in turn — carries the inner
conversion's drops forward. A drop declared on the inner mapping is reported
on the outer result as well, so composition cannot make a published loss
disappear.
Fidelity says what a conversion does. Maturity says how much confidence the working group has in it. They are separate columns and are never collapsed.
| Value | Meaning |
|---|---|
settled |
The working group has reviewed the mapping and agreed it |
open |
The mapping is under discussion; the alternatives are stated in the Notes and none has been adopted |
not-discussed |
The type or field has not been examined yet |
A not-discussed row SHALL NOT claim a fidelity outcome. It carries unmapped
in both directions with a reason, because the guide cannot assert what nobody
has checked. Reviewer coverage is published in full on
Open Items rather than smoothed over.
| Value | Meaning |
|---|---|
datatype |
The mapping is expressible between the two data types alone |
archetype |
The mapping needs surrounding context — an openEHR archetype and a FHIR resource or profile — to be stated at all |
DV_ORDINAL is the clearest archetype-scope case: its symbol and its ordinal
value have no single FHIR data type to land in, and the mapping is only
meaningful as a pair of Observation.component entries. Rows at archetype
scope describe what the surrounding structures must do; they do not define
archetypes or profiles, which is
out of scope for this guide.
Every mapping row cites both specifications: the openEHR Reference Model
attribute it maps from, and the FHIR R5 element it maps to. A row with only one
citation is not published. A row whose claim neither specification supports is
recorded not-discussed or open rather than asserted.
Citations are always published URLs. Where a row targets a FHIR extension rather than a core element, the citation is to the extension pack.
Extension-pack citations are marked with a dagger — †. In the
generated tables, these citations cannot be resolved against the RI's
specification mirrors: those hold the openEHR Reference Model and the FHIR R5
core specification, and neither contains extension definitions.
A dagger therefore means "this citation is taken on the working group's
authority". Citations to openEHR RM pages and to FHIR R5 core pages carry no
dagger. Where such a citation sits on a real endpoint — a field, an
extension, or a resource element — it SHALL name a real anchor on the page,
not merely the page. For the generated mapping tables, that rule is enforced by
the external RI's ledger validation. The hand-maintained inventory on
Gaps states the rule's one exception with its reason:
RelativeTime is cited to the R5 data-type inventory page precisely because R5
defines no such type and there is no anchor to point at. Separately, and
conditionally on the specification mirrors being configured, each anchor in
the generated tables is resolved against a local copy of the specification by the RI's
citation suite. That check belongs to the external RI's documented release
gate and skips for a contributor who has not set the mirrors up. Publishing
this guide does not execute or prove either check.
Citations to terminology.hl7.org and to
jira.hl7.org are likewise verified as well-formed and
host-allow-listed only by the RI's validation; they exist in neither mirror.
Citations to build.fhir.org are not permitted anywhere in this guide, because a
continuous-build snapshot is not a published specification.
These checks cover the generated tables. Citations in the hand-maintained tables on Gaps and Open Items follow the same rules and are checked by review.
SHALL, SHALL NOT, SHOULD, and MAY are used in the sense
RFC 2119 gives them and are
normative wherever they appear in this guide. Lower-case "shall", "should", and
"may" are not conformance language.
Most of the tables in this guide are generated. Each sits between a pair of HTML comments of the form:
<!-- >>> mapping ledger: <region-id> (generated by npm --prefix reference run render) >>> -->
<!-- <<< mapping ledger: <region-id> (generated by npm --prefix reference run render) <<< -->
Everything between those two lines comes from the mapping ledger in the external reference implementation. An edit made inside a region is lost on the next render. To change a table, change the RI's ledger and follow its authoring and compatibility process, then review the generated guide update separately. To add prose, put it outside the sentinels, where nothing will touch it. The embedded command text in the delimiters is a serialization contract, not a command to run in this checkout.
The drift check turns a hand edit into a loud failure rather than a silent loss, but it only helps if it is run. That check belongs to the external RI's documented process, not to the guide build.
Generated table presentation is maintained in the RI's
reference\render\html.ts; mapping content remains owned by its ledger.
For hand-authored Markdown tables outside managed regions, retain the Markdown rows and
give each table the grid class inside its own named, keyboard-focusable
scrolling wrapper:
<div markdown="1" style="max-width: 100%; overflow-x: auto;" tabindex="0" role="group" aria-label="Scrollable table">
| <span style="white-space: nowrap;">→ openEHR</span> | Notes |
|-|-|
| Example value | Longer explanations can wrap normally. |
{: .grid}
</div>
The attribute line attaches grid to the table itself. The wrapper permits
table-local horizontal scrolling when needed, while ordinary headers and body
cells remain free to wrap. Use the no-wrap span only when → openEHR is an
actual column header, not for explanatory body labels such as those above.
Gaps and Open Items are hand-authored. Gaps and
Open Items carry no managed region, and the external RI
neither generates nor checks their content: edit their tables directly in this
guide. Page-wide presentation and link checks still apply.
Their tables are HTML rather than Markdown. Keep each table's grid class and its
scroll wrapper, and write HTML rather than Markdown inside the cells — the
wrapper carries no markdown="1", so **bold** would publish literally.
After editing, run the IG Publisher build (Track 2 in the repository's build
instructions) and read the rendered page to check table structure, escaping,
and links.
Two duties replace the automation that used to keep these pages in step with
the mapping tables:
lossy or unmapped verdict, update the matching row on Gaps in the same
change. The field table is the normative statement; the Gaps row restates
it.openehr-modelling, working-group, or a session item — the register on
Open Items lists it. When a mapping is added, the reviewer-coverage table
gains its row.A hand-written link to a mapping table or row copies the anchor exactly as the
category page publishes it, rather than reconstructing it from the mapping or
row id, and names a category exactly as its page is titled. These are consumed,
never declared: the RI's link surface remains their one source. The IG
Publisher's Track 2 link inspection reports broken targets, including
hand-written fragments, in its broken-links QA results; it does not keep a
copy synchronized when RI mapping or row ids change.