Message Object¶
The message object is a read/write copy of the message. When a message enters the inbound queue, the message object is initialized to an exact copy of the source object. As mapping functions are applied, the message object is modified. When a message is sent to a destination, it is the value of the message object that is sent.
Some message object functions are available on every message model, while others are specific to a particular model, the JSON manipulators only apply to JSON messages, the DICOM accessors only to DICOM. This page describes what each model adds; the sections below name the kinds of operations available rather than listing every function.
The Code Wizard is the function reference
Every signature, parameter, return value, and worked example is published by the Code Wizard in the script editor, generated from the same definitions the engine uses so it can never drift from the product. The Code Wizard groups message functions by model, so opening the folder for your channel's format shows exactly the functions listed here as available. Use the Code Wizard menu inside a script, or open Channels -> Scripting -> Code Wizard -> Function Reference in the help navigation, or search for the function by name.
Common Functions¶
Available on every message model: reading a node (Get Node), getting the raw bytes, converting the message to a string, reading the message ID and the created/erred timestamps, getting and setting the ACK message, and the two flow-control functions Discard and Error.
Available on every message model except Binary: the multi-node operations, namely Get All Nodes, Get Count, Get Last Node, Set All Nodes, and Set Node, together with the node tests Check Node Exists, Check Node is Blank, and Check Node is Not Blank. A Binary message has no node structure to walk, so these do not apply to it. The node-removal functions are likewise unavailable on Binary; see each model's own section for where they are offered.
HL7¶
Adds the child-node builders (Add Child, and the Before / After variants), node removal, counts for fields and repetitions, and access to the segment delimiter and end-of-line character.
ASTM¶
The same shape as HL7, child-node builders, node removal, field and repetition counts, and end-of-line control.
Binary¶
The Binary message model supports the common functions listed above but not the "all message models except Binary" set, because there is no node structure to traverse. Get Node is supported, but / is its only valid node path and it returns the whole payload decoded with the message type's configured encoding, which is the same value To String returns.
It adds two functions: Set Bytes, for replacing the message payload wholesale, and Length, for the number of bytes in the payload. Use Length to test whether a Binary message has a payload at all; to test for a payload that is only whitespace, pass To String to StringUtils.isBlank.
CSV¶
Adds row and column counts, node removal, quoting and unquoting of values, end-of-line control, and sorting of the message rows by string, number, or date.
On a CSV message, the nodePath argument to Get Node identifies a column, either the header name, or a 1-based numeric column index passed as a string ('1', '2', ...). Header-name matching is case-insensitive and ignores leading/trailing whitespace on the header value, but spaces and punctuation within the header must match exactly. For a header row containing "value (not a FF)", the column path is 'value (not a FF)' (or '1'). 'value' alone does not match. The row instance argument is 1-based and counts data rows only; the header row is excluded.
DICOM¶
The largest model-specific set. Typed accessors read and write each DICOM value representation (strings, signed and unsigned shorts and longs, floats, and doubles) each available in a single-value and an as-array form. Beyond those, the model exposes group operations (Get DICOM Group, Has DICOM Group, Remove DICOM Group, Get DICOM Group Size), sequence access, the file preamble, private data content, whole-instance operations such as Merge DICOM and Change Transfer Syntax, and the raw-byte accessors including a for-file variant.
See Handling Large DICOM Images before reading pixel data in a script.
Writing binary data to a DICOM tag
A tag whose value representation is Other Byte (OB), Other Double (OD), Other Float (OF), Other Word (OW) or Unknown (UN) holds binary data. Set DICOM Bytes accepts a byte array or a String for those tags, and Set Node accepts a String only. A String must be Base64 encoded: line breaks within it are ignored, an empty String stores no bytes, and any other String is refused, which sends the message to the error queue.
EDIFACT¶
Child-node builders, node removal, end-of-line control, and access to the component separator, element separator, and segment delimiter.
Old Fxd Width¶
Node removal and end-of-line control only.
Fxd Length¶
Node removal, end-of-line control, and Set Fixed Length Pad Character.
ISO 8583¶
Node removal only.
JSON¶
The other large model-specific set, and the reason is typing: JSON distinguishes strings, numbers, booleans, nulls, objects, and arrays, so most operations exist once per type. There are setters for each type (Set JSON String, Set JSON Number, and so on) plus Set All variants, adders for appending to an object or an array and for inserting before or after an existing member, type tests (Is JSON Array, Is JSON String, ...), array count and key listing, array sorting by string, number, or date, Parse JSON String and Stringify JSON Object, and Format JSON for pretty-printing.
Text¶
Supports the common functions and the "all message models except Binary" common functions. There are no additional functions specific to the Text message model.
X12¶
Child-node builders, node removal, end-of-line control, and access to the component separator, element separator, and segment delimiter.
XML¶
Child-node builders including Add Child Message for grafting one message into another, node removal, namespace removal (single or all), prolog add and remove, comment and whitespace stripping, and Format XML for pretty-printing.