Hi All,
I am experimenting with using Orthanc and the associated Python plugin to auto-route studies based on called AET.
In the sample code auto-route code below from the documentation:
import orthanc
def OnChange(changeType, level, resourceId):
if changeType == orthanc.ChangeType.STABLE_STUDY:
print('Stable study: %s' % resourceId)
orthanc.RestApiPost('/modalities/sample/store', resourceId)
orthanc.RegisterOnChangeCallback(OnChange)
The resourceId
seems to be at the study level. However the called AET is only found in the metadata at the instance level. I can’t find an easy way to use the study resourceId
to find any of the stored instance Ids. If i could, then I could easily use the REST API to get the calledAET
.
What is the easiest way to do so? I thought of reimplementing the SHA1 hash function
for Instance Ids as listed here (but this seems like a little unelegant).
Instances are identified as the SHA-1 hash of the concatenation of
their PatientID tag (0010,0020),
their StudyInstanceUID tag (0020,000d),
their SeriesInstanceUID tag (0020,000e), and
their SOPInstanceUID tag (0008,0018).
Any help on best way to approach this would be much appreciated. Thank you.