Modyfing Orthanc c-find response

Hello,

This is my first time here. :slight_smile: Greetings from Poland!
I’m writing here because I got stuck and need your help.

What I would like to do is modify Orthanc c-find answer before it gets back to ‘requesting’ modality (Horos in my case). I know there is a possibility to modify the request with IncomingFindRequestFilter accessible through lua scripts. I found out that it’s also possible to use ‘get_content_of_specified_query_answer’ through python plugin but this is also not what i am looking for (as the answer is already sent). I am also aware of lua callback OutgoingFindRequestFilter which is (…)invoked whenever Orthanc acts as a C-Find SCU, which gives the opportunity to dynamically fix outgoing C-Find requests before they are actually sent to the queried modality(…) but again this is the request that is being modyfied here. I couldn’t find the information how to fiddle with Orthanc ‘active response to c-find’ before it is sent by Orthanc Rest API.

This way I would be able to search remote modalities ‘through’ Orthanc server: if Orthanc receives a c-find request and the study is NOT in Orthancs database then this Orthanc server looks for queried study in its configured Modalities (non-Orthanc PACS).

Thank you for your time.

Regards

Adam

Dear Adam,

Nice to meet you!

Your use case is definitely possible with Orthanc, but not using Lua. You’ll have to develop a C/C++ plugin that takes advantage of the “OrthancPluginRegisterFindCallback()” function in the API of the plugin SDK:

https://sdk.orthanc-server.com/group__DicomCallbacks.html#ga42ea14ecf712872c2c953219a1526a46

https://book.orthanc-server.com/developers/creating-plugins.html

Note that what you want to do is referred to as a “DICOM proxy”, which has been previously discussed several times on this forum, for instance:
https://groups.google.com/g/orthanc-users/c/xEuCfnnyWng/m/qmKf0ejYAQAJ

Regards,
Sébastien-