.. _qr_sops: Query/Retrieve Service Class ============================ The `Query/Retrieve Service Class `_ defines a service that facilitates querying and retrieval of stored Instances. Supported SOP Classes --------------------- .. _qr_find_sops: Query/Retrieve (Find) SOP Classes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-----------------------------+---------------------------------------------------+ | UID | SOP Class | +=============================+===================================================+ | 1.2.840.10008.5.1.4.1.2.1.1 | PatientRootQueryRetrieveInformationModelFind | +-----------------------------+---------------------------------------------------+ | 1.2.840.10008.5.1.4.1.2.2.1 | StudyRootQueryRetrieveInformationModelFind | +-----------------------------+---------------------------------------------------+ | 1.2.840.10008.5.1.4.1.2.3.1 | PatientStudyOnlyQueryRetrieveInformationModelFind | +-----------------------------+---------------------------------------------------+ .. _qr_move_sops: Query/Retrieve (Move) SOP Classes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-----------------------------+---------------------------------------------------+ | UID | SOP Class | +=============================+===================================================+ | 1.2.840.10008.5.1.4.1.2.1.2 | PatientRootQueryRetrieveInformationModelMove | +-----------------------------+---------------------------------------------------+ | 1.2.840.10008.5.1.4.1.2.2.2 | StudyRootQueryRetrieveInformationModelMove | +-----------------------------+---------------------------------------------------+ | 1.2.840.10008.5.1.4.1.2.3.2 | PatientStudyOnlyQueryRetrieveInformationModelMove | +-----------------------------+---------------------------------------------------+ | 1.2.840.10008.5.1.4.1.2.4.2 | CompositeInstanceRootRetrieveMove | +-----------------------------+---------------------------------------------------+ .. _qr_get_sops: Query/Retrieve (Get) SOP Classes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-----------------------------+---------------------------------------------------+ | UID | SOP Class | +=============================+===================================================+ | 1.2.840.10008.5.1.4.1.2.1.3 | PatientRootQueryRetrieveInformationModelGet | +-----------------------------+---------------------------------------------------+ | 1.2.840.10008.5.1.4.1.2.2.3 | StudyRootQueryRetrieveInformationModelGet | +-----------------------------+---------------------------------------------------+ | 1.2.840.10008.5.1.4.1.2.3.3 | PatientStudyOnlyQueryRetrieveInformationModelGet | +-----------------------------+---------------------------------------------------+ | 1.2.840.10008.5.1.4.1.2.5.3 | CompositeInstanceRetrieveWithoutBulkDataGet | +-----------------------------+---------------------------------------------------+ | 1.2.840.10008.5.1.4.1.2.4.3 | CompositeInstanceRootRetrieveGet | +-----------------------------+---------------------------------------------------+ .. _qr_statuses: Statuses -------- .. _qr_find_statuses: C-FIND Statuses ~~~~~~~~~~~~~~~~ +------------+----------+----------------------------------+ | Code (hex) | Category | Description | +============+==========+==================================+ | 0x0000 | Success | Success | +------------+----------+----------------------------------+ | 0x0122 | Failure | SOP Class not supported | +------------+----------+----------------------------------+ | 0xFE00 | Cancel | Processing has been terminated | +------------+----------+----------------------------------+ Query/Retrieve (Find) Service Statuses ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------+----------+----------------------------------------------+ | Code (hex) | Category | Description | +==================+==========+==============================================+ | 0xA700 | Failure | Out of resources | +------------------+----------+----------------------------------------------+ | 0xA900 | Failure | Dataset does not match SOP Class | +------------------+----------+----------------------------------------------+ | 0xC000 to 0xCFFF | Failure | Unable to process | +------------------+----------+----------------------------------------------+ | 0xFF00 | Pending | Matches are continuing | +------------------+----------+----------------------------------------------+ | 0xFF01 | Pending | Matches are continuing; one or more Optional | | | | keys was not supported | +------------------+----------+----------------------------------------------+ pynetdicom Query/Retrieve (Find) Statuses ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When pynetdicom is acting as a Query/Retrieve (Find) SCP it uses the following status codes values to indicate the corresponding issue has occurred to help aid in debugging. +------------------+----------+-----------------------------------------------+ | Code (hex) | Category | Description | +==================+==========+===============================================+ | 0xC001 | Failure | User's callback implementation returned a | | | | status Dataset with no (0000,0900) *Status* | | | | element | +------------------+----------+-----------------------------------------------+ | 0xC002 | Failure | User's callback implementation returned an | | | | invalid status object (not a pydicom Dataset | | | | or an int) | +------------------+----------+-----------------------------------------------+ | 0xC310 | Failure | Failed to decode the dataset received from | | | | the peer | +------------------+----------+-----------------------------------------------+ | 0xC311 | Failure | Unhandled exception raised by the user's | | | | implementation of the ``on_c_find`` callback | +------------------+----------+-----------------------------------------------+ | 0xC312 | Failure | Failed to encode the dataset received from | | | | the user's implementation of the ``on_c_find``| | | | callback | +------------------+----------+-----------------------------------------------+ .. _qr_get_statuses: C-GET Statuses ~~~~~~~~~~~~~~ +------------+----------+----------------------------------+ | Code (hex) | Category | Description | +============+==========+==================================+ | 0x0000 | Success | Success | +------------+----------+----------------------------------+ | 0x0122 | Failure | SOP Class not supported | +------------+----------+----------------------------------+ | 0x0124 | Failure | Not authorised | +------------+----------+----------------------------------+ | 0x0210 | Failure | Duplicate invocation | +------------+----------+----------------------------------+ | 0x0212 | Failure | Mistyped argument | +------------+----------+----------------------------------+ | 0xFE00 | Cancel | Sub-operations terminated | +------------+----------+----------------------------------+ Query/Retrieve (Get) Service Statuses ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------+----------+----------------------------------------------+ | Code (hex) | Category | Description | +==================+==========+==============================================+ | 0xA701 | Failure | Out of resources; unable to calculate number | | | | of matches | +------------------+----------+----------------------------------------------+ | 0xA702 | Failure | Out of resources; unable to perform | | | | sub-operations | +------------------+----------+----------------------------------------------+ | 0xA900 | Failure | Dataset does not match SOP Class | +------------------+----------+----------------------------------------------+ | 0xAA00 | Failure | None of the frames requested were found in | | | | the SOP Instance | +------------------+----------+----------------------------------------------+ | 0xAA01 | Failure | Unable to create new object for this SOP | | | | class | +------------------+----------+----------------------------------------------+ | 0xAA02 | Failure | Unable to extract frames | +------------------+----------+----------------------------------------------+ | 0xAA03 | Failure | Time-based request received for a | | | | non-time-based original SOP Instance | +------------------+----------+----------------------------------------------+ | 0xAA04 | Failure | Invalid request | +------------------+----------+----------------------------------------------+ | 0xB000 | Warning | Sub-operations complete, one or more | | | | or warnings | +------------------+----------+----------------------------------------------+ | 0xC000 to 0xCFFF | Failure | Unable to process | +------------------+----------+----------------------------------------------+ | 0xFF00 | Pending | Sub-operations are continuing | +------------------+----------+----------------------------------------------+ pynetdicom Query/Retrieve (Get) Statuses ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------+----------+-----------------------------------------------+ | Code (hex) | Category | Description | +==================+==========+===============================================+ | 0xC001 | Failure | User's callback implementation returned a | | | | status Dataset with no (0000,0900) *Status* | | | | element | +------------------+----------+-----------------------------------------------+ | 0xC002 | Failure | User's callback implementation returned an | | | | invalid status object (not a pydicom Dataset | | | | or an int) | +------------------+----------+-----------------------------------------------+ | 0xC410 | Failure | Failed to decode the dataset received from | | | | the peer | +------------------+----------+-----------------------------------------------+ | 0xC411 | Failure | Unhandled exception raised by the user's | | | | implementation of the ``on_c_get`` callback | +------------------+----------+-----------------------------------------------+ | 0xC413 | Failure | The user's implementation oc the ``on_c_get`` | | | | callback yielded an invalid number of | | | | sub-operations | +------------------+----------+-----------------------------------------------+ .. _qr_move_statuses: C-MOVE Statuses ~~~~~~~~~~~~~~~ +------------+----------+----------------------------------+ | Code (hex) | Category | Description | +============+==========+==================================+ | 0x0000 | Success | Success | +------------+----------+----------------------------------+ | 0x0122 | Failure | SOP Class not supported | +------------+----------+----------------------------------+ | 0x0124 | Failure | Not authorised | +------------+----------+----------------------------------+ | 0x0210 | Failure | Duplicate invocation | +------------+----------+----------------------------------+ | 0x0211 | Failure | Unrecognised operation | +------------+----------+----------------------------------+ | 0x0212 | Failure | Mistyped argument | +------------+----------+----------------------------------+ | 0xFE00 | Cancel | Sub-operations terminated | +------------+----------+----------------------------------+ Query/Retrieve (Move) Service Statuses ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------+----------+----------------------------------------------+ | Code (hex) | Category | Description | +==================+==========+==============================================+ | 0xA701 | Failure | Out of resources; unable to calculate number | | | | of matches | +------------------+----------+----------------------------------------------+ | 0xA702 | Failure | Out of resources; unable to perform | | | | sub-operations | +------------------+----------+----------------------------------------------+ | 0xA801 | Failure | Move destination unknown | +------------------+----------+----------------------------------------------+ | 0xA900 | Failure | Dataset does not match SOP Class | +------------------+----------+----------------------------------------------+ | 0xAA00 | Failure | None of the frames requested were found in | | | | the SOP Instance | +------------------+----------+----------------------------------------------+ | 0xAA01 | Failure | Unable to create new object for this SOP | | | | class | +------------------+----------+----------------------------------------------+ | 0xAA02 | Failure | Unable to extract frames | +------------------+----------+----------------------------------------------+ | 0xAA03 | Failure | Time-based request received for a | | | | non-time-based original SOP Instance | +------------------+----------+----------------------------------------------+ | 0xAA04 | Failure | Invalid request | +------------------+----------+----------------------------------------------+ | 0xB000 | Warning | Sub-operations complete, one or more | | | | or warnings | +------------------+----------+----------------------------------------------+ | 0xC000 to 0xCFFF | Failure | Unable to process | +------------------+----------+----------------------------------------------+ | 0xFF00 | Pending | Sub-operations are continuing | +------------------+----------+----------------------------------------------+ pynetdicom Query/Retrieve (Move) Statuses ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------+----------+-----------------------------------------------+ | Code (hex) | Category | Description | +==================+==========+===============================================+ | 0xC001 | Failure | User's callback implementation returned a | | | | status Dataset with no (0000,0900) *Status* | | | | element | +------------------+----------+-----------------------------------------------+ | 0xC002 | Failure | User's callback implementation returned an | | | | invalid status object (not a pydicom Dataset | | | | or an int) | +------------------+----------+-----------------------------------------------+ | 0xC510 | Failure | Failed to decode the dataset received from | | | | the peer | +------------------+----------+-----------------------------------------------+ | 0xC511 | Failure | Unhandled exception raised by the user's | | | | implementation of the ``on_c_get`` callback | +------------------+----------+-----------------------------------------------+ | 0xC513 | Failure | The user's implementation oc the ``on_c_move``| | | | callback yielded an invalid number of | | | | sub-operations | +------------------+----------+-----------------------------------------------+ | 0xC514 | Failure | The user's implementation oc the ``on_c_move``| | | | callback failed to yield the (address, port) | | | | and/or the number of sub-operations | +------------------+----------+-----------------------------------------------+ | 0xC515 | Failure | The user's implementation oc the ``on_c_move``| | | | callback failed to yield a valid (address, | | | | port) pair | +------------------+----------+-----------------------------------------------+ References ---------- * DICOM Standard, Part 4, `Annex C `_ * DICOM Standard, Part 4, `Annex Y `_ * DICOM Standard, Part 7, Sections `9.1.2.1.5 `_, `9.1.3.1.6 `_ and `9.1.4.1.7 `_