Search for "SR" modalites in Instances

Hello All, hope you are all keeping well in these covid times.

Using REST is there a way to find all “SR” Modalities in all available “Instances” on the Orthanc server ?

Thank You
Stay Well
Mark.

Hello,

I guess you are looking for the “/tools/find” route in the REST API:
https://book.orthanc-server.com/users/rest.html#performing-finds-within-orthanc

Here is a sample call to our demo server (replace “MR” by “SR” in your scenario, as we don’t have “SR” images in our sample images):

$ curl https://demo.orthanc-server.com/tools/find -d ‘{“Level”:“Instances”,“Query”:{“Modality”:“MR”},“Expand”:true}’

HTH,
Sébastien-

Thank You Sebastien.

Your example works perfectly.

However when I try on my 1.5.8 server I get the following …

$ curl http://192.168.xxx.xxx:8042/tools/find -d ‘{“Level”:“Instances”,“Query”:{Modality":“SR”},“Expand”:true}’
{
“Details” : “The body must contain a JSON object”,
“HttpError” : “Bad Request”,
“HttpStatus” : 400,
“Message” : “Bad request”,
“Method” : “POST”,
“OrthancError” : “Bad request”,
“OrthancStatus” : 8,
“Uri” : “/tools/find”
}

Am I missing anything? Is there something I need to turn on or off in the configuration file ?
Thank You, again
Stay Well.
Regards, Mark

You json is bad, you were missing double quote (") before Modality. It should be

{“Level”:“Instances”,“Query”:{**“**Modality”:“MR”},“Expand”:true}

Thx Phong, fixed.

I will now book an appointment to get my eyes checked.

Regards.