# HG changeset patch # User Alain Mazy # Date 1485957864 0 # Node ID 1442da6a03ddd801ba01d6d9942535aa4838e34d # Parent 4305c183c7f8820c23c046111538edcdfd343933 removed unused .orig file diff -r 4305c183c7f8 -r 1442da6a03dd Resources/Samples/Lua/OnStableStudy.lua.orig --- a/Resources/Samples/Lua/OnStableStudy.lua.orig Wed Feb 01 14:03:41 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -function Initialize() - print('Number of stored studies at initialization: ' .. - table.getn(ParseJson(RestApiGet('/studies')))) -end - - -function Finalize() - print('Number of stored studies at finalization: ' .. - table.getn(ParseJson(RestApiGet('/studies')))) -end - - -function OnStoredInstance(instanceId, tags, metadata) - patient = ParseJson(RestApiGet('/instances/' .. instanceId .. '/patient')) - print('Received an instance for patient: ' .. - patient['MainDicomTags']['PatientID'] .. ' - ' .. - patient['MainDicomTags']['PatientName']) -end - - -function OnStableStudy(studyId, tags, metadata) - if (metadata['ModifiedFrom'] == nil and - metadata['AnonymizedFrom'] == nil) then - - print('This study is now stable: ' .. studyId) - - -- The tags to be replaced - local replace = {} - replace['StudyDescription'] = 'Modified study' - replace['StationName'] = 'My Medical Device' - replace['0031-1020'] = 'Some private tag' - - -- The tags to be removed - local remove = { 'MilitaryRank' } - - -- The modification command - local command = {} - command['Remove'] = remove - command['Replace'] = replace - - -- Modify the entire study in one single call - local m = RestApiPost('/studies/' .. studyId .. '/modify', - DumpJson(command, true)) - print('Modified study: ' .. m) - end -end