Conditions
Overview
A condition is an expression evaluated against a DICOM instance that returns a boolean value (true or false). Conditions are used in profiles to determine whether specific actions or transformations should be applied to DICOM elements based on the content of the instance.
Quick Reference
| Function | Purpose | Example |
|---|---|---|
tagValueIsPresent |
Exact match | tagValueIsPresent(#Tag.Modality, "CT") |
tagValueContains |
Substring match | tagValueContains(#Tag.StudyDescription, "cardiac") |
tagValueBeginsWith |
Prefix match | tagValueBeginsWith(#Tag.SeriesNumber, "1") |
tagValueEndsWith |
Suffix match | tagValueEndsWith(#Tag.StationName, "GE") |
tagIsPresent |
Tag existence | tagIsPresent(#Tag.PatientName) |
Constants
To improve readability and reduce errors, the following constants are available:
-
#Tag- Retrieves DICOM tag identifiers by their standard names- Example:
#Tag.PatientBirthDate→0010,0030 - Example:
#Tag.StudyDescription→0008,1030 - Example:
#Tag.Modality→0008,0060
- Example:
-
#VR- Retrieves DICOM Value Representation types- Example:
#VR.LO→ Long String - Example:
#VR.DA→ Date - Example:
#VR.PN→ Person Name
- Example:
Using these constants is recommended over hardcoded tag values to make profiles more maintainable and self-documenting.
Available Functions
All utility functions are detailed below with their parameters, return types, and usage examples.
Utility functions are available to define the conditions and are detailed below.
tagValueIsPresent
tagValueIsPresent(int tag, String value) or tagValueIsPresent(String tag, String value)
This function will retrieve the tag value of the DICOM and check if the value parameter is the same as the tag value.
tagValueContains
tagValueContains(int tag, String value) or tagValueContains(String tag, String value)
This function will retrieve the tag value of the DICOM and check if the value parameter appears in the tag value.
tagValueBeginsWith
tagValueBeginsWith(int tag, String value) or tagValueBeginsWith(String tag, String value)
This function will retrieve the tag value of the DICOM and check if the tag value begins with the parameter value
tagValueEndsWith
tagValueEndsWith(int tag, String value) or tagValueEndsWith(String tag, String value)
This function will retrieve the tag value of the DICOM and check if the tag value ends with the parameter value
tagIsPresent
tagIsPresent(int tag) or tagIsPresent(String tag)
This function will check if the tag is present in the DICOM instance.
Combining Conditions
Multiple conditions can be combined using logical operators.
&& corresponds to the AND logical operator
|| corresponds to the OR logical operator