Cannot get OHIF viewer to connect with existing Orthanc database

Hello! For our project we’ve imported all the DICOM files we need into our own setup of Orthanc that is separate to the Orthanc that the instructions seem to want us to launch for this. It is running from its own Docker container and not through running yarn run orthanc:up. We would like to connect our OHIF viewer to that. When I run yarn run dev:orthanc it does seem to almost connect to it because it prompts for the Orthanc username/password and responds correctly to it but after that it says “Data Source Connection Error Error: request failed Please ensure the following data source is configured correctly or is running: Orthanc Server”. Is there an additional step we should be applying to get this to work with our existing Orthanc server fully, such as some configuration settings we would have to adjust? I would imagine if it is prompting and responding properly to the username/password then it is somewhat connecting to it right. I have also tried using the config/local_orthanc.js file as well but it usually either didn’t work right or gave similar results (although I’m not entirely sure if I was trying to use it properly). Any help we can get with this would be appreciated, and if any additional information is needed to help with this please let me know.

1 Like

Thanks for the question @wolfborg and welcome to the forum.

It sounds like I am going to need a bit more information, but I will try to also provide some as well.

I will start by saying (but forgive me if you already knew this) that CORS needs to be considered when dealing with OHIF data sources (like Orthanc). So if you look at our yarn run orthanc:up recipe you will see that nginx handles this. So my first question is “Have you accounted for this in your setup?”

Other information that you could provide is the browser console contents when you receive the “Data Source Connection Error.”

I will also say that running yarn run dev:orthanc is intended to be used with the recipe I mentioned previously. So it might be best to use config/local_orthanc.js if you are using your own setup. However, that might require tweaks of the configuration depending on which port Orthanc is running/listening on. Notice that for config/local_orthanc.js, the expectation is that Orthanc is running on (the standard) 80 port and DICOM web requests are at `‘http://localhost/dicom-web’.

Ok let’s start with this. :blush:

Hello wolfborg, i can help you with your issue i already faced this issue in the past i will fix this issue for you can you contact me with my mail penchalagopi7396@gmail.com

1 Like

Hello @jbocce

Thank you for your previous reply. I was eventually able to get this partially working but by using the OHIF viewer that seems to be included with our Orthanc Docker container setup. That was at least good enough for us to be able to test out if it’ll work for our purposes. But now our next step is to actually get the OHIF viewer working on port 80 and connected to this separate Orthanc Docker port (which is not port 80).

That said, a built version of the OHIF viewer set to use the Orthanc connection does appears to have the CORS issue that you mentioned, as the browser console gives errors that seem to indicate as much. I’m assuming this is due to the seperate ports used despite being on the same server, is that correct? Can you provide any additional advice as to how to actually going about rectifying that issue? Is this something that needs to be set on the Apache end or within the Orthanc docker setup somehow or both?

Actually we eventually need the ability to have multiple Orthanc instances running with separate data in each and then either have the same OHIF viewer be able to select between them or setup different OHIF viewers that would select different Orthanc data sources. The reason for this is needing data separated and access to it restricted for different specified users. I mention this because I don’t know if this either complicates things too much related to the CORS issue or if maybe what we’re looking to do could be handled better through a setting I’m unaware of.

If it’s possible to get both the Orthanc and the OHIF viewer to run on port 80 that would probably be ideal but I don’t know if that’s possible if we need multiple instances of Orthanc going.

Any help we can get with this would be appreciated!