Query remote PACS using Orthanc REST API to determine if RTDOSE associated with PatientID exists

695 views
Skip to first unread message

christop...@gmail.com

unread,
Nov 13, 2017, 12:17:56 PM11/13/17
to Orthanc Users
I'd like to be able to query a remote PACS server to see if a given patient has a particular kind of series (e.g. RTDOSE, RTSTRUCT).

I can query the remote PACS at the study level to get all studies associated with a given patient ID using the modalities/PACS/query endpoint of the REST API and posting '{"PatientID": <ID HERE>}' .

However, when querying at the series or instance level, nothing is found. The difference between these levels would make sense if series and instances didn't have a PatientID tag, but I think that instances do.

Ideally, I'd be able to post '{"PatientID": <ID HERE>, "Modality": "RTDOSE"}' to find any RTDOSE instances. Any idea of how best to do this? Thanks in advance!

Sébastien Jodogne

unread,
Nov 13, 2017, 1:00:45 PM11/13/17
to Orthanc Users
Hello,

Here is a sample command-line to achieve this goal with the REST API of Orthanc:

# curl -X POST http://localhost:8042/tools/find -d '{"Level":"Series","Expand":true,"Query":{"Modality":"RTDOSE","PatientID":"12345678"}}'

HTH,
Sébastien-

christop...@gmail.com

unread,
Nov 14, 2017, 12:45:12 PM11/14/17
to Orthanc Users
Hi Sébastien, thanks for your response.

I'm trying to query a non-Orthanc remote PACS using the Orthanc REST API to determine if RT objects exist on the remote server before retrieving them. The request you posted above would only search the Orthanc server itself, right? I would need to have retrieved the files to use that request.


To test this out, I query/retrieved a small set of patients from the PACS to my Orthanc server, one of which happened to have CT, RTSTRUCT, and RTPLAN objects on the remote PACS. Since I know that this patient has those files, I tried querying the remote server using the following requests:

# curl -X POST http://localhost:8042/modalities/PACS/query -d '{"Level":"Series","Expand":true,"Query":{"Modality":"CT","PatientID":"12345678"}}'

# curl -X POST http://localhost:8042/modalities/PACS/query -d '{"Level":"Series","Expand":true,"Query":{"Modality":"RTSTRUCT","PatientID":"12345678"}}'

# curl -X POST http://localhost:8042/modalities/PACS/query -d '{"Level":"Series","Expand":true,"Query":{"Modality":"RTPLAN","PatientID":"12345678"}}'

I then GET the answers at /queries/{id}/answers for all of the returned query hash ids, which are all empty. This isn't working as expected given that I know that those files exist on the PACS. I also omitted "Expand":true from the queries, still doesn't work. The deprecated /modalities/{id}/find doesn't work either.


In contrast, when I search the Orthanc server for that patient using the request you suggested I get the expected results:

# curl -X POST http://localhost:8042/tools/find -d '{"Level":"Series","Expand":true,"Query":{"Modality":"CT","PatientID":"12345678"}}'
# curl -X POST http://localhost:8042/tools/find -d '{"Level":"Series","Expand":true,"Query":{"Modality":"RTSTRUCT","PatientID":"12345678"}}'
# curl -X POST http://localhost:8042/tools/find -d '{"Level":"Series","Expand":true,"Query":{"Modality":"RTPLAN","PatientID":"12345678"}}'


Is there any way to duplicate the ability to search at the series level in this manner when querying a remote server?

Thanks again!

Xueyong Qian

unread,
Mar 2, 2020, 10:43:58 AM3/2/20
to Orthanc Users
Hi christop,

I encountered the same problem and here is the solution that works for me: Add the study level info.
So instead of querying: {"SeriesInstanceUID": ""}, do {"StudyInstanceUID":"", "SeriesInstanceUID": ""}


On Monday, November 13, 2017 at 6:17:56 PM UTC+1, christop...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages