Mercurial > hg > orthanc
comparison OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.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 | 5fabef29c4ff |
comparison
equal
deleted
inserted
replaced
4626:686f189a903d | 4627:f7d5372b59b3 |
---|---|
303 CheckNoEvent(); | 303 CheckNoEvent(); |
304 } | 304 } |
305 | 305 |
306 | 306 |
307 virtual void AddAttachment(int64_t id, | 307 virtual void AddAttachment(int64_t id, |
308 const FileInfo& attachment) ORTHANC_OVERRIDE | 308 const FileInfo& attachment, |
309 int64_t revision) ORTHANC_OVERRIDE | |
309 { | 310 { |
310 OrthancPluginAttachment tmp; | 311 OrthancPluginAttachment tmp; |
311 tmp.uuid = attachment.GetUuid().c_str(); | 312 tmp.uuid = attachment.GetUuid().c_str(); |
312 tmp.contentType = static_cast<int32_t>(attachment.GetContentType()); | 313 tmp.contentType = static_cast<int32_t>(attachment.GetContentType()); |
313 tmp.uncompressedSize = attachment.GetUncompressedSize(); | 314 tmp.uncompressedSize = attachment.GetUncompressedSize(); |
314 tmp.uncompressedHash = attachment.GetUncompressedMD5().c_str(); | 315 tmp.uncompressedHash = attachment.GetUncompressedMD5().c_str(); |
315 tmp.compressionType = static_cast<int32_t>(attachment.GetCompressionType()); | 316 tmp.compressionType = static_cast<int32_t>(attachment.GetCompressionType()); |
316 tmp.compressedSize = attachment.GetCompressedSize(); | 317 tmp.compressedSize = attachment.GetCompressedSize(); |
317 tmp.compressedHash = attachment.GetCompressedMD5().c_str(); | 318 tmp.compressedHash = attachment.GetCompressedMD5().c_str(); |
318 | 319 |
319 CheckSuccess(that_.backend_.addAttachment(transaction_, id, &tmp)); | 320 CheckSuccess(that_.backend_.addAttachment(transaction_, id, &tmp, revision)); |
320 CheckNoEvent(); | 321 CheckNoEvent(); |
321 } | 322 } |
322 | 323 |
323 | 324 |
324 virtual void ClearChanges() ORTHANC_OVERRIDE | 325 virtual void ClearChanges() ORTHANC_OVERRIDE |
664 CheckNoEvent(); | 665 CheckNoEvent(); |
665 } | 666 } |
666 | 667 |
667 | 668 |
668 virtual bool LookupAttachment(FileInfo& attachment, | 669 virtual bool LookupAttachment(FileInfo& attachment, |
670 int64_t& revision, | |
669 int64_t id, | 671 int64_t id, |
670 FileContentType contentType) ORTHANC_OVERRIDE | 672 FileContentType contentType) ORTHANC_OVERRIDE |
671 { | 673 { |
672 CheckSuccess(that_.backend_.lookupAttachment(transaction_, id, static_cast<int32_t>(contentType))); | 674 CheckSuccess(that_.backend_.lookupAttachment(transaction_, &revision, id, static_cast<int32_t>(contentType))); |
673 CheckNoEvent(); | 675 CheckNoEvent(); |
674 | 676 |
675 uint32_t count; | 677 uint32_t count; |
676 CheckSuccess(that_.backend_.readAnswersCount(transaction_, &count)); | 678 CheckSuccess(that_.backend_.readAnswersCount(transaction_, &count)); |
677 | 679 |
1125 CHECK_FUNCTION_EXISTS(backend_, getLastChange); | 1127 CHECK_FUNCTION_EXISTS(backend_, getLastChange); |
1126 CHECK_FUNCTION_EXISTS(backend_, getLastChangeIndex); | 1128 CHECK_FUNCTION_EXISTS(backend_, getLastChangeIndex); |
1127 CHECK_FUNCTION_EXISTS(backend_, getLastExportedResource); | 1129 CHECK_FUNCTION_EXISTS(backend_, getLastExportedResource); |
1128 CHECK_FUNCTION_EXISTS(backend_, getMainDicomTags); | 1130 CHECK_FUNCTION_EXISTS(backend_, getMainDicomTags); |
1129 CHECK_FUNCTION_EXISTS(backend_, getPublicId); | 1131 CHECK_FUNCTION_EXISTS(backend_, getPublicId); |
1132 CHECK_FUNCTION_EXISTS(backend_, getResourceType); | |
1130 CHECK_FUNCTION_EXISTS(backend_, getResourcesCount); | 1133 CHECK_FUNCTION_EXISTS(backend_, getResourcesCount); |
1131 CHECK_FUNCTION_EXISTS(backend_, getResourceType); | |
1132 CHECK_FUNCTION_EXISTS(backend_, getTotalCompressedSize); | 1134 CHECK_FUNCTION_EXISTS(backend_, getTotalCompressedSize); |
1133 CHECK_FUNCTION_EXISTS(backend_, getTotalUncompressedSize); | 1135 CHECK_FUNCTION_EXISTS(backend_, getTotalUncompressedSize); |
1134 CHECK_FUNCTION_EXISTS(backend_, isDiskSizeAbove); | 1136 CHECK_FUNCTION_EXISTS(backend_, isDiskSizeAbove); |
1135 CHECK_FUNCTION_EXISTS(backend_, isExistingResource); | 1137 CHECK_FUNCTION_EXISTS(backend_, isExistingResource); |
1136 CHECK_FUNCTION_EXISTS(backend_, isProtectedPatient); | 1138 CHECK_FUNCTION_EXISTS(backend_, isProtectedPatient); |
1140 CHECK_FUNCTION_EXISTS(backend_, lookupAttachment); | 1142 CHECK_FUNCTION_EXISTS(backend_, lookupAttachment); |
1141 CHECK_FUNCTION_EXISTS(backend_, lookupGlobalProperty); | 1143 CHECK_FUNCTION_EXISTS(backend_, lookupGlobalProperty); |
1142 CHECK_FUNCTION_EXISTS(backend_, lookupMetadata); | 1144 CHECK_FUNCTION_EXISTS(backend_, lookupMetadata); |
1143 CHECK_FUNCTION_EXISTS(backend_, lookupParent); | 1145 CHECK_FUNCTION_EXISTS(backend_, lookupParent); |
1144 CHECK_FUNCTION_EXISTS(backend_, lookupResource); | 1146 CHECK_FUNCTION_EXISTS(backend_, lookupResource); |
1147 CHECK_FUNCTION_EXISTS(backend_, lookupResourceAndParent); | |
1145 CHECK_FUNCTION_EXISTS(backend_, lookupResources); | 1148 CHECK_FUNCTION_EXISTS(backend_, lookupResources); |
1146 CHECK_FUNCTION_EXISTS(backend_, lookupResourceAndParent); | |
1147 CHECK_FUNCTION_EXISTS(backend_, selectPatientToRecycle); | 1149 CHECK_FUNCTION_EXISTS(backend_, selectPatientToRecycle); |
1148 CHECK_FUNCTION_EXISTS(backend_, selectPatientToRecycle2); | 1150 CHECK_FUNCTION_EXISTS(backend_, selectPatientToRecycle2); |
1149 CHECK_FUNCTION_EXISTS(backend_, setGlobalProperty); | 1151 CHECK_FUNCTION_EXISTS(backend_, setGlobalProperty); |
1150 CHECK_FUNCTION_EXISTS(backend_, setMetadata); | 1152 CHECK_FUNCTION_EXISTS(backend_, setMetadata); |
1151 CHECK_FUNCTION_EXISTS(backend_, setProtectedPatient); | 1153 CHECK_FUNCTION_EXISTS(backend_, setProtectedPatient); |