pynetdicom._handlers.doc_handle_create

pynetdicom._handlers.doc_handle_create(event: Event, *args: Sequence[Any]) Tuple[Union[Dataset, int], Optional[Dataset]][source]

Documentation for handlers bound to evt.EVT_N_CREATE.

User implementation of this event handler is required if one or more services that use N-CREATE are to be supported. If a handler is not implemented and bound to evt.EVT_N_CREATE then the N-CREATE request will be responded to using a Status value of 0x0110 - Processing Failure.

Management of the SOP Instances created in response to an N-CREATE request is the responsibility of the user.

Event

evt.EVT_N_CREATE

Supported Service Classes

Status

Success
0x0000 - Success
Failure
0x0105 - No such attribute
0x0106 - Invalid attribute value
0x0107 - Attribute list error
0x0110 - Processing failure
0x0111 - Duplicate SOP Instance
0x0116 - Attribute value out of range
0x0117 - Invalid object instance
0x0118 - No such SOP Class
0x0120 - Missing attribute
0x0121 - Missing attribute value
0x0124 - Refused: not authorised
0x0210 - Duplicate invocation
0x0211 - Unrecognised operation
0x0212 - Mistyped argument
0x0213 - Resource limitation
0xA510 - Failed: an initiate media creation action has already been received for this SOP Instance
0xC221 - The Referenced Fraction Group Number does not exist in the referenced plan
0xC222 - No beams exist within the referenced fraction group
0xC223 - SCU already verifying and cannot currently process this request
0xC227 - No such object instance - Referenced RT Plan not found
0xC309 - The provided value of UPS State was not ‘SCHEDULED’
0xC616 - There is an existing Film Box that has not been printed and N-ACTION at the Film Session level is not supported. A new Film Box will not be created when a previous Film Box has not been printed
Warning
0xB300 - THE UPS was created with modifications
0xB600 - Memory allocation not supported
0xB605 - Requested Min Density or Max Density outside of printer’s operating range. The printer will use its respective minimum or maximum density value instead
Parameters
  • event (events.Event) –

    The event representing a service class receiving a N-CREATE request message. Event attributes are:

    Event properties are:

    • attribute_list: the decoded Dataset contained within the N-CREATE request’s Attribute List parameter. Because pydicom uses a deferred read when decoding data, if the decode fails the returned Dataset will only raise an exception at the time of use.

    • message_id: the N-CREATE 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 list then there will be one or more optional extra parameters matching the contents of args.

Returns

  • status (pydicom.dataset.Dataset or int) – The status returned to the peer AE in the N-CREATE response. Must be a valid N-CREATE status value for the applicable Service Class as either an int or a Dataset object containing (at a minimum) a (0000,0900) Status element. If returning a Dataset object 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 ‘Success’ or ‘Warning’ then a Dataset containing elements of the response’s Attribute List conformant to the specifications in the corresponding Service Class.

    If the status category is not ‘Success’ or ‘Warning’ then None.

Raises

NotImplementedError – If the handler has not been implemented and bound to evt.EVT_N_CREATE by the user.

References