This wiki has undergone a migration to Confluence found Here
<meta name="googlebot" content="noindex">

Version 2 - FHIR Mapping Scenarios

From HL7Wiki
Jump to navigation Jump to search

The focus of this track will be on the transformation from HL7v2 to FHIR (and vice versa). The testing scenarios shown below form the core of the "HL7v2 Mapping" test track. There are currently five test scenarios:

  1. (v2 to FHIR) ADT Query - mapping a v2 query and its response
  2. (v2 to FHIR) ADT - mapping a sequence of ADT events (one source system)
  3. (v2 to FHIR) ADT - mapping a sequence of ADT events (multiple source systems)
  4. (v2 to FHIR) ORU - mapping a sequence of laboratory results messages
  5. (FHIR to v2) ADT - mapping a number of ADT events

You may select one or more of these testing scenarios - whatever appeals to you most given your particular context. We encourage you to create generic mapping solutions, the test itself is however limited to the test messages supplied on this page.

Mapping HL7 version 2 to FHIR

One of the main use-cases for mapping will be to populate a FHIR Resource Repository using data derived from a HL7 version 2 message feeds. The FHIR Specification details some of the differences between HL7v2 and FHIR, and contains a partial mapping of resources to HL7 version 2 (e.g. observation resource). This test track will focus on the most commonly used HL7v2 trigger events, i.e. ADT and ORU.

The wording below distinguishes between three kinds of actors:

  • FHIR Client: a software application that has the capability to create/assemble FHIR based requests.
  • FHIR Server: a software application with the capability to receive and process FHIR based requests. The server need not have a stiorage capability for FHIR resources.
    • A Messaging Enabled FHIR Server is a kind of FHIR server which supports the messaging interoperability paradigm. Note that none of the FHIR Servers currently available for testing falls into this category.
  • Transformation Agent: the software component that transforms HL7v2 to FHIR and/or vice versa. The role of Transformation Agent will be combined with that of a FHIR client and/or a FHIR Server.

1. ADT Query

Demographics and visit query according to IHE ITI specs (IHE ITI Volume 2a, section 3.22 "Patient Demographics and Visit Query").

  1. Test for Transformation Agent / FHIR Client:
    • Determine (e.g. by querying the FHIR server) the ID of a patient which has an active encounter on a particular FHIR server. Edit the HL7v2.5 query example to include that identifier.
    • Process/read a HL7v2.5 QBP^ZV1 query, send corresponding query to FHIR server, transform response to HL7 v2.5 RSP^ZV2.
    • Determine the ID of a patient which doesn't have an active encounter; edit the HL7v2.5 query example to include that identifier and retest the transformation/request process.
    • Determine the ID of a patient which doesn't exist; edit the HL7v2.5 query example to include that identifier and retest the transformation/request process.
  2. Notes:
    • We'll ignore any HL7 v2 extensions right now (notably Z-segments).
    • All QPD-3 options, as well as QPD-8 (as documented in the IHE specification) SHALL be supported.
    • See PDQm for the IHE PDQm proposal based on FHIR which may act as guidance.
  3. Example/test messages:
MSH|^~\&|SomeSystem||TransformationAgent||timestamp||QBP^ZV1^QBP_Q21|controlId|P|2.5
QPD|Q22^IHE PDQ Query^HL70471|queryId|@PID.5.1.1^Smith~@PID.8^F|||||
RCP|I||R|

Example notes: QPD-8 is left empty on purpose, returning patient-encounters for all identity domains.

2. ADT (single source system)

Hl7v2.5 ADT messages: process a sequence comprised of A31, A01, A02, A08, A03 trigger events. The sequence A31-A01-A02 will contain 2 allergies, A08 drops one allergy (A08 and A03 only contain 2 allergies). All messages are sent/created by the PAS/HIS system of the 'Good Health Hospital', which has the URL http://www.ghh.org

  1. Test for Transformation Agent / FHIR Client:
    • (easy option, assumes that the FHIR Server supports Messaging) - process/read this sequence of HL7v2.5 messages, transform each of them to a FHIR Message, send FHIR messages to FHIR Server.
      • Determine what the most appropriate 'focal resource(s)' should be that should be referenced in messageHeader.data
    • (difficult option, assumes that the FHIR server only supports REST) - process/read this sequence of HL7v2.5 messages, transform each of them into a series of FHIR resources, query/update/delete resources on the FHIR Server.
      • The Transformation agent will have to detect that one allergy has been dropped from the message -compared to the previous message about the same patient and encounter-, and that an allergy has to be deleted.
      • A provenance resource SHOULD be created to document the fact that certain resources were sourced from a single message
      • You SHOULD populate the text option in the generated resources
      • Patient, encounter and allergies SHALL be transformed into identified FHIR resources, other resources MAY be either contained or identified.
  2. Notes:
    • We'll ignore any HL7 v2 extensions right now (notably Z-segments)
    • Given that all messages (in this test scenario) are sent by one and the same source system the use of HL7v2 'update mode' and nulls can be ignored.
    • See David hay's blog for his reflections on this kind of mapping.
  3. Test messages:
    • In order to avoid too many identifier clashes when various systems would store translations of the message below, you should replace all items shown in Italics (e.g. controlID, NHS_Number, LocalPatId, VisitNumber, etc.) with your own identifiers.
    • ADT^A02 doesn't support NK1 nor AL1. So their absence can't be interpreted in any way.
MSH|^~\&|SomeSystem||TransformationAgent||20150501115930||ADT^A31|controlID|P|2.5
EVN|A31|20150501115930|
PID|1||NHS_Number^10^^NHS^NH~LocalPatId^^^TCPAS^MR||Kennedy^Ann^F^^Ms^^L||19280524^Y|F|||22 Stable Road^^Whitstable^Kent^^CR5 1EL^^^^P||277543^PRN|||U||
PV1|1|N|
AL1|1|DA|1605^acetaminophen^L|MO|Muscle Pain~hair loss
AL1|2|DA|1558^Oxycodone^L|MO|Muscle Pain~hair loss
AL1|3|MA|2221^Peanuts^L|SV|Anaphylactic Shock 
MSH|^~\&|SomeSystem||TransformationAgent||20150502090000||ADT^A01|controlID|P|2.5
EVN|A01|20150502090000|
PID|1||NHS_Number^10^^NHS^NH~LocalPatId^^^TCPAS^MR||Kennedy^Ann^F^^Ms^^L||19280524^Y|F|||22 Stable Road^^Whitstable^Kent^^CR5 1EL^^^^P||277543^PRN|||U||
NK1|1|Kennedy^Joe|FTH|||+44 201 12345678||
PV1||I|INT^0001^02^GENHOS||||0100^ANDERSON,CARL|0148^ADDISON,JAMES||SUR|||||||0148^ANDERSON,CARL|S|VisitNumber^^^GENHOS|A|||||||||||||||||||GENHOS|||||20150502090000|
AL1|1|DA|1605^acetaminophen^L|MO|Muscle Pain~hair loss
AL1|2|DA|1558^Oxycodone^L|MO|Muscle Pain~hair loss
AL1|3|MA|2221^Peanuts^L|SV|Anaphylactic Shock 
MSH|^~\&|SomeSystem||TransformationAgent||20150502103420||ADT^A02|controlID|P|2.5
EVN|A01|20150502103420|
PID|1||NHS_Number^10^^NHS^NH~LocalPatId^^^TCPAS^MR||Kennedy^Ann^F^^Ms^^L||19280524^Y|F|||22 Stable Road^^Whitstable^Kent^^CR5 1EL^^^^P||277543^PRN|||U||
PV1||I|SUR^0005^01^GENHOS|||INT^0001^02^GENHOS|0500^DVORAK,PETR|0148^ADDISON,JAMES||SUR|||||||0148^ANDERSON,CARL|S|VisitNumber^^^GENHOS|A|||||||||||||||||||GENHOS|||||20150502090000|
MSH|^~\&|SomeSystem||TransformationAgent||20150502105810||ADT^A08|controlID|P|2.5
EVN|A08|20150502105810|
PID|1||NHS_Number^10^^NHS^NH~LocalPatId^^^TCPAS^MR||Kennedy^Ann^F^^Ms^^L||19280524^Y|F|||22 Stable Road^^Whitstable^Kent^^CR5 1EL^^^^P||277543^PRN|||U||
NK1|1|Kennedy^Joseph|FTH|||+44 201 12345678||
PV1||I|SUR^0005^01^GENHOS|||INT^0001^02^GENHOS|0500^DVORAK,PETER|0148^ADDISON,JAMES||SUR|||||||0148^ANDERSON,CARL|S|VisitNumber^^^GENHOS|A|||||||||||||||||||GENHOS|||||20150502090000|
AL1|1|DA|1605^acetaminophen^L|MO|Muscle Pain~hair loss
AL1|2|MA|2221^Peanuts^L|SV|Anaphylactic Shock 
MSH|^~\&|SomeSystem||TransformationAgent||20150502100000||ADT^A03|controlID|P|2.5
EVN|A03|20150502100000|
PID|1||NHS_Number^10^^NHS^NH~LocalPatId^^^TCPAS^MR||Kennedy^Ann^F^^Ms^^L||19280524^Y|F|||22 Stable Road^^Whitstable^Kent^^CR5 1EL^^^^P||277543^PRN|||U||
NK1|1|Kennedy^Joseph|FTH|||+44 201 12345678||
PV1||I|SUR^0005^01^GENHOS|||INT^0001^02^GENHOS|0500^DVORAK,PETER|0148^ADDISON,JAMES||SUR|||||||0148^ANDERSON,CARL|S|VisitNumber^^^GENHOS|A|||||||||||||||||||GENHOS|||||20150502090000|20150502100000|
AL1|1|DA|1605^acetaminophen^L|MO|Muscle Pain~hair loss
AL1|2|MA|2221^Peanuts^L|SV|Anaphylactic Shock

3. ADT (multiple source systems)

Hl7v2.5 ADT messages:

  • Detailed description to be created. The client will be one of various systems that updates a FHIR server. This forces the client to use 'update mode', i.e. if the server has a resource based on a XYZ||w|a|"" segment (from system 1), and system 2 sends XYZ|1||a|k the resulting resource (on the FIR server) should contain the equivalent of XYZ|1|w|a|k.


4. Lab Results

HL7v2.5 Lab results: a sequence comprised of ORU temporary result, and ORU final result. Chem tests. All messages are sent/created by the Lab department of the 'Good Health Hospital', which has the URL http://www.ghh.org/lab

  1. Test for Transformation Agent / FHIR Client:
    • (easy option, assumes that the FHIR Server supports Messaging) - process/read this sequence of HL7v2.5 messages, transform each of them to a FHIR Message, send FHIR messages to FHIR Server.
      • Determine what the most appropriate 'focal resource(s)' should be that should be referenced in messageHeader.data.
      • If OBX-21 hasn't been valued (it doesn't even exist in Hl7 v2.5) the OBX shoudl be turned into a contained resource.
    • (difficult option, assumes that the FHIR server only supports REST) - process/read this sequence of HL7v2.5 messages, transform each of them into a series of FHIR resources, query/update/delete resources on the FHIR Server.
      • This requires updating of existing resources, which is a challenge in that there are no unique resource.ids in HL7 v2.
      • A provenance resource SHOULD be created to document the fact that certain resources were sourced from a single message
      • The following policy applies: given that the Lab system isn't the 'master' when it comes to data OTHER than the actual results (ORC/OBR/OBX/SPM/SAC/..) all other data should be considered to be references (to e.g. patient/encounter) only.
      • Patient, encounter and order/observations related resources SHOULD be identified FHIR resources (as far as possible), other resources MAY be either contained or identified.
      • You SHOULD populate the text option in the generated resources
  2. Notes:
    • We'll ignore any HL7 v2 extensions right now (notably Z-segments)
    • Given that all messages (in this test scenario) are sent by one and the same source system the use of HL7v2 'update mode' and nulls can be ignored.
    • See this whitepaper for a discussion of an example this type of mapping.
  3. Test messages:
    • In order to avoid too many identifier clashes when various systems would store translations of the message below, you should replace all items shown in Italics (e.g. controlID, LocalPatientId, SpecimenId, PlacerOrderNumber, etc.) with your own identifiers.
MSH|^~\&|SomeSystem||TransformationAgent||201410060645||ORU^R01|182|T|2.5||
PID|1||LocalPatientId^^^AMC^PI||van den Berg-Meijer&&Meijer&van den&Berg^A^P^^^^L||19601012|F|||Prinsengracht 22&Prinsengracht&22^22^Amsterdam^^1200 PJ^^M||020 555366^PRN^PH|||M||
OBR|1|PlacerOrderNumber|FillerOrderNumber|85027^Hemogram and platelet count, automated^CPT4||||||^COLLECT^JOHN|P|||||^URO^^^^DR||||||201410060644|||P|||||||&CYTO&JANE^201410060929
OBX|1|NM|11156-7^LEUKOCYTES^LN||||||||I|
OBX|2|NM|11273-0^ERYTHROCYTES^LN||4.06|tera.l-1||N|||P|||201410060627
OBX|3|NM|20509-6^HEMOGLOBIN^LN||||||||I|
OBX|4|NM|20570-8^HEMATOCRIT^LN||40.1|%||N|||P|||201410060830
OBX|5|NM|11125-2^PLATELETS^LN||221|giga.l-1||N|||F|||201410060830
SPM|1|SpecimenID||BLD|||||||P||||||201410060535|201410060821||Y||||||1
OBR|2|PlacerOrderNumber2|FillerOrderNumber2|85009^Differential WBC Count, buffy coat^CPT4||||||^COLLECT^JOHN|P|||||^URO^^^^DR||||||201410060929|||P|||||||&CYTO&JANE^201410060929
OBX|1|NM|23761-0^NEUTROPHILS/100 LEUKOCYTES^LN||72|%||N|||P|||201410060627
OBX|2|NM|26450-7^EOSINOPHILS/100 LEUKOCYTES^LN||2|%||N|||P|||201410060627
OBX|3|NM|26478-8^LYMPHOCYTES/100 LEUKOCYTES^LN||20|%||N|||P|||201410060627
OBX|4|NM|26485-3^MONOCYTES/100 LEUKOCYTES^LN||6|%||N|||P|||201410060627
OBX|5|NM|30180-4^BASOPHILS/100 LEUKOCYTES^LN||0|%||N|||P|||201410060627
SPM|1|SpecimenID||BLD|||||||P||||||201410060535|201410060821||Y||||||1

..and the final result (and yes, we did switch the order of the OBRs as well as the OBXs, to ensure you have no depencies on the segment sequence.)

MSH|^~\&|SomeSystem||TransformationAgent||201410060931||ORU^R01|ControlID|T|2.5|||||USA||EN
PID|1||LocalPatientId^^^AMC^PI||van den Berg-Meijer&&Meijer&van den&Berg^A^P^^^^L||19601012|F|||Prinsengracht 22&Prinsengracht&22^22^Amsterdam^^1200 PJ^^M||020 555366^PRN^PH|||M||
OBR|1|PlacerOrderNumber2|FillerOrderNumber2|85009^Differential WBC Count, buffy coat^CPT4||||||^COLLECT^JOHN|P| ||||^URO^^^^DR|||||||201410060929|||F|||||||&CYTO&JANE^201410060929
OBX|1|NM|30180-4^BASOPHILS/100 LEUKOCYTES^LN||0|%||N|||F|||201410060830
OBX|2|NM|23761-0^NEUTROPHILS/100 LEUKOCYTES^LN||72|%||N|||F|||201410060830
OBX|3|NM|26450-7^EOSINOPHILS/100 LEUKOCYTES^LN||2|%||N|||F|||201410060830
OBX|4|NM|26478-8^LYMPHOCYTES/100 LEUKOCYTES^LN||20|%||N|||F|||201410060830
OBX|5|NM|26485-3^MONOCYTES/100 LEUKOCYTES^LN||6|%||N|||F|||201410060830
SPM|1|SpecimenID||BLD|||||||P||||||201410060535|201410060621||Y||||||1
OBR|2|PlacerOrderNumber|FillerOrderNumber|85027^Hemogram and platelet count, automated^CPT4||||||^COLLECT^JOHN|P|| |||^URO^^^^DR|||||||201410060929|||F|||||||&CYTO&JANE^201410060929
OBX|1|NM|20509-6^HEMOGLOBIN^LN||13.4|g/l-1||N|||F|||201410060830
OBX|2|NM|11156-7^LEUKOCYTES^LN||8.2|giga.l-1||N|||F|||201410060830
OBX|3|NM|11273-0^ERYTHROCYTES^LN||4.08|tera.l-1||N|||F|||201410060830
OBX|4|NM|20570-8^HEMATOCRIT^LN||39.7|%||N|||F|||201410060830
OBX|5|NM|11125-2^PLATELETS^LN||220|giga.l-1||N|||F|||201410060830
SPM|1|SpecimenID||BLD|||||||P||||||201410060535|201410060621||Y||||||1

Mapping FHIR to HL7 v2

5. Encounter Events

FHIR-to-v2 test case:

  1. As a client, detect (somehow) that [at least] the following trigger events have occurred:
    1. the Encounter resource has been created
    2. an Encounter resource has reached the status completed,
    3. the location of the encounter has changed
    4. the physician responsible for the encounter has changed
  2. Retrieve the necessary resources and map the data to a HL7 v2.5 message.
    • The following segments should be created if data exists in Resources: MSH EVN PID PV1 AL1 PR1 DG1