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

Documentation for handlers bound to evt.EVT_N_SET.

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



Supported Service Classes


0x0000 - Success
0x0105 - No such attribute
0x0106 - Invalid attribute value
0x0110 - Processing failure
0x0112 - SOP Instance not recognised
0x0116 - Attribute value out of range
0x0117 - Invalid object instance
0x0118 - No such SOP Class
0x0119 - Class-Instance conflict
0x0121 - Missing attribute value
0x0124 - Refused: not authorised
0x0210 - Duplicate invocation
0x0211 - Unrecognised operation
0x0212 - Mistyped argument
0x0213 - Resource limitation
0xC112 - Applicable Machine Verification Instance not found
0xC224 - Reference Beam Number not found within the referenced Fraction Group
0xC225 - Referenced device or accessory not supported
0xC226 - Referenced device or accessory not found with the referenced beam
0xC300 - The UPS may no longer be updated
0xC301 - The correct Transaction UID was not provided
0xC307 - Specified SOP Instance UID does not exist or is not a UPS Instance managed by this SCP
0xC310 - The UPS is not in the ‘IN PROGRESS’ state
0xC603 - Image size is larger than image box size
0xC605 - Insufficient memory in printer to store the image
0xC613 - Combined Print Image size is larger than the Image Box size
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
0x0001 - Requested optional attributes are not supported
0xB305 - Coerced invalid values to valid values
0xB600 - Memory allocation not supported
0xB604 - Image size larger than image box size, the image has been demagnified
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
0xB609 - Image size is larger than the Image Box. The Image has been cropped to fit
0xB60A - Image size or Combined Print Image size is larger than the Image Box size. The Image or Combined Print Image has been decimated to fit
  • event (events.Event) –

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

    Event properties are:

    • message_id: the N-SET request’s Message ID as int.

    • modification_list: the decoded Dataset contained within the N-SET request’s Modification 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.

  • 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.


  • status (pydicom.dataset.Dataset or int) – The status returned to the peer AE in the N-SET response. Must be a valid N-SET 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.


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