Mercurial > hg > orthanc
annotate Resources/Samples/Lua/AutoroutingConditional.lua @ 3200:1f4a2c58e7fa
set encoding to UTF-8, IBinaryFormatter
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 06 Feb 2019 13:51:20 +0100 |
parents | 904096e7367e |
children |
rev | line source |
---|---|
1572
904096e7367e
More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1285
diff
changeset
|
1 function OnStoredInstance(instanceId, tags, metadata, origin) |
904096e7367e
More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1285
diff
changeset
|
2 -- The "origin" is only available since Orthanc 0.9.4 |
904096e7367e
More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1285
diff
changeset
|
3 PrintRecursive(origin) |
1285
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1011
diff
changeset
|
4 |
1011 | 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 |