diff OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp @ 5574:5a13483d12c5 find-refactoring

find-refactoring: attachments
author Alain Mazy <am@orthanc.team>
date Fri, 26 Apr 2024 16:32:18 +0200
parents 738f80622e91
children 77570cce8855
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp	Thu Apr 25 17:07:33 2024 +0200
+++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp	Fri Apr 26 16:32:18 2024 +0200
@@ -3926,6 +3926,24 @@
     {
       labels_ = item.GetLabels();
     }
-    // TODO-FIND: continue: isStable_, satus_, fileSize_, fileUuid_
+
+    if (item.HasResponseContent(FindRequest::ResponseContent_Attachments))
+    {
+      FileInfo attachment;
+      if (item.LookupAttachment(attachment, FileContentType_Dicom))
+      {
+        fileSize_ = attachment.GetUncompressedSize();
+        fileUuid_ = attachment.GetUuid();
+      }
+    }
+
+    if (item.HasResponseContent(FindRequest::ResponseContent_ChildrenMetadata))
+    {
+      // TODO-FIND: the status_ is normally obtained from transaction.GetSeriesStatus(internalId, i)
+      // but, that's an heavy operation for something that is rarely used -> we should have dedicated SQL code 
+      // to compute it AFAP and we should compute it only if the user request it !
+    }
+
+    // TODO-FIND: continue: isStable_, status_
   }
 }