A Send HL7 Message task simulates a system sending HL7 messages to a host on a specific TCP port. The HL7 messages are defined directly in the task. Validation can be done on the acknowledgment (ACK) messages that are sent back.
Create a new “Send HL7 Message” task
- Right-click the name of the parent Action the new task will be created in.
- Select Add New Task –> Send HL7 Message
- New Task appears under the parent Action.
- Edit the task name as needed.
A new task is added at the end of the current action. Drag and drop to change the task order.
Configuring a “Send HL7 Message” task
There are several options to control message format and destinations.
- Set timing: Specify the wait time before and after execution. Wait times give a sending or receiving system enough time to initiate. They also add a pause between action executions.
- Set the message destination: Default network connections are preconfigured destinations for messages. They contain a hostname (or IP address), a port and a connection timeout. Using default network connections lets you quickly change the testing environment by updating the default network connection instead of modifying all tasks individually. More details about how to define network connections are available on the Options page.
- If “Use default connection” is checked, the message will be sent to the host and port defined in the default sending network connection.
- If “Use default connection” is unchecked, pick a destination for the message to be sent to from the list.
- Connection attempts: Set the number of time the task will try to send the message to destination. The task will fail after unsuccessful attempts.
- Wait for response: Check if you want to wait for an ACK message after sending the message.
- Select the message format: Messages can be sent using the HL7-v2.x or XML encoding format.
- HL7-v2.x format is the most popular and uses pipe (“|”) and caret (“^”) delimiters. This is the default.
- Sent message profile: Set the reference profile for the message to be sent. The reference profile will be used to show metadata related to the message (message structure, segment/field definition).
- Message to send: Enter the messages to send in the large text area.
- If you don’t have messages available for testing, use the Generate message from Profile button to generate one. The message generated will require editing but will provide a framework to work with.
- Messages can come directly from a variable. To do so, right-click the messages area, and select “Use Variable”. Then select the variable that generates the messages to be sent.
- Messages can include variables which will be instantiated (filled out) at run time. For more details about variables, take a look at the Variables page.
To add variables to the message:
- Move the mouse over the field content to be replaced by a variable.
- Right-Click and select Set Variable to Field…
- Select the variable and configure it if needed.
- Click OK.
- Messages can also include values coming from another message in the scenario suite.
- Move the mouse over the field content to be replaced.
- Right-Click and select “Insert Criteria”.
- Configure the criteria field.
- Click Apply.
Note: If you’re using the XML format, you will need to open the XML Editor (click the Edit.. button) to be able to insert variables or edit the document.
- Specify the segment delimiter: By default the HL7 standard delimiter (Carriage Return) will be used but you can select another if needed by the receiving system.
- Save message sent to file: Sent messages are stored in the execution results and in the execution reports. If needed, sent messages can be stored in a file at execution time. Stored messages will be exactly what was sent, with actual instantiated values for each variable.
- If checked, the messages will be stored in the file path provided. Variables can be used to build the file path.
- If unchecked, the messages will not be stored on disk. This is the default.
Add validation rules
If the receiving system is configured to return message acknowledgement, each sent message would be responded to with an ACK or a NACK message. Validations can be added to the task to confirm the ACK/NACK response is as expected. Several validation types can be added: