diff OrthancServer/Sources/ServerIndex.cpp @ 4514:5b929e6b3c36

removal of "dicom-as-json" attachments
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 16 Feb 2021 12:18:41 +0100
parents b4c58795f3a8
children 350a22c094f2
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerIndex.cpp	Fri Feb 12 12:13:19 2021 +0100
+++ b/OrthancServer/Sources/ServerIndex.cpp	Tue Feb 16 12:18:41 2021 +0100
@@ -975,11 +975,13 @@
           }
         }
 
-        // New in Orthanc 1.9.1
-        SetInstanceMetadata(content, instanceMetadata, instanceId,
-                            MetadataType_Instance_PixelDataOffset,
-                            (hasPixelDataOffset ? 
-                             boost::lexical_cast<std::string>(pixelDataOffset) : ""));
+        if (hasPixelDataOffset)
+        {
+          // New in Orthanc 1.9.1
+          SetInstanceMetadata(content, instanceMetadata, instanceId,
+                              MetadataType_Instance_PixelDataOffset,
+                              boost::lexical_cast<std::string>(pixelDataOffset));
+        }
         
         const DicomValue* value;
         if ((value = dicomSummary.TestAndGetValue(DICOM_TAG_SOP_CLASS_UID)) != NULL &&
@@ -1900,7 +1902,7 @@
   }
 
 
-  void ServerIndex::ListAvailableAttachments(std::list<FileContentType>& target,
+  void ServerIndex::ListAvailableAttachments(std::set<FileContentType>& target,
                                              const std::string& publicId,
                                              ResourceType expectedType)
   {
@@ -2030,10 +2032,10 @@
 
       ResourceType thisType = db_.GetResourceType(resource);
 
-      std::list<FileContentType> f;
+      std::set<FileContentType> f;
       db_.ListAvailableAttachments(f, resource);
 
-      for (std::list<FileContentType>::const_iterator
+      for (std::set<FileContentType>::const_iterator
              it = f.begin(); it != f.end(); ++it)
       {
         FileInfo attachment;