Mercurial > hg > orthanc
annotate Resources/Samples/Lua/AutoroutingConditional.lua @ 4014:27628b0f6ada
merging logging code for plugins and files
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 08 Jun 2020 17:03:25 +0200 |
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 |