changeset 4249:485f9be9ba92

improvement
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 13 Oct 2020 15:41:25 +0200
parents 38b24aa98ed3
children cbf9afa17415
files OrthancServer/Resources/Samples/Lua/ClassifyUsingAet.lua
diffstat 1 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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