Determine level from Orthanc ID

If I have an Orthanc ID for a resource, is there an API call that I could use to directly determine its level (Patient, Study, Series, etc)?

I’ve googled through the Orthanc Book and posts in this user group, but got no hits.

In my use case, I’d like to restrict DICOM stores to a particular destination to the Study level. That is, only full studies should be sent to this destination node - NOT full patients or separate series.

I wrote a python script with the python plugin to intercept the incoming RestApi call. At the moment, I am making a call to the studies RestAPI within a try statement that creates an exception if the orthanc resource ID does not exist at the studies level.

However, I wondered if I was missing a cleaner way to do this - some call to the RestAPI with the Orthanc resource ID that would return whether it exists and at what level.

Thanks,
John.

Hi John,

No, there’s no such endpoint but you should be able to extract that info from the url of the RestApi call that you intercept.

HTH

Alain.

Hi Alain,

Thanks for the quick response.

At the moment, I am intercepting the store call directly. So I only appear to have access to the remote modality name (in the uri) and the resource ID of the thing to be sent (in the request[‘body’]).

John.