comparison OrthancServer/Sources/ServerToolbox.cpp @ 4498:7b99e8bb8246

IStorageArea::HasReadRange()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 09 Feb 2021 11:37:13 +0100
parents d9473bd5ed43
children ff8170d17d90
comparison
equal deleted inserted replaced
4497:10357b2f7150 4498:7b99e8bb8246
377 for (std::list<std::string>::const_iterator 377 for (std::list<std::string>::const_iterator
378 it = instances.begin(); it != instances.end(); ++it) 378 it = instances.begin(); it != instances.end(); ++it)
379 { 379 {
380 ServerContext::DicomCacheLocker locker(context, *it); 380 ServerContext::DicomCacheLocker locker(context, *it);
381 381
382 Json::Value dicomAsJson; 382 // Delay the reconstruction of DICOM-as-JSON to its next access through "ServerContext"
383 OrthancConfiguration::DefaultDicomDatasetToJson(dicomAsJson, locker.GetDicom()); 383 context.GetIndex().DeleteAttachment(*it, FileContentType_DicomAsJson);
384 384
385 std::string s = dicomAsJson.toStyledString();
386 context.AddAttachment(*it, FileContentType_DicomAsJson, s.c_str(), s.size());
387
388 context.GetIndex().ReconstructInstance(locker.GetDicom()); 385 context.GetIndex().ReconstructInstance(locker.GetDicom());
389 } 386 }
390 } 387 }
391 } 388 }
392 } 389 }