/
The Transform device

The Transform device

The Transform device lets you perform set functions on an HL7 message to change it prior to sending to the next device in the channel, not unlike the HL7 Transform device. However, the Transform device provides less flexibility than the HL7 Transform. It also lets you email a message or branch and forward the message to other queues/channels.

To insert a Transform device into the channel, click Edit Channel Settings and choose Branching > Transform device.

The Transform device is also available under the HL7 and Transforms and Custom Code categories.

The Function device toolbar

Above the list of operations for the device is the Function device toolbar. This toolbar includes the Add new expression button as well as several others.

The toolbar contains the following:

  • Show/Edit Snippet Functions; This launches a pop-up window that contains the custom function code for the device. You can edit the transform code directly from this window (requires knowledge of how to write C# or VB code).
  • Set the language: Choose whether to write the custom function code in C# or VB. Warning: changing the language will reset the device code to the default state. Any custom methods, service references, and database connections will be lost.
  • Delete the selected operation.
  • Reorder the operations using the up and down arrows (operations are processed in the order in which they appear in the list).
  • Copy the selected operation.
  • Paste an operation from the clipboard.
  • Troubleshoot the device operations by using Single-stepping.
  • Exit Single-stepping mode.

Configuring the device

Once you have added the device to a channel, you can start adding transform operations.

  1. Click the Add new expression button. A sample expression will be added as indicated in the illustration above.
  2. Modify the expression as follows:
    1. Enabled: Check the box to run the operation associated with the transform expression.
    2. Operation: This defines the action that will be taken by the expression. By default, an operation that copies a value from one segment to another is written into the expression. Click in this field to edit as needed. A list of available operations with a description of each is listed in the bottom pane of the window. There are three types of operations available:
      1. HL7 Functions: operations that change the content of the HL7 message (each function lists the appropriate syntax to use as well as a description of the function).
      2. Branching Function: sends the message to other queue(s). You may send the message to one or more destinations.
      3. Email Function: Sends an email with the message.
    3. Condition: Specify when the expression should be run. The default is Always. Setting the condition to Never is equivalent to unchecking the Enabled option.
    4. Description: A plain-text description of the purpose/function of the expression
  3. Click Save (CTRL+S) to deploy the channel changes.

HL7 Functions

The list of HL7 Functions includes appending segments to the end of a message, copying values from one path to another, getting the value of a path, and removing segments. It also includes two table-based functions - Map Tables and In Tables.

Using MapTables

A map table allows you to compare the contents of an HL7 path and replaced it with another value. To do this, you have to map the HL7 path values to the replacement values in a table.

To create the MapTable:

  1. Click the MapTables button on the device configuration screen.
  2. On the resulting field, click Add new map table and enter the following:
    1. Table Name.
    2. The value that should be used with a path value does not match any of the entries in the table.
    3. The value that should be used when a path value is blank (null).
    4. The In Value (the incoming value that should be compared to the table).
    5. The Out Value (the new value that should be used when the In Value matches a table entry).
    6. Description of the mapping (optional).
  3. Close the window to save the table.

When an HL7 is processed that contains the specified In Value, that value will be replaced with what is listed in the Out Value column and non-matches/empty values will be handled as specified.

Using InTables

The InTable function returns a boolean "true" value if the incoming values match what is listed in the table.

To create the InTable:

  1. Click the InTables button on the device configuration screen.
  2. On the resulting field, click Add new InTable and enter the following:
    1. A Table Name.
    2. A list of the incoming values that should be matched, each value listed on its own line.
  3. Close the window to save the table.

When an HL7 message is processed, the values in the specified path will be compared to the table and Connexion will return a "true" value for any matches.

Editing a table

You can edit the values in a table at any time:

  1. Click either MapTables or InTables, depending on the type of table you want to edit.
  2. Select the table you want to edit from the list.
  3. Edit the values as appropriate (name and values to match).
  4. Close the window to save the table.

Deleting a table

If you no longer want to use a table:

  1. Click either MapTables or InTables.
  2. Select the table you want to delete from the list.
  3. Click the red "delete" icon.
  4. Close the window to save.

If you delete a table, be sure to modify or delete the expression that references that table or else the expression will error out upon evaluation.

Branching functions

The Transform device offers one branching function that allows you to forward the message to other queues. The syntax of the function is listed in the bottom pane when you select Branching from the Functions drop-down.

To add a branching function:

  1. Click the Add new expression button.
  2. Select Branching from the Functions drop-down. Modify the Operation field using the syntax specified (don't forget to enter the names of the target queues, checking for spelling accuracy).
  3. Click Save (CTRL+S) to deploy the channel changes.

The Branching function should be used with messages that have already been stored in the Connexion database. If you need to forward a message that has not yet been stored, use the QueueMessage method available in the XXX device.

Email functions

Use the Email function to send an email when the message is processed.

To add an email function:

  1. Click the Add new expression button.
  2. Select Email from the Functions drop-down. Modify the Operation field using the syntax specified (check spelling for accuracy).
  3. Click Save (CTRL+S) to deploy the channel changes.

Using Single Stepping

Single-stepping is a standard code convention that allows you to view individual transform changes line by line. To activate single-stepping, click the toolbar button.

Once single-stepping is activated, the transform currently being displayed is highlighted in yellow.

Use the arrow buttons, click the single-step button again, or use the F10 key to navigate through each transform to view the changes. When you have finished stepping through each transform, Connexion will exit single-step mode.

To exit single-step mode, click the Exit single-step mode button (the red box next to the single-step button on the toolbar).

Related content

Branch device (HL7)
Branch device (HL7)
More like this
Template device
Template device
Read with this
HL7 Transform device
HL7 Transform device
More like this
HL7 Transform Tool
HL7 Transform Tool
More like this
HL7 Transform Tool
HL7 Transform Tool
More like this
HL7 Transform Tool
HL7 Transform Tool
More like this