pynetdicom._handlers.doc_handle_move¶
-
pynetdicom._handlers.
doc_handle_move
(event)¶ Documentation for handlers bound to
evt.EVT_C_MOVE
.User implementation of this event handler is required if one or more services that use C-MOVE are to be supported. If a handler is not implemented and bound to
evt.EVT_C_MOVE
then the C-MOVE request will be responded to using a Status value of0xC511
- Failure.The first yield should be the
(addr, port)
of the move destination, the second yield the number of required C-STORE sub-operations as anint
, and the remaining yields the(status, dataset)
pairs.Matching SOP Instances will be sent to the peer AE with AE title
move_aet
over a new association. Ifmove_aet
is unknown then the SCP will send a response with a ‘Failure’ status of0xA801
‘Move Destination Unknown’.Event
evt.EVT_C_MOVE
Supported Service Classes
- Query/Retrieve Service
- Hanging Protocol Query/Retrieve Service
- Defined Procedure Protocol Query/Retrieve Service
- Color Palette Query/Retrieve Service
- Implant Template Query/Retrieve Service
Status
- Success
0x0000
- Sub-operations complete, no failures- Pending
0xFF00
- Sub-operations are continuing- Cancel
0xFE00
- Sub-operations terminated due to Cancel indication- Failure
0x0122
- SOP class not supported0x0124
- Not authorised0x0210
- Duplicate invocation0x0211
- Unrecognised operation0x0212
- Mistyped argument0xA701
- Out of resources: unable to calculate number of matches0xA702
- Out of resources: unable to perform sub-operations0xA801
- Move destination unknown0xA900
- Identifier does not match SOP class0xAA00
- None of the frames requested were found in the SOP instance0xAA01
- Unable to create new object for this SOP class0xAA02
- Unable to extract frames0xAA03
- Time-based request received for a non-time-based original SOP Instance0xAA04
- Invalid request0xC000
to0xCFFF
- Unable to process
Parameters: event (events.Event) –
The event representing a service class receiving a C-MOVE request message.
Event
attributes are:assoc
: theassociation
that is running the service that received the C-MOVE request.context
: the presentation context the request was sent under as apresentation.PresentationContextTuple
.event
: the event that occurred asnamedtuple
.move_destination
: the C-MOVE request’s Move Destination value asbytes
.request
: the receivedC-MOVE request
timestamp
: the date and time that the C-MOVE request was processed by the service.
Event
properties are:identifier
: the decodedDataset
contained within the C-MOVE request’s Identifier parameter. Because pydicom uses a deferred read when decoding data, if the decode fails the returnedDataset
will only raise an exception at the time of use.is_cancelled
: returnsTrue
if a C-CANCEL request has been received, False otherwise. If a C-CANCEL is received then the handler should yield a(0xFE00, None)
status/dataset pair and return.
Yields: addr, port (str, int or None, None) – The first yield should be the TCP/IP address and port number of the destination AE (if known) or
(None, None)
if unknown. If(None, None)
is yielded then the SCP will send a C-MOVE response with a ‘Failure’ Status of0xA801
(move destination unknown), in which case nothing more needs to be yielded.int – The second yield should be the number of C-STORE sub-operations required to complete the C-MOVE operation. In other words, this is the number of matching SOP Instances to be sent to the peer.
status (pydiom.dataset.Dataset or int) – The status returned to the peer AE in the C-MOVE response. Must be a valid C-MOVE status value for the applicable Service Class as either an
int
or aDataset
containing (at a minimum) a (0000,0900) Status element. If returning aDataset
then it may also contain optional elements related to the Status (as in DICOM Standard Part 7, Annex C).dataset (pydicom.dataset.Dataset or None) – If the status is ‘Pending’ then yield the
Dataset
to send to the peer via a C-STORE sub-operation over a new association.If the status is ‘Failed’, ‘Warning’ or ‘Cancel’ then yield a
Dataset
with a (0008,0058) Failed SOP Instance UID List element containing the list of the C-STORE sub-operation SOP Instance UIDs for which the C-MOVE operation has failed.If the status is ‘Success’ then yield
None
, although yielding a final ‘Success’ status is not required and will be ignored if necessary.
See also
send_c_move()
C_MOVE
QueryRetrieveServiceClass
HangingProtocolQueryRetrieveServiceClass
DefinedProcedureProtocolQueryRetrieveServiceClass
ColorPaletteQueryRetrieveServiceClass
ImplantTemplateQueryRetrieveServiceClass
References