Hello,
I've been using Orthanc as an auto-router to cloud storage as well as a local back-up for 4 years now. I would like to be able to route the incoming studies in one block instead of instance-by-instance. I have been trying to convert my existing auto-route Lua using onStableStudy instead of onStoredInstance but have not been successful. Also, I use the origin parameter for parsing certain studies and see that it isn't listed as a parameter in the onStoredInstance documentation (at least that I can find).
here is my current auto-routing code, if it helps:
function OnStoredInstance(instanceId, tags, metadata, origin)
-- Extract the value of the "PatientName" DICOM tag
local patientName= string.lower(tags['PatientName'])
--Do not send out exams received from MIM (192.168.6.41)
if origin['RemoteIp'] ~= '192.168.6.41' then
print('onStoredInstance function has been called')
SendToModality(instanceId, '03-MIMCLOUD')
print(patientName..' image sent to Mim')
SendToModality(instanceId, '08-RADIUS')
print(patientName..' image sent to Radius')
SendToModality(instanceId, '09-MIM-CD')
print(patientName..' image sent to Front Desk Archive')
end
--Only route CT SCANS to MEDICVISION
if origin['RemoteIp'] == '192.168.6.10' then
print('CT scan found')
SendToModality(instanceId, '13-MEDICVISION')
print('CT image sent to MEDICVISION')
end
Thanks for any help!
Jason McDonald
print('SendToModality has been executed')
end