← All posts

Combining openEHR and FHIR® in practice: A practical approach to bridging two standards

How do you connect openEHR and FHIR® in a way that's practical and maintains data quality? A step-by-step explanation with a blood pressure example.

7 May 2025 By Marc van Aalten
Combining openEHR and FHIR® in practice: A practical approach to bridging two standards

In the Netherlands, the need for better digital collaboration in healthcare is growing. That is why more and more organizations are choosing a combination of openEHR for semantically rich health data storage and HL7 FHIR for standardized data exchange between systems.

But how do you connect these two standards in a way that is practical to implement while also preserving data quality?

This blog is for anyone working on health data exchange: architects, project managers, information managers, and vendors. You’ll get practical answers as well as a concrete example. You’ll learn how to create mappings between openEHR and HL7 FHIR using the FHIRconnect specifications and the openFHIR engine.

The problem: fragmented data and complex transformations

In practice, health data is stored in different source systems, each with its own data structures. To exchange this information, the data is transformed into HL7 FHIR through mappings. That sounds logical, but it comes with several challenges:

  • Complex mappings: Each source system requires custom work to correctly transform data into the appropriate FHIR profile. Even minor differences in interpretation can quickly lead to errors or lost details.
  • Labor-intensive maintenance: FHIR profiles and source systems change regularly. Consider software updates or new versions of FHIR profiles. The mappings must then be updated, tested, and validated again.
  • Risk of data loss: Transformations create a risk that clinical nuances will be lost, especially when source systems contain more or different information than the standard FHIR format can accommodate.

In short, without a sustainable, semantically sound approach, healthcare organizations will continue to invest considerable time, money, and effort in building and maintaining mappings.

The solution: connecting openEHR and HL7 FHIR with the FHIRconnect specifications

Combining openEHR and HL7 FHIR offers the best of both worlds. But connecting those worlds effectively requires smart transformation logic. That is why the FHIRconnect specifications were developed.

What are the FHIRconnect specifications?

The FHIRconnect specifications describe how to connect openEHR compositions and FHIR profiles. You create a single mapping file in YAML format that works in both directions: from FHIR to openEHR and vice versa.

Because these specifications are vendor-neutral, they can be widely adopted. Any engine that supports the standard can execute the mappings. The openFHIR engine is one concrete example.

Figure 1 shows how the openFHIR engine executes these mappings: in real time on the left and through database-level synchronization on the right.

Figure 1: openFHIR architecture (Source: https://open-fhir.com/)

One open ecosystem based on existing standards

With openEHR as the foundation for storing health data, HL7 FHIR for exchanging it, and openFHIR as the connecting layer, you get an open ecosystem that is scalable and maintainable.

Mapping a blood pressure measurement in practice

You do not need to be a programmer to create mappings, but solid subject-matter knowledge of HL7 FHIR and openEHR is essential. You need to understand the data models, profiles, and terminologies to build accurate and sustainable mappings.

With this expertise, you can start working independently with the open-source FHIRconnect specifications and the openFHIR engine.

I worked on a mapping from OBSERVATION.blood_pressure.v2 (openEHR) to nl-core-BloodPressure (FHIR R4). Below, I’ll show you how it works.

You create the mapping in a YAML file. The FHIRconnect specifications include examples you can reuse. Alternatively, you can find an example in this library.

Step 1: Create a context mapping

In the context mapping, you define:

  • The FHIR version being used;
  • The FHIR profile being mapped;
  • The corresponding openEHR template;
  • The archetypes being used.

Figure 2: Creating a context mapping

Step 2: Define your model mapping

The model mapping consists of several parts. The header links the FHIR profile to the openEHR archetype, including versions and metadata. Its purpose is to support version control and mapping reuse. See Figure 3.

Figure 3: Blood pressure model mapping header

A preprocessor is used to specify that a mapping should be applied only when a particular condition is met. For example: execute the mapping only if Observation.code = 85354-9 (the LOINC code for blood pressure). See Figure 4.

Figure 4: Blood pressure preprocessor

The body is the core of your mapping. In this section, you define the actual connections between FHIR and openEHR. For each data element, you specify which element in FHIR corresponds to which element in openEHR. This is done using FHIRPath and an openEHR path.

What do you configure in the body?

For each data element you want to map, add a separate block containing:

  • name: a recognizable name for the mapping rule;
  • fhir: the path to the element in FHIR.

Figure 5 contains an example mapping for the “measurement method.” Add the FHIRPath after “$resource” in the fhir field.

Figure 5: Model mapping body—BloodPressure method

  • openehr: the corresponding path in openEHR.

For the openEHR path, I use the Better Archetype Designer (see Figure 6). The “Details” tab of your template shows the “Resolved path.” Trim the path so it starts after the archetype name. In the example below, this is the path you need: /protocol[at0011]/items[at1035]. Then add it after “$archetype” in your model mapping.

Figure 6: openEHR path

  • type: the data type;
  • conditions (optional): conditions that determine when this mapping is applied, such as a fhirCondition (see Figure 4);
  • followedBy (optional): sometimes you want a particular mapping to be executed only after another mapping has been completed. That is what followedBy is for. In effect, you are saying: “Map this first, then map that other field.” Figures 7 and 8 show how this is used to map the FHIR data element “systolic blood pressure,” which is nested under “component”;

Figure 7: HL7 FHIR profile nl-core-BloodPressure

Figure 8: Model mapping followedBy SystolicBP

  • manual (optional): use this when the mapping cannot be performed automatically. You specify a fixed manual value; this is ideal when a FHIR field has no direct equivalent in openEHR. Figure 9 shows an example of a manual mapping for the id and meta data elements of the FHIR resource.

Figure 9: Manual mapping (id and meta)

Step 3: Upload your mappings to the openFHIR engine

Use an API tool such as Postman or Insomnia.

Upload the openEHR Operational Template (OPT):

[POST] https://sandbox.open-fhir.com/opt

Figure 10: Downloading the OPT from the Archetype Designer

Figure 11: Uploading the OPT Upload the context mapping:

[POST] https://sandbox.open-fhir.com/fc/context

Figure 12: Uploading the context mapping

Upload the model mapping:

[POST] https://sandbox.open-fhir.com/fc/model

Figure 13: Uploading the model mapping

Step 4: When the magic happens

Is everything configured and uploaded? Then it is time for the best part: seeing the mapping in action. Use the following endpoint to transform your openEHR data into a FHIR message in real time:

[POST] https://sandbox.open-fhir.com/openfhir/tofhir

This endpoint uses the mapping files you uploaded earlier—the OPT, context mapping, and model mapping—and executes the mapping based on the FHIRconnect specifications.

…and voilà: you automatically receive a complete FHIR message for a blood pressure measurement, neatly generated from your openEHR template.

{
	"resourceType": "Bundle",
	"entry": [
		{
			"resource": {
				"resourceType": "Observation",
				"id": "nl-core-BloodPressure-01",
				"meta": {
					"profile": [
						"http://nictiz.nl/fhir/StructureDefinition/nl-core-BloodPressure"
					]
				},
				"extension": [
					{
						"url": "http://hl7.org/fhir/StructureDefinition/observation-bodyPosition",
						"valueCodeableConcept": {
							"coding": [
								{
									"system": "http://snomed.info/sct",
									"code": "33586001",
									"display": "Sitting position"
								}
							],
							"text": "Sitting position"
						}
					}
				],
				"status": "final",
				"category": [
					{
						"coding": [
							{
								"system": "http://terminology.hl7.org/CodeSystem/observation-category",
								"code": "vital-signs",
								"display": "Vital Signs"
							}
						]
					}
				],
				"code": {
					"coding": [
						{
							"system": "http://loinc.org",
							"code": "85354-9",
							"display": "Blood pressure panel with all children optional"
						}
					]
				},
				"effectiveDateTime": "2025-03-28T11:42:09+00:00",
				"bodySite": {
					"coding": [
						{
							"system": "http://snomed.info/sct",
							"code": "368209003",
							"display": "Structure of right upper arm"
						}
					],
					"text": "Structure of right upper arm"
				},
				"method": {
					"coding": [
						{
							"system": "http://snomed.info/sct",
							"code": "371911009",
							"display": "Blood pressure measurement using a cuff"
						}
					],
					"text": "Blood pressure measurement using a cuff"
				},
				"component": [
					{
						"code": {
							"coding": [
								{
									"system": "http://loinc.org",
									"code": "8480-6",
									"display": "Systolic blood pressure"
								}
							]
						},
						"valueQuantity": {
							"value": 130,
							"unit": "mm[Hg]"
						}
					},
					{
						"code": {
							"coding": [
								{
									"system": "http://loinc.org",
									"code": "8462-6",
									"display": "Diastolic blood pressure"
								}
							]
						},
						"valueQuantity": {
							"value": 85,
							"unit": "mm[Hg]"
						}
					},
					{
						"code": {
							"coding": [
								{
									"system": "http://snomed.info/sct",
									"code": "6797001",
									"display": "Mean blood pressure (observable entity)"
								}
							]
						},
						"valueQuantity": {
							"value": 135,
							"unit": "mm[Hg]"
						}
					},
					{
						"code": {
							"coding": [
								{
									"system": "http://snomed.info/sct",
									"code": "70665002",
									"display": "Blood pressure cuff"
								}
							]
						},
						"valueCodeableConcept": {
							"coding": [
								{
									"system": "http://snomed.info/sct",
									"code": "L",
									"display": "Large"
								}
							],
							"text": "Large"
						}
					},
					{
						"code": {
							"coding": [
								{
									"system": "http://snomed.info/sct",
									"code": "85549003",
									"display": "Korotkoff sounds (observable entity)"
								}
							]
						},
						"valueCodeableConcept": {
							"coding": [
								{
									"system": "http://snomed.info/sct",
									"code": "255271000",
									"display": "Phase V"
								}
							],
							"text": "Phase V"
						}
					}
				]
			}
		}
	]
}

Governance: prevent duplicate work

Good governance prevents duplicate work and safeguards quality. Use central platforms to store and share mapping files, such as the Clinical Knowledge Manager (CKM) for openEHR models and Simplifier for FHIR profiles. Manage mappings under the direction of organizations such as Nictiz to ensure they can be reused nationwide.

The CKM already supports uploading mappings.

Figure 15: Uploading mappings to CKM

The community is embracing this approach

The introduction of the FHIRconnect specifications and the openFHIR engine has generated many positive responses, including on LinkedIn. Healthcare professionals and technologists see this approach as a concrete step toward better collaboration between systems.

Conclusion: define once, use everywhere

With the FHIRconnect specifications, you can connect openEHR and FHIR without reinventing the wheel each time—and in a way that is scalable, reliable, and reusable.

Ready to get started?

  • View an example mapping in the sandbox;
  • Read the FHIRconnect specifications;
  • Start creating your first mapping.

Would you like to receive the complete mapping files? Or would you like to discuss your mapping? Click “Meet us” or contact Marc at [email protected].

Want to understand how this fits your implementation? Get in touch →

Get started

Ready to make interoperability work?

Discover how Interoplab helps your organisation achieve demonstrable compliance.