openEHR and FHIR UKCore

@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

That’s what on the LHS (clinical informatics) side of the diagram I call it an Archetype, on the RHS I use the common IHE term and then the FHIR term (I’ll remove the openEHR bit).

It’s a bridging diagram.

This is a more complicated and I think separate discussion.

Well it is for me :slight_smile: At present I’m using hints in Templates and Archetypes to indicate it can also be a resource.

The only reliable hint I’ve found is nodeId linked to a SNOMED/LOINC term which I’ve taken to imply it’s an Observation. Other resources are possible but I think Templates/Archetypes need to add in some hints to the mapping.
It is a another discussion but this FHIR SDC is talking about it Form Data Extraction - Structured Data Capture v3.0.0

It is the nodeId plus a random number to make the linkId unique (at0000 is causing a lot of issues)

Intend to revisit if I try writing back in FHIR.

Use the archetypeID, not at0000 e.g. ‘openEHR-EHR-OBSERVATION-blood_pressure.v2’ that acts as a unique namespace for any of the atCodes which are unique within each archetype

1 Like

Well they are for those archetypes that are to do with real questionnaires, but not for the other 650 archetypes, unless you want to represent all clinical data as a ‘questionnaire’, which I realise is a path that some FHIR users take. It depends on whether your view is that the FHIR types have any real meaning, or one just uses what is easiest, more or less ignoring the names of the resources.

In the first view, Vitals signs archetypes have nothing to do with FHIR Questionnaire. In the second, maybe they do…

Anyway, archetypes may be best understood as a library of how to record data items, and templates are specific data sets made of such items. A form is just one way to visualise a template or part thereof, but a template is not a form definition, although it can be used to generate one.

2 Likes

I do have multiple answers, it’s not just FHIR Questionnaire, It depends on what the user is doing (use case).

The frameworks (from use cases) I can find in openEHR implementations are currently:

  • IHE QEDm (FHIR)
  • IHE XDS (XML)

openEHR probably is suited as the main definition standard for

  • IHE SDC (this is where Questionnaire comes in)

Might need to look at also supporting

  • IHE MHD (FHIR API for XDS)

In addition you also have HL7 v2 ADT which openEHR implementations support.

All of these frameworks should work together and data models may change depending on use case e.g. an openEHR Composition may be:

  • FHIR QuestionnaireResponse (SDC)
  • FHIR Observations (QEDM) - simplified viewpoint
  • OBXs (ADT) - simplified viewpoint
  • PDF (XDS/MHD)