HighPerformanceAutoRouting.py - Check successful storing before deletion of instances

Hello.

I am testing Orthanc Server, and I think it is a very good solution, with a good amazing strategy of using plugins for configuration!
My congratulations to that.

I would like to ask you a question, … in this development published by Sebastien (python plugin for autorouting), dicom instances are removed after being autorouted…:

https://hg.orthanc-server.com/orthanc/file/default/OrthancServer/Resources/Samples/Python/HighPerformanceAutoRouting.py

Send all the instances with a single DICOM connexion

RestToolbox.DoPost(‘%s/modalities/sample/store’ % URL, instances)

Remove all the instances from Orthanc

for instance in instances:

RestToolbox.DoDelete(‘%s/instances/%s’ % (URL, instance))

I wonder whether it is possible to assure that autorouting was made properly (without error) before erasing… is it possible to check that instances are successfully autorouted after invoke autorouting?

I suggest to assure that before deletion.

Thanks in advance.
Fernando.

Hello,

You can implement this by monitoring the status of the job that is created if using “/modalities/samples/store” in asynchronous mode:
https://book.orthanc-server.com/users/advanced-rest.html#jobs

You could also consider implementing a Python plugin that listens to the “orthanc.ChangeType.DELETED” change:
https://book.orthanc-server.com/plugins/python.html#listening-to-changes

HTH,
Sébastien-