Criteria Editor

Definition

The Criteria Editor is used to construct string-value using Carlang expressions.

Carlang

Carlang is an excel-like function language. With Carlang, you are able to retrieve HL7/XML/DataSet values from a specified task/field. Currently, there are 3 functions available:

@HL7(“TASK_PATH”[R9],”HL7_FIELD”)

This function is used to retrieve an HL7 field value from any executed task in the scenario suite. The function has 2 parameters.

  • TASK_PATH: The task containing the source HL7 message. If not specified, the current task will be used.
    • [R]: (Optional) Use this parameter to get the value from the task’s result message (ACK).
    • [9]: (Optional) Use this parameter to get the value from the task’s ninth message (if your task have many messages). Message index is a 1-based index.
  • HL7_FIELD: The HL7 Field to retrieve value from. Ex: PID.3.1, PID[2].3.1.

Hl7 Field syntax is SEGMENT_NAME[SEGMENT_REPETITION].FIELD_POSITION[FIELD_REPETITION].COMPONENT_POSITION.SUB_COMPONENT_POSITION

@XML(“TASK_PATH”[R],”X_PATH”)

This function is used to retrieve an X-Path value from any executed task in the scenario suite. The function has 2 parameters.

  • TASK_PATH: The task containing the source XML message. If not specified, the current task will be used.
    • [R]: (Optional) Use this parameter to get the value from the task’s result message (ACK).
  • X_PATH: The X-Path to retrieve value from: Ex: ClinicalDocument/typeId/@extension.

@DataSet(“TASK_PATH”[9],”COLUMN”,”ROW”,”TABLE”)

This function is used to retrieve a value from an SQL Query result-set. The function has 4 parameters:

  • TASK_PATH: (Optional) The task containing the source SQL Query result-set. If not specified, the current task will be used.
    • [9]: (Optional) Use this parameter to specify which iteration of the specified task from which to get data.
  • COLUMN: The name/index of the column in the result-set containing the data.
  • ROW: (Optional) The row index in the result-set containing the data.
  • TABLE: (Optional) The name/index of the table in the result-set containing the data. 

@Value(“TASK_PATH”[R])

This function is used to retrieve a string value from any executed task in the scenario suite. The function has 1 parameter.

  • TASK_PATH: The task containing the source value. If not specified, the current task will be used.
    • [R]: (Optional) Use this parameter to get the value from the task’s result value.

 

Configuration

HL7 v2.x Field

  • Click on the ‘Browse…’ button to select the Task containing the value or leave it empty to use the current task.
  • Check the ‘Get field from ACK’ if you which to get the value from the ACK message instead of the HL7 message sent/received.
  • If more than one message is present and you wish to compare against a specific message, you can set the index. If an index is not specified then all messages are matched 1-on-1 for validation. The first message of the source Task will be compared to the first message of the compared Task, the second with the second, etc.
  • Specify which element you wish to validate by setting the Segment, Field, Component and Sub-Component as needed.
  • By default, the first instance found of a Segment or Field will be used for the validation. If needed, you can specify which repetition to use by setting the Seg # and/or Field #.

XML Field

  • Click on the ‘Browse…’ button to select the Task containing the value or leave it empty to use the current task.
  • Select the X-Path to be used.

 DataSet Field

  • Click on the ‘Browse… button’ to select the Task containing the value or leave it empty to use the current task.
  • (Optional) Select the task iteration.
  • Select the column name.
  • (Optional) select the row index.
  • (Optional) Select the table from the result-set (if the SQL Query contains more than one SELECT).

When finished, click on insert to add it to the criteria. You can then insert another Field Value or text. When you are done editing, click on Apply to close the editor and apply the changes.

 

Advanced Criteria Example

To check that PID.2 and PID.4 of a sending task named “Send Task 1″, have been properly merged and separated by a dash in the Z01.1 field of the current task:

  1. Create the following validation: Z01.1 is = _
  2. Set the criteria to: @HL7(“/ScenarioName/ActionName/Send Task 1″,”PID.2″)-@HL7(“/ScenarioName/ActionName/Send Task 1″,”PID.4″)

So, if PID.2 is “ABC” and PID.4 is “123″, then the runtime validation would be: Z01.1 is = ABC-123