diff OrthancServer/Sources/ServerJobs/MergeStudyJob.cpp @ 4508:8f9090b137f1

Optimization in C-STORE SCP by avoiding an unnecessary DICOM parsing
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 11 Feb 2021 11:00:05 +0100
parents d9473bd5ed43
children f0038043fb97 fb98db281d1d
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerJobs/MergeStudyJob.cpp	Thu Feb 11 09:33:48 2021 +0100
+++ b/OrthancServer/Sources/ServerJobs/MergeStudyJob.cpp	Thu Feb 11 11:00:05 2021 +0100
@@ -147,12 +147,11 @@
     // Fix since Orthanc 1.5.8: Assign new "SOPInstanceUID", as the instance has been modified
     modified->ReplacePlainString(DICOM_TAG_SOP_INSTANCE_UID, FromDcmtkBridge::GenerateUniqueIdentifier(ResourceType_Instance));
 
-    DicomInstanceToStore toStore;
-    toStore.SetOrigin(origin_);
-    toStore.SetParsedDicomFile(*modified);
+    std::unique_ptr<DicomInstanceToStore> toStore(DicomInstanceToStore::CreateFromParsedDicomFile(*modified));
+    toStore->SetOrigin(origin_);
 
     std::string modifiedInstance;
-    if (GetContext().Store(modifiedInstance, toStore,
+    if (GetContext().Store(modifiedInstance, *toStore,
                        StoreInstanceMode_Default) != StoreStatus_Success)
     {
       LOG(ERROR) << "Error while storing a modified instance " << instance;