Orthanc RESTAPI modalities querry @Series level

Hi @SébastienJodogne / Orthanc community!

I’m currently running an orthanc server soothly on an ubuntu 16.04LTS. This server is properly paired with oother dicom modalities via a local network and all expected functionallities are working fine either from the web explorer and from the restAPI standpoint. Thanks for this brilliant work & doc!

My concern is about a very simple query usecase that I can’t really manage to do.
Namely I would like to query modalities at the series level. When I do this on the orthanc server itslefs it works like a charm with, for example the following payload:

Now when starting with a modality the doc states to use a POST method on /modalities/{id}/query and this works when using a payload at a Study level for example:

  • data = {“Level”: “Study”, “Query”: {“AccessionNumber”: “”, “PatientBirthDate”: “”, “PatientID”: “”, “PatientName”: “”, “PatientSex”: “”, “StudyDate”: “”, “StudyDescription”: “”}}

Unfortunately this doesnt suits my usecase since I’m looking at Series-Level fields to querry… And I got a 500 error if I try this with a “series level” payload as the first one…

The only workaround I found so far would be to:

  1. querry all the studies on the modalities

  2. Get the ids and then query all the series of every study

  3. Given the series ids querry all the tags of these series

  4. Given the dicom tags filter the result of it afterwards

This solution sounds pretty inefficient and wont scale as the number of modalities grows…

TLDR What option is given in orthanc to querry modalities at series level using the restAPI (the usecase being e.g. to retrive series with a given series description).

Thanks a lot for reading this and maybe for the lightening me :smiley: !
Have a great day

Hello,

This should work:

POST /modalities/{…}/query
data = {“Level”: “Series”, “Query”: {“SeriesDescription”: “some querry”}}

https://api.orthanc-server.com/index.html#tag/Networking/paths/~1modalities~1{id}~1query/post

You should check the logs of your remote modality. Maybe your remote modality simply doesn’t support the “QueryRetrieveLevel” (0008,0052) of “SERIES”, or maybe it expects more tags in queries related to the series level (such as the “StudyInstanceUID” of the parent study). Get in touch with the support team for your modality, as explained here:

https://book.orthanc-server.com/faq/proprietary.html

For us to be able to provide further support, please provide a minimal working example so that other people can independently reproduce your issue:
https://book.orthanc-server.com/users/support.html#discussing-a-minimal-working-example

Kind Regards,
Sébastien-

Hi Sebastien,

First of all thank you for your detailed and fast answer. It appears that indeed by giving the “StudyInstanceUID” inside the payload i’m able to recover all the series withnin the given study but that is done in detriment of the other payloads filters (e.g. “SeriesDescription”).

Namely
data = {“Level”: “Series”, “Query”: {“SeriesDescription”: “Something”, “StudyInstanceUID”: “1.2.3.4.5.5.7.8.9”} }
Provides all series inside the given study even if the series description does not comprises “Something”. Let me know if you have any idea/clue.

Thanks for your time

Again, this is a question to be asked to the manufacturer of the remote modality:
https://book.orthanc-server.com/faq/proprietary.html

You can inspect the query that is sent by Orthanc and the answer that is replied by the remote modality by using the “–verbose” (and possibly “–trace-dicom” for low-level DCMTK logs) command-line flag of Orthanc:

https://book.orthanc-server.com/faq/dicom.html

Sébastien-