For the time being, Lua scripting is a very experimental feature.
There are only 2 implemented callbacks (ReceivedInstanceFilter and IncomingHttpRequestFilter), as described in the
Orthanc Wiki. "ReceivedInstanceFilter" is used to reject incoming DICOM instance, whereas "IncomingHttpRequestFilter" is used to build custom access control lists for users.
We are indeed planning in the mid-term to implement a "
command queue" that would be driven by Lua scripts. The Lua callbacks would be able to push commands (anonymization, deletion, DICOM storing, HTTP/FTP forwarding...) in a queue that would be continuously processed by a thread in Orthanc. Such a command queue would allow to embed high-level, scripted logic directly inside Orthanc. This would remove the dependency on external scripting, hereby enhancing the performance of the framework.
However, for the time being, there is no such feature. The "ReceivedInstanceFilter" Lua script would just allow you to discard DICOM instances, and not to forward them. For the use case you describe, you currently have to rely on external scripting (e.g. with Python). A
sample code is available in the Orthanc distribution.
HTH,
Sébastien-