pynetdicom._handlers.doc_handle_store¶
- pynetdicom._handlers.doc_handle_store(event: Event, *args: Sequence[Any]) int | Dataset [source]¶
Documentation for handlers bound to
evt.EVT_C_STORE
.User implementation of this event handler is required if one or more services that use C-STORE are to be supported. If a handler is not implemented and bound to
evt.EVT_C_STORE
then the C-STORE request will be responded to using a Status value of0xC211
- Failure.If the user is storing the dataset in the DICOM File Format then they are responsible for adding the File Meta Information.
Event
evt.EVT_C_STORE
Supported Service Classes
Status
- Success
0x0000
- Success- Warning
0xB000
- Coercion of data elements0xB006
- Elements discarded0xB007
- Dataset does not match SOP class- Failure
0x0117
- Invalid SOP instance0x0122
- SOP class not supported0x0124
- Not authorised0x0210
- Duplicate invocation0x0211
- Unrecognised operation0x0212
- Mistyped argument0xA700
to0xA7FF
- Out of resources0xA900
to0xA9FF
- Dataset does not match SOP class0xC000
to0xCFFF
- Cannot understand
- Parameters:
event (events.Event) –
The event representing a service class receiving a C-STORE request message.
Event
attributes are:assoc
: theAssociation
that is running the service that received the C-STORE request.context
: the presentation context the request was sent under as aPresentationContextTuple
.event
: the event that occurred asInterventionEvent
.request
: the receivedC-STORE request
timestamp
: the date and time that the C-STORE request was processed by the service asdatetime.datetime
.
Event
properties are:dataset
: the decodedDataset
contained within the C-STORE request’s Data Set 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.dataset_path
: whenSTORE_RECV_CHUNKED_DATASET
isTrue
, this is the path to the received dataset aspathlib.Path
.file_meta
: aDataset
containing DICOM conformant File Meta Information that can be used with the decoded dataset when saving to file:event.dataset.file_meta = event.file_meta
.message_id
: the C-STORE request’s Message ID asint
.
args – If the handler was bound to the event using
bind(event, handler, args)
or by passingevt_handlers=[(event, handler, args), ...]
, where args is alist
then there will be one or more optional extra parameters matching the contents of args.
- Returns:
status – The status returned to the requesting AE in the C-STORE response. Must be a valid C-STORE status value for the applicable Service Class as either an
int
or aDataset
object containing (at a minimum) a (0000,0900) Status element. If returning aDataset
object then it may also contain optional elements related to the Status (as in the DICOM Standard, Part 7, Annex C).- Return type:
- Raises:
NotImplementedError – If the handler has not been implemented and bound to
evt.EVT_C_STORE
by the user.
References