diff 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
line wrap: on
line diff
--- a/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.cpp	Mon Apr 19 10:28:43 2021 +0200
+++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.cpp	Tue Apr 20 15:11:59 2021 +0200
@@ -305,7 +305,8 @@
 
     
     virtual void AddAttachment(int64_t id,
-                               const FileInfo& attachment) ORTHANC_OVERRIDE
+                               const FileInfo& attachment,
+                               int64_t revision) ORTHANC_OVERRIDE
     {
       OrthancPluginAttachment tmp;
       tmp.uuid = attachment.GetUuid().c_str();
@@ -316,7 +317,7 @@
       tmp.compressedSize = attachment.GetCompressedSize();
       tmp.compressedHash = attachment.GetCompressedMD5().c_str();
 
-      CheckSuccess(that_.backend_.addAttachment(transaction_, id, &tmp));
+      CheckSuccess(that_.backend_.addAttachment(transaction_, id, &tmp, revision));
       CheckNoEvent();
     }
 
@@ -666,10 +667,11 @@
 
     
     virtual bool LookupAttachment(FileInfo& attachment,
+                                  int64_t& revision,
                                   int64_t id,
                                   FileContentType contentType) ORTHANC_OVERRIDE
     {
-      CheckSuccess(that_.backend_.lookupAttachment(transaction_, id, static_cast<int32_t>(contentType)));
+      CheckSuccess(that_.backend_.lookupAttachment(transaction_, &revision, id, static_cast<int32_t>(contentType)));
       CheckNoEvent();
 
       uint32_t count;
@@ -1127,8 +1129,8 @@
     CHECK_FUNCTION_EXISTS(backend_, getLastExportedResource);
     CHECK_FUNCTION_EXISTS(backend_, getMainDicomTags);
     CHECK_FUNCTION_EXISTS(backend_, getPublicId);
+    CHECK_FUNCTION_EXISTS(backend_, getResourceType);
     CHECK_FUNCTION_EXISTS(backend_, getResourcesCount);
-    CHECK_FUNCTION_EXISTS(backend_, getResourceType);
     CHECK_FUNCTION_EXISTS(backend_, getTotalCompressedSize);
     CHECK_FUNCTION_EXISTS(backend_, getTotalUncompressedSize);
     CHECK_FUNCTION_EXISTS(backend_, isDiskSizeAbove);
@@ -1142,8 +1144,8 @@
     CHECK_FUNCTION_EXISTS(backend_, lookupMetadata);
     CHECK_FUNCTION_EXISTS(backend_, lookupParent);
     CHECK_FUNCTION_EXISTS(backend_, lookupResource);
+    CHECK_FUNCTION_EXISTS(backend_, lookupResourceAndParent);
     CHECK_FUNCTION_EXISTS(backend_, lookupResources);
-    CHECK_FUNCTION_EXISTS(backend_, lookupResourceAndParent);
     CHECK_FUNCTION_EXISTS(backend_, selectPatientToRecycle);
     CHECK_FUNCTION_EXISTS(backend_, selectPatientToRecycle2);
     CHECK_FUNCTION_EXISTS(backend_, setGlobalProperty);