Hello,
The solution to this question would be to create a C/C++ plugin that implements a custom storage area using "OrthancPluginRegisterStorageArea2()":
This plugin would start a thread that continuously monitors the content of the Radiant storage folder. The thread would be started/stopped by listening to the "OrthancPluginChangeType_OrthancStarted" and "OrthancPluginChangeType_OrthancStopped" events using "OrthancPluginRegisterOnChangeCallback()":
Depending on your operating system, different libraries can be used to monitor the content of a folder. Once a new DICOM file is found by the thread, the plugin would upload it to Orthanc by doing a POST call to "/instances" using "OrthancPluginRestApiPost()":
Furthermore, after POST-ing the new detected instance, the thread would store in an external database (e.g. SQLite or PostgreSQL), a row that maps the "SOPInstanceUID" DICOM tag and the Orthanc identifier to the path in the Radiant folder (in, say, "Table1"):
Now, the part of the plugin that implements the custom storage area would behave as follows:
- When a "OrthancPluginContentType_Dicom" content type is encountered:
- The "OrthancPluginStorageCreate" callback would parse the DICOM content in order to extract the "SOPInstanceUID" DICOM tag, and stores in the external database the mapping from the UUID of the attachment to the "SOPInstanceUID" (in, say, "Table2"): https://book.orthanc-server.com/faq/orthanc-storage.html
- The "OrthancPluginStorageReadWhole" callback would use the database to map the provided UUID of the attachment, to the "SOPInstanceUID" (using "Table2"), then to the path in the Radiant folder (using "Table1"). The content of the file from Radiant would be returned by the callback.
- Optionally, the "OrthancPluginStorageReadRange" callback would use the same approach as "OrthancPluginStorageReadWhole".
- The "OrthancPluginStorageDelete" only remove the row in the database that corresponds to the UUID of the attachment (in "Table2").
- Other content types are handled as in the "StorageArea" sample plugin: https://hg.orthanc-server.com/orthanc/file/Orthanc-1.9.6/OrthancServer/Plugins/Samples/StorageArea
Optionally, your plugin could also monitor the removal of file in the Radiant storage area, and automatically call DELETE on "/instances/{id}" by using the external database (which would avoid orphaned entries in "Table1").
Summarizing, this is definitely possible to use Orthanc as a proxy to another DICOM server, but this requires some programming. If you don't feel comfortable with this, get in touch with a professional assistance to develop this plugin for you and release it as free and open-source software:
Regards,
Sébastien-