Transformation Script Toolbar

Transformation Script Toolbar

 

NEW in version 1.6! You can now control the order in which your transformation instructions are executed allowing you to "chain" macros together. Consider the following simple transformation script example:

 

 

 

Transformation Instructions Tab

Transformation Tab in a Destination Window

 

In the screen-shot above we are using the Replace() instruction to modify some values in the PID Segment, Field 5, Component 1 (The Patient Surname). The execution order of the 2 instructions is shown in the column with header #. The instructions will attempt to do the following:

1.FIRST: If the surname contains the string "YYY" (not case sensitive), it will be replaced with the string "ZZZ". So if the surname is the value "Smith" after this macro executes the value will remain unchanged.

2.SECOND: If the surname contains the string "S" (not case sensitive), it will be replaced with the string "YYY". So if the surname is the value "Smith" after this macro executes the value will be changed to "YYYmith". And that will be final value for that component which will be delivered to the destination.

 

However, if you click the SortAscending16 Tbutton on the toolbar to change the order in which these Transformation Instructions are executed, you will get the "Change Execution Order Window" which you can use to swap the order of the two instructions, like so:

 

Changing Execution Order

Change Execution Order Window

 

After saving this change our script now looks like the screen-shot below and will behave accordingly.

 

Transformation Instructions Tab

Transformation Tab in a Destination Window

 

If you notice we have now swapped the two Replace() instructions and NOW the instructions will attempt to do the following:

1.FIRST: If the surname contains the string "S" (not case sensitive), it will be replaced with the string "YYY". So if the surname is the value "Smith" after this macro executes the value will be changed to "YYYmith".

2.SECOND: If the surname contains the string "YYY" (not case sensitive), it will be replaced with the string "ZZZ". Since the original surname "Smith" was altered by first instruction and is now "YYYmith", after this macro executes the value will be changed AGAIN to "ZZZmith". And that will be final value for that component which will be delivered to the destination.

 

 

See Also: Transformation Instructions

HL7+ - Putting HL7 to work for you!
© 2018 HermeTech International
(a Division of TransWorld Scribes)