pynetdicom._handlers.doc_handle_c_get¶
- 
pynetdicom._handlers.doc_handle_c_get(event, *args)[source]¶
- Documentation for handlers bound to - evt.EVT_C_GET.- User implementation of this event handler is required if one or more services that use C-GET are to be supported. If a handler is not implemented and bound to - evt.EVT_C_GETthen the C-GET request will be responded to using a Status value of- 0xC411- Failure.- Yields an - intcontaining the total number of C-STORE sub-operations, then yields- (status, dataset)pairs.- Event - evt.EVT_C_GET- Supported Service Classes - Status - Success
- 0x0000- Sub-operations complete, no failures or warnings
- Failure
- 0xA701- Out of resources: unable to calculate the number of matches- 0xA702- Out of resources: unable to perform sub-operations- 0xA900- Identifier does not match SOP class- 0xAA00- None of the frames requested were found in the SOP instance- 0xAA01- Unable to create new object for this SOP class- 0xAA02- Unable to extract frames- 0xAA03- Time-based request received for a non-time-based original SOP Instance- 0xAA04- Invalid request- 0xC000to- 0xCFFF- Unable to process
- Cancel
- 0xFE00- Sub-operations terminated due to Cancel request
- Warning
- 0xB000- Sub-operations complete, one or more failures or warnings
- Pending
- 0xFF00- Matches are continuing - Current Match is supplied and any Optional Keys were supported in the same manner as Required Keys
 - Parameters
- event (events.Event) – - The event representing a service class receiving a C-GET request message. - Eventattributes are:- assoc: the- Associationthat is running the service that received the C-GET request.
- context: the presentation context the request was sent under as a- PresentationContextTuple.
- event: the event that occurred as- InterventionEvent.
- request: the received- C-GET request
- timestamp: the date and time that the C-GET request was processed by the service as- datetime.datetime.
 - Eventproperties are:- identifier: the decoded- Datasetcontained within the C-GET request’s Identifier parameter. Because pydicom uses a deferred read when decoding data, if the decode fails the returned- Datasetwill only raise an exception at the time of use.
- is_cancelled: returns- Trueif a C-CANCEL request has been received,- Falseotherwise. If a C-CANCEL is received then the handler should- yield (0xFE00, None)and- return.
- message_id: the C-GET request’s Message ID as- int.
 
- args – If the handler was bound to the event using - bind(event, handler, args)or by passing- evt_handlers=[(event, handler, args), ...], where args is a- listthen there will be one or more optional extra parameters matching the contents of args.
 
- Yields
- int – The first yielded value should be the total number of C-STORE sub-operations necessary to complete the C-GET operation. In other words, this is the number of matching SOP Instances to be sent to the peer. 
- status (pydicom.dataset.Dataset or int) – The status returned to the peer AE in the C-GET response. Must be a valid C-GET status value for the applicable Service Class as either an - intor a- Datasetobject containing (at a minimum) a (0000,0900) Status element. If returning a- Datasetobject 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 category is ‘Pending’ then yield the - Datasetto send to the peer via a C-STORE sub-operation over the current association.- If the status category is ‘Failed’, ‘Warning’ or ‘Cancel’ then yield a - Datasetwith a (0008,0058) Failed SOP Instance UID List element containing a list of the C-STORE sub-operation SOP Instance UIDs for which the C-GET operation has failed.- If the status category is ‘Success’ then yield - None, although yielding a final ‘Success’ status is not required and will be ignored if necessary.
 
 - See also - send_c_get(),- C_GET,- QueryRetrieveServiceClass,- HangingProtocolQueryRetrieveServiceClass,- DefinedProcedureProtocolQueryRetrieveServiceClass,- ColorPaletteQueryRetrieveServiceClass,- ImplantTemplateQueryRetrieveServiceClass,- ProtocolApprovalQueryRetrieveServiceClass- References