Blog

    FHIR and openEHR Resource Mapping Matrix: Vital Signs, Problems, Medications and Allergies

    By GauravNovember 27, 20269 mins read
    On this page

    Teams that store clinical data in openEHR rarely live in an openEHR-only world. Partners, payers and apps ask for FHIR, and data from FHIR sources needs a home in the openEHR repository. Each connection starts with the same question: which archetype element becomes which FHIR element, and what falls on the floor?

    This post is for clinical modellers and integration engineers building that bridge. It sets out how to lay out a mapping matrix, works through vital signs, problems, medications and allergies, and lists what each direction loses and how to test it.

    What is a FHIR and openEHR mapping matrix?

    Exposing openEHR data through FHIR?

    Our FHIR development team builds FHIR APIs and mappings on top of existing clinical data stores.

    A FHIR and openEHR mapping matrix is a versioned table that pairs each element of an openEHR archetype with a FHIR resource element, with the terminology binding, the transform and any loss noted for each direction. Agnotic Technologies treats the matrix as the specification that mapping code is built and tested against.

    The matrix is a clinical document as much as a technical one. A clinical modeller should be able to read it and agree that the meaning survives the trip.

    Why map between openEHR and FHIR at all?

    You map between them because each does a different job. openEHR suits long-lived, richly modelled clinical records, while FHIR is what most partners, apps and regulators expect at the boundary.

    • Outbound: an openEHR repository exposes data through a FHIR API for apps and partners.
    • Inbound: FHIR data from devices, labs or other EHRs is stored as openEHR compositions.
    • Reporting: national or payer reporting asks for FHIR profiles your repository must fill.

    Start the matrix with the data partners actually request. Mapping every archetype in every template up front costs months and produces rows nobody uses.

    How is the matrix laid out?

    Lay the matrix out with one row per archetype element and direction, so outbound and inbound rules can differ. Each row is pinned to an archetype version and a FHIR profile.

    openEHR to FHIR mapping through a matrix: compositions in an openEHR clinical data repository, identified by archetype paths and versions, pass through a mapping layer with a path map, terminology bindings and a gap log, and come out as FHIR Observation, Condition, MedicationRequest and AllergyIntolerance resources, with a bar for the versioned matrix reviewed by a clinical modeller
    • Archetype: the archetype id with its version, such as openEHR-EHR-OBSERVATION.blood_pressure.v2.
    • Path: the node id path to the element inside the archetype.
    • FHIR target: the resource, profile and element path.
    • Terminology: the code system on each side and any translation.
    • Loss note: what the target cannot carry, and whether that is accepted.

    Keep a gap log beside the matrix for elements with no target at all. A clinical modeller reviews the matrix before each release, and every mapping change goes through that review.

    Vital signs: the closest match

    Vital signs map most cleanly, because both sides model them as measurements with values, units and times. The main work is codes and the context around each reading.

    The published openEHR archetype openEHR-EHR-OBSERVATION.blood_pressure.v2 is used to record the systemic arterial blood pressure of an individual, for all representations of the measurement no matter which method or body location is used.

    The HL7 FHIR R4 vital signs profile requires each vital signs Observation to carry a status, the vital-signs category, a LOINC code for what was measured, a patient, a measurement time and a numeric value with a UCUM unit, or a reason when there is no value; blood pressure uses panel code 85354-9 with systolic and diastolic components.

    • Blood pressure: blood_pressure.v2 to an Observation with panel code 85354-9, systolic 8480-6 and diastolic 8462-4 components.
    • Pulse: pulse.v2 rate to an Observation coded 8867-4 for heart rate.
    • Body weight: body_weight.v2 to an Observation coded 29463-7.
    • Body temperature: body_temperature.v2 to an Observation coded 8310-5.

    The openEHR archetypes also hold context such as position, cuff size or exertion. Map what has a FHIR home, such as body site or method, and record the rest in the loss note rather than squeezing it into free text.

    Where do problems and diagnoses differ?

    Problems differ in how status and certainty are modelled. The openEHR problem_diagnosis.v1 archetype records details about a single identified problem or diagnosis, while FHIR Condition carries clinical and verification status as coded elements.

    • Name: Problem/Diagnosis name to Condition.code, with the code system kept.
    • Dates: date/time of onset and of resolution to onsetDateTime and abatementDateTime.
    • Certainty: Diagnostic certainty to verificationStatus, through an agreed value map.
    • Severity and body site: to Condition.severity and Condition.bodySite.

    Elements such as course description, impact or cause have no direct Condition field. Decide per element whether they travel as a note, an extension your partners accept, or not at all.

    How do medications map?

    Medications map in two parts: orders and what happened after them. The medication_order.v3 instruction maps to MedicationRequest, and the medication ACTION archetype carries the steps that follow.

    The ACTION records careflow steps such as prescription issued, prescription dispensed and dose administered. FHIR spreads those across MedicationRequest status, MedicationDispense and MedicationAdministration, so one openEHR action history can become several FHIR resources.

    Dose and timing are the hardest part. Structured dose directions on both sides rarely line up one to one, so keep the original text alongside the structured mapping and test complex regimens by hand.

    Allergies and adverse reaction risk

    Allergies map from the adverse_reaction_risk archetype to FHIR AllergyIntolerance, and the two describe almost the same idea. Both record a risk tied to a substance, plus reactions that have happened.

    The published openEHR archetype openEHR-EHR-EVALUATION.adverse_reaction_risk.v2 records the clinical assessment of the propensity for an individual to experience an adverse reaction if exposed, or re-exposed, to a specified substance or class of substances.

    FHIR AllergyIntolerance describes the risk of a harmful or undesirable physiological response unique to an individual and associated with exposure to a substance. Map the substance, criticality, reaction manifestations and onset, and agree a value map for status and verification, where the two sides use different value sets.

    What does each direction lose?

    Each direction loses something, and the matrix should say what. Losses accepted on purpose are fine; losses nobody noticed are not.

    • openEHR to FHIR: state and protocol details, event series with intervals, archetype node ids and composition context.
    • openEHR to FHIR: elements such as course description or impact with no target field.
    • FHIR to openEHR: references between resources that the template does not model.
    • FHIR to openEHR: extensions and profile-specific elements with no archetype home.

    For inbound data, the template decides what can be stored. If a FHIR element matters clinically and has no place in the template, the fix is a template change agreed with the modellers, not a hidden field.

    Mapping matrix failure points

    Most failures come from treating the matrix as a one-off spreadsheet rather than a maintained specification.

    • Version drift: the archetype or FHIR profile moves on and the matrix still points to the old one.
    • Silent loss: elements dropped without a loss note, so nobody knows they are missing.
    • Status guesses: certainty and status values mapped by name instead of an agreed value map.
    • Free text stuffing: unmapped context written into notes that nobody downstream reads.
    • One direction only: outbound tested, inbound assumed to be the reverse.

    A worked example: exposing an openEHR vital signs chart through FHIR

    A hospital stores ward observations in openEHR and a partner's early warning app needs them through FHIR. The matrix covers blood pressure, pulse, respiration, temperature, oxygen saturation and weight, each pinned to its archetype version.

    Each reading becomes a vital signs Observation with its LOINC code and UCUM unit. Position and cuff size have no agreed target, so the loss note records them as not sent, and the partner confirms its scoring does not need them.

    A month later the partner asks for consciousness level. The modellers add a row from the hospital's template, the code is updated in one place and the round trip tests run again.

    Who owns what?

    The matrix needs clinical, technical and partner owners.

    • Clinical modeller: archetype choice, meaning of each row and accepted losses.
    • Terminology owner: code systems and value maps on both sides.
    • Integration engineer: mapping code, tests and the gap log.
    • Partner contact: which FHIR profile and elements the partner relies on.

    Store the matrix in version control next to the mapping code, not in a shared spreadsheet. Reviews then happen on the same change that alters the code, and the history shows who accepted each loss.

    How do you test the mapping both ways?

    Test both ways with round trips. Take a composition, map it to FHIR, map it back and compare, then do the same from FHIR resources.

    • Profile validation: every FHIR output checked against the target profile.
    • Template validation: every inbound composition checked against the template.
    • Round trip diff: values that changed or vanished compared with the loss notes.
    • Clinical review: a modeller checks a sample of real-shaped cases each release.

    Every difference in a round trip should match a loss note. A difference without one is a bug or an undocumented loss.

    What are FHIR openEHR mapping best practices?

    Keep one matrix row per archetype element and direction, pin each to archetype and profile versions, and record every loss on purpose. Use agreed value maps for status and certainty.

    Have a clinical modeller review each release, keep a gap log, and prove the mapping with round trip tests in both directions.

    How Agnotic can help

    Agnotic builds mapping layers between openEHR repositories and FHIR APIs: the matrix, value maps, mapping code, gap logs and round trip tests. We work with your clinical modellers so the meaning of each element survives the trip.

    Compare FHIR and openEHR for your platform

    See how the two standards differ and where each fits before you commit to a mapping.

    Sources

    Frequently Asked Questions

    Rarely. Vital signs map closely, but state, protocol and some problem details have no FHIR target. A good matrix records each loss and whether it is accepted.

    Talk to an engineer about your project

    Share the archetypes in your templates and the FHIR profiles your partners need. We will draft the matrix and flag the losses.