# HG changeset patch # User Sebastien Jodogne # Date 1602596485 -7200 # Node ID 485f9be9ba92423ea59fa2d8c37bb100805c92d6 # Parent 38b24aa98ed3b0cab896f6831a0908f5870b0cca improvement diff -r 38b24aa98ed3 -r 485f9be9ba92 OrthancServer/Resources/Samples/Lua/ClassifyUsingAet.lua --- a/OrthancServer/Resources/Samples/Lua/ClassifyUsingAet.lua Tue Oct 13 15:36:48 2020 +0200 +++ b/OrthancServer/Resources/Samples/Lua/ClassifyUsingAet.lua Tue Oct 13 15:41:25 2020 +0200 @@ -28,12 +28,14 @@ local tags = ParseJson(RestApiGet('/instances/' .. instanceId .. '/tags?simplify')) local metadata = ParseJson(RestApiGet('/instances/' .. instanceId .. '/metadata?expand')) - local path = ToAscii( - TARGET .. '/' .. - GetFromTable(metadata, 'RemoteAET', 'None') .. '/'.. - GetFromTable(tags, 'PatientID', '') .. ' - ' .. GetFromTable(tags, 'PatientName', '') .. '/' .. - GetFromTable(tags, 'StudyDate', '') .. ' - ' .. GetFromTable(tags, 'StudyDescription', '') .. '/' .. - GetFromTable(tags, 'SeriesDescription', '')) + local path = ToAscii(TARGET .. '/' .. + GetFromTable(metadata, 'RemoteAET', 'None') .. '/'.. + GetFromTable(tags, 'StudyDate', '') .. '/' .. + GetFromTable(tags, 'PatientID', '') .. ' - ' .. + GetFromTable(tags, 'PatientName', '') .. ' - ' .. + GetFromTable(tags, 'StudyDescription', '') .. '/' .. + GetFromTable(tags, 'Modality', '') .. ' - ' .. + GetFromTable(tags, 'SeriesDescription', '')) -- Create the subdirectory (CAUTION: For Linux demo only, this is insecure!) -- http://stackoverflow.com/a/16029744/881731 @@ -44,6 +46,6 @@ target:write(dicom) target:close() - -- Optional step: Remove the source file + -- Optional step: Remove the DICOM instance from Orthanc RestApiDelete('/instances/' .. instanceId) end