My lua script for auto-routing files received in Orthanc is as below:
function OnStoredInstance(instanceId, tags, metadata)
SendToModality(instanceId, 'sample')
end
How can I filter and allow only files with first and foremost a StudyDescription dicom tag and secondly a certain StudyDescription dicom tag to be received in the directory which I have set in my Orthanc configuration file for auto-routing. Have tried all the methods in the lua script documentation but none has worked to suit my case.
What piece of code should I add into this function:
function OnStoredInstance(instanceId, tags, metadata)
SendToModality(instanceId, 'sample')
end
(Note: Some of the files I am receiving completely don't have a StudyDescription dicom tag.)
Here is an example of conditional routing with Lua taken from the Orthanc docs
You can change the PatientName tag to StudyDescription since they belong to the study level.