Skip to main content

HL7 to HL7 Map

The HL7 to HL7 Map component is designed to provide a template filter component for getting started with complex HL7 integrations, including:

  1. Converting messages from one HL7 version (inbound) to another (outbound)

  2. Dynamically handling filtering and mapping operations on different message types

  3. HL7 mapping strategies, including how to use codemaps

  4. Using .gitignore file to filter confidential sample data from git history

This component can be customized and adapted according to your workflow needs.

How to use it:

STEP 1: Import the HL7 to HL7 Map component

STEP 2: Enter the Translator to see the example starter code

You'll notice the Translator contains a simple script and sample HL7 data that demonstrates the workflow for converting HL7 v2.6 ADT A01 messages to v2.7 ADT A01 messages:

  1. Parsing an inbound HL7 message with the inbound VMD (ex. VMD/ADT_2_6.vmd).

  2. Initializing the HL7MAP Library using the HL7MAPinit function and specifying the directories containing the mapping and/or filtering modules.

  3. Filtering the inbound message using the HL7MAP library

  4. Building the outbound message and mapping data from the inbound message using the HL7MAP library

  5. Pushing the message to the queue for further processing or downstream delivery

You can cycle through the provided sample messages to see how the component handles different message types. This component also demonstrates https://interfaceware.atlassian.net/wiki/x/g4Cxog by ensuring any additional sample messages will not be stored in the commit history. The sample .gitignore file can be viewed in the component's Bitbucket repository.

STEP 2: Connect the component to a source and destination component

Since this is a feeder component, you'll need a source component (ex. https://interfaceware.atlassian.net/wiki/x/FwBTog) to send messages to it and a destination component (ex. https://interfaceware.atlassian.net/wiki/x/V4CVog) that it can pass messages on for further processing or sending to a downstream system.

STEP 3: Start the source, destination, and HL7 to HL7 Map components

You can start the components and send a stream of sample messages from a https://interfaceware.atlassian.net/wiki/x/NgCUog component to see how the mapping and filtering is handled.

How the sample mapping and filtering modules work:

filters/default - filters messages through the default conditions

The default filtering module checks for messages with an in_message_type of “Catchall” and returns true to filter these messages out. It returns false for all other messages.

filters/ADTA01 - filters ADTA01 messages

The ADTA01 filtering module provides an example of a filtering module that checks filter conditions for ADT A01 messages.

mappings/ADTA01 - dynamically calls the correct mapping module based on provided arguments

The ADTA01 mapping module contains a main BuildMessage function that takes the provided out_message_type (ex. ADTA01) and the outbound VMD file ( out_vmd) to build the outbound message. This function also handles the mapping for each segment.

Simple mappings are handled by using the node.mapTree function at the segment level while complex mappings are handled by local mapping functions that may perform additional transformations or mappings.

mappings/codemaps - contains the codemap mapping the inbound and outbound HL7 codesets

codemaps contains the codemap for mapping the inbound HL7 version codes to the outbound HL7 version codes. In the example script, codemaps for Organ Donor, Administrative Sex, Segment Action, and Marital Status codesets from v2.6 to v2.7 are provided.