Conditions in a De-identification Profile
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.
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.
Tags Inside Sequences
A condition is evaluated for each visited attribute, including the attributes nested in the items of a sequence. The tag given to a function is looked up from the dataset being visited outwards: inside a sequence item, the item’s own value is used when the item holds the tag, otherwise the value of the enclosing dataset (up to the top level). A condition on a study-level tag such as Modality therefore holds at every level, while a condition on a tag that only exists inside the items of a sequence is true only while those items are visited.
Combining Conditions
Multiple conditions can be combined using logical operators.
&& corresponds to the AND logical operator
|| corresponds to the OR logical operator