Receiving & Processing MessagesLast Updated: 12/02/2015 Introduced in Verision: 2.0
Once you have enabled receivers, you should be able to start receiving messages. You will be able to see these messages showing up on the interface dashboard:
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 following message, you can see the receiver (or message source) for this message. In the tree you can 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 which will tell you if the parser encountered any errors during the processing of this particular message.
In your 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:
In this view you can see 3 workflows that are automatically created for you. These three workflows have three different jobs:
- Pre-Processing Flow
- Processing Flow
- Post-Processing Flow
Important Note: All HL7 Interface flows expect a message envelope which contains multiple HL7 messages.
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 non-standard 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 a string and converts it into a string with “message separator” characters in between each message.
Join Segments Into Message
Takes a string 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 setup 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
If you want to understand more about the power of the Decisions flow engine, please see our full documentation site.
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, Pre-Processing, Processing, and Post-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.