parent studies / patient on instance post ?

Hi there,

I’m using a Java app to send a batch of DICOM to Orthanc. It is very close to the ImportDicomFiles.py, it’s scan recursively folder and send the file to Orthanc.

The batch of DICOM sended could be very huge (thousands of instances) but at the end of the process I want to know what are the new study/Patient uploaded (in my case I want to know the studies level).

At DICOM writing Orthanc give back the stored instance ID.
I made a loop that query the /instance/{ID}/study api to get the parent study.

It is working well but I’m making A LOT of Rest request as I need to query the Instance level, so I find a new study only once for hundred of request (if a study contains 500 instances I got the information for the first instance and then the 499 will give me an identical StudyID which I ignore).

It would be much faster if the JSON answer of the /instance post API can give the parent ID (Series / Study / Patient). This way by just parsing the answer message I will be able to know how many different Series / Study / Patient have been imported in the import process without any additional Rest call.

I assume at the moment of Orthanc is replying the Instance ID it probably knows it’s parent level, so maybe it could be easy to output the parent ID as well in the answer message ?

Best regards,

Salim

Can you have Orthan initiate it? I use studystable event in lua to send a notification to my application via http get with the study details. Then it is only done once.

Sorry posted too quickly. You could initiate a http get yourself or possibly create it add a text file with the study data which your java app would query for study data.

Hi Bryan,

I don't understand what you said.
If you refer to stable status using the change API it is unsafe for me for two reasons :
If orthanc receive dicom from another protocol (dicom, peer) during my script execution I will get new series message that didn't came from my upload process.
Then, if the upload send dicom that are already stored in orthanc the stable/new series will not be triggered.

I want to know specifically what files has been sent to orthanc during my specific app

Best regards

Salim

Sorry, I was unaware you only wanted two know what was store from your application.

Dear Salim,

This feature has just been committed in the Orthanc mainline:
https://bitbucket.org/sjodogne/orthanc/commits/5dd649de253dd9099ee71d0a1e473349e9161056

HTH,
Sébastien-

As usual Sebastien, thank you so much for your kind support of my projects.

Salim