HL7Sender
The HL7 Sender component is used to send the HL7 data on to a port specified on a particular IP address in a specified format. The component receives the response (acknowledgment) generated and sends it to the output port.
HL7 Sender allows sending HL7 messages onto different HL7 Receivers. A set of input and output ports is generated for each configuration.
Configuration and Testing
The component can be configured using the properties in the Custom Property Sheet (CPS) shown in Figure 1.
Figure 1: Custom Property Sheet (CPS) for the HL7Sender component
Pre Processing XSL Configuration
Pre Processing XSL configuration can be used to transform request message before processing it. Click the small button against the property to configure the properties.
Refer to the Pre/Post Processing XSL Configuration section under Common Configurations topic for details regarding XSL configuration. The properties comprising this XSL configuration are:
- Provide XSL
- XSLT Engine
- Transformation source data
- Set transformation result as
Post Processing XSL Configuration
Post Processing XSL configuration can be used to transform response message before sending it to the output port.
As mentioned in the above section, refer to the Pre/Post Processing XSL Configuration section under Common Configurations topic for details regarding XSL configuration.
Figure 2: Pre/Post Processing XSL Configuration
Input contains multiple messages
Enable this property if the input contains multiple HL7 messages delimited by a character.
Figure 3: Property allowing multiple messages in the input, separated by a delimiter
Validate Input
Enable this property to perform validation on the input message.
Figure 4: Property to perform validation and select validation type
Validate ACK Response
Enable this property to perform validation on the ACK Response received before sending it to the output port.
Validation Type
- DEFAULT: Messages will be validated with standard HL7 message rules.
- CONFORMANCE_PROFILE: Message will be validated with the conformance profile file configured for its type. Default validation is performed if a conformance profile is not configured for a specific type.
Figure 5: Conformance profile validation type and its options
Sender Configurations
Select a Sender to Modify
Add the sender which is used in the creation of component input and output ports. By default, the component has no ports. Depending on the names provided in the property sheet (Click the Add button against the Sender Configurations property), a set of input and output ports gets generated.
Sender Connection Details
Click the small button against the Connection Details property to configure connection details.
Figure 6: Sender Connection Details configuration properties
IP Address
The IP address on which HL7 Receiver service is running.
Port Number
Port number on which HL7 Receiver is listening.
Request Time Out (in ms)
Request Time Out is the time out of the HL7 message in milliseconds. The HL7 Sender waits for the response till the timeout happens and throws an exception if it does not receive any response.
The configuration can be saved to use later by providing a preferred name in the Named Configuration text area. Conversely, a preconfigured port number can be selected from the drop-down.
Is Use custom blocks in MLLP
Enable this option to define custom blocks to be used in MLLP. Specify valid hexadecimal representation of characters in Start Block, End Block, and Last Character fields. The default values populated are standard blocks used in MLLP.
- Start Block: Start Block character (1 byte). Default value is 0B (0x0B).
- End Block: End Block character (1 byte). Default value is 1C (0x1C).
- Last Character: Usually Carriage Return is used as last character (1 byte). Default value 0D (0x0D).
Figure 7: Options to define Custom blocks
Receive Type
The type of message expected on component's input port.
- Piped: Piped message is expected on input port.
- XML: XML message is expected on input port.
- Both: Message received on input port can be of any type (piped or XML).
Send Type
Type of the Acknowledgement message which is sent on to the component's output port.
- Piped – Piped message is expected on input port.
- XML – XML message is expected on input port.
Message Rectifier
Message Rectifier class
Message Rectifier class is a class whose instance will be delegated the responsibility of rectifying or correcting HL7 message every time a retry is attempted. If a value is not provided here then message rectification will not be done and retry is attempted with the same message.
Message Rectifier implements com.fiorano.services.hl7sender.engine.IMessageRectifier and should have a default constructor.
Message Rectifier class
public interface IMessageRectifier {
/**
* This method of implementation, if exists, will be called when the <code>originalMessage</code>
* could not be sent because of an exception.
*
* @param originalMessage message that has to be corrected
* @param problem exception that was encountered when trying to send <code>originalMessage</code>
* @return rectified message
* @throws ServiceExecutionException any exception that might occur when rextifying
*/
Message rectifyMessage(Message originalMessage, Exception problem) throws ServiceExecutionException;
/**
* This method of implementation, if exists, will be called when the <code>originalMessage</code>
* is sent and an ack message other than AA is returned
*
* @param originalMessage message that has to be corrected
* @param ackMessage ackMessage, ither than AA, that was returned in response to <code>originalMessage</code>
* @return rectified message
* @throws ServiceExecutionException any exception that might occur when rextifying
*/
Message rectifyMessage(Message originalMessage, Message ackMessage) throws ServiceExecutionException;
}
Ack Code Categories
Each Ack Code [AA, AR, AE …. ] the sender is expected to receive can be categorized as a success or error or warning as shown in Figure 1. In case, the ack code returned to sender is configured as success or warning, the ack message is simply sent onto the output port of the component. If the received ack code is configured as a warning, then a retry is attempted.
Retry Configuration
When ack code returned to sender is categorized as a warning, the number of times retry is to be attempted and interval after which retry is to be attempted can be configured.
Functional Demonstration
The figure below illustrates the event process where HL7Sender accepts ADT and ORU messages and sends out the corresponding acknowledgments.
Figure 8: Sample Event process using HL7Sender
The figure below illustrates the event process where HL7Receiver listens to the messages from HL7Sender.
Figure 9: Sample Event process using HL7Receiver
Scenario 1: Sending an ADT A01 message
Configure the HL7Sender as shown in Figure 1.
When a sample ADT A01 message is sent from the Feeder ADT_XML, HL7Sender sends this message to HL7Receiver.
When the message receipt is acknowledged by HL7Receiver, HL7Sender receives it and sends it to the Display ADT_ACK_REC.
Figure 10: Acknowledgment received by HL7Sender
Scenario 2: Sending an ORU R01 message
Configure HL7Sender as shown in Figure 1.
When a sample ORU A01 message is sent from the Feeder ORU_MSG, HL7Sender sends this message to HL7Receiver.
Sample ORU R01 message
MSH|^~\&|FORMENTRY|AMRS|HL7LISTENER|AMRS|20060809121931||ORU^R01|formentry-20060809121931|P|2.5|1||||||||2^AMRS-ELDORET^http://schema.openmrs.org/2006/FormEntry/formId^URI
PID|||3^^^^||Patient^John^D||
PV1||O|1^Unknown||||2^Ima Doc (2-6)|||||||||||||||||||||||||||||||||||||20060807|||||||V
ORC|RE||||||||20060807161605|1^Super User
OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT
OBX|1|NM|5089^WEIGHT (KG)^99DCT||70|||||||||20060807
OBR|2|||1019^COMPLETE BLOOD COUNT^99DCT
OBX|1|NM|1015^HEMATOCRIT^99DCT||1000|||||||||20060807
OBX|2|NM|21^HEMOGLOBIN^99DCT||1000|||||||||20060807
OBX|3|NM|678^WHITE BLOOD CELLS^99DCT||100000|||||||||20060807
OBX|4|NM|729^PLATELETS^99DCT||10|||||||||20060807
OBR|3|||1284^PROBLEM LIST^99DCT
OBX|1|CWE|6042^PROBLEM ADDED^99DCT||2^ANEMIA, HEMOLYSIS^99DCT|||||||||20060807
When the message receipt is acknowledged by HL7Receiver, HL7Sender receives it and sends it to the Display ORU_MSG_REC.
Figure 11: Acknowledgement received by HL7Sender
Figure 12: ORU R01 message received by HL7Receiver
Scenario 3: Sending multiple messages at a time
Create the event process in the following manner.
Figure 13: Sample Event process for sending multiple messages
Configure HL7Sender as shown in the figure below.
Figure 14: CPS configuration to enable sending multiple messages
When two HL7 messages are given in different lines through the same feeder, HL7Sender sends these as two separate messages to the HL7Receiver. This is because both the messages are separated by the delimiter (0A-New LineFeed).
Two sample HL7 messages sent as input
MSH|^~\&|EPIC|EPICADT|SMS|SMSADT|199912271408|CHARRIS|ADT^A04|1817457|D|2.5|PID||0493575^^^2^ID 1|454721||DOE^JOHN^^^^|DOE^JOHN^^^^|19480203|M||B|254 MYSTREETAVE^^MYTOWN^OH^44123^USA||(216)123-4567|||M|NON|400003403~1129086|NK1||ROE^MARIE^^^^|SPO||(216)123-4567||EC|||||||||||||||||||||||||||PV1||O|168~219~C~PMA^^^^^^^^^||||277^ALLEN MYLASTNAME^BONNIE^^^^|||||||||| ||2688684|||||||||||||||||||||||||199912271408||||||002376853
MSH|^~\&|EPIC|EPICADT|SMS|SMSADT|199912271408|CHARRIS|ADT^A04|1817457|D|2.5|PID||0493575^^^2^ID 1|454721||DOE^JOHN^^^^|DOE^JOHN^^^^|19480203|M||B|254 MYSTREETAVE^^MYTOWN^OH^44123^USA||(216)123-4567|||M|NON|400003403~1129086|NK1||ROE^MARIE^^^^|SPO||(216)123-4567||EC|||||||||||||||||||||||||||PV1||O|168~219~C~PMA^^^^^^^^^||||277^ALLEN MYLASTNAME^BONNIE^^^^|||||||||| ||2688684|||||||||||||||||||||||||199912271408||||||002376853
Figure 15: It is seen that two messages are received in the output port of the HL7Receiver
To understand the service better, refer the HL7Sender-Receiver example which demonstrates HL7Sender service features.