Find patients via API

Hi,

Has anyone used a tool like Postman (https://www.getpostman.com) to use the API to find a patient? I am getting a bad request at the moment. Any tips or insight would be appreciated.

Thanks
Greg

Screen Shot 2017-01-03 at 11.35.31 AM.png

Ah, I didn’t notice but my JSON was invalid. This resolved the 400 request. The result, however, return is empty. Executing the same query via the web returns 2 results.

Screen Shot 2017-01-03 at 2.02.45 PM.png

Hello,

Were you able to get your situation resolved? What Orthanc version and what platform?

I tried your query on a test Orthanc Docker w/ Plugins (mainline) and uploaded test dicom image, and query returns results for me in Postman.

Thanks!

No, I wasn’t able to return any data via the API. I am using the remote/free DICOM server:

“sample” : [ “STORESCP”, “www.dicomserver.co.uk”, 11112 ]

I can search for results via the web but I can’t via the API. I am also unable to download modalities via the web.

Thanks

Hello,

You are seemingly confusing the REST API of Orthanc with the DICOM protocol. Indeed, your JSON request uses the REST API, whereas “www.dicomserver.co.uk” uses the DICOM protocol. What are you exactly trying to do?

Here is a sample command-line session that would lookup for a patient stored by Orthanc, then send it to “www.dicomserver.co.uk” using the REST API of Orthanc:

curl -X POST http://localhost:8042/tools/find -d ‘{“Level”:“Study”,“Query”:{“PatientName”:“G”}}’

[ “6e2c0ec2-5d99c8ca-c1c21cee-79a09605-68391d12” ]

curl -X POST http://localhost:8042/modalities/sample/store -d ‘[ “6e2c0ec2-5d99c8ca-c1c21cee-79a09605-68391d12” ]’

{}

The first command retrieves the Orthanc identifier of the study of interest. The second command triggers a DICOM C-Store session to send the study to the remote modality.

HTH,
Sébastien-

PS: Note however that for security reasons, it is strongly discouraged to use the DICOM protocol over Internet: The DICOMweb protocol should be used in such situations.

http://www.orthanc-server.com/static.php?page=dicomweb

As a complement, note that the instructions above are for pushing DICOM files from Orthanc to another modality.

And here are similar instructions for the opposite direction, i.e. if you are trying to query/retrieve (pulling) DICOM images from a remote DICOM modality:

curl -X POST http://localhost:8042/modalities/sample/query -d ‘{“Level”:“Study”,“Query”:{“PatientName”:“G”}}’

{
“ID” : “b247aaed-8234-47cd-8559-43f2b095977c”,
“Path” : “/queries/b247aaed-8234-47cd-8559-43f2b095977c”
}

curl -X POST http://localhost:8042/queries/b247aaed-8234-47cd-8559-43f2b095977c/retrieve -d ORTHANC

The “ORTHANC” argument in the second command corresponds to the AET of your Orthanc server, as known by your remote DICOM server.

HTH,
Sébastien-