Hi everyone,
I’m currently using Orthanc to send DICOMs to a remove modality, which works fine with the ‘/modalities/XXX/store’ REST API. I’m using this in Asynchronous mode, so a job is created for the transfer and completed successfully afterward.
However, after the transfer is finished I would like to delete the resources from the Orthanc server and I’m currently wondering if there is a way to achieve this without separate book-keeping (e.g. storing the job ID in a database and periodically checking if it’s done to trigger the delete).
Ideally, I would like to create a delete job that waits for the previous store job to be finished and until it enters the success state, but I think this is not possible with Orthanc right now?
As an alternative, I’m considering just monitoring the ‘/jobs’ REST endpoint to basically implement a monitor of pending/succeeded store jobs that would trigger a delete whenever a succeeded store job is found. However, here I’m concerned that over time the list of jobs will become very large, so I’m wondering if there is any way to completely delete jobs from the list (API only says that there is Cancel/Pause/Resubmit/Resume) or for example only return the last let’s say 50 jobs when triggering ‘/jobs’ .
Are there any other maybe more simple ways one could use to delete resources after a store has been completed?
thanks in advance and happy holiday season
Martin