IMPAX 6.5.1 Server Knowledge Base home > Configuring IMPAX Server with Administration Tools > Source Manager > Customizing field mappings to extract information from images > List of field mapping grammar functions

getdicomsequence


This operation looks for a sequence within the DICOM header that matches the tag value. For every item within the found sequence, the operation evaluates match_expression and compares its value to match_value. If the comparison is true, then the operation evaluates return_expression on the same sequence and returns that as the value.

Syntax

getdicomsequence (tag, match-expression, match-value, return-expression)

Parameters

Remarks

Both match-expression and return-expression can be another field mapping grammar function.

Example

getdicomsequence( 0x540220, getdicomstring(0x80102), 'SNM3', getdicomstring(0x80100) 
+ '/' + getdicomsequence( 0x540222, 'T', 'T', getdicomstring(0x80100)))

Within the following DICOM header

...
0040 0318 6 | organ_exposed | CS | 1 | "BREAST"
0040 8302 10 | Unknown element | Unkn | ? | "1.0007
9966"
     0054 0220 (undef.) | view_code_sequence | SQ | 1 | **** Item: length(Undefined) offset(1798)
     0008 0100 8 | code_value | SH | 1 | "R-10242"
     0008 0102 4 | coding_scheme_designator | SH | 1 | "SNM3"
     0008 0104 14 | code_meaning | LO | 1 | "cranio-caudal"

...

     0054 0222 (undef.) | view_angulation_modifier_code_sequence | SQ | 1 | **** Item: 
length(Undefined) offset(1868)
        0008 0100 8 | code_value | SH | 1 | "R-102D5"
        0008 0102 4 | coding_scheme_designator | SH | 1 | "SNM3"
        0008 0104 18 | code_meaning | LO | 1 | "Implant displaced"
        **** End Item
        **** End sq
     **** End Item

The operation first looks for the tag 0x540220 (the view_code_sequence). Within that sequence, it evaluates the expression getdicomstring(0x80102). It compares that expression’s value to "SNM3", finds a match, and so it returns the evaluation of the sub-sequence: getdicomstring(0x80100) + '/' + getdicomsequence( 0x540222, 'T', 'T', getdicomstring(0x80100))

Inside the matched sequence, getdicomstring finds the value "R-10242". It then evaluates getdicomsequence against that and finds the view_angulation_modifier_code_sequence, and returns R-102D5 from within that sub-sequence.

The return value for the full expression is 'R-10242/R-102D5'.


See also


Topic number: 9992

Applies to: IMPAX 6.5.1 Server Knowledge Base