Skip to content

message.getDICOMSequence

Use when: You want to read values from the modified message during mapping. If you need the original incoming message, use source.getDICOMSequence.

Signature: message.getDICOMSequence(nodePath, instance*)

Returns: DICOM Message[] result - the first node that matches the nodePath and instance as a JS Array of DICOM Messages, or a DICOM Message if an instance is specified

Get the result as a JS Array of DICOM Message models that matches the nodePath.

Note

instance is optional. When not specified, every matching sequence item is returned as an array; supply one to return that single item. When specified, the nodePath should not include an instance identifier.

Parameters

Type Name Description Default
String nodePath the DICOM node path
Integer instance* (optional) the match instance to return. Use 1 for the first instance.

Example

// assumes `message` is a DICOM message model object

// Retrieve a DICOM Sequence as an array of DICOM Message models
var dicomSequenceArray = message.getDICOMSequence(
    "0040,0275" // Example DICOM sequence tag (Request Attributes Sequence)
);

// Retrieve a specific instance from the sequence
// (useful when the sequence appears multiple times)
var dicomSequenceInstance = message.getDICOMSequence(
    "0040,0275",
    2 // instance (1 = first instance)
);

// Result:
// - Without an instance:
//     Returns a JavaScript Array of DICOM Message objects
// - With an instance:
//     Returns a single DICOM Message model