annotate Database/Lua/AutoroutingConditional.lua @ 175:09ca519087a1

doc
author am@osimis.io
date Thu, 20 Sep 2018 11:58:08 +0200
parents 525a2f57ec94
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
41
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 16
diff changeset
1 function OnStoredInstance(instanceId, tags, metadata, origin)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 16
diff changeset
2 -- The "origin" is only available since Orthanc 0.9.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 16
diff changeset
3 PrintRecursive(origin)
16
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 -- Extract the value of the "PatientName" DICOM tag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 local patientName = string.lower(tags['PatientName'])
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 if string.find(patientName, 'knee') ~= nil then
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 -- Only send patients whose name contains "Knee"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 Delete(SendToModality(instanceId, 'orthanctest'))
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 else
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 -- Delete the patients that are not called "Knee"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 Delete(instanceId)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 end