# HG changeset patch # User Sebastien Jodogne # Date 1645604811 -3600 # Node ID a56c4128c9a2afd3539b8d2e62d18c9973e6e52c # Parent b14dbbb8eda9529a328ac0e1518f6d9e826850a8 ReceivedInstanceCallback in Python: added origin diff -r b14dbbb8eda9 -r a56c4128c9a2 Sphinx/source/plugins/python/received-instance-callback.py --- a/Sphinx/source/plugins/python/received-instance-callback.py Wed Feb 23 08:38:50 2022 +0100 +++ b/Sphinx/source/plugins/python/received-instance-callback.py Wed Feb 23 09:26:51 2022 +0100 @@ -13,7 +13,13 @@ memory_dataset.seek(0) return memory_dataset.read() -def ReceivedInstanceCallback(receivedDicom): +def ReceivedInstanceCallback(receivedDicom, origin): + orthanc.LogWarning('SOURCE: %d' % origin) + if origin == orthanc.InstanceOrigin.REST_API: + orthanc.LogWarning('DICOM instance received from the REST API') + elif origin == orthanc.InstanceOrigin.DICOM_PROTOCOL: + orthanc.LogWarning('DICOM instance received from the DICOM protocol') + dataset = dcmread(BytesIO(receivedDicom)) if dataset.PatientID.startswith('001-'):