pynetdicom.association.Association¶
-
class
pynetdicom.association.Association(ae, mode, local_socket=None)[source][source]¶ Manage an Association with a peer AE.
-
acceptor¶ Representation of the association’s acceptor AE.
Type: association.ServiceUser
-
ae¶ The local AE.
Type: ae.ApplicationEntity
-
dimse¶ The DICOM Message Service Element provider.
Type: dimse.DIMSEServiceProvider
-
dul¶ The DICOM Upper Layer service provider.
Type: dul.DULServiceProvider
-
mode¶ The mode of the local AE, either the association ‘requestor’ or association ‘acceptor’.
Type: str
-
requestor¶ Representation of the association’s requestor AE.
Type: association.ServiceUser
-
__init__(ae, mode, local_socket=None)[source][source]¶ Create a new Association instance.
Association negotiation won’t begin until Association.start() is called.
Parameters: - ae (ae.ApplicationEntity) – The local AE.
- mode (str) – Must be “requestor” or “acceptor”.
- local_socket (socket.socket or None) – If mode is ‘acceptor’ then this is the connection to the peer, otherwise will be None.
Methods
__init__(ae, mode[, local_socket])Create a new Association instance. abort()Sends an A-ABORT to the remote AE and kills the Association. debug_association_aborted([primitive])Debugging information when an A-ABORT request received. debug_association_accepted(primitive)Debugging information when an A-ASSOCIATE accept is received. debug_association_rejected(primitive)Debugging information when an A-ASSOCIATE rejection received. debug_association_released([primitive])Debugging information when an A-RELEASE request received. debug_association_requested(primitive)Debugging information when an A-ASSOCIATE request received. getName()isAlive()Return whether the thread is alive. isDaemon()is_alive()Return whether the thread is alive. join([timeout])Wait until the thread terminates. kill()Kill the main association thread loop. release()Send an A-RELEASE request to the peer. run()The main Association control. send_c_echo([msg_id])Send a C-ECHO request to the peer AE. send_c_find(dataset[, msg_id, priority, …])Send a C-FIND request to the peer AE. send_c_get(dataset[, msg_id, priority, …])Send a C-GET request to the peer AE. send_c_move(dataset, move_aet[, msg_id, …])Send a C-MOVE request to the peer AE. send_c_store(dataset[, msg_id, priority, …])Send a C-STORE request to the peer AE. send_n_action(dataset, action_type, …[, …])Send an N-ACTION request message to the peer AE. send_n_create(dataset, class_uid, instance_uid)Send an N-CREATE request message to the peer AE. send_n_delete(class_uid, instance_uid[, msg_id])Send an N-DELETE request message to the peer AE. send_n_event_report(dataset, event_type, …)Send an N-EVENT-REPORT request message to the peer AE. send_n_get(identifier_list, class_uid, …)Send an N-GET request message to the peer AE. send_n_set(dataset, class_uid, instance_uid)Send an N-SET request message to the peer AE. setDaemon(daemonic)setName(name)start()Start the thread’s activity. Attributes
accepted_contextsReturn a list of accepted Presentation Contexts. aeReturn the Association’s parent ApplicationEntity. daemonA boolean value indicating whether this thread is a daemon thread. identThread identifier of this thread or None if it has not been started. is_acceptorReturn True if the local AE is the association acceptor. is_requestorReturn True if the local AE is the association requestor. localReturn a dict with information about the local AE. modeReturn the Association’s mode as a str. nameA string used for identification purposes only. rejected_contextsReturn a list of rejected Presentation Contexts. remoteReturn a dict with information about the peer AE. -
accepted_contexts¶ Return a list of accepted Presentation Contexts.
-
ae Return the Association’s parent ApplicationEntity.
-
daemon¶ A boolean value indicating whether this thread is a daemon thread.
This must be set before start() is called, otherwise RuntimeError is raised. Its initial value is inherited from the creating thread; the main thread is not a daemon thread and therefore all threads created in the main thread default to daemon = False.
The entire Python program exits when no alive non-daemon threads are left.
-
static
debug_association_aborted(primitive=None)[source][source]¶ Debugging information when an A-ABORT request received.
Parameters: assoc_primitive (pynetdicom.pdu_primitives.A_ABORT) – The A-ABORT (RQ) primitive received from the DICOM Upper Layer
-
static
debug_association_accepted(primitive)[source][source]¶ Debugging information when an A-ASSOCIATE accept is received.
Parameters: primitive (pynetdicom.pdu_primitives.A_ASSOCIATE) – The A-ASSOCIATE (AC) PDU received from the DICOM Upper Layer
-
static
debug_association_rejected(primitive)[source][source]¶ Debugging information when an A-ASSOCIATE rejection received.
Parameters: assoc_primitive (pynetdicom.pdu_primitives.A_ASSOCIATE) – The A-ASSOCIATE (RJ) primitive received from the DICOM Upper Layer
-
static
debug_association_released(primitive=None)[source][source]¶ Debugging information when an A-RELEASE request received.
Parameters: assoc_primitive (pynetdicom.pdu_primitives.A_RELEASE) – The A-RELEASE (RQ) primitive received from the DICOM Upper Layer
-
static
debug_association_requested(primitive)[source][source]¶ Debugging information when an A-ASSOCIATE request received.
Parameters: primitive (pynetdicom.pdu_primitives.A_ASSOCIATE) – The A-ASSOCIATE (RQ) PDU received from the DICOM Upper Layer
-
ident¶ Thread identifier of this thread or None if it has not been started.
This is a nonzero integer. See the get_ident() function. Thread identifiers may be recycled when a thread exits and another thread is created. The identifier is available even after the thread has exited.
-
isAlive()[source]¶ Return whether the thread is alive.
This method returns True just before the run() method starts until just after the run() method terminates. The module function enumerate() returns a list of all alive threads.
-
is_acceptor¶ Return True if the local AE is the association acceptor.
-
is_alive()[source]¶ Return whether the thread is alive.
This method returns True just before the run() method starts until just after the run() method terminates. The module function enumerate() returns a list of all alive threads.
-
is_requestor¶ Return True if the local AE is the association requestor.
-
join(timeout=None)[source]¶ Wait until the thread terminates.
This blocks the calling thread until the thread whose join() method is called terminates – either normally or through an unhandled exception or until the optional timeout occurs.
When the timeout argument is present and not None, it should be a floating point number specifying a timeout for the operation in seconds (or fractions thereof). As join() always returns None, you must call isAlive() after join() to decide whether a timeout happened – if the thread is still alive, the join() call timed out.
When the timeout argument is not present or None, the operation will block until the thread terminates.
A thread can be join()ed many times.
join() raises a RuntimeError if an attempt is made to join the current thread as that would cause a deadlock. It is also an error to join() a thread before it has been started and attempts to do so raises the same exception.
-
local¶ Return a dict with information about the local AE.
-
mode Return the Association’s mode as a str.
-
name¶ A string used for identification purposes only.
It has no semantics. Multiple threads may be given the same name. The initial name is set by the constructor.
-
rejected_contexts¶ Return a list of rejected Presentation Contexts.
-
remote¶ Return a dict with information about the peer AE.
-
send_c_echo(msg_id=1)[source][source]¶ Send a C-ECHO request to the peer AE.
Parameters: msg_id (int, optional) – The DIMSE Message ID, must be between 0 and 65535, inclusive, (default 1).
Returns: status – If the peer timed out or sent an invalid response then returns an empty
Dataset. If a valid response was received from the peer then returns aDatasetcontaining at least a (0000,0900) Status element, and, depending on the returned Status value, may optionally contain additional elements (see DICOM Standard Part 7, Annex C).The DICOM Standard Part 7, Table 9.3-13 indicates that the Status value of a C-ECHO response “shall have a value of Success”. However Section 9.1.5.1.4 indicates it may have any of the following values:
- Success
0x0000Success- Failure
0x0122SOP class not supported0x0210Duplicate invocation0x0211Unrecognised operation0x0212Mistyped argument
As the actual status depends on the peer SCP, it shouldn’t be assumed that it will be one of these.
Return type: Raises: RuntimeError– If called without an association to a peer SCP.ValueError– If the association has no accepted Presentation Context for ‘Verification SOP Class’.
See also
ae.ApplicationEntity.on_c_echo(),dimse_primitives.C_ECHO(),service_class.VerificationServiceClass()References
-
send_c_find(dataset, msg_id=1, priority=2, query_model='P')[source][source]¶ Send a C-FIND request to the peer AE.
Yields
(status, identifier)pairs.Parameters: - dataset (pydicom.dataset.Dataset) – The C-FIND request’s Identifier dataset. The exact requirements for the Identifier dataset are Service Class specific (see the DICOM Standard, Part 4).
- msg_id (int, optional) – The DIMSE Message ID, must be between 0 and 65535, inclusive, (default 1).
- priority (int, optional) –
The C-FIND operation Priority (may not be supported by the peer), one of:
0- Medium1- High2- Low (default)
- query_model (str, optional) –
The Information Model to use, one of the following:
P- Patient Root Information Model - FIND 1.2.840.10008.5.1.4.1.2.1.1 (default)S- Study Root Information Model - FIND 1.2.840.10008.5.1.4.1.2.2.1O- Patient Study Only Information Model - FIND 1.2.840.10008.5.1.4.1.2.3.1W- Modality Worklist Information - FIND 1.2.840.10008.5.1.4.31G- General Relevant Patient Information Query 1.2.840.10008.5.1.4.37.1B- Breast Imaging Relevant Patient Information Query 1.2.840.10008.5.1.4.37.2C- Cardiac Relevant Patient Information Query 1.2.840.10008.5.1.4.37.3PC- Product Characteristics Query Information Model - FIND 1.2.840.10008.5.1.4.41SA- Substance Approval Query Information Model - FIND 1.2.840.10008.5.1.4.42H- Hanging Protocol Information Model - FIND 1.2.840.10008.5.1.4.38.2D- Defined Procedure Protocol Information Model - FIND 1.2.840.10008.5.1.4.20.1CP- Color Palette Information Model - FIND 1.2.840.10008.5.1.4.39.2IG- Generic Implant Template Information Model - FIND 1.2.840.10008.5.1.4.43.2IA- Implant Assembly Template Information Model - FIND 1.2.840.10008.5.1.4.44.2IT- Implant Template Group Information Model - FIND 1.2.840.10008.5.1.4.44.2
Yields: status (pydicom.dataset.Dataset) – If the peer timed out or sent an invalid response then yields an empty
Dataset. If a response was received from the peer then yields aDatasetcontaining at least a (0000,0900) Status element, and depending on the returned value, may optionally contain additional elements (see the DICOM Standard, Part 7, Section 9.1.2.1.5 and Annex C).The status for the requested C-FIND operation should be one of the following values, but as the returned value depends on the peer this can’t be assumed:
General C-FIND (Part 7, Section 9.1.2.1.5 and Annex C)
- Cancel
0xFE00Matching terminated due to Cancel request- Success
0x0000Matching is complete: no final Identifier is supplied- Failure
0x0122SOP class not supported
Query/Retrieve Service, Basic Worklist Management Service, Hanging Protocol Query/Retrieve Service, Defined Procedure Protocol Query/Retrieve Service, Substance Administration Query Service, Color Palette Query/Retrieve Service and Implant Template Query/Retrieve Service specific (DICOM Standard Part 4, Annexes C.4.1, K.4.1.1.4, U.4.1, HH, V.4.1.1.4, X and BB):
- Failure
0xA700Out of resources0xA900Identifier does not match SOP Class0xC000to0xCFFFUnable to process- Pending
0xFF00Matches are continuing: current match is supplied and any Optional Keys were supported in the same manner as Required Keys0xFF01Matches are continuing: warning that one or more Optional Keys were not supported for existence and/or matching for this Identifier)
Relevant Patient Information Query Service specific (DICOM Standard Part 4, Annex Q.2.1.1.4):
- Failure
0xA700Out of resources0xA900Identifier does not match SOP Class0xC000Unable to process0xC100More than one match found0xC200Unable to support requested template- Pending
0xFF00Matches are continuing: current match is supplied and any Optional Keys were supported in the same manner as Required Keys
identifier (pydicom.dataset.Dataset or None) – If the status is ‘Pending’ then the C-FIND response’s Identifier
Dataset. If the status is not ‘Pending’ this will beNone. The exact contents of the response Identifier are Service Class specific (see the DICOM Standard, Part 4).
Raises: RuntimeError– Ifsend_c_findis called with no established association.ValueError– If no accepted Presentation Context for dataset exists or if unable to encode the Identifier dataset.
See also
ae.ApplicationEntity.on_c_find(),dimse_primitives.C_FIND(),service_class.QueryRetrieveFindServiceClass(),service_class.RelevantPatientInformationQueryServiceClass(),service_class.SubstanceAdministrationQueryServiceClass(),service_class.HangingProtocolQueryRetrieveServiceClass(),service_class.DefinedProcedureProtocolQueryRetrieveServiceClass(),service_class.ColorPaletteQueryRetrieveServiceClass(),service_class.ImplantTemplateQueryRetrieveServiceClass()References
-
send_c_get(dataset, msg_id=1, priority=2, query_model='P')[source][source]¶ Send a C-GET request to the peer AE.
Yields
(status, identifier)pairs.The
AE.on_c_storecallback should be implemented prior to callingsend_c_getas the peer will return any matches via a C-STORE sub-operation over the current association. In addition, SCP/SCU Role Selection Negotiation must be supported by the Association.Parameters: - dataset (pydicom.dataset.Dataset) – The C-GET request’s Identifier
Dataset. The exact requirements for the Identifier are Service Class specific (see the DICOM Standard, Part 4). - msg_id (int, optional) – The DIMSE Message ID, must be between 0 and 65535, inclusive, (default 1).
- priority (int, optional) –
The C-GET operation Priority (may not be supported by the peer), one of:
0- Medium1- High2- Low (default)
- query_model (str, optional) –
The Query/Retrieve Information Model to use, one of the following:
P- Patient Root Information Model - GET 1.2.840.10008.5.1.4.1.2.1.3 (default)S- Study Root Information Model - GET 1.2.840.10008.5.1.4.1.2.2.3O- Patient Study Only Information Model - GET 1.2.840.10008.5.1.4.1.2.3.3C- Composite Instance Root Retrieve - GET 1.2.840.10008.5.1.4.1.2.4.3CB- Composite Instance Retrieve Without Bulk Data - GET 1.2.840.10008.5.1.4.1.2.5.3H- Hanging Protocol Information Model - GET 1.2.840.10008.5.1.4.38.4D- Defined Procedure Protocol Information Model - GET 1.2.840.10008.5.1.4.20.3CP- Palette Color Information Model - GET 1.2.840.10008.5.1.4.39.4IG- Generic Implant Template Information Model - GET 1.2.840.10008.5.1.4.43.4IA- Implant Assembly Template Information Model - GET 1.2.840.10008.5.1.4.44.4IT- Implant Template Group Information Model - GET 1.2.840.10008.5.1.4.44.4
Yields: status (pydicom.dataset.Dataset) – If the peer timed out or sent an invalid response then yields an empty
Dataset. If a response was received from the peer then yields aDatasetcontaining at least a (0000,0900) Status element, and depending on the returned value may optionally contain additional elements (see DICOM Standard Part 7, Section 9.1.2.1.5 and Annex C).The status for the requested C-GET operation should be one of the following values, but as the returned value depends on the peer this can’t be assumed:
General C-GET (DICOM Standard Part 7, Section 9.1.3 and Annex C)
- Success
0x0000Sub-operations complete: no failures or warnings- Failure
0x0122SOP class not supported0x0124Not authorised0x0210Duplicate invocation0x0211Unrecognised operation0x0212Mistyped argument
Query/Retrieve Service, Hanging Protocol Query/Retrieve Service, Defined Procedure Protocol Query/Retrieve Service, Color Palette Query/Retrieve Service and Implant Template Query/Retrieve Service specific (DICOM Standard Part 4, Annexes C.4.3, Y.C.4.2.1.4, Z.4.2.1.4, U.4.3, X, BB and HH):
- Pending
0xFF00Sub-operations are continuing- Cancel
0xFE00Sub-operations terminated due to Cancel indication- Failure
0xA701Out of resources: unable to calculate number of matches0xA702Out of resources: unable to perform sub-operations0xA900Identifier does not match SOP class0xAA00None of the frames requested were found in the SOP instance0xAA01Unable to create new object for this SOP class0xAA02Unable to extract frames0xAA03Time-based request received for a non-time-based original SOP Instance0xAA04Invalid request0xC000to0xCFFFUnable to process- Warning
0xB000Sub-operations completed: one or more failures or warnings
identifier (pydicom.dataset.Dataset or None) – If the status is ‘Pending’ or ‘Success’ then yields
None. If the status is ‘Warning’, ‘Failure’ or ‘Cancel’ then yields aDatasetwhich should contain an (0008,0058) Failed SOP Instance UID List element, however this is not guaranteed and may instead return an emptyDataset.
Raises: RuntimeError– Ifsend_c_getis called with no established association.ValueError– If no accepted Presentation Context for dataset exists or if unable to encode the Identifier dataset.
See also
ae.ApplicationEntity.on_c_get(),ae.ApplicationEntity.on_c_store(),service_class.QueryRetrieveGetServiceClass(),service_class.HangingProtocolQueryRetrieveServiceClass(),service_class.DefinedProcedureProtocolQueryRetrieveServiceClass(),service_class.ColorPaletteQueryRetrieveServiceClass(),service_class.ImplantTemplateQueryRetrieveServiceClass(),dimse_primitives.C_GET()References
- dataset (pydicom.dataset.Dataset) – The C-GET request’s Identifier
-
send_c_move(dataset, move_aet, msg_id=1, priority=2, query_model='P')[source][source]¶ Send a C-MOVE request to the peer AE.
Yields
(status, identifier)pairs.The peer will attempt to start a new association with the AE with AE Title
move_aetand hence must be known to the SCP. Once the association has been established it will use the C-STORE service to send any matching datasets.Parameters: - dataset (pydicom.dataset.Dataset) – The C-MOVE request’s Identifier
Dataset. The exact requirements for the Identifier are Service Class specific (see the DICOM Standard, Part 4). - move_aet (bytes) – The AE title of the destination for the C-STORE sub-operations performed by the peer.
- msg_id (int, optional) – The DIMSE Message ID, must be between 0 and 65535, inclusive, (default 1).
- priority (int, optional) –
The C-MOVE operation Priority (if supported by the peer), one of:
0- Medium1- High2- Low (default)
- query_model (str, optional) –
The Query/Retrieve Information Model to use, one of the following:
P- Patient Root Information Model - MOVE 1.2.840.10008.5.1.4.1.2.1.2 (default)S- Study Root Information Model - MOVE 1.2.840.10008.5.1.4.1.2.2.2O- Patient Study Only Information Model - MOVE 1.2.840.10008.5.1.4.1.2.3.2C- Composite Instance Root Retrieve - MOVE 1.2.840.10008.5.1.4.1.2.4.2H- Hanging Protocol Information Model - MOVE 1.2.840.10008.5.1.4.38.3D- Defined Procedure Protocol Information Model - MOVE 1.2.840.10008.5.1.4.20.2CP- Color Palette Information Model - MOVE 1.2.840.10008.5.1.4.39.3IG- Generic Implant Template Information Model - MOVE 1.2.840.10008.5.1.4.43.3IA- Implant Assembly Template Information Model - MOVE 1.2.840.10008.5.1.4.44.3IT- Implant Template Group Information Model - MOVE 1.2.840.10008.5.1.4.44.3
Yields: status (pydicom.dataset.Dataset) – If the peer timed out or sent an invalid response then yields an empty
Dataset. If a response was received from the peer then yields aDatasetcontaining at least a (0000,0900) Status element, and depending on the returned value, may optionally contain additional elements (see DICOM Standard Part 7, Section 9.1.4 and Annex C).The status for the requested C-MOVE operation should be one of the following values, but as the returned value depends on the peer this can’t be assumed:
General C-MOVE (DICOM Standard Part 7, 9.1.4.1.7 and Annex C)
- Cancel
0xFE00Sub-operations terminated due to Cancel indication- Success
0x0000Sub-operations complete: no failures- Failure
0x0122SOP class not supported
Query/Retrieve Service, Hanging Protocol Query/Retrieve Service, Defined Procedure Protocol Query/Retrieve Service, Color Palette Query/Retrieve Service and Implant Template Query/Retreive Service specific (DICOM Standard Part 4, Annexes C, U, Y, X, BB and HH):
- Failure
0xA701Out of resources: unable to calculate number of matches0xA702Out of resources: unable to perform sub-operations0xA801Move destination unknown0xA900Identifier does not match SOP Class0xAA00None of the frames requested were found in the SOP instance0xAA01Unable to create new object for this SOP class0xAA02Unable to extract frames0xAA03Time-based request received for a non-time-based original SOP Instance0xAA04Invalid request0xC000to0xCFFFUnable to process- Pending
0xFF00Sub-operations are continuing- Warning
0xB000Sub-operations complete: one or more failures
identifier (pydicom.dataset.Dataset or None) – If the status is ‘Pending’ or ‘Success’ then yields
None. If the status is ‘Warning’, ‘Failure’ or ‘Cancel’ then yields aDatasetwhich should contain an (0008,0058) Failed SOP Instance UID List element, however this is not guaranteed and may instead return an emptyDataset.
See also
ae.ApplicationEntity.on_c_move(),ae.ApplicationEntity.on_c_store(),dimse_primitives.C_MOVE(),service_class.QueryRetrieveMoveServiceClass(),service_class.HangingProtocolQueryRetrieveServiceClass(),service_class.ColorPaletteQueryRetrieveServiceClass(),service_class.ImplantTemplateQueryRetrieveServiceClass()References
- dataset (pydicom.dataset.Dataset) – The C-MOVE request’s Identifier
-
send_c_store(dataset, msg_id=1, priority=2, originator_aet=None, originator_id=None)[source][source]¶ Send a C-STORE request to the peer AE.
Parameters: - dataset (pydicom.dataset.Dataset) – The DICOM dataset to send to the peer.
- msg_id (int, optional) – The DIMSE Message ID, must be between 0 and 65535, inclusive,
(default
1). - priority (int, optional) –
The C-STORE operation Priority (may not be supported by the peer), one of:
0- Medium1- High2- Low (default)
- originator_aet (bytes, optional) – The AE title of the peer that invoked the C-MOVE operation for
which this C-STORE sub-operation is being performed (default
None). - originator_id (int, optional) – The Message ID of the C-MOVE request primitive from which this
C-STORE sub-operation is being performed (default
None).
Returns: status – If the peer timed out or sent an invalid response then returns an empty
Dataset. If a valid response was received from the peer then returns aDatasetcontaining at least a (0000,0900) Status element, and, depending on the returned value, may optionally contain additional elements (see DICOM Standard Part 7, Annex C).The status for the requested C-STORE operation should be one of the following, but as the value depends on the peer SCP this can’t be assumed:
General C-STORE (DICOM Standard Part 7, 9.1.1.1.9 and Annex C):
- Success
0x0000Success- Failure
0x0117Invalid SOP instance0x0122SOP class not supported0x0124Not authorised0x0210Duplicate invocation0x0211Unrecognised operation0x0212Mistyped argument
Storage Service and Non-Patient Object Storage Service specific (DICOM Standard Part 4, Annexes B.2.3 and GG):
- Failure
0xA700to0xA7FFOut of resources0xA900to0xA9FFData set does not match SOP class0xC000to0xCFFFCannot understand- Warning
0xB000Coercion of data elements0xB006Element discarded0xB007Data set does not match SOP class
Non-Patient Object Service Class specific (DICOM Standard Part 4, Annex GG.4.2)
- Failure
0xA700Out of resources0xA900Data set does not match SOP class0xC000Cannot understand
Return type: Raises: RuntimeError– Ifsend_c_storeis called with no established association.AttributeError– If dataset is missing (0008,0016) SOP Class UID, (0008,0018) SOP Instance UID elements or the (0002,0010) Transfer Syntax UID file meta information element.ValueError– If no accepted Presentation Context for dataset exists or if unable to encode the dataset.
See also
ae.ApplicationEntity.on_c_store(),dimse_primitives.C_STORE(),service_class.StorageServiceClass(),service_class.NonPatientObjectStorageServiceClass()References
-
send_n_action(dataset, action_type, class_uid, instance_uid, msg_id=1)[source][source]¶ Send an N-ACTION request message to the peer AE.
Parameters: - dataset (pydicom.dataset.Dataset or None) – The dataset that will be sent as the Action Information parameter in the N-ACTION request, or None if not required.
- action_type (int) – The value of the request’s (0000,1008) Action Type ID element.
- class_uid (pydicom.uid.UID) – The UID to be sent in the request’s (0000,0003) Requested SOP Class UID element.
- instance_uid (pydicom.uid.UID) – The UID to be sent in the request’s (0000,1001) Requested SOP Instance UID element.
- msg_id (int, optional) – The DIMSE Message ID, must be between 0 and 65535, inclusive, (default 1).
Returns: status (pydicom.dataset.Dataset) – If the peer timed out or sent an invalid response then yields an empty
Dataset. If a response was received from the peer then yields aDatasetcontaining at least a (0000,0900) Status element, and depending on the returned value, may optionally contain additional elements (see the DICOM Standard, Part 7, Section 9.1.2.1.5 and Annex C).General N-ACTION (DICOM Standard Part 7, Section 10.1.4 and Annex C)
- Success
0x0000Successful operation- Failure
0x0110Processing failure0x0112No such SOP Instance0x0114No such argument0x0115Invalid argument value0x0117Invalid object instance0x0118No such SOP Class0x0119Class-Instance conflict0x0123No such action0x0124Not authorised0x0210Duplicate invocation0x0211Unrecognised operation0x0212Mistyped argument0x0213Resource limitation
action_reply (pydicom.dataset.Dataset or None) – If the status is ‘Success’ then a
Datasetcontaining attributes corresponding to those supplied in the Action Reply, otherwise returns None.
See also
ae.ApplicationEntity.on_n_action(),dimse_primitives.N_ACTION()References
-
send_n_create(dataset, class_uid, instance_uid, msg_id=1)[source][source]¶ Send an N-CREATE request message to the peer AE.
Parameters: - dataset (pydicom.dataset.Dataset or None) – The dataset that will be sent as the Attribute List parameter in the N-CREATE request, or None if not required.
- class_uid (pydicom.uid.UID) – The UID to be sent in the request’s (0000,0002) Affected SOP Class UID element.
- instance_uid (pydicom.uid.UID or None) – The UID to be sent in the request’s (0000,1000) Affected SOP Instance UID element or None if not required.
- msg_id (int, optional) – The DIMSE Message ID, must be between 0 and 65535, inclusive, (default 1).
Returns: status (pydicom.dataset.Dataset) – If the peer timed out or sent an invalid response then yields an empty
Dataset. If a response was received from the peer then yields aDatasetcontaining at least a (0000,0900) Status element, and depending on the returned value, may optionally contain additional elements (see the DICOM Standard, Part 7, Section 9.1.2.1.5 and Annex C).General N-CREATE (DICOM Standard Part 7, Section 10.1.5 and Annex C)
- Success
0x0000Successful operation- Failure
0x0110Processing failure0x0112No such SOP Instance0x0114No such argument0x0115Invalid argument value0x0117Invalid object instance0x0118No such SOP Class0x0119Class-Instance conflict0x0123No such action0x0124Not authorised0x0210Duplicate invocation0x0211Unrecognised operation0x0212Mistyped argument0x0213Resource limitation
attribute_list (pydicom.dataset.Dataset or None) – If the status is ‘Success’ then a
Datasetcontaining attributes corresponding to those supplied in the Attribute List, otherwise returns None.
See also
ae.ApplicationEntity.on_n_create(),dimse_primitives.N_CREATE()References
-
send_n_delete(class_uid, instance_uid, msg_id=1)[source][source]¶ Send an N-DELETE request message to the peer AE.
Parameters: - class_uid (pydicom.uid.UID) – The UID to be sent in the request’s (0000,0003) Requested SOP Class UID element.
- instance_uid (pydicom.uid.UID) – The UID to be sent in the request’s (0000,1001) Requested SOP Instance UID element.
- msg_id (int, optional) – The DIMSE Message ID, must be between 0 and 65535, inclusive, (default 1).
Returns: status – If the peer timed out or sent an invalid response then yields an empty
Dataset. If a response was received from the peer then yields aDatasetcontaining at least a (0000,0900) Status element, and depending on the returned value, may optionally contain additional elements (see the DICOM Standard, Part 7, Section 9.1.2.1.5 and Annex C).General N-DELETE (DICOM Standard Part 7, Section 10.1.6 and Annex C)
- Success
0x0000Successful operation- Failure
0x0110Processing failure0x0112No such SOP Instance0x0117Invalid object instance0x0118No such SOP Class0x0119Class-Instance conflict0x0124Not authorised0x0210Duplicate invocation0x0211Unrecognised operation0x0212Mistyped argument0x0213Resource limitation
Return type: See also
ae.ApplicationEntity.on_n_delete(),dimse_primitives.N_DELETE()References
-
send_n_event_report(dataset, event_type, class_uid, instance_uid, msg_id=1)[source][source]¶ Send an N-EVENT-REPORT request message to the peer AE.
Parameters: - dataset (pydicom.dataset.Dataset) – The dataset that will be sent as the Event Information parameter in the N-EVENT-REPORT request.
- event_type (int) – The value to be sent in the request’s (0000,10002) Event Type ID element.
- class_uid (pydicom.uid.UID) – The UID to be sent in the request’s (0000,0003) Affected SOP Class UID element.
- instance_uid (pydicom.uid.UID) – The UID to be sent in the request’s (0000,1001) Affected SOP Instance UID element.
- msg_id (int, optional) – The DIMSE Message ID, must be between 0 and 65535, inclusive, (default 1).
Returns: status (pydicom.dataset.Dataset) – If the peer timed out or sent an invalid response then yields an empty
Dataset. If a response was received from the peer then yields aDatasetcontaining at least a (0000,0900) Status element, and depending on the returned value, may optionally contain additional elements (see the DICOM Standard, Part 7, Section 9.1.2.1.5 and Annex C).General N-EVENT-REPORT (DICOM Standard Part 7, Section 10.1.1 and Annex C)
- Success
0x0000Successful operation- Failure
0x0110Processing failure0x0112No such SOP Instance0x0113No such event type0x0114No such argument0x0115Invalid argument value0x0117Invalid object instance0x0118No such SOP Class0x0119Class-Instance conflict0x0210Duplicate invocation0x0211Unrecognised operation0x0212Mistyped argument0x0213Resource limitation
event_reply (pydicom.dataset.Dataset or None) – If the status is ‘Success’ then a
Datasetcontaining the optional reply to the event report.
See also
ae.ApplicationEntity.on_n_event_report(),dimse_primitives.N_EVENT_REPORT()References
-
send_n_get(identifier_list, class_uid, instance_uid, msg_id=1)[source][source]¶ Send an N-GET request message to the peer AE.
Parameters: - identifier_list (list of pydicom.tag.Tag) – A list of DICOM Data Element tags to be sent in the request’s (0000,1005) Attribute Identifier List element. Should either be a list of pydicom Tag objects or a list of values that is acceptable for creating pydicom Tag objects.
- class_uid (pydicom.uid.UID) – The UID to be sent in the request’s (0000,0003) Requested SOP Class UID element.
- instance_uid (pydicom.uid.UID) – The UID to be sent in the request’s (0000,1001) Requested SOP Instance UID element.
- msg_id (int, optional) – The DIMSE Message ID, must be between 0 and 65535, inclusive, (default 1).
Returns: status (pydicom.dataset.Dataset) – If the peer timed out or sent an invalid response then yields an empty
Dataset. If a response was received from the peer then yields aDatasetcontaining at least a (0000,0900) Status element, and depending on the returned value, may optionally contain additional elements (see the DICOM Standard, Part 7, Section 9.1.2.1.5 and Annex C).General N-GET (DICOM Standard Part 7, Section 10.1.2 and Annex C)
- Success
0x0000Successful operation- Warning
0x0107Attribute list error- Failure
0x0110Processing failure0x0112No such SOP Instance0x0117Invalid object instance0x0118No such SOP Class0x0119Class-Instance conflict0x0122SOP class not supported0x0124Not authorised0x0210Duplicate invocation0x0211Unrecognised operation0x0212Mistyped argument0x0213Resource limitation
attribute_list (pydicom.dataset.Dataset or None) – If the status is ‘Success’ then a
Datasetcontaining attributes corresponding to those supplied in the Attribute Identifier List, otherwise returns None.
See also
ae.ApplicationEntity.on_n_get(),dimse_primitives.N_GET(),service_class.DisplaySystemManagementServiceClass()References
-
send_n_set(dataset, class_uid, instance_uid, msg_id=1)[source][source]¶ Send an N-SET request message to the peer AE.
Parameters: - dataset (pydicom.dataset.Dataset) – The dataset that will be sent as the Modification List parameter in the N-SET request.
- class_uid (pydicom.uid.UID) – The UID to be sent in the request’s (0000,0003) Requested SOP Class UID element.
- instance_uid (pydicom.uid.UID) – The UID to be sent in the request’s (0000,1001) Requested SOP Instance UID element.
- msg_id (int, optional) – The DIMSE Message ID, must be between 0 and 65535, inclusive, (default 1).
Returns: status (pydicom.dataset.Dataset) – If the peer timed out or sent an invalid response then yields an empty
Dataset. If a response was received from the peer then yields aDatasetcontaining at least a (0000,0900) Status element, and depending on the returned value, may optionally contain additional elements (see the DICOM Standard, Part 7, Section 9.1.2.1.5 and Annex C).General N-SET (DICOM Standard Part 7, Section 10.1.3 and Annex C)
- Success
0x0000Successful operation- Warning
0x0107Attribute list error0x0116Attribute value out of range- Failure
0x0105No such attribute0x0106Invalid attribute value0x0110Processing failure0x0112No such SOP Instance0x0117Invalid object instance0x0118No such SOP Class0x0119Class-Instance conflict0x0121Missing attribute value0x0122SOP class not supported0x0124Not authorised0x0210Duplicate invocation0x0211Unrecognised operation0x0212Mistyped argument0x0213Resource limitation
attribute_list (pydicom.dataset.Dataset or None) – If the status is ‘Success’ then a
Datasetcontaining attributes corresponding to those supplied in the Attribute List, otherwise returns None.
See also
ae.ApplicationEntity.on_n_set(),dimse_primitives.N_SET()References
-