Skip to main content

Conditions

Conditions allow you to define criteria that determine when a rule, workflow, or action should apply in AdvaPACS.

A condition evaluates information associated with a DICOM instance, such as the value of a specific DICOM tag, and determines whether the configured criteria are met. Conditions can be combined to create more specific matching logic, allowing rules to target only the studies or instances that meet the required criteria.

This page describes the available condition types and how they can be configured throughout AdvaPACS.

Creating Conditions

Conditions are created by defining the criteria that must be met for a rule or action to apply. Each condition uses a Condition Type to determine what information is evaluated and how the condition is processed. The process to add conditions will vary slightly depending on where they are being added (e.g. within a Transform Rule or within an HL7 Service), but the general process remains the same.

For example, if we wanted to add a condition to a Transform rule we are creating to check if the Modality is DX:

  1. Select the Conditions tab.

  2. Select Add Condition.

  1. Select the Condition Type you want to use.

  1. Configure the criteria for the selected condition type.

  1. Return to the Transform Rule tab and select Save.

Combining Conditions

Multiple conditions can be combined to create more specific matching logic. When adding conditions, use AND or OR to determine how the conditions are evaluated together:

  • AND — all conditions in the group must return True for the overall condition to be met.
  • OR — at least one condition in the group must return True for the overall condition to be met.

For example, if you want to create a condition to check which will only apply on a Saturday OR a Sunday:

Nested Conditions

Conditions can also be nested within other conditions. This allows you to group conditions and combine different AND and OR logic to create more complex criteria. For example, the condition below uses a combination of AND and OR logic to match DX studies received on a weekend.

The top-level AND group requires both of the following to be True:

  • The DICOM Modality (0008,0060) is equal to DX.
  • The nested OR condition requires the day of the week to be either Saturday or Sunday.

As a result, the overall condition will only return True when the modality is DX AND the day is either Saturday OR Sunday.

Condition Types

AdvaPACS provides several condition types that determine how a condition evaluates the specified value. The condition type controls the comparison that is performed and when the condition is considered to have been met.

Different condition types can be used depending on the required logic, from simple value comparisons to more flexible pattern-based matching.

DICOM

The DICOM condition type evaluates the value of a specified DICOM tag against a configured value. This allows a condition to be met based on information contained within the DICOM data. When configuring a DICOM condition, specify the DICOM Tag to evaluate, the Operator used for the comparison, and the Value to compare against.

For example, you could configure a condition to check whether Modality (0008,0060) is equal to CT. The condition will be met when the Modality tag contains the value CT:

DICOM conditions can be used to evaluate a wide range of information, such as modality, patient details, study information, accession number, institution, or other values stored within DICOM tags.

Day of Week

The Day of Week condition type evaluates the day on which an action occurs. This allows rules to be applied only on specific days of the week. When configuring a Day of Week condition, select one or more days on which the condition should be met.

For example, you could configure a condition for Saturday and Sunday to apply a rule only when an action occurs during the weekend.

Day of Week conditions are useful for creating rules that behave differently depending on the day, such as routing studies to a different destination outside normal weekday workflows.

Time of Day

The Time of Day condition type evaluates the time at which an action occurs. This allows rules to be applied only during a specified period of the day. When configuring a Time of Day condition, specify the Start Time and End Time that define the period in which the condition should be met.

For example, you could configure a condition from 18:00 to 08:00 to apply a rule only to actions that occur outside normal business hours:

Time of Day conditions are useful for time-based workflows, such as routing studies to a different destination overnight or applying different processing rules outside normal operating hours.

Script

The Script condition type uses a custom script to determine whether a condition is met. This provides more flexibility for scenarios that require logic beyond the standard condition types. When configuring a Script condition, define the script that should be evaluated. The script must return either True or False:

  • True — the condition is met.
  • False — the condition is not met.
  • If the script does not return a value, the result defaults to False.

Script conditions are useful when a rule needs to evaluate multiple values, perform more complex comparisons, or apply custom logic that cannot be represented using a single DICOM, Day of Week, or Time of Day condition.

Note

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

HL7

The HL7 condition type evaluates information contained within an HL7 message. This allows rules to be applied based on the value of a specific field within the message. When configuring an HL7 condition, specify the HL7 field to evaluate, the Operator used for the comparison, and the Value to compare against.

When specifying an HL7 field in a condition, use the following format:

<segment>-<field#>-<component#>-<subcomponent#>

For example, you could configure a condition to check whether the patient class in PID-5-2 is empty:

info

This condition type is only available in HL7 Services.