# Composition mapping to FHIR **Category:** [HL7 FHIR](https://discourse.openehr.org/c/fhir/101) **Created:** 2023-09-17 13:39 UTC **Views:** 1213 **Replies:** 15 **URL:** https://discourse.openehr.org/t/composition-mapping-to-fhir/4462 --- ## Post #1 by @Kevin_Mayfield This is meant to be high level and a 'fag packet'. (I am looking at understanding COMPOSITION and making notes as I go along and based on the diagram from here https://specifications.openehr.org/releases/RM/latest/ehr.html#_compositions) Any major issues? ![image|690x475](upload://uJ5RcKswVZjrfGLIc4XHl07XFjo.png) --- ## Post #2 by @joostholslag Hi Kevin, thanks for sharing. Could you elaborate a bit more please, in what you’re trying to achieve. It’s sometimes a bit hard to judge what’s coming from where. E.g. the “patient details” composition, where is that name defined and by whom? --- ## Post #3 by @Kevin_Mayfield My background is HL7 and trying to understand openEHR. So I'm really try to map my current understanding to openEHR. This might be a technical (and incorrect reply :) ). I think openEHR has it's own copy of patient_details, I'd assume this is sync'd with a PAS system via HL7 v2 (or openEHR can also act as a PAS) --- ## Post #4 by @ian.mcnicoll There is an openEHR Demographics model which can be used to store PAS-type information and/or staff details but ? most openEHR implementers do not use this but just use an existing PAS/ Demo service, often via a FHIR wrapper. For your purposes, I'd suggest largely keeping formal patient demographics out of scope - it is certainly not handled in an openEHR CDR - Care team info is, however, in scope --- ## Post #5 by @joostholslag Thanks for making the effort to understand openehr. In my experience mappings like this are useful as a discussion starter. But since the perspective of the specs (‘exchange vs persistence’) and the scope of the models (e.g. openEHR COMPOSITION vs resource) is very different. It quickly will become confusing to understand openEHR from a FHIR mapping perspective. A suggestion would be to view it from a data instance (actual fake patient data) instead of abstractly comparing the models. At least for me that would make it easier to help. Does that make sense? (Agree with Ian regarding demographics btw) --- ## Post #6 by @Kevin_Mayfield I've actually gone for a two phase map. Phase 1 - Template -> FHIR Questionnaire and then Composition -> FHIR QuestionnaireResponse. Phase 2 - Use FHIR SDC and in particular this https://build.fhir.org/ig/HL7/sdc/extraction.html as an approach mapping to other resources. Initial tests appear to this would work. Have managed a round trip from openEHR to FHIR to FHIR SDC and back to openEHR --- ## Post #7 by @thomas.beale [quote="ian.mcnicoll, post:4, topic:4462"] most openEHR implementers do not use this but just use an existing PAS/ Demo service, often via a FHIR wrapper. [/quote] And using the PARTY_PROXY.external_ref field that is inherited into PARTY_SELF, PARTY_IDENTIFIED etc. --- ## Post #8 by @Kevin_Mayfield Spoke with @ian.mcnicoll yesterday. In my FHIR conversion, I’m trying to get two conversions which: * Is used to build a UI for capturing the data (it resembles how templates are displayed in CKM) * Can be used to render Composition in a UI * Has mapping metadata for conversion between HL7 standards and also mini LOINC/SNOMED maps (we can add in more complex conversions using FHIR https://hl7.org/fhir/R4/structuremap.html) - I think some of this might be useful to add to openEHR Template model. * Can be used to pre-populate openEHR Composition (from external sources) * Can be used to extract openEHR Composition into FHIR resources (Sharing option A - Decomposed)) * QuestionnaireResponse can be used to share openEHR Composition with non openEHR users (Sharing option B - Not decomposed). As this is a more basic format and aimed at rendering, it might be easier to convert to PDF (Sharing option C) The rough pattern is based on IHE SDC ![image|675x499](upload://zoYTwdVlVuadNUSFKsySYtKfENn.jpeg) and so is also following https://build.fhir.org/ig/HL7/sdc/ --- ## Post #9 by @Kevin_Mayfield This might also serve as a bridge between openEHR and LOINC Panels https://loinc.org/panels/ which I'm presuming are often implemented at HL7 v2 ORU. --- ## Post #10 by @Kevin_Mayfield LOINC exposes these panels via a FHIR Server https://loinc.org/fhir/ I think it's possible for CKM to do similar and expose openEHR definitions and terminology as FHIR CodeSystem, ValueSet and Questionnaire Main reason for doing this is to allow developers (well me at least) to compare apples with apples. --- ## Post #11 by @Kevin_Mayfield This probably has overlaps with https://blog.better.care/introducing-fhir-connect I was using Betters One London UCP as a use case, but wasn't aware of fhir connect. Main difference is I'm seeing a FHIR conversion which is more like Composition (FHIR QuestionnaireResponse). FHIR QuestionnaireResponse can be mapped to other FHIR resources if the end system desires so. (Converting to a FHIR Bundle with many resources may be unnecessary, especially if the recipient doesn't have a FHIR Server) --- ## Post #12 by @ian.mcnicoll You might find this useful ... https://discourse.openehr.org/t/using-the-openehr-template-designer-to-create-clinical-document-definitions/569/4 --- ## Post #13 by @Kevin_Mayfield I shuddered when I read CDA :slight_smile: --- ## Post #14 by @Kevin_Mayfield Don't quote me but is some talk of CDA and FHIR Documents being a dead end. My view is if QuestionnaireResponse or even PDF gets the data shared.... why bring in other formats? This is really a question rather than a statement. --- ## Post #15 by @yampeku If you are interested in the template --> questionnaire way take a look at this http://141.147.80.147:8080/openehr2fhir/ --- ## Post #16 by @IgorSchoonbrood This is cool! Do gou have more info about this? --- **Canonical:** https://discourse.openehr.org/t/composition-mapping-to-fhir/4462 **Original content:** https://discourse.openehr.org/t/composition-mapping-to-fhir/4462