Mercurial > hg > orthanc-tests
comparison Database/Lua/AutoroutingConditional.lua @ 16:04fa104ab63b
lua
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 19 Jun 2015 08:34:24 +0200 |
parents | |
children | 525a2f57ec94 |
comparison
equal
deleted
inserted
replaced
15:2e5dbbbe3889 | 16:04fa104ab63b |
---|---|
1 function OnStoredInstance(instanceId, tags, metadata, remoteAet, calledAet) | |
2 -- The "remoteAet" and "calledAet" arguments are only available | |
3 -- since Orthanc 0.8.6 | |
4 if remoteAet ~=nil and calledAet ~= nil then | |
5 print ("Source AET: " .. remoteAet .. " => Called AET: " .. calledAet) | |
6 end | |
7 | |
8 -- Extract the value of the "PatientName" DICOM tag | |
9 local patientName = string.lower(tags['PatientName']) | |
10 | |
11 if string.find(patientName, 'knee') ~= nil then | |
12 -- Only send patients whose name contains "Knee" | |
13 Delete(SendToModality(instanceId, 'orthanctest')) | |
14 | |
15 else | |
16 -- Delete the patients that are not called "Knee" | |
17 Delete(instanceId) | |
18 end | |
19 end |