Send study (dicom file) when network available (low internet availability)

Hi all,

The clinic I am using OrthanC in (as a mini-PACS) has a spotty internet. It works sometimes, and at other times it is completely cut off from the internet.

I have setup the OrthanC server there to forward the studies to my cloud PACS (OrthanC as well). However, when the internet is unavailable, the sendmodality function obviously fails. I was wondering what the best way is for OrthanC to try to send the study again after an interval (say 5 minutes).

Any help would be greatly appreciated.

PS: I have found that the Check function in DicomUserConnection.cpp (orthanc / OrthancServer / DicomProtocol / DicomUserConnection.cpp) at line 161 is the one checking if the network is available and logs a "DicomUserConnection:" when the network is unavailable. Not sure if that helps with the solution. But that's where I reached before giving up.

Hi Ayush,

I don’t think you should handle retries in a lua callback. It’s probably not a good idea to stay in the callback for a few hours …

In your case, I would advise you to write a python scripts that is external to Orthanc and that will drive Orthanc to perform the transfer.

Here is a suggested workflow:

  • a python script is running indefinitely, monitoring the /changes API url. This url will inform you each time a new study has been received.

  • each time a new study has arrived in Orthanc, it tries to send it to your cloud modality. If it fails, you can retry until it succeeds.

  • once it has been transmitted successfully, the script should request the /changes again to see if something new happened during the previous transmission and start over again …

BTW, take care that sending images over the DICOM protocol to a cloud instance of Orthanc is not secured at all (first of all, it’s not encrypted and the DICOM port is an open door); I recommend that you define your Orthanc cloud as a peer and transfer the images over HTTPS (and configure at least a basic authentication).