Mercurial > hg > orthanc
comparison Resources/Samples/Lua/Autorouting.lua @ 1011:23590917e83e lua-scripting
lua samples
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 09 Jul 2014 17:51:28 +0200 |
parents | 160dfe770618 |
children |
comparison
equal
deleted
inserted
replaced
1010:160dfe770618 | 1011:23590917e83e |
---|---|
1 function OnStoredInstance(instanceId, tags, metadata) | 1 function OnStoredInstance(instanceId, tags, metadata) |
2 --PrintRecursive(tags) | 2 Delete(SendToModality(instanceId, 'sample')) |
3 --PrintRecursive(metadata) | |
4 --print(metadata['RemoteAET']) | |
5 | |
6 if (metadata['ModifiedFrom'] == nil and | |
7 metadata['AnonymizedFrom'] == nil) then | |
8 local patientName = string.lower(tags['PatientName']) | |
9 if string.find(patientName, 'david') ~= nil then | |
10 --Delete(SendToModality(instanceId, 'sample')) | |
11 --Delete(SendToPeer(instanceId, 'peer')) | |
12 local replace = {} | |
13 replace['StationName'] = 'My Medical Device' | |
14 | |
15 local remove = { 'MilitaryRank' } | |
16 | |
17 Delete(SendToModality(ModifyInstance(instanceId, replace, remove, true), 'sample')) | |
18 Delete(instanceId) | |
19 else | |
20 Delete(instanceId) | |
21 end | |
22 end | |
23 end | 3 end |