Go to the Administration tab.
Click the Devices tab.
Add a
new device, or click the edit button, , of an existing DICOM
device.
Scroll to the data coercion section.
Define rules and click save.
Data coercion rules insert, remove and modify values in DICOM attributes when the system first acquires the object, before it is initially registered. The rules are assigned to a specific registered device, and applied to all DICOM C-STORE messages arriving from that device. Coercion works for DICOM alpha-numeric attributes only. Multiple rules can exist for a single device, and are applied in the defined sequence.
To define coercion rules, go to the Devices
page and click on the edit button, , of the device in the Devices table. At
the bottom of the DICOM Services page, the format of each rule is explained
in the legend. If
you need the DICOM tag for a particular attribute, select it from the
pull-down menu and click on Add Tag. If
the attribute is not available, enter it directly into the text box. Complete
the rule by typing the rest of the command. When
you have completed all the rules, click on Save.
Note: data coercion rules do not propagate between servers. If they are required on multiple eRAD PACS servers, you must make the change on each one.
The supported coercion rules are as follows:
General Syntax:
<lvalue>=<expression>
lvalues:
DICOM Tag This is in the form, (gggg,eeee). It represents the target attribute. After the expression is evaluated, the results are assigned to this attribute.
Expressions: Can be either a Value or a Function.
Values
(gggg,eeee) This returns the value of a DICOM tag. If the DICOM tag does not exist, NULL() is returned. The parentheses are required.
Quoted string This is in the form, <string>. Returns the literal string <string>. The string can contain escaped characters, including \n, \\ and \.
Unquoted string Non-quoted strings can be used when they contain only contiguous, alphanumeric characters.
(gggg,eeee),d,n (Retired) This returns the nth field in the DICOM tag (gggg,eeee) value as separated by the delimiter d.
Functions
and(a,b) This function returns true if both a and b are non-NULL.
concat(a,b[,c ]) This function concatenates the values a and b (and c, etc.) NULL values are treated as an empty string, .
contains(a,b) This function returns true if string a exists in string b. Otherwise it returns NULL.
<empty string> - This is the empty string, .
equals(a,b) This function returns true if a and b are equal, NULL if they are not equal
if(cond,a,b) This function returns a if cond is not NULL, b if cond is NULL.
indexof(a, p) Returns the starting position of pattern p in string a. The first position in string a is 0. Returns -1 if p is not found in a. Returns NULL if p or a is NULL.
not(a) This function returns true if a is NULL, NULL if a is not NULL.
NULL() This function deletes the target lvalue.
or(a,b[,c...]) This function returns the first non-NULL value.
split(a,d,n) This function returns the nth field in a using d as the field delimiter.
strlen(a) Returns the number of characters in string a, or NULL if string a is NULL.
substr(a,from[,len]) Returns the len characters in a, starting at position from. The first position is 0. If from extends past the end of the string, the NULL string is returned. If len is omitted, the remaining string is returned.
In the evaluation of expressions, NULL is not the same as the empty string, . If a DICOM attribute does not exist, it is NULL. If it exists, but contains a 0-length value, it is the empty string, .
An example of a coercion rule to insert a prefix, PFX, before the Accession Number (0008,0050). If the attribute 0008,0050 exists, even if it contains a 0-length value, insert PFX into the beginning of the existing value and assign it back to the original attribute. If the original attribute does not exist, return NULL(), which prevents it from being added to the object.
(0008,0050)=if( (0008,0050) , concat(PFX,(0008,0050)) , NULL() )
Another example is to coerce a patient name, (0010,0010), defined as LASTNAME,FIRSTNAME[,MI] into DICOM-compliant syntax, LASTNAME^FIRSTNAME[^MI]. Note that the line break is inserted for readability only. To work, this needs to be entered on a single line.
(0010,0010)=concat(split((0010,0010), ,, 1), ^, split((0010,0010), ,, 2),
if(split((0010,0010), ,, 3), ^, ), split((0010,0010), ,, 3) )