Getting back the StudyInstanceUID when association sudenlly is aborted

195 Views Asked by At

I am writing a sample DICOM SCP Store. I simulate a transfer of many DCM folders (from another computer connected to my LAN) using SCU Store command. 3 transfers are simulated at the same time. for unkonwn reason, one of the transfer is aborted. I a tried to trace the aborted association in order to getting back the related StudyInstanceUID. Here is my SCP :

from pynetdicom import AE, debug_logger, AllStoragePresentationContexts, evt

debug_logger()

def handle_store(event):
    """Handle EVT_C_STORE events."""
    ds = event.dataset
    ds.file_meta = event.file_meta

    return 0x0000

handlers = [(evt.EVT_C_STORE, handle_store)]

ae = AE()
# Unlimited PDU size
ae.maximum_pdu_size = 0
#ae.add_supported_context
ae.supported_contexts = AllStoragePresentationContexts
ae.start_server(('', 11112), block=True, evt_handlers=handlers)

I found the related message in association.py, but any chance to get the aborted dataset.StudyInstanceUID :

# Check for abort
            if self.acse.is_aborted():
                msg = "Association Aborted"
                if self.acse.is_aborted('a-p-abort'):
                    msg += " (A-P-ABORT)"
                LOGGER.info(msg)
                self.is_aborted = True
                self.is_established = False
                evt.trigger(self, evt.EVT_ABORTED, {})
                self.kill()
                return
0

There are 0 best solutions below