Send HL7 Message


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

  1. Right-click the name of the parent Action the new task will be created in.
  2. Select Add New Task –> Send HL7 Message
  3. New Task appears under the parent Action.
  4. 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.

  1. 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.
  2. 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.
  3. Connection attempts: Set the number of time the task will try to send the message to destination. The task will fail after unsuccessful attempts.
  4. Wait for response: Check if you want to wait for an ACK message after sending the message.
  5. 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.
  6. 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).
  7. 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:
      1. Move the mouse over the field content to be replaced by a variable.
      2. Right-Click and select Set Variable to Field…
      3. Select the variable and configure it if needed.
      4. Click OK.
    • Messages can also include values coming from another message in the scenario suite.
      1. Move the mouse over the field content to be replaced.
      2. Right-Click and select “Insert Criteria”.
      3. Configure the criteria field.
      4. 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.

  1. 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.
  2. 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: