comparison OrthancServer/Sources/ServerToolbox.cpp @ 4627:f7d5372b59b3 db-changes

handling revisions of attachments
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 20 Apr 2021 15:11:59 +0200
parents 95ffe3b6ef7c
children 66109d24d26e
comparison
equal deleted inserted replaced
4626:686f189a903d 4627:f7d5372b59b3
163 " with identifier " + *it); 163 " with identifier " + *it);
164 } 164 }
165 165
166 // Get the DICOM file attached to some instances in the resource 166 // Get the DICOM file attached to some instances in the resource
167 FileInfo attachment; 167 FileInfo attachment;
168 if (!transaction.LookupAttachment(attachment, instance, FileContentType_Dicom)) 168 int64_t revision;
169 if (!transaction.LookupAttachment(attachment, revision, instance, FileContentType_Dicom))
169 { 170 {
170 throw OrthancException(ErrorCode_InternalError, 171 throw OrthancException(ErrorCode_InternalError,
171 "Cannot retrieve the DICOM file associated with instance " + 172 "Cannot retrieve the DICOM file associated with instance " +
172 transaction.GetPublicId(instance)); 173 transaction.GetPublicId(instance));
173 } 174 }
292 it = instances.begin(); it != instances.end(); ++it) 293 it = instances.begin(); it != instances.end(); ++it)
293 { 294 {
294 ServerContext::DicomCacheLocker locker(context, *it); 295 ServerContext::DicomCacheLocker locker(context, *it);
295 296
296 // Delay the reconstruction of DICOM-as-JSON to its next access through "ServerContext" 297 // Delay the reconstruction of DICOM-as-JSON to its next access through "ServerContext"
297 context.GetIndex().DeleteAttachment(*it, FileContentType_DicomAsJson); 298 context.GetIndex().DeleteAttachment(
299 *it, FileContentType_DicomAsJson, false /* no revision */, -1 /* dummy revision */);
298 300
299 context.GetIndex().ReconstructInstance(locker.GetDicom()); 301 context.GetIndex().ReconstructInstance(locker.GetDicom());
300 } 302 }
301 } 303 }
302 } 304 }