Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleSTEP 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.4 6 ADT A01 messages to v2.7 ADT A01 messages:

  1. Parsing an inbound HL7 message with the inbound VMD (ex. VMD/ADT_2_46.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.

...

Expand
titleSTEP 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

...

Expand
titleHL7MAPclient - sets up the object framework

Sets up the HL7MAP object framework, adding the method modules to a metatable and storing the provided mapping and filter directories. If no custom directories are provided, it defaults to the provided directories HL7MAP/mappings ('HL7MAP.mappings') and HL7MAP/filters ('HL7MAP.filters’).

Expand
titleHL7MAPbuild - dynamically calls the correct mapping module based on the provided arguments

HL7MAPbuild takes the provided out_message_type (ex. ADTA01) and calls the matching mapping module in HL7MAP/mappings (ex. HL7MAP/mappings/ADTA01.lua). It passes the provided outbound VMD file (out_vmd) and inbound message (in_message) to the mapping module, which will build and map the outbound message.

...

titleHL7MAPfilter - dynamically calls the correct filtering module based on the provided arguments

...

sample mapping and filtering modules work:

Expand
titleHL7MAP/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.

Expand
titleHL7MAP/filters/ADTA01 - filters ADTA01 messages

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

Expand
titleHL7MAP/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.

image-20240430-151215.png

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.

image-20240430-151551.png

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

HL7MAPcodemaps 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.4 6 to v2.7 are provided.

How to use the HL7MAP Library in a custom HL7 integration:

Expand
titleSTEP 1: Make an internal version of the HL7MAP library

The HL7MAP library comes packaged with sample filter and mapping modules, so to use it in a custom HL7 integration, you’ll need to create an internal copy of the repository. You can do so by changing the upstream repository via the library’s Repository Management Screen:

ViewRemote.pngImage Removed
Expand
titleSTEP 2: Localize the mappings and filters folders to the component

Drag and drop the HL7MAP/mappings and HL7MAP/filters folders outside of the HL7MAP library into the component’s Project Tree. This will allow you to customize filtering and mapping logic for a specific integration.

When initializing the HL7MAP object with custom mappings and filters directories, use the following syntax:

Code Block
local H = HL7MAPclient{filter_dir="NEW_FILTER_LOCATION",mapping_dir="NEW_MAPPING_LOCATION""}
Expand
titleSTEP 3: In the mappings folder, update HL7codemaps

Update mappings/HL7MAPcodemaps to the specific codesets and HL7 versions your messages will be using.

Expand
titleSTEP 4: Update/add filtering modules

Update or add message-specific filter modules in the filters folder. The modules should be named [HL7_Type].lua.

Messages with an inbound HL7 message type (ex. ADTA01) that matches the name of a filtering module (ex. ADTA01.lua) will be filtered by that module. All other messages will be filtered by the default filter conditions in filters/default.lua, which can also be further customized.

Expand
titleSTEP 5: Update/add mapping modules

Update or add mapping modules in the mappings folder. The modules should be named [HL7_Type].lua.

By default, only messages with an outbound HL7 message type (ex. ADTA01) that matches the name of a mapping module (ex. ADTA01.lua) will be mapped. All other messages will be pushed downstream in their original form.