HL7 Modules Receiving and Processing Messages
- Updated on 07 Nov 2018
- 6 minutes to read
Once you have enabled a Receiver to start receiving messages the new messages will display under Recent Messages on the left side of the Interface dashboard. Messages that have an error occur will display under Open Tasks and the Reciever will appear on the right side under Name. In this example, a File Reciever was set up and is displayed underName>FileReceiver.
If you right-click one of the messages in the recent list you will get an action that allows you to view the message. In the next Figure -Received Message you can see the receiver (or message source) for this message. In the designer folders view the whole HL7 message structure, and on the right-hand side, you have the ability to edit the message.
There is an indicator on the bottom of this window that notifies whether or not the parser encountered any errors for the current message.
On the interface there are 3 distinct views:
Interface Dashboard – a view of the most important data related to your messages being processed on this interface.
Designer View – a Decisions designer project where you can build flows, forms, rules, and reports related to this interface.
Folder View – an administrative view of all of the data in this interface. An interface is really a ‘folder’ of data elements and can have messages, tasks, and more.
To define how this interface processes and deals with HL7 messages you need to switch to the Designer View shown in the next Figure -Designer View of Interface.
In this view, you can see 3 workflows that are automatically created for you. These three workflows have three different jobs:
Post Processing Flow
Important Note: All HL7 Interface flows expect a message envelope which contains multiple HL7 messages.
Pre Processing Flow
This flow gets the HL7 message as text before the message is parsed into an actual HL7 object. The purpose of this flow is to allow you to perform manipulations on the message that may be required to make the message process successfully.
If you have a system that sends nonstandard or malformed data but does this consistently or according to some rules you can make changes to the messages before the main processing happens within the Decisions platform.
Because this flow works with the text of the message you can use any of the standard text and rule steps available in Decisions. We also provide a number of flow steps specific for helping deal with HL7 text that is in the ER7 format (broken up by pipe characters typically).
- Add Segment At Position
Inserts the specified text (assumed to be a segment) at a position in a String of segments.
PID|1|Some Value|Some Value
PV2|1|Some Value|Some Value
Add Segment (PV1|1|Some Value) at position 2 would yield:
PID|1|Some Value|Some Value
PV2|1|Some Value|Some Value
- Clean Special Chars Before Segment Start
HL7 relies on newline and carriage return characters that sometimes cause problems. You can use this step to remove these special characters.
- For Each Segment Array in Envelope
This takes the main text of the whole HL7 message which is assumed to be a list of messages and gives you each individual message as a String of segments one at a time.
- Get Data From Segment By Position
Gets data from a specific segment by the position of the data in the segment.
For Example: PID|1|First Value|Second Value
The PID segment, position 2 is the text “First Value”
- Get First Segment By Type
Returns a segment from the array of segments by segment type name.
- Get Segment Position
Gets the position or index of a specific segment.
- Get Segments By Type
Gets all segments of a specific type as a String
- Join Messages Into Envelope
Takes aString and converts it into a string with “message separator” characters in between each message.
- Join Segments Into Message
Takes aString and converts it into an HL7 message with “segment separator” characters in between each segment.
- Remove All Segments By Type
Removes all the segments with a matching type name.
- Replace Data In Segment By Position
Substitutes new data in a segment by the position value.
- Split Envelope Into Messages
Splits an envelope (string) into a String by the message separator character.
- Split Message Into Segments
Splits a message into a String of segments by the segment separator character.
The processing flow is where the Decisions HL7 engine provides the most value. By default, this flow is set up to do no work, so out of the box you can simply use the Decisions HL7 Mediator to receive messages from systems and send them right back out again unmodified. This can be very useful to create a single hub where messages are distributed to a wide range of systems in your environment, but the processing flow lets you inject behavior.
There is not enough that can be said about the importance of this part of the HL7 Mediator. This processing flow allows you to the following very simple examples:
Stop the message and assign tasks to people (alerts, corrections, notifications)
Transform the message using databases, web services, math, text manipulation and more
Store the messages in other systems
Transform the message data
Have people manually correct the message data
Compare the message data to other systems and allow it or discard it
Merge messages with other messages
Input to the Processing Flow
The processing flow takes an HL7 Message Envelope as input. This envelope may have multiple HL7 messages in it.
Output of the Processing Flow
The flow outputs the same HL7 Message Envelope with messages changed, removed, or added so that the interface can send these messages along to other systems via the configured emitters.
The processing flow also has a special set of HL7 message specific steps that can be used in the workflow engine. Most of these steps will have an obvious use to someone familiar with HL7 messages and syntax, however; A few of these steps require explanation because they are particularly useful.
- For Each Abstract Message in Envelope
This step iterates through all of the HL7 messages in the envelope and allows you to work with one message at a time until your work is complete. This is commonly used with the Cast Message as Another Message Type step which lets you treat a message as another type.
- For Each Message in Envelope
This step is similar to the one above except that you specify the message types you expect to be processing and you get separate paths for each message type to modify this message in the workflow.
- Send to Interface
This step allows you to send a message directly to an interface at a specific ‘stage’ of the processing.
The post-processing flow behaves as the counterpart to the preprocessing flow. It takes the raw HL7 text that the processing flow has passed through and allows it to be modified before it is sent over to receiving systems via the emitters. This allows you, once again, to accommodate systems and services that do not support the standards appropriately