1011
|
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
|