comparison Resources/Samples/Lua/AutoroutingModification.lua @ 1011:23590917e83e lua-scripting

lua samples
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 09 Jul 2014 17:51:28 +0200
parents
children f796207e3df1
comparison
equal deleted inserted replaced
1010:160dfe770618 1011:23590917e83e
1 function OnStoredInstance(instanceId, tags, metadata)
2 -- Ignore the instances that result from a modification to avoid
3 -- infinite loops
4 if (metadata['ModifiedFrom'] == nil and
5 metadata['AnonymizedFrom'] == nil) then
6
7 -- The tags to be replaced
8 local replace = {}
9 replace['StationName'] = 'My Medical Device'
10
11 -- The tags to be removed
12 local remove = { 'MilitaryRank' }
13
14 -- Modify the instance, send it, then delete the modified instance
15 Delete(SendToModality(ModifyInstance(instanceId, replace, remove, true), 'sample'))
16
17 -- Delete the original instance
18 Delete(instanceId)
19 end
20 end