Server Side Scripting with Lua - more documentation?

I'm trying to understand the full capabilities of Orthanc's server side scripting. I see there is a function that gets called which allows for filtering incoming DICOM instances (ReceivedInstanceFilter). Is there a full list of such functions? In particular, I would want to tap into the event that takes place after a DICOM instance has been received fully and stored. I'd want to be able to access the data from the DICOM instance and be able to forward that along to another destination (not a DICOM server, but a customized end point) via HTTP. It seems like this would be possible with the ReceivedInstanceFilter function, but is that ideal?

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-