changeset 515:baf2b0c3ef0e

enforce minimal version of Orthanc core (1.11.0), not only of SDK
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 25 Apr 2022 16:28:07 +0200
parents 87b0e7e4d8d5
children 05f2e83dc050
files Plugin/Plugin.cpp
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Plugin/Plugin.cpp	Mon Apr 25 15:51:49 2022 +0200
+++ b/Plugin/Plugin.cpp	Mon Apr 25 16:28:07 2022 +0200
@@ -35,6 +35,11 @@
 #include <boost/algorithm/string/predicate.hpp>
 
 
+#define ORTHANC_CORE_MINIMAL_MAJOR     1
+#define ORTHANC_CORE_MINIMAL_MINOR     11
+#define ORTHANC_CORE_MINIMAL_REVISION  0
+
+
 static const char* const HAS_DELETE = "HasDelete";
 
 
@@ -512,6 +517,20 @@
       return -1;
     }
 
+    if (!OrthancPlugins::CheckMinimalOrthancVersion(ORTHANC_CORE_MINIMAL_MAJOR,
+                                                    ORTHANC_CORE_MINIMAL_MINOR,
+                                                    ORTHANC_CORE_MINIMAL_REVISION))
+    {
+      char info[1024];
+      sprintf(info, "Your version of Orthanc (%s) must be above %d.%d.%d to run this plugin",
+              context->orthancVersion,
+              ORTHANC_CORE_MINIMAL_MAJOR,
+              ORTHANC_CORE_MINIMAL_MINOR,
+              ORTHANC_CORE_MINIMAL_REVISION);
+      OrthancPluginLogError(context, info);
+      return -1;
+    }
+
 #if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_CLIENT == 0
     LOG(WARNING) << "Performance warning in DICOMweb: The plugin was compiled against "
                  << "Orthanc SDK <= 1.5.6. STOW and WADO chunked transfers will be entirely stored in RAM.";