diff OrthancServer/Sources/DicomInstanceToStore.cpp @ 4504:7d1eabfac6e0

removed cached dicom-as-json from DicomInstanceToStore
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Feb 2021 11:29:53 +0100
parents d9473bd5ed43
children 97d103b57cd1
line wrap: on
line diff
--- a/OrthancServer/Sources/DicomInstanceToStore.cpp	Tue Feb 09 17:05:45 2021 +0100
+++ b/OrthancServer/Sources/DicomInstanceToStore.cpp	Wed Feb 10 11:29:53 2021 +0100
@@ -158,7 +158,6 @@
     size_t                               bufferSize_;
     SmartContainer<ParsedDicomFile>      parsed_;
     SmartContainer<DicomMap>             summary_;
-    SmartContainer<Json::Value>          json_;
     MetadataMap                          metadata_;
 
     PImpl() :
@@ -194,8 +193,7 @@
     void ComputeMissingInformation()
     {
       if (hasBuffer_ &&
-          summary_.HasContent() &&
-          json_.HasContent())
+          summary_.HasContent())
       {
         // Fine, everything is available
         return; 
@@ -229,32 +227,20 @@
         hasBuffer_ = true;
       }
 
-      if (summary_.HasContent() &&
-          json_.HasContent())
-      {
-        return;
-      }
-
-      // At this point, we know that the DICOM file is available as a
-      // memory buffer, but that its summary or its JSON version is
-      // missing
-
-      ParseDicomFile();
-      assert(parsed_.HasContent());
-
-      // At this point, we have parsed the DICOM file
-    
       if (!summary_.HasContent())
       {
+        // At this point, we know that the DICOM file is available as a
+        // memory buffer, but that its summary or its JSON version is
+        // missing
+        
+        ParseDicomFile();
+        assert(parsed_.HasContent());
+
+        // At this point, we have parsed the DICOM file
+        
         summary_.Allocate();
         OrthancConfiguration::DefaultExtractDicomSummary(summary_.GetContent(), parsed_.GetContent());
       }
-    
-      if (!json_.HasContent())
-      {
-        json_.Allocate();
-        OrthancConfiguration::DefaultDicomDatasetToJson(json_.GetContent(), parsed_.GetContent());
-      }
     }
 
 
@@ -328,19 +314,6 @@
     }
 
     
-    const Json::Value& GetJson()
-    {
-      ComputeMissingInformation();
-    
-      if (!json_.HasContent())
-      {
-        throw OrthancException(ErrorCode_InternalError);
-      }
-
-      return json_.GetConstContent();
-    }
-
-
     DicomInstanceHasher& GetHasher()
     {
       if (hasher_.get() == NULL)
@@ -444,12 +417,6 @@
   }
 
 
-  void DicomInstanceToStore::SetJson(const Json::Value& json)
-  {
-    pimpl_->json_.SetConstReference(json);
-  }
-
-
   const DicomInstanceToStore::MetadataMap& DicomInstanceToStore::GetMetadata() const
   {
     return pimpl_->metadata_;
@@ -488,12 +455,6 @@
   }
 
     
-  const Json::Value& DicomInstanceToStore::GetJson() const
-  {
-    return const_cast<PImpl&>(*pimpl_).GetJson();
-  }
-
-
   bool DicomInstanceToStore::LookupTransferSyntax(std::string& result) const
   {
     return const_cast<PImpl&>(*pimpl_).LookupTransferSyntax(result);