Compare messages

This tutorial shows you how to use Caristix software to validate transformations during a conversion project.

Comparing messages: when to use this tutorial

During projects where HL7 interfaces are ported from a legacy integration engine to a new technology, message flows (transformations, etc.) must remain the same.  Actually, message content (structure and semantics) must remain the same.  The challenge is to validate that the interface was ported but that the same transformations and filters still apply. 

Manual validation is not a viable option for most projects.  In this case, best-practice guidance is to automate repetitive, time-consuming and resource-intensive tasks. 

This tutorial shows you how to set up a test suite to validate a small or a large volume of messages easily and quickly.

Overview

The process is straightforward. First, get inbound and outbound messages from your legacy engine; the outbound messages have had transformations applied to them. Second, send those original inbound messages to the new integration technology so the new transformations are applied. Finally, compare both sets of outbound messages, which should be identical. If there are any differences, it means that the transformations on each platform are not equivalent and you need to adjust the code.

Here is a step-by-step explanation.

Step #1: Create a suite

  1. Create a test suite:

    For the purposes of this tutorial, name the suite Caristix Test Tutorial – Message Comparison

  2. Create a scenario:

    Name the scenario How To

  3. Add an action:

    Name the action Compare Messages

  4. Create a “Send HL7 File” task:

    Call this new task Send initial HL7 messages. 

  5. Create a “Receive HL7 Message” task:

    Call it Receive transformed messages.  Note:  This assumes the interface will send the transformed messages back to the application.  If the interface sends transformed messages to a file, use “Read HL7 file” task.

At this point, the suite skeleton is built (ScenarioSuite_32).

 

Step #2:  Configure the sending and receiving tasks

In this step, you’ll configure the tasks to send the initial set of messages to the new integration engine.  It receives it, transform messages and sends it back to the application.  The application would then be listening to receive transformed messages for validation.

  1. Configure the Send initial HL7 messages task

    • Select the Send initial HL7 messages task
    • Select the Configuration tab
    • Configure an outbound connection where host and port connect to the new interface engine.
    • Select it as the Outbound connection
    • Set File Path to reach the file to send (ex: C:Messagesinitial messages.hl7)
  2. Configure the Receive transformed messages task

    • Select the Receive transformed messages task
    • Select the Configuration tab
    • Configure an inbound connection where host is 0.0.0.0 and port is listening on the related engine.
    • Select it as the Inbound connection
    • Check the Listen until timeout box.  The task will be completed when there are no longer any messages to receive.
  3. Setup the validation rules

    • Select the Validation tab
    • Select the Message Comparison tab
    • Paste the expected messages (your outbound messages from the legacy engine) in the Expected Message section
      To paste them, right-click below the Expected Messages label and select Paste

     

Step #3:  Execute

Good!  Let’s run the test

  1. Right-click the suite root node (Caristix Test Tutorial – Message Comparison)
  2. Select Run

 

Once the execution is complete, each tree node will have a status icon. The expected messages should be identical to the transformed messages from the new engine. If the test works, your Expected Messages and Received Messages should be identical.

Status Name Description
   ExecutionStatus_Succeeded_16 Validation Succeeded Executed successfully and all validation succeeded
ExecutionStatus_ValidationFailed_16 Validation Failed Executed successfully by at least a validation failed
ExecutionStatus_ExecutionFailed_16 Execution Failed Execution failed due to an error or an unexpected timeout
ExecutionStatus_Skipped_16 Execution Skipped Configured to not execute
ExecutionStatus_Stopped_16 Execution Stopped Execution stopped while processing