Hi.
I am doing a C-GET (SCU) request with pynetdicom where I explicitly return an error code (0xA702) in the handler of the C-Store event. From what I read from the DICOM standard the C-GET should at least return a warning (0xB000), see C.4.3.1.4 Status as one or more sub-operations failed. I tried it with Orthanc as the SCP and it returns a success status (0x0000) even if all sub-operations failed. Is this the correct behavior? The strange thing is that our GE PACS has the same “problem”.
Also discussed in https://github.com/pydicom/pynetdicom/issues/552
Best regards,
Kai
Here is the code I use with pynetdicom:
from pydicom.dataset import Dataset
from pynetdicom import (
AE,
evt,
build_role,
debug_logger,
)
from pynetdicom.sop_class import (
PatientRootQueryRetrieveInformationModelGet,
CTImageStorage,
)
debug_logger()
def handle_store(event):
data = event.dataset
data.file_meta = event.file_meta
print(data.PatientName)
print(“in here”)
data.save_as(data.SOPInstanceUID, write_like_original=False)
return 0xA702
handlers = [(evt.EVT_C_STORE, handle_store)]
ae = AE(ae_title=“ADIT1”)
ae.add_requested_context(PatientRootQueryRetrieveInformationModelGet)
ae.add_requested_context(CTImageStorage)
role = build_role(CTImageStorage, scp_role=True, scu_role=True)
ds = Dataset()
ds.QueryRetrieveLevel = “IMAGE”
ds.PatientID = “10001”
ds.StudyInstanceUID = “1.2.840.113845.11.1000000001951524609.20200705182951.2689481”
ds.SeriesInstanceUID = “1.3.12.2.1107.5.1.4.66002.30000020070513455668000000609”
ds.SOPInstanceUID = “1.3.12.2.1107.5.1.4.66002.30000020070513455668000000610”
assoc = ae.associate(“127.0.0.1”, 7501, ext_neg=[role], evt_handlers=handlers)
if assoc.is_established:
responses = assoc.send_c_get(ds, PatientRootQueryRetrieveInformationModelGet)
for (status, identifier) in responses:
print(status)
if status:
print(“C-GET query status: 0x{0:04x}”.format(status.Status))
else:
print(“Connection timed out, was aborted or received invalid response”)
assoc.release()
else:
print(“Association rejected, aborted or never connected”)
And the last part of the log:
I: Get SCP Result: 0x0000 (Success)
I: Sub-Operations Remaining: 0, Completed: 0, Failed: 1, Warning: 0
(0000, 0900) Status US: 0
(0000, 1021) Number of Completed Sub-operations US: 0
(0000, 1022) Number of Failed Sub-operations US: 1
(0000, 1023) Number of Warning Sub-operations US: 0
C-GET query status: 0x0000