diff OrthancServer/ServerToolbox.cpp @ 1673:0bbcfd9695e5 db-changes

UpgradeDatabase in the sample plugin
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 02 Oct 2015 13:26:05 +0200
parents a412ad57f0f9
children 2ad22b2970a2
line wrap: on
line diff
--- a/OrthancServer/ServerToolbox.cpp	Fri Oct 02 12:20:49 2015 +0200
+++ b/OrthancServer/ServerToolbox.cpp	Fri Oct 02 13:26:05 2015 +0200
@@ -33,9 +33,10 @@
 #include "PrecompiledHeadersServer.h"
 #include "ServerToolbox.h"
 
+#include "../Core/DicomFormat/DicomArray.h"
+#include "../Core/FileStorage/StorageAccessor.h"
 #include "../Core/Logging.h"
 #include "../Core/OrthancException.h"
-#include "../Core/DicomFormat/DicomArray.h"
 #include "ParsedDicomFile.h"
 
 #include <cassert>
@@ -286,8 +287,10 @@
         }
 
         // Read and parse the content of the DICOM file
+        StorageAccessor accessor(storageArea);
+
         std::string content;
-        storageArea.Read(content, attachment.GetUuid(), FileContentType_Dicom);
+        accessor.Read(content, attachment);
 
         ParsedDicomFile dicom(content);
 
@@ -306,7 +309,7 @@
           case ResourceType_Study:
             Toolbox::SetMainDicomTags(database, resource, ResourceType_Study, dicomSummary, true);
 
-            // Duplicate the patient tags at the study level
+            // Duplicate the patient tags at the study level (new in Orthanc 0.9.5 - db v6)
             Toolbox::SetMainDicomTags(database, resource, ResourceType_Patient, dicomSummary, false);
             break;