notification of presence for Study / DICOM import of study in a folder / Dicom morphing

Hi

I would have a few question related to Orthanc

1 / Notification
In the DICOM / HL7 World, when the archive receives a study, it can send a HL7 DSN message in order to inform other partner of the presence of the images in the Archive

My question is :
How is this made with Orthanc ?

Scenario: Orthanc receives DICOM objects through HTTPS or C-Store or checking the content of the folder \toto\Dicom
When the Study is imported in Orthanc what I would need is a message that tells another components:

Study UID / Demographic information
Dose by reading DICOM tag xx yy
instution name by reading DICOM tag xy yx
number of images
whatever dicom tags relevant in the message to another party

2 / Import through network folder:
is it possible to ask Orthanc to check every second or 2 second the content of a network folder and if there is a DICOM Files, it would “suck” the file, integrates it and delete it ?
If yes, does it work with SMB share ? with NFS share ? whatever ?

3 / DICOM Morphing
Is it possible to configure Orthanc to set it to change DICOM Tags before it auto-routes some study somewhere ?

Ex:
Modality1 > Dicom Store > Orthanc > modification that says if traffic arrives from Modality 1 then change institution name to xxxx > DICOM store > Archive

Modality2 > Dicom Store > Orthanc > modification that says if traffic arrives from Modality 2 then anonomize the patient using parameters XYZ > DICOM store > Archive

Hello,

Here are some brief answers to your questions:

1- This would be best done by creating a C/C++ Orthanc plugin:
https://book.orthanc-server.com/developers/creating-plugins.html

a. Register a handler that listens to the event “OrthancPluginChangeType_StableStudy” using “OrthancPluginRegisterOnChangeCallback()”.
b. Get all the required tags from the study of interest by using the REST API of Orthanc using “OrthancPluginRestApiGet()”.

c. Call your favorite HL7 client library from the plugin.

2- This could be implemented by combining Python’s “Watchdog” library with the REST API of Orthanc:
https://pypi.org/project/watchdog/

https://bitbucket.org/sjodogne/orthanc/src/default/Resources/Samples/ImportDicomFiles/ImportDicomFiles.py

3- Check out the Orthanc Book for such an example using Lua scripting:
https://book.orthanc-server.com/users/lua.html#important-remarks-about-auto-routing

HTH,
Sébastien-