Mercurial > hg > orthanc
annotate Resources/Samples/Lua/AutoroutingConditional.lua @ 3349:ef18ea68a362
merge
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Thu, 18 Apr 2019 15:52:56 +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 |