Trigger Python when images are stored in Orthanc

Hello!

How can I trigger a piece of Python-code every time an ultrasound-machines stores images on the Orthanc-server? In the Python-script I would like to pass the uri to the images in Orthanc Explorer to our EMR-software via an API. So I must have some patient-data from the study (the patient-data is available in the study-tags as the patient-data was part of the worklist-information).

Perhaps this is a too simple question? I can give more details off course. Thanks for any advice!

Gerard Verheij
Karmenta, The Netherlands

1 Like

Hello Gerard,

You can accomplish this with the following example of RegisterOnStoredInstanceCallback:

https://orthanc.uclouvain.be/book/plugins/python.html#accessing-the-content-of-a-new-instance

Make sure you have the libOrthancPython.so plugin enabled and that your python script is registered by the PythonScript directive in your Orthanc config.

Thank you! That seems simpler than I thought.

1 Like