public class MCdimseMessage extends MCattributeSet
DICOM provides for two kinds of DIMSE service messages: request messages sent by Service
Class User (SCU) applications to Service Class Provider (SCP) applications, and response
messages sent by SCP applications in reply to received request messages. In either case,
MCdimseMessage
objects are used to represent messages sent or received.
DIMSE messages contain a command set and may also contain a data set. The exact contents of the command set and data set depend on the service class defined by the DICOM standard, which is conveyed through the service and command values associated with the message. This class provides access to attributes of both sets.
This class provides convenience methods to retrieve or set information in the command set. Other command set attributes and data set attributes can be set using the base classe's methods.
An instance of this class can not be used by multiple threads concurrently.
Modifier and Type | Field and Description |
---|---|
static short |
MESSAGE_PRIORITY_HIGH
Defined value for Priority attribute (0000,0700) in a high priority DIMSE message.
|
static short |
MESSAGE_PRIORITY_LOW
Defined value for Priority attribute (0000,0700) in a low priority DIMSE message.
|
static short |
MESSAGE_PRIORITY_MEDIUM
Defined value for Priority attribute (0000,0700) in a medium priority DIMSE message.
|
Constructor and Description |
---|
MCdimseMessage()
Initializes a new DIMSE message object with no service and command specified.
|
MCdimseMessage(com.merge.mcw.CoreAttribSet ats)
Initializes a new DIMSE message object based on the content of a core attribute set.
|
MCdimseMessage(MCfile file)
Initializes a new DIMSE message object based on the content of a DICOM file.
|
MCdimseMessage(java.lang.String serviceName,
MCcommand command)
Initializes a new DIMSE message object for the specified service and command.
|
Modifier and Type | Method and Description |
---|---|
short |
getActionTypeId()
Gets the Action Type ID (0000,1008) attribute's value from this message's command set.
|
java.lang.String |
getAffectedSopClassUid()
Gets the Affected SOP Class UID (0000,0002) from the message's command set.
|
java.lang.String |
getAffectedSopInstanceUid()
Gets the Affected SOP Instance UID (0000,1000) from the message's command set.
|
MCcommand |
getCommand()
Gets the DICOM command associated with this message.
|
int |
getCompletedSubOperations()
Gets the number of completed C-STORE sub-operations as specified by the Number Of Completed
Sub-operations (0000,1021) attribute.
|
java.lang.String |
getErrorComment()
Gets the Error Comment (0000,0902) attribute value from the message's command set.
|
int |
getErrorId()
Gets the Error ID (0000,0903) attribute value from the message's command set.
|
int |
getEventTypeId()
Gets the application-specific Event Type code as specified by the Event Type ID (0000,1002)
attribute's value.
|
int |
getFailedSubOperations()
Gets the number of C-STORE sub-operations that failed.
|
int |
getMessageId()
Gets the message ID of this message from the Message ID attribute (0000,0110).
|
int |
getMessageIdBeingRespondedTo()
Gets the message ID of the request message related to this response message, from the Message ID Being
Responded To (0000,0120) attribute.
|
short |
getMessagePriority()
Retrieves the Message Priority from the Priority (0000,0700) attribute.
|
java.lang.String |
getMoveDestination()
Gets the Application Entity Title of the destination for the C-MOVE operation.
|
java.lang.String |
getMoveOriginator()
Gets the Application Entity Title of the originator of the C-MOVE operation.
|
int |
getMoveOriginatorMessageId()
Gets the message ID of the C-MOVE request message that resulted in this C-STORE request.
|
int |
getRemainingSubOperations()
Gets the number of C-STORE sub-operations remaining for the move operation.
|
java.lang.String |
getRequestedSopClassUid()
Gets the requested SOP Class UID value from the Requested SOP Class UID (0000,0003) attribute.
|
java.lang.String |
getRequestedSopInstanceUid()
Gets the requested SOP Instance UID value from the Requested SOP Instance UID (0000,1001) attribute..
|
int |
getResponseStatus()
Gets the response status code from the Status (0000,0900) attribute.
|
java.lang.String |
getService()
Gets the name of the DICOM service associated with this message.
|
int |
getWarningSubOperations()
Gets the number of C-STORE sub-operations which generated warnings.
|
void |
setActionTypeId(int actionTypeID)
Sets the Action Type ID (0000,1008) attribute's value in this message's command set.
|
void |
setAffectedSopClassUid(java.lang.String uid)
Sets the Affected SOP Class UID (0000,0002) attribute's value in this message's command set.
|
void |
setAffectedSopInstanceUid(java.lang.String uid)
Sets the Affected SOP Instance UID (0000,1000) attribute's value in this message's command set.
|
void |
setCompletedSubOperations(int number)
Sets the value of the Number Of Completed Sub-Operations (0000,1021) attribute.
|
void |
setErrorComment(java.lang.String comment)
Sets the Error Comment (0000,0902) attribute's value in this message's command set.
|
void |
setErrorId(int errorID)
Sets the Error ID (0000,0903) attribute's value in this message's command set.
|
void |
setEventTypeId(int eventType)
Sets an Event Type ID (0000,1002) attribute's value.
|
void |
setFailedSubOperations(int number)
Sets the Number Of Failed Sub-Operations (0000,1022) attribute's value.
|
void |
setMessagePriority(short priority)
Sets the Message Priority (0000,0700) attribute's value in this message's command set.
|
void |
setMoveDestination(java.lang.String aeTitle)
Sets the Move Destination (0000,0600) attribute's value.
|
void |
setMoveOriginator(java.lang.String aeTitle)
Sets the Move Originator Application Entity Title (0000,1030) attribute's value.
|
void |
setMoveOriginatorMessageId(int msgID)
Sets the Move Originator Message ID (0000,1031) attribute's value.
|
void |
setRemainingSubOperations(int number)
Sets the value of the Number Of Remaining Sub_Operation (0000,1020) attribute.
|
void |
setRequestedSopClassUid(java.lang.String uid)
Sets the value of the Requested SOP Class UID (0000,0003) attribute in this message's command set.
|
void |
setRequestedSopInstanceUid(java.lang.String uid)
Sets the value of the Requested SOP Instance UID (0000,1001) attribute in this message's command set.
|
void |
setServiceCommand(java.lang.String serviceName,
MCcommand command)
Sets the DICOM service and command associated with this message.
|
void |
setWarningSubOperations(int number)
Sets the value of the Number Of Warning Sub-Operations (0000,1022) attribute.
|
addAttribute, addAttribute, addEncapsulatedFrame, addValue, addValue, clear, clear, contains, contains, copyTo, createSignature, createSignature, deleteSignature, dispose, duplicate, getBigInteger, getBigInteger, getBulkValue, getBulkValue, getDoubleValue, getDoubleValue, getEncapsulatedFrame, getFloatValue, getFloatValue, getFrame, getIntValue, getIntValue, getItem, getItem, getKeyword, getKeyword, getLongValue, getLongValue, getModality, getNextValidationError, getOffsetTable, getShortValue, getShortValue, getSOPClassUID, getSOPInstanceUID, getStringValue, getStringValue, getStringValue, getStringValue, getTransferSyntax, getValue, getValue, getValue, getValue, getValueCount, getValueCount, getValueLength, getValueLength, getValueRepresentation, getValueRepresentation, getValues, getValues, iterator, list, list, readAttributeSetsFromJSON, readAttributeSetsFromJSON, readFromJSON, readFromJSON, readFromStream, readFromStream, readFromXML, readFromXML, readFromXMLNative, readFromXMLNative, removeAttribute, removeAttribute, resetTransferSyntax, setDefaultCompression, setTransferSyntax, setValue, setValue, setValueRepresentation, setValueRepresentation, size, validate, validateAttribute, verifySignature, writeAttributeSetsToJSON, writeToJSON, writeToStream, writeToStream, writeToXML, writeToXML, writeToXMLNative
public static final short MESSAGE_PRIORITY_LOW
public static final short MESSAGE_PRIORITY_MEDIUM
public static final short MESSAGE_PRIORITY_HIGH
public MCdimseMessage()
If the message is to be sent to a network partner, or if it is to be validated, the
setServiceCommand(String, MCcommand)
method must be called first to associate
the message object with a given DICOM service and command.
MCexception
- If the toolkit is not initialized.public MCdimseMessage(java.lang.String serviceName, MCcommand command)
serviceName
- A DICOM service name as defined in the service profile, mergecom.srv.command
- The DICOM command for this message.MCexception
- If the toolkit is not initialized or if one of the parameters is invalid.public MCdimseMessage(MCfile file)
This constructor assigns the data set portion of the file to the new message and disposes the file object.
file
- The DICOM file object providing the data set for the message.MCexception
- If the file parameter is null
.public MCdimseMessage(com.merge.mcw.CoreAttribSet ats)
ats
- DIMSE message object providing the data set for the message.MCexception
- If the attribute set type is not MESSAGE.public java.lang.String getService()
Service names are defined in the service configuration file (mergecom.srv) and the
MCsopClass
class can be used to obtain service names for specific SOP class UID's.
getService
in class MCattributeSet
MCexception
- if this message is disposed.public MCcommand getCommand()
getCommand
in class MCattributeSet
MCexception
- if this message is disposed.public void setServiceCommand(java.lang.String serviceName, MCcommand command)
A service/command pair must be associated with the message before it can be streamed out (encoded) or validated.
setServiceCommand
in class MCattributeSet
serviceName
- The name of a DICOM service as configured in the service configuration file
(mergecom.srv). See MCsopClass
for information on how to obtain service names.command
- The command for this message.MCexception
- If a parameter is invalid or if the message is disposed.public short getActionTypeId()
Normalized DICOM service classes make use of the N-ACTION DIMSE service. That service requests that a specific action be performed by the peer DIMSE service user. Each SOP class using the N-ACTION service defines Action Type IDs that identify a specific service. This method retrieves the Action Type ID that was specified in the DIMSE message.
MCexception
- If this message does not contain the requested attribute or if the attribute has no value.public java.lang.String getAffectedSopClassUid()
null
if the attribute is missing or empty.public java.lang.String getAffectedSopInstanceUid()
null
if the attribute is missing or empty.public int getCompletedSubOperations()
MCexception
- If this message does not contain the requested attribute or if the attribute has no value.public java.lang.String getErrorComment()
null
if the attribute is missing or empty.public int getErrorId()
MCexception
- If this message does not contain the requested attribute or if the attribute has no value.public int getEventTypeId()
MCexception
- If this message does not contain the requested attribute or if the attribute has no value.public int getFailedSubOperations()
MCexception
- If this message does not contain the requested attribute or if the attribute has no value.public int getMessageId()
MCexception
- If this message does not contain the requested attribute or if the attribute has no value.public int getMessageIdBeingRespondedTo()
MCexception
- If this message does not contain the requested attribute or if the attribute has no value.public short getMessagePriority()
Valid priority values defined by DICOM are MESSAGE_PRIORITY_HIGH
, MESSAGE_PRIORITY_LOW
and MESSAGE_PRIORITY_MEDIUM
.
MCexception
- If this message does not contain the requested attribute or if the attribute has no value.public java.lang.String getMoveDestination()
null
if the attribute is missing or empty.public java.lang.String getMoveOriginator()
null
if the attribute is missing or empty.public int getMoveOriginatorMessageId()
MCexception
- If this message does not contain the requested attribute or if the attribute has no value.public int getRemainingSubOperations()
MCexception
- If this message does not contain the requested attribute or if the attribute has no value.public java.lang.String getRequestedSopClassUid()
null
if the attribute is missing or empty.public java.lang.String getRequestedSopInstanceUid()
null
if the attribute is missing or empty.public int getResponseStatus()
Common response status codes are defined by MCresponseStatus
class.
MCexception
- If this message does not contain the requested attribute or if the attribute has no value.public int getWarningSubOperations()
MCexception
- If this message does not contain the requested attribute or if the attribute has no value.public void setActionTypeId(int actionTypeID)
Normalized DICOM service classes make use of the N-ACTION DIMSE service. That service requests that a specific action be performed by the peer DIMSE service user. Each SOP class using the N-ACTION service defines Action Type IDs that identify a specific service.
This method replaces any existing value with the one provided.
actionTypeID
- A DICOM defined Action Type ID.MCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setAffectedSopClassUid(java.lang.String uid)
This method replaces any existing value with the one provided.
uid
- The Affected SOP Class UID value.MCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setAffectedSopInstanceUid(java.lang.String uid)
This method replaces any existing value with the one provided.
uid
- The Affected SOP Instance UID value.MCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setCompletedSubOperations(int number)
This method replaces any existing value with the one provided.
number
- The number of completed sub-operations.MCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setErrorComment(java.lang.String comment)
This method replaces any existing value with the one provided.
comment
- Comment describing an error encountered.MCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setErrorId(int errorID)
This method replaces any existing value with the one provided.
errorID
- An application-specific error numberMCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setEventTypeId(int eventType)
This method replaces any existing value with the one provided.
eventType
- An event type code.MCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setFailedSubOperations(int number)
This method replaces any existing value with the one provided.
number
- The number of failed sub-operations.MCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setMessagePriority(short priority)
This method replaces any existing value with the one provided.
priority
- One of the message priority values defined by the MESSAGE_PRIORITY_HIGH
,
MESSAGE_PRIORITY_LOW
and MESSAGE_PRIORITY_MEDIUM
fields.MCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setMoveDestination(java.lang.String aeTitle)
This method replaces any existing value with the one provided.
aeTitle
- The Move Destination Application Entity Title.MCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setMoveOriginator(java.lang.String aeTitle)
This method replaces any existing value with the one provided.
aeTitle
- The Move Originator Application Entity Title.MCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setMoveOriginatorMessageId(int msgID)
This method replaces any existing value with the one provided.
msgID
- The move originator message ID.MCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setRemainingSubOperations(int number)
This method replaces any existing value with the one provided.
number
- The number of remaining sub-operations for the current C-MOVE operation.MCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setRequestedSopClassUid(java.lang.String uid)
This method replaces any existing value with the one provided.
uid
- The Requested SOP Class UID valueMCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setRequestedSopInstanceUid(java.lang.String uid)
This method replaces any existing value with the one provided.
uid
- The Requested SOP Instance UID valueMCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).public void setWarningSubOperations(int number)
This method replaces any existing value with the one provided.
number
- The number of C-STORE sub-operations that generated warningsMCexception
- If this message is disposed, if the value to set is invalid or if the
toolkit fails to store the value (out of memory).