Working with Command Sets

DICOM messages that are transferred across a DICOM Associate connection include a command set and may or may not include a data set. The command set is a specialized data set that contains information about the action to be taken, such as Request, Response, Find, Get, Move, Action, etc. Since the command set is a data set, it consists of one or more data elements. An accompanying data set contains either the data set on which to perform the command, or the data set resulting from a command.

Each command set has its own specific set of data elements. For more information on command sets in general, refer to the DICOM Standard.

Since a command set is a specialized data set, it is created by calling InitCS method to create the data set and initialize it to a command set.

To obtain information about an existing command set, use the GetInfoCS method, which updates the InfoCommand property and the InfoRequest property. To determine whether the command set is a request or a response, check the InfoRequest property after calling the GetInfoCS method.

You can also determine the type of a command set by "and-ing" the value of the TAG_COMMAND_FIELD value with COMMAND_REQUEST or COMMAND_RESPONSE. In addition, you can determine whether a command set has a required data set by "and-ing" the value of the TAG_DATA_SET_TYPE element with COMMAND_DATASET_PRESENT, COMMAND_DATASET_IDENTIFIER, or COMMAND_DATASET_ABSENT.

To insert one data set into another data set, use InsertDS method.