Integration of Orthanc to PHP based web application (Electronic Health Record system)

We, a group of doctors from a developing country attempting to develop integrated EHR system (with PACS and LIMS) to be used in our tirtiary care hospital, where all of our services are free of charge!.

We are piloting an EHR web application based on PHP, Javasctipt, and Ajax with MySQL and now we are getting little bit familiar with those technologies, but NOT with C++ or other technologies with Orthanc.

We manged to setup Orthanc server(s) in our LAN and send dicom images from our radiology department modalities (MRI, CT and CR) to it and retrieve those without much hassle (through HTTP and DICOM)

Now we need to incorporate the Orthanc web viewer to our patient based EHR system as follows;

In our EHR web application, first we need to select the patient which redirect to patient dashboard, where there is a button calld medical Images. when clicked, we need to display all the STUDIES related to that patient (in our Orthanc server) in chronological order, and then browse SERIES and INSTANCES as in your defalt web viever/series viewer.

In our php web application, PatientID is a session variable and so we need to display all dicom studies related to that PatientID only (may be in a iframe or div). So what is the way (simple URL like to display all the studies related and then browse and view series and instances?

We know that this is 99% possible and its a simple thing for a IT guy, but with our poor knowledge of IT domain, we are stuck there. Sorry to post such a long description for a silly question. Any help with example code or link will be highly appreciated.

Thank you.


Dammit, I’m also a doctor, not an IT guy / gal… :slight_smile:

Here’s a file to access the lookup function.


  • configure $orthanc to your server
  • call lookup.php?patientID=123456 (e.g. patientID as 123456)

This returns the studies for that patient. You’ll probably need to do a few more file_get_contents if you want to list the studies in your EHR instead of listing the studies in Orthanc Explorer.


lookup.php (1.01 KB)


To this end, you might want to use a Lua script to filter out DELETE/POST requests:


Thank you Emsy,

Finally just now we manged to get what we want, after few struggles, the worst was;

Thank you very much once again…

Also now we need to disable Patients, Upload, Delete and Anonymize ability in Orthanc explorer, as it is not needed and harmful to our EMR, Any clue/suggestion?

Thank you very much Sebastien for the quick response and the wonderful piece of this DICOM app as FOSS. You saved a lot of time we had to spent with DCM4CHEE and Weasis. Please keep it up the good work. Cheers…!

Glad to hear that Orthanc is useful to you :slight_smile:

Soory for digging an old thread,
Just started testing orthanc.
Have followed the direction to enable curl and use lookup.php.
but still cannot find the i missing something?

It seems the error is on my part.
I’ve enable authentication but have not set the oprion on the curl call.
Sorry for the misunderstanding


i have the same problem that you solved it befor
can you tell me what you did to integrate orthanc with php

بتاريخ الثلاثاء، 19 مايو، 2015 10:23:06 ص UTC-7، كتب Krish: