Patient Search over API or via Database Queries

I want to be able to query the API or the Database in order to find Studies, Series, and Instances by querying with an MRN/PatientID number, or perhaps with a Patient Name or Birth Date.

I read the API Docs and I see that the API seemingly does not support such queries.

I have looked through the PostgreSQL database, and I am having trouble understanding the schema, or the way the information is organized.

Does anyone have any info on how to search the Database for an MRN/PatientID and get associated Studies, Series, and/or Instances UUIDs?

Any sort of info will be helpful!

Have you checked out the “/tools/find” URI in the REST API?

Here are some samples coming from the public integration tests:
https://bitbucket.org/sjodogne/orthanc-tests/src/default/Tests/Tests.py?fileviewer=file-view-default#Tests.py-1446

Once the ID of the patient/study/series of interest is retrieved (with “/tools/find”), you can access its child studies/series/instances (by respectively getting “/studies/{id}”, “/series/{id}” or “/instances/{id}”).

HTH,
Sébastien-

Thanks for this info, Sébastien!

Perhaps I am doing this wrong, I do not know how to perform a “C-Find”
Here are some of my attempts, and I am obviously doing this wrong: https://gist.github.com/anonymous/f789ea2a5d08eeef0660

I can do GET and POST requests using curl, and it will work just fine. How do I use the /tools/find URI?

This helped me very much, thanks: https://gist.github.com/anonymous/079662f1a433cb99ca85

You may notice that the API is emitting nginx server headers when I query, I have nginx as the frontend so that I can control authentication to the API and allow access to the webviewer with a different set of credentials and the main “explorer” interface with a different set of credentials, as well as control the behaviour of the HTTP Codes.

This helped me very much, thanks: https://gist.github.com/anonymous/079662f1a433cb99ca85

Fine, glad to read that this helped.

You may notice that the API is emitting nginx server headers when I query, I have nginx as the frontend so that I can control authentication to the API and allow access to the webviewer with a different set of credentials and the main “explorer” interface with a different set of credentials, as well as control the behaviour of the HTTP Codes.

Yes, pushing Orthanc behind nginx/Apache is definitely the good approach to extend it with more flexibility/logging/authentication/… :slight_smile: