DIMSE command set encoding and decoding.
Command sets are the control headers of DIMSE messages, always encoded in Implicit VR Little Endian regardless of the negotiated transfer syntax (PS3.7 Section 6.3.1). All elements belong to group 0000.
Wire Format (Implicit VR Little Endian)
Each data element: <<group::16-little, element::16-little, length::32-little, value::binary>>
No VR field — the VR is determined from the tag via the DICOM dictionary.
Command Set Elements (PS3.7 Section 6.3)
| Tag | Name | VR | Description |
|---|---|---|---|
| (0000,0000) | CommandGroupLength | UL | Byte count of remaining command |
| (0000,0002) | AffectedSOPClassUID | UI | SOP Class being operated on |
| (0000,0100) | CommandField | US | Which DIMSE operation |
| (0000,0110) | MessageID | US | Unique ID for request/response pairing |
| (0000,0120) | MessageIDBeingRespondedTo | US | Original request's MessageID |
| (0000,0800) | CommandDataSetType | US | 0x0101 = no data set follows |
| (0000,0900) | Status | US | Operation result code |
See Dimse.Command.Fields for command field constants and
Dimse.Command.Status for status code definitions.
Summary
Functions
Returns the Affected SOP Class UID from a command set.
Returns the command field value from a command set.
Decodes an Implicit VR Little Endian binary into a command set map.
Encodes a command set map into Implicit VR Little Endian binary.
Returns the message ID from a command set.
Returns true if the command set indicates no data set follows.
Returns the status from a command set.
Functions
Returns the Affected SOP Class UID from a command set.
Returns the command field value from a command set.
Decodes an Implicit VR Little Endian binary into a command set map.
Returns {:ok, map} where keys are {group, element} tuples and
values are decoded Elixir values.
Encodes a command set map into Implicit VR Little Endian binary.
The map keys are DICOM tags {group, element} and values are the
raw Elixir values to encode. The CommandGroupLength (0000,0000) is
computed automatically and should not be included in the input map.
Example
{:ok, binary} = Dimse.Command.encode(%{
{0x0000, 0x0002} => "1.2.840.10008.1.1",
{0x0000, 0x0100} => 0x0030,
{0x0000, 0x0110} => 1,
{0x0000, 0x0800} => 0x0101
})
Returns the message ID from a command set.
Returns true if the command set indicates no data set follows.
Returns the status from a command set.