comparison OrthancServer/Resources/Samples/Lua/AutoroutingConditional.lua @ 4044:d25f4c0fa160 framework

splitting code into OrthancFramework and OrthancServer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Jun 2020 20:30:34 +0200
parents Resources/Samples/Lua/AutoroutingConditional.lua@904096e7367e
children
comparison
equal deleted inserted replaced
4043:6c6239aec462 4044:d25f4c0fa160
1 function OnStoredInstance(instanceId, tags, metadata, origin)
2 -- The "origin" is only available since Orthanc 0.9.4
3 PrintRecursive(origin)
4
5 -- Extract the value of the "PatientName" DICOM tag
6 local patientName = string.lower(tags['PatientName'])
7
8 if string.find(patientName, 'david') ~= nil then
9 -- Only send patients whose name contains "David"
10 Delete(SendToModality(instanceId, 'sample'))
11
12 else
13 -- Delete the patients that are not called "David"
14 Delete(instanceId)
15 end
16 end