Mercurial > hg > orthanc
annotate OrthancServer/Resources/Samples/Lua/AutoroutingConditional.lua @ 4688:177ad026d219
backward compatibility with old DicomModification serialization from Orthanc <= 1.6.1
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 10 Jun 2021 10:09:54 +0200 |
parents | d25f4c0fa160 |
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 |