changeset 271:6b18d3fbee82

backward compatibility with Orthanc SDK 0.9.5
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 22 Apr 2021 10:41:29 +0200
parents 5931c2ff22ca
children c7dc70a0a477
files Framework/Plugins/DatabaseBackendAdapterV2.cpp Framework/Plugins/IndexBackend.cpp Framework/Plugins/IndexBackend.h Framework/Plugins/StorageBackend.cpp
diffstat 4 files changed, 23 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Plugins/DatabaseBackendAdapterV2.cpp	Wed Apr 21 17:56:43 2021 +0200
+++ b/Framework/Plugins/DatabaseBackendAdapterV2.cpp	Thu Apr 22 10:41:29 2021 +0200
@@ -1029,6 +1029,8 @@
   }
 
 
+#if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
+#  if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 4, 0)
   static OrthancPluginErrorCode  LookupIdentifierRange(OrthancPluginDatabaseContext* context,
                                                        void* payload,
                                                        OrthancPluginResourceType resourceType,
@@ -1059,6 +1061,8 @@
     }
     ORTHANC_PLUGINS_DATABASE_CATCH;
   }
+#  endif
+#endif
 
 
   static OrthancPluginErrorCode  LookupMetadata(OrthancPluginDatabaseContext* context,
@@ -1465,6 +1469,8 @@
 #endif    
 
     
+#if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
+#  if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 2)
   // New primitive since Orthanc 1.5.2
   static OrthancPluginErrorCode GetChildrenMetadata(OrthancPluginDatabaseContext* context,
                                                     void* payload,
@@ -1494,8 +1500,12 @@
     }
     ORTHANC_PLUGINS_DATABASE_CATCH;      
   }
+#  endif
+#endif
 
 
+#if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
+#  if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 2)
   // New primitive since Orthanc 1.5.2
   static OrthancPluginErrorCode GetLastChangeIndex(int64_t* result,
                                                    void* payload)
@@ -1510,8 +1520,12 @@
     }
     ORTHANC_PLUGINS_DATABASE_CATCH;      
   }
+#  endif
+#endif
 
 
+#if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
+#  if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 2)
   // New primitive since Orthanc 1.5.2
   static OrthancPluginErrorCode TagMostRecentPatient(void* payload,
                                                      int64_t patientId)
@@ -1526,6 +1540,8 @@
     }
     ORTHANC_PLUGINS_DATABASE_CATCH;      
   }
+#  endif
+#endif
    
 
 #if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)      // Macro introduced in 1.3.1
--- a/Framework/Plugins/IndexBackend.cpp	Wed Apr 21 17:56:43 2021 +0200
+++ b/Framework/Plugins/IndexBackend.cpp	Thu Apr 22 10:41:29 2021 +0200
@@ -2389,6 +2389,7 @@
 #endif
 
 
+#if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
   void IndexBackend::CreateInstanceGeneric(OrthancPluginCreateInstanceResult& result,
                                            DatabaseManager& manager,
                                            const char* hashPatient,
@@ -2505,6 +2506,7 @@
     assert(result.seriesId != -1);
     assert(result.instanceId != -1);
   }
+#endif
 
 
   void IndexBackend::Register(IndexBackend* backend,
--- a/Framework/Plugins/IndexBackend.h	Wed Apr 21 17:56:43 2021 +0200
+++ b/Framework/Plugins/IndexBackend.h	Thu Apr 22 10:41:29 2021 +0200
@@ -358,6 +358,7 @@
     }
 #endif
 
+#if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
     // This function corresponds to
     // "Orthanc::Compatibility::ICreateInstance::Apply()"
     void CreateInstanceGeneric(OrthancPluginCreateInstanceResult& result,
@@ -366,6 +367,7 @@
                                const char* hashStudy,
                                const char* hashSeries,
                                const char* hashInstance);
+#endif
 
     bool LookupGlobalIntegerProperty(int& target /*out*/,
                                      DatabaseManager& manager,
--- a/Framework/Plugins/StorageBackend.cpp	Wed Apr 21 17:56:43 2021 +0200
+++ b/Framework/Plugins/StorageBackend.cpp	Thu Apr 22 10:41:29 2021 +0200
@@ -315,7 +315,8 @@
   }
 
 
-#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 9, 0)
+#if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
+#  if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 9, 0)
   static OrthancPluginErrorCode StorageReadWhole(OrthancPluginMemoryBuffer64* target,
                                                  const char* uuid,
                                                  OrthancPluginContentType type)
@@ -492,6 +493,7 @@
     }
     ORTHANC_PLUGINS_DATABASE_CATCH;
   }
+#  endif
 #endif