miércoles, 30 de octubre de 2019

Using LinkEHR to generate FHIR Observation profiles

After my last 'summer challenge' post one of the missing things was to make it publicly available in a simple way. This post shows how that algorithm was actually implemented in LinkEHR. This functionality is available in LinkEHR version that can be downloaded from linkehr.com

The process is quite straightforward:
  1. Open a given archetype (or import OPT)
    1. Process is NOT limited to openEHR Observation archetypes, any archetype can be feed as an input. Output will always be FHIR observation profile/s
  2. Launch the wizard in Advanced utilities -> Transform openEHR to FHIR observation
  3. Select an output path
  4. Select the archetype paths to be exported
    1. The process lists all paths with a leaf node, regardless of where are they included in the archetype (data, protocol, etc.)
  5. Select the type of the element in the FHIR profile (as Observation.component, as Observation.value or as a new extension)
  6. Check the suitable options from the bottom and press Finish



Process should provide a observation profile + a set of ValueSets coming from the coded values of the archetype. It also provides the Extension profiles from nodes selected as extension (if any)


What is currently supported via UI

  • Add translations to ValueSets
  • Support to OPTs as input 
    • Presented OPT paths are not as readable as in normal archetypes, but the process should work Ok anyway
  • Generate mapping file
    • Creates a LinkEHR mapping file containing the mapping the openEHR source paths to the target FHIR XML paths
  • Generate empty FHIR archetype
    • This creates an empty FHIR archetype for being use with the above mapping file. This allows the automatic generation of an XQuery program to transform openEHR data instances into FHIR data instances

 What is currently supported by code (hopefully soon in the UI)

  • Generate a set of observation profiles from a single openEHR archetype. 
    • Still evaluating how to create a simple UI for this functionality
  • Deal with underlying openEHR Reference Model
    • Some RM attributes are probably interesting to be included in profiles, which means some kind of merge of RM + archetype must be done
  • Generating STU3 profiles
    • It is supported to generate both R4 and STU3 "flavours"of FHIR. However, needs more testing to ensure everything is still correct after latest changes.

Currently working on

  • Dealing with DV_IDENTIFIER. 
    • No support for Identifier type in Observation.component.value[x] means that either identifiers are put in some specific paths in the FHIR profile or we create extensions. Trying to identify all these possible paths to ask users what they want to do with them

Potential improvements

  • Support other reference models
    • ISO 13606 would be almost trivial, but probably other RM such as HL7 CDA are interesting to tackle
  • Create Bundles to group the observations
  • Evaluate other classes (openEHR Composition with FHIR Composition resource)

Please tell me any doubt, problem, or error you found with the process so I can fix it. Probably best channel is by twitter (@yampeku)

PS: This functionality has actually been a month included in the tool, but only a few selected people knew it was already there to get their feedback