changeset 5956:db4bae374968

fix
author Alain Mazy <am@orthanc.team>
date Thu, 16 Jan 2025 15:19:10 +0100
parents 34ba0344f240
children e068fbad9a36
files OrthancServer/Sources/ServerJobs/ArchiveJob.cpp
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp	Thu Jan 16 12:16:35 2025 +0100
+++ b/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp	Thu Jan 16 15:19:10 2025 +0100
@@ -31,6 +31,7 @@
 #include "../../../OrthancFramework/Sources/Logging.h"
 #include "../../../OrthancFramework/Sources/OrthancException.h"
 #include "../../../OrthancFramework/Sources/MultiThreading/Semaphore.h"
+#include "../../../OrthancFramework/Sources/SerializationToolbox.h"
 #include "../OrthancConfiguration.h"
 #include "../ServerContext.h"
 #include "../SimpleInstanceOrdering.h"
@@ -586,7 +587,20 @@
 
       if (level_ == ArchiveResourceType_Instance)
       {
-        AddResourceToExpand(id);
+        std::string strIndexInSeries;
+        uint32_t indexInSeries = 0;
+        FileInfo fileInfo;
+        int64_t revisionNotUsed;
+        
+        if (index.LookupMetadata(strIndexInSeries, id, ResourceType_Instance, MetadataType_Instance_IndexInSeries))
+        {
+          SerializationToolbox::ParseUnsignedInteger32(indexInSeries, strIndexInSeries);
+        }
+
+        if (index.LookupAttachment(fileInfo, revisionNotUsed, ResourceType_Instance, id, FileContentType_Dicom))
+        {
+          AddInstance(id, indexInSeries, fileInfo);
+        }
       }
       else if (resource.GetLevel() == GetResourceLevel(level_))
       {