Statuses: Working with Response status codes (statuses)

This module provides some useful status constants. You should be aware, that some status codes depends on a command or a service you are responding to. The following tables provides list of some well known status codes grouped by commands and status types. The table is by no means cover the whole DICOM standard status codes.

Service/Command

Status

Code

Description

Related Attributes

C-ECHO

Success

0000

Failure

0122

Refused: SOP Class Not Supported

0210

Duplicate Invocation

0212

Mistyped argument

0211

Unrecognized Operation

C-STORE

Failure

A7xx

Refused: Out of Resources

(0000,0902)

A9xx

Error: Data Set does not match SOP Class

(0000,0901) (0000,0902)

Cxxx

Error: Cannot understand

(0000,0901) (0000,0902)

0112

Failed: SOP Class Not Supported

0210

Duplicate Invocation

0117

Invalid Object Instance

0212

Mistyped argument

0211

Unrecognized Operation

0124

Refused: Not Authorized

Warning

B000

Coercion of Data Elements

(0000,0901) (0000,0902)

B007

Data Set does not match SOP Class

(0000,0901) (0000,0902)

B006

Elements Discarded

(0000,0901) (0000,0902)

Success

0000

Success

C-FIND

Failure

A700

Refused: Out of Resources

(0000,0902)

A900

Error: Data Set does not match SOP Class

(0000,0901) (0000,0902)

Cxxx

Failed: Unable to process

(0000,0901) (0000,0902)

0112

Failed: SOP Class Not Supported

Cancel

FE00

Matching terminated due to Cancel request

Success

0000

Matching is complete - No final Identifier is supplied.

Pending

FF00

Matches are continuing - Current Match is supplied and any Optional Keys were supported in the same manner as Required Keys.

FF01

Matches are continuing - Warning that one or more Optional Keys were not supported for existence and/or matching for this Identifier.

C-GET

Failure

Cancel

Warning

A701

Refused: Out of Resources - Unable to calculate number of matches

(0000,0902)

A702

Refused: Out of Resources - Unable to perform sub-operations

(0000,1021) (0000,1022) (0000,1023)

A900

Error: Data Set does not match SOP Class

(0000,0901) (0000,0902)

Cxxx

Failed: Unable to process

(0000,0901) (0000,0902)

0112

Failed: SOP Class Not Supported

0210

Duplicate Invocation

0212

Mistyped argument

0211

Unrecognized Operation

0124

Refused: Not Authorized

FE00

Cancel Sub-operations terminated due to Cancel Indication

(0000,1020) (0000,1021) (0000,1022) (0000,1023)

B000

Sub-operations Complete - One or more Failures or Warnings

(0000,1021) (0000,1022) (0000,1023)

Success

0000

Sub-operations Complete - No Failures or Warnings

(0000,1021) (0000,1022) (0000,1023)

Pending

FF00

Sub-operations are continuing

(0000,1020) (0000,1021) (0000,1022) (0000,1023)

C-MOVE

Failure

A701

Refused: Out of Resources - Unable to calculate number of matches

(0000,0902)

A702

Refused: Out of Resources - Unable to perform sub-operations

(0000,1020) (0000,1021) (0000,1022) (0000,1023)

A801

Refused: Move Destination unknown

(0000,0902)

A900

Error: Data Set does not match SOP Class

(0000,0901) (0000,0902)

Cxxx

Failed: Unable to process

(0000,0901) (0000,0902)

AA00

Failed: None of the frames requested were found in the SOP Instance

(0000,0902)

AA01

Failed: Unable to create new object for this SOP class

(0000,0902)

AA02

Failed: Unable to extract frames

(0000,0902)

AA03

Failed: Time-based request received for a non-time-based original SOP Instance.

(0000,0902)

AA04

Failed: Invalid Request

(0000,0901) (0000,0902)

0112

Failed: SOP Class Not Supported

0210

Duplicate Invocation

0212

Mistyped argument

0211

Unrecognized Operation

0124

Refused: Not Authorized

Cancel

FE00

Sub-operations terminated due to Cancel Indication

(0000,1020) (0000,1021) (0000,1022) (0000,1023)

Warning

B000

Sub-operations Complete - One or more Failures or Warnings

(0000,1020) (0000,1021) (0000,1022) (0000,1023)

Success

0000

Sub-operations Complete - No Failures or Warnings

(0000,1020) (0000,1021) (0000,1022) (0000,1023)

Pending

FF00

Sub-operations are continuing

(0000,1020) (0000,1021) (0000,1022) (0000,1023)

N-EVENT-REPORT

Failure

0119

Class-Instance Conflict

0210

Duplicate Invocation

(0000,0110)

0115

Invalid Argument Value

0117

Invalid Object Instance

0212

Mistyped Argument

0114

No Such Argument

0113

No Such Event Type

0118

No Such SOP Class

0112

No Such SOP Instance

0110

Processing Failure

0213

Resource Limitation

0211

Unrecognized Operation

N-ACTION

Failure

0119

Class-Instance Conflict

0210

Duplicate Invocation

(0000,0110)

0115

Invalid Argument Value

0117

Invalid Object Instance

0212

Mistyped Argument

0123

No Such Action

0114

No Such Argument

0118

No Such SOP Class

0112

No Such SOP Instance

0110

Processing Failure

0213

Resource Limitation

0211

Unrecognized Operation

0124

Refused: Not Authorized

N-GET

Failure

0107

Attribute List Error

0119

Class-Instance Conflict

0210

Duplicate Invocation

0117

Invalid Object Instance

0212

Mistyped Argument

0118

No Such SOP Class

0112

No Such SOP Instance

0110

Processing Failure

0213

Resource Limitation

0211

Unrecognized Operation

0124

Refused: Not Authorized

N-SET

Failure

0119

Class-Instance Conflict

0210

Duplicate Invocation

0106

Invalid Attribute Value

0116

Attribute Value Out Of Range

0212

Mistyped Argument

0117

Invalid Object Instance

0121

Missing Attribute Value

0105

No Such Attribute

0107

Attribute List Error

0118

No Such SOP Class

0112

No Such SOP Instance

0110

Processing Failure

0213

Resource Limitation

0211

Unrecognized Operation

0124

Refused: Not Authorized

N-CREATE

Failure

0210

Duplicate Invocation

0111

Duplicate SOP Instance

0106

Invalid Attribute Value

0116

Attribute Value Out Of Range

0117

Invalid Object Instance

0120

Missing Attribute

0121

Missing Attribute Value

0212

Mistyped Argument

0105

No Such Attribute

0107

Attribute List Error

0118

No Such SOP Class

0110

Processing Failure

0213

Resource Limitation

0211

Unrecognized Operation

0124

Refused: Not Authorized

N-DELETE

Failure

0119

Class-Instance Conflict

0210

Duplicate Invocation

0117

Invalid Object Instance

0212

Mistyped Argument

0118

No Such SOP Class

0112

No Such SOP Instance

0110

Processing Failure

0213

Resource Limitation

0211

Unrecognized Operation

0124

Refused: Not Authorized

New status codes can be created using statuses.Status class:

SUCCESS = Status(0x0000)

statuses.Status class also takes an optional argument command to create status depending on the command. This class is a convenience wrapper around integer, that provides information on status type (Failure, Success, Warning or Pending) and status description. If status code is unknown to the library it assumes it’s a failure with unspecified description.

You can add new statuses by using statuses.add_status function. By using it you will be adding new known status code to the global library dictionary of status codes.

pynetdicom2.statuses.add_status(code: int, code_type: Literal['Success', 'Pending', 'Failure', 'Warning', 'Cancel'], description: str, end: int | None = None, command: Type[DIMSEMessage] | None = None) None

Adds new status code to the global library dictionary of known statuses

Parameters:
  • code – status code or starting value for a range of statuses if end is provided

  • code_type – code type (either Success, Warning, Pending, Cancel or Failure)

  • description – status description

  • end – optional argument that specifies end value for a range of statuses

  • command – DIMSE command, if this status is command/service specific

class pynetdicom2.statuses.Status(value: int, command: Type[DIMSEMessage] | None = None)

Class represents message status.

This is a helper class that provides convenience methods for printing status codes.

pynetdicom2.statuses.register_statuses() None

Registers known statuses in the global library dictionary

pynetdicom2.statuses.SUCCESS = Status(0x0)

(0x0000) Success

pynetdicom2.statuses.PROCESSING_FAILURE = Status(0x110)

(0x0110) Processing Failure

pynetdicom2.statuses.SOP_CLASS_NOT_SUPPORTED = Status(0x122)

(0x0122) Refused: SOP Class Not Supported

pynetdicom2.statuses.C_STORE_CANNOT_UNDERSTAND = Status(0xC000)

(0xC000) Error: Cannot understand (C-STORE)

pynetdicom2.statuses.C_STORE_CANNON_UNDERSTAND = Status(0xC000)

Deprecated misspelled alias of C_STORE_CANNOT_UNDERSTAND. Kept for backwards compatibility; use C_STORE_CANNOT_UNDERSTAND instead.

pynetdicom2.statuses.C_STORE_OUT_OF_RESOURCES = Status(0xA700)

(0xA700) Refused: Out of Resources (C-STORE)

pynetdicom2.statuses.C_STORE_ELEMENTS_DISCARDED = Status(0xB006)

(0xB006) Elements Discarded (C-STORE)

pynetdicom2.statuses.C_FIND_PENDING = Status(0xFF00)

(0xFF00) Matches are continuing - Current Match is supplied and any Optional Keys were supported in the same manner as Required Keys. (C-FIND)

pynetdicom2.statuses.C_FIND_PENDING_WARNING = Status(0xFF01)

(0xFF01) Matches are continuing - Warning that one or more Optional Keys were not supported for existence and/or matching for this Identifier. (C-FIND)

pynetdicom2.statuses.C_FIND_UNABLE_TO_PROCESS = Status(0xC000)

(0xC000) Failed: Unable to process (C-FIND)

pynetdicom2.statuses.C_FIND_OUT_OF_RESOURCES = Status(0xA700)

(0xA700) Refused: Out of Resources (C-FIND)

pynetdicom2.statuses.C_FIND_CANCEL = Status(0xFE00)

(0xFE00) Matching terminated due to Cancel request (C-FIND)

pynetdicom2.statuses.C_GET_PENDING = Status(0xFF00)

(0xFF00) Sub-operations are continuing (C-GET)

pynetdicom2.statuses.C_GET_WARNING = Status(0xB000)

(0xB000) Sub-operations Complete - One or more Failures or Warnings (C-GET)

pynetdicom2.statuses.C_GET_UNABLE_TO_PROCESS = Status(0xC000)

(0xC000) Failed: Unable to process (C-GET)

pynetdicom2.statuses.C_GET_CANCEL = Status(0xFE00)

(0xFE00) Sub-operations terminated due to Cancel Indication (C-GET)

pynetdicom2.statuses.C_MOVE_PENDING = Status(0xFF00)

(0xFF00) Sub-operations are continuing (C-MOVE)

pynetdicom2.statuses.C_MOVE_WARNING = Status(0xB000)

(0xB000) Sub-operations Complete - One or more Failures or Warnings (C-MOVE)

pynetdicom2.statuses.C_MOVE_UNABLE_TO_PROCESS = Status(0xC000)

(0xC000) Failed: Unable to process (C-MOVE)

pynetdicom2.statuses.C_MOVE_DESTINATION_UNKNOWN = Status(0xA801)

(0xA801) Refused: Move Destination unknown

pynetdicom2.statuses.C_MOVE_CANCEL = Status(0xFE00)

(0xFE00) Sub-operations terminated due to Cancel Indication (C-MOVE)