openEHR and FHIR UKCore

Are there any active projects/discussions on documenting mappings between the (slowly) emerging UK Core FHIR profiles and openEHR?

If so, I’d like to get involved…

@ian.mcnicoll I’m guessing you might have some visibility of anything that is going on in this area.

Hi Richard - we are working on some ideas around this at Better. Still early days but happy to chat.

Hi Richard,

Have a look at GitHub - freshehr/openehr-care-connect-adaptor

This is a fork of funded by Code4Health / Apperta to demonstrate how to retrieve openEHR data via AQL to populate FHIR resources, based on some ‘standard’ templates we developed for this sort of purpose.

Uses HAPI-FHIR and STU3 The live ‘demos’ are not working but it should be buildable and work against both EhrBase and BetterCDR.

I’d love to see this updated for FHIR UK Core and the FHIR IPS profiles , and on the openEHR side, update the templates to use more recent archetype versions, with input from other UK openEHR folks if possible. We would happily get involved with that.

Thanks @Alastair - I’ve been away from the openEHR world for quite a few years so need to get back up to speed again. Personally, my interests/responsibilities have moved on from interoperability (e.g. FHIR) to data. I’ve seen bespoke CDRs and the problems that they exhibit and (in my opinion) FHIR is not the standard for that (for many reasons).

That said, within the UK, FHIR is here to stay and I have a stack of knowledge and experience in that. As such it’s an opportune challenge to integrate the FHIR and openEHR worlds.

Let’s see if anyone else shows interest and have a chat in a week or so.

I see @ian.mcnicoll has responded as I have been writing this :slight_smile:

Hi Richard, good to see you around again. On the FHIR / question you might find the EhrBase FHIR Bridge interesting if you have not already come across it.

@richard.kavanagh the FHIR Bridge mentioned by Thomas has FHIR → openEHR mappings for the German data sets GECCO - Implementation Guide - Current

I have designed and implemented some of those mappings, also done work on mapping openEHR back to FHIR.

Though it is a good base to implement the mappings you need, you need to develop all the mappings from scratch in code, but you can use the current mappings as examples on how to do it.

On the modeling side of things, openEHR templates were designed based on the FHIR profiles in GECCO. I don’t know how many archetypes were reused from the CKM or created from scratch for this purpose. You can find the templates and archetypes here Clinical Knowledge Manager

1 Like

Very relevant to our work also.

We have a vaccines database modelled in FHIR and stored in Postgres, but over time want to map / persist data in EHRbase, so our vaccines template (which @ian.mcnicoll helped us with!) is effectively mapped to UKCore. Obviously this is a hand crafted effort with no automation, but our requirement for maps in other areas e.g. Allergies, meds and problems (probably the ‘persistent compositions’ in effect) are likely to grow.

2 Likes

@Paulmiller @richard.kavanagh if you are looking at the FHIR Bridge and need help with that, the man behind the architecture is Renaud Subiger, you should contact him, a great guy to work with! https://www.linkedin.com/in/renaud-subiger-4541aa152/

4 Likes

Thanks, Thomas. As I mentioned I have a bit to catch up on. When I was last looking at openEHR there weren’t really any robust repositories, now there seem to be several. Operational templates were just emerging and now they look to be both available and stable.

EhrBase looks like a great product but I’m not looking to get too involved in the Java side of things. My development skills are predominantly in the C# area.

I’ll continue my research for now…

Just FYI, you may have already found these pages, but in case not, see here for products / implementations and here for deployments (well, we guess maybe 30% of deployments) - none of the China, Japan or SE Asia is in there yet.

Nigh on everything that we’re now modelling in Wales will have an eye on UK Core. Adverse reactions, shared meds etc but also moving into stuff in the cancer space, diagnosis etc. We are testing FHIR Bridge now also so a shared mapping repository would be very helpful .

1 Like

A good opportunity to refloat the conversation about an official openEHR mapping language!

1 Like

So a “little” wiser on the openEHR front now, I think it’s time (for me) to dive in and see if I can bring anyone else along with me…

My initial proposal is along the lines of:

  • List out the UK FHIR Profiles, ranked by the most mature (some are very slowly going through a ballot process at the moment)
  • Crowdsource which of them are appropriate for openEHR mapping and any preferences on order (some of the demographic ones are probably not too important at the moment)
  • Establish what the target openEHR model is (archetype/template)
  • Establish a mechanism for mapping (is an openEHR specific methodology required, or can an existing one be used?) - if all else fails we can start simple in a non-computable form
  • Source example openEHR and FHIR instances to test mapping rules
  • Explore computable translation options, I don’t know what exists in the openEHR space for this but I know there are open source HL7/FHIR options

Haven’t decided where to document all of this, any suggestions welcome… :slight_smile:

Hi Richard,
we have a standards space in Confluence that already has a certain amount of FHIR/openEHR content. We can create a new page there - probably the existing ones are not exactly what you want - happy to give you a new page (tree).

For your amusement, see this FHIR ‘choice’ analysis I did a couple of years ago for VA. Gives some idea of why mapping in and out of FHIR is not easy.

1 Like

Thanks @thomas.beale, using Confluence seems like a good call, so I have started to jot down some initial words here https://openehr.atlassian.net/l/c/NmoTcBvM

I can have a go at the initial archetype mappings (if only as a means to stimulate someone to correct me) - there may be prior art in this area though.

2 Likes

I think we may have another step in this process.

I’ve been struggling comparing PRSB, Lab Panels, LOINC Panels, openEHR archetypes + templates, etc.
To me these are all definitions which have a variety of implementation options. E.g.

  • a LOINC Panel is followed in a HL7 v2 ORU exchange
  • a openEHR Composition (correct me if I’m wrong) can be shared as a document or Composition via IHE XDS(/MHD).
  • Observations in a LOINC panel/HL7 v2 ORU are shared as a series of FHIR Observations (via IHE QEDm RESTful API)
  • Observations on Apple iPhone Health are shared as FHIR Observations using LOINC coding.

So what I did was to try to convert all of the definitions to FHIR Questionnaire.

Alongside this I’m seeing three different types of entities:

  • Form (is this really an archetype?)
  • Resource - this is a technical thing, only observations in the above is a resource
  • Document - I see this as PDF, html, CDA, FHIR Document, openEHR Composition

and an archetype can end up (when shared) as a mix of all three. However the main definition does appear to be openEHR Archetype/openEHR Template/FHIR Questionnaire.

It does appear that openEHR Templates (and Archetypes) and FHIR Questionnaires are very much related.

Is some minor differences mostly around coding and Template context (openEHR examples I’ve found go for XDS document metadata and FHIR examples tends to follow HL7 v2 ADT Encounters … this may be lack of understanding of openEHR and it is all fine).

Example conversion to FHIR Questionnaire from Template: Vital signs [openEHR Clinical Knowledge Manager]

{
  "resourceType": "Questionnaire",
  "id": "a24b52ef-deb2-45e7-ac64-1346bbd64843",
  "meta": {
    "versionId": "3",
    "lastUpdated": "2023-09-09T07:55:30.633Z"
  },
  "url": "https://example.fhir.openehr.org/Questionnaire/Vitalsigns",
  "identifier": [
    {
      "value": "74b50979-ab22-4351-bfdc-cc5191ea0ac5"
    }
  ],
  "title": "Vital signs",
  "status": "draft",
  "contact": [
    {
      "name": "2021-03-07"
    }
  ],
  "purpose": "A simple template containing only the most commonly used main data elements of Body temperature, Blood pressure, Body mass index, Height/Length, Body weight, Pulse/Heart beat, Respiration, and Pulse oximetry. Non-metric unit alternatives have been constrained out.",
  "item": [
    {
      "extension": [
        {
          "url": "http://openehr.org/Datatype",
          "valueString": "CARCHETYPEROOT"
        },
        {
          "url": "http://openehr.org/Archetype",
          "valueString": "openEHR-EHR-OBSERVATION.body_temperature.v2"
        }
      ],
      "linkId": "at0000-3930",
      "text": "Body temperature",
      "type": "group",
      "item": [
        {
          "extension": [
            {
              "url": "http://openehr.org/Datatype",
              "valueString": "CCOMPLEXOBJECT/ELEMENT"
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod",
              "valueDuration": {
                "value": 2,
                "unit": "weeks",
                "system": "http://unitsofmeasure.org",
                "code": "wk"
              }
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationExtract",
              "valueBoolean": true
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "Cel"
              }
            }
          ],
          "linkId": "at0000-3930/at0004-4161",
          "code": [
            {
              "system": "http://snomed.info/sct",
              "code": "386725007"
            }
          ],
          "text": "Temperature",
          "type": "quantity"
        }
      ]
    },
    {
      "extension": [
        {
          "url": "http://openehr.org/Datatype",
          "valueString": "CARCHETYPEROOT"
        },
        {
          "url": "http://openehr.org/Archetype",
          "valueString": "openEHR-EHR-OBSERVATION.blood_pressure.v2"
        }
      ],
      "linkId": "at0000-171",
      "code": [
        {
          "system": "http://snomed.info/sct",
          "code": "364090009"
        }
      ],
      "text": "Blood pressure",
      "type": "group",
      "item": [
        {
          "extension": [
            {
              "url": "http://openehr.org/Datatype",
              "valueString": "CCOMPLEXOBJECT/ELEMENT"
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod",
              "valueDuration": {
                "value": 2,
                "unit": "weeks",
                "system": "http://unitsofmeasure.org",
                "code": "wk"
              }
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationExtract",
              "valueBoolean": true
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "mm[Hg]"
              }
            }
          ],
          "linkId": "at0000-171/at0004-6886",
          "code": [
            {
              "system": "http://snomed.info/sct",
              "code": "271649006"
            },
            {
              "system": "http://openehr.org/CodeSystem",
              "code": "125"
            }
          ],
          "text": "Systolic",
          "type": "quantity"
        },
        {
          "extension": [
            {
              "url": "http://openehr.org/Datatype",
              "valueString": "CCOMPLEXOBJECT/ELEMENT"
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod",
              "valueDuration": {
                "value": 2,
                "unit": "weeks",
                "system": "http://unitsofmeasure.org",
                "code": "wk"
              }
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationExtract",
              "valueBoolean": true
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "mm[Hg]"
              }
            }
          ],
          "linkId": "at0000-171/at0005-1110",
          "code": [
            {
              "system": "http://snomed.info/sct",
              "code": "271650006"
            },
            {
              "system": "http://openehr.org/CodeSystem",
              "code": "125"
            }
          ],
          "text": "Diastolic",
          "type": "quantity"
        }
      ]
    },
    {
      "extension": [
        {
          "url": "http://openehr.org/Datatype",
          "valueString": "CARCHETYPEROOT"
        },
        {
          "url": "http://openehr.org/Archetype",
          "valueString": "openEHR-EHR-OBSERVATION.body_mass_index.v2"
        }
      ],
      "linkId": "at0000-2329",
      "text": "Body mass index",
      "type": "group",
      "item": [
        {
          "extension": [
            {
              "url": "http://openehr.org/Datatype",
              "valueString": "CCOMPLEXOBJECT/ELEMENT"
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod",
              "valueDuration": {
                "value": 2,
                "unit": "weeks",
                "system": "http://unitsofmeasure.org",
                "code": "wk"
              }
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationExtract",
              "valueBoolean": true
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "kg/m2"
              }
            }
          ],
          "linkId": "at0000-2329/at0004-7991",
          "code": [
            {
              "system": "http://snomed.info/sct",
              "code": "60621009"
            },
            {
              "system": "http://loinc.org",
              "code": "39156-5"
            },
            {
              "system": "http://openehr.org/CodeSystem",
              "code": "349"
            }
          ],
          "text": "Body mass index",
          "type": "quantity"
        }
      ]
    },
    {
      "extension": [
        {
          "url": "http://openehr.org/Datatype",
          "valueString": "CARCHETYPEROOT"
        },
        {
          "url": "http://openehr.org/Archetype",
          "valueString": "openEHR-EHR-OBSERVATION.height.v2"
        }
      ],
      "linkId": "at0000-9736",
      "text": "Height/Length",
      "type": "group",
      "item": [
        {
          "extension": [
            {
              "url": "http://openehr.org/Datatype",
              "valueString": "CCOMPLEXOBJECT/ELEMENT"
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod",
              "valueDuration": {
                "value": 2,
                "unit": "weeks",
                "system": "http://unitsofmeasure.org",
                "code": "wk"
              }
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationExtract",
              "valueBoolean": true
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "cm"
              }
            }
          ],
          "linkId": "at0000-9736/at0004-5081",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "8302-2"
            },
            {
              "system": "http://openehr.org/CodeSystem",
              "code": "122"
            }
          ],
          "text": "Height/Length",
          "type": "quantity"
        }
      ]
    },
    {
      "extension": [
        {
          "url": "http://openehr.org/Datatype",
          "valueString": "CARCHETYPEROOT"
        },
        {
          "url": "http://openehr.org/Archetype",
          "valueString": "openEHR-EHR-OBSERVATION.body_weight.v2"
        }
      ],
      "linkId": "at0000-2405",
      "text": "Body weight",
      "type": "group",
      "item": [
        {
          "extension": [
            {
              "url": "http://openehr.org/Datatype",
              "valueString": "CCOMPLEXOBJECT/ELEMENT"
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod",
              "valueDuration": {
                "value": 2,
                "unit": "weeks",
                "system": "http://unitsofmeasure.org",
                "code": "wk"
              }
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationExtract",
              "valueBoolean": true
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "kg"
              }
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "g"
              }
            }
          ],
          "linkId": "at0000-2405/at0004-4936",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "29463-7"
            },
            {
              "system": "http://openehr.org/CodeSystem",
              "code": "124"
            }
          ],
          "text": "Weight",
          "type": "quantity"
        }
      ]
    },
    {
      "extension": [
        {
          "url": "http://openehr.org/Datatype",
          "valueString": "CARCHETYPEROOT"
        },
        {
          "url": "http://openehr.org/Archetype",
          "valueString": "openEHR-EHR-OBSERVATION.pulse.v2"
        }
      ],
      "linkId": "at0000-6911",
      "text": "Pulse/Heart beat",
      "type": "group",
      "item": [
        {
          "extension": [
            {
              "url": "http://openehr.org/Datatype",
              "valueString": "CCOMPLEXOBJECT/ELEMENT"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "/min"
              }
            }
          ],
          "linkId": "at0000-6911/at0004-3770",
          "code": [
            {
              "system": "http://openehr.org/CodeSystem",
              "code": "382"
            }
          ],
          "text": "Rate",
          "type": "quantity"
        }
      ]
    },
    {
      "extension": [
        {
          "url": "http://openehr.org/Datatype",
          "valueString": "CARCHETYPEROOT"
        },
        {
          "url": "http://openehr.org/Archetype",
          "valueString": "openEHR-EHR-OBSERVATION.respiration.v2"
        }
      ],
      "linkId": "at0000-3263",
      "text": "Respiration",
      "type": "group",
      "item": [
        {
          "extension": [
            {
              "url": "http://openehr.org/Datatype",
              "valueString": "CCOMPLEXOBJECT/ELEMENT"
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod",
              "valueDuration": {
                "value": 2,
                "unit": "weeks",
                "system": "http://unitsofmeasure.org",
                "code": "wk"
              }
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationExtract",
              "valueBoolean": true
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "/min"
              }
            }
          ],
          "linkId": "at0000-3263/at0004-8183",
          "code": [
            {
              "system": "http://snomed.info/sct",
              "code": "271625008"
            },
            {
              "system": "http://openehr.org/CodeSystem",
              "code": "382"
            }
          ],
          "text": "Rate",
          "type": "quantity"
        }
      ]
    },
    {
      "extension": [
        {
          "url": "http://openehr.org/Datatype",
          "valueString": "CARCHETYPEROOT"
        },
        {
          "url": "http://openehr.org/Archetype",
          "valueString": "openEHR-EHR-OBSERVATION.pulse_oximetry.v1"
        }
      ],
      "linkId": "at0000-4333",
      "text": "Pulse oximetry",
      "type": "group",
      "item": [
        {
          "extension": [
            {
              "url": "http://openehr.org/Datatype",
              "valueString": "CCOMPLEXOBJECT/ELEMENT"
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod",
              "valueDuration": {
                "value": 2,
                "unit": "weeks",
                "system": "http://unitsofmeasure.org",
                "code": "wk"
              }
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationExtract",
              "valueBoolean": true
            }
          ],
          "linkId": "at0000-4333/at0006-221",
          "code": [
            {
              "system": "http://snomed.info/sct",
              "code": "431314004"
            },
            {
              "system": "http://loinc.org",
              "code": "59408-5"
            }
          ],
          "text": "SpO₂",
          "type": "integer"
        }
      ]
    }
  ]
}

I have a basic bit of conversion code in this git repo GitHub - NHSDigital/IOPS-FHIR-openEHR. Its spring boot based / java based (like FHR Bridge). It has two end points:

POST {{baseUrl}}/Questionnaire/$convertTemplate
POST {{baseUrl}}/Questionnaire/$convertArchetype

baseUrl on local machines would be http://localhost:9006/openFHIR/R4

p.s. Ignore the SDC (IHE/FHIR Structured Data Capture) elements such as

 {
                                            "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod",
                                            "valueDuration": {
                                                "value": 2,
                                                "unit": "weeks",
                                                "system": "http://unitsofmeasure.org",
                                                "code": "wk"
                                            }
                                        },
                                        {
                                            "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationExtract",
                                            "valueBoolean": true
                                        }

I’m using this for automatic FHIR Observation generation and auto populating entries in a openEHR Template/(FHIR Questionnaire). This is for experiments with diagnostic systems (EPR, LIMS, etc) supporting IHE QEDm interfaces.

The example I created should work with US National Library of Medicine NLM Form Builder. https://lhcformbuilder.nlm.nih.gov/

Compare and contrast - from the Veratech guys!

http://141.147.80.147:8080/openehr2fhir/

How are you constructing the ‘linkId’?

I don’t think your diagram is quite correct.

Archetypes and templates are not forms. They are really closer to resources philosophically. Semantic information structure components akin to allergyIntolerance, Condition etc in FHIR but with a broader range of concrete resources which FHIR manages profiles on generic ‘more syntactic’ components like Observation or Questionnaire.

Because all openEHR data is committed within a Composition instance, this plays very nicely with document registry/ record locators like XDS.

I’ll have a go at redrawing your diagram.

1 Like

Also see Findings: "Transform openEHR to FHIR Questionnaire" - #7 by Kenneth_Myhra

1 Like