Skip to main content

Conditions

The following features uses Conditions to specify when to run the rule and/or further filter instances or HL7 messages.

Conditions allows you to create conditional statements with the use of logical operators, such as, And and Or to create simple to complex conditions.

For example, using the Or operator, the condition below will run a rule on Monday or Wednesday or Friday.

Here's another example, which is composed of 3 conditions:

  • 2 individual conditions
  • 1 nested condition with 2 individual conditions

With this configuration, the rule will run on Monday or Wednesday or on Friday at 8am to 12pm.

Condition Operands

The following are the available operands that you can use in creating conditions:

DICOM

Use DICOM tag values in your condition.

If the Day of Week and Time of Day evaluates the conditions based on day and time, the DICOM operand evaluates the conditions on DICOM tag values of instances.

For example, suppose you only want to filter instances that has a modality of CT.

Input the DICOM tag that you want to use in your condition by entering either the DICOM tag in hexadecimal notation or the name of the DICOM tag. In this case, (0008,0060) or Modality.

Then, select your Operator. In this example, it's Equals. And the Value of the DICOM tag that you want to filter out, CT.

With this condition, the rule will only filter instances that has the CT modality.

caution

This operand only checks the DICOM tag values of instances of the specified Level in the rule (ex. Level in Routing Rules).

In conclusion, using the DICOM operand further filters instances that are initially filtered by the Devices in the rule (ex. Source AE in Routing Rules).

Day of Week

Use the day of week in your condition to specify what day the rule will run.

The time zone will be set to the default time zone in your tenant account, which can be found under Admin > Settings > DICOM > Time Zone.

Time of Day

Use the time of day in your condition to specify at what time the rule will run.

Script

info

This is only available when the rule is executed on the AdvaPACS Gateway

Use a script in creating conditions.

This allows you to create conditions with greater flexibility and helps tailor your conditions to your specific needs.

The script you create in conditions must return True or False. If nothing is returned it will default to False.

Clicking on the View Script button will show the Script Editor where you can write custom scripts using the Rhino Javascript Engine

HL7

info

This condition type is only available in HL7 Services.

Use HL7 field values in your condition.

HL7 evaluates conditions on HL7 field values of HL7 messages.

For example, HL7 messages that match the condition above, where the HL7 Field PID-5-2 is empty, will return True and will be processed further.

To select an HL7 field in your condition, follow this format: <segment>-<field#>-<component#>-<subcomponent#> (e.g. PID-5-3-1)

Creating Conditions

  1. Click Add Condition to add a condition. You can add multiple conditions.

    This adds a single condition.

    These are individual conditions.

    You can also add a nested condition by clicking on Add Nested Condition.

  2. Select a logical operator.

    The chosen logical operator determines how the conditions are evaluated.

    For example, in the image below, the condition for the rule is made up of three conditions:

    • 2 individual conditions
    • 1 nested condition with 1 individual condition

    If the chosen logical operator is AND, the entire condition is only satisfied if all three conditions evaluate to True.

    On the other hand, if OR is used, the entire condition is satisfied if at least one condition among the three conditions evaluates to True.

  3. Select an Operand for each condition.

  4. Once you are done, go back to the rule or service section and click Create to create the rule or service.

    For example: