changeset 2039:e33e0ae51d7b

new configuration option AllowFindSopClassesInStudy
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 21 Jun 2016 15:17:49 +0200
parents 235319b3ddf0
children 6ea2e264ca50
files NEWS OrthancServer/OrthancFindRequestHandler.cpp Resources/Configuration.json
diffstat 3 files changed, 22 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Tue Jun 21 14:29:45 2016 +0200
+++ b/NEWS	Tue Jun 21 15:17:49 2016 +0200
@@ -6,7 +6,7 @@
 
 * HTTPS client certificates can be associated with Orthanc peers to enhance security over Internet
 * Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
-* New option "--logfile" to output the Orthanc log to the given file
+* New command-line option "--logfile" to output the Orthanc log to the given file
 * Support of SIGHUP signal (restart Orthanc only if the configuration files have changed)
 
 REST API
@@ -61,6 +61,7 @@
 * Upgrade to Boost 1.60.0 for static builds
 * Use of HTTP status 403 Forbidden (instead of 401) if access to a REST resource is disallowed
 * Option "HttpsVerifyPeers" can be used to connect against self-signed HTTPS certificates
+* New configuration option "AllowFindSopClassesInStudy"
 * Macro "__linux" (now obsolete) replaced by macro "__linux__" (maybe solves Debian bug #821011)
 * Modification of instances can now replace PixelData (resp. EncapsulatedDocument) with 
   provided a PNG/JPEG image (resp. PDF file) if it is encoded using Data URI Scheme
--- a/OrthancServer/OrthancFindRequestHandler.cpp	Tue Jun 21 14:29:45 2016 +0200
+++ b/OrthancServer/OrthancFindRequestHandler.cpp	Tue Jun 21 15:17:49 2016 +0200
@@ -112,6 +112,9 @@
                                       const DicomTag& tag,
                                       const std::list<std::string>& instances)
   {
+    // WARNING: This function is slow, as it reads the JSON file
+    // summarizing each instance of interest from the hard drive.
+
     std::string formatted = tag.Format();
 
     for (std::list<std::string>::const_iterator
@@ -223,9 +226,18 @@
 
     if (query.HasTag(DICOM_TAG_SOP_CLASSES_IN_STUDY))
     {
-      std::set<std::string> values;
-      ExtractTagFromInstances(values, context, DICOM_TAG_SOP_CLASS_UID, instances);
-      StoreSetOfStrings(result, DICOM_TAG_SOP_CLASSES_IN_STUDY, values);
+      if (Configuration::GetGlobalBoolParameter("AllowFindSopClassesInStudy", false))
+      {
+        std::set<std::string> values;
+        ExtractTagFromInstances(values, context, DICOM_TAG_SOP_CLASS_UID, instances);
+        StoreSetOfStrings(result, DICOM_TAG_SOP_CLASSES_IN_STUDY, values);
+      }
+      else
+      {
+        result.SetValue(DICOM_TAG_SOP_CLASSES_IN_STUDY, "", false);
+        LOG(WARNING) << "The handling of \"SOP Classes in Study\" (0008,0062) "
+                     << "in C-FIND requests is disabled";
+      }
     }
   }
 
--- a/Resources/Configuration.json	Tue Jun 21 14:29:45 2016 +0200
+++ b/Resources/Configuration.json	Tue Jun 21 15:17:49 2016 +0200
@@ -302,6 +302,11 @@
      }
    **/
   
+  // If set to "true", Orthanc will handle "SOP Classes in Study"
+  // (0008,0062) in C-FIND requests. This option is turned off by
+  // default, as it requires intensive accesses to the hard drive.
+  "AllowFindSopClassesInStudy" : false,
+
   // Register a new tag in the dictionary of DICOM tags that are known
   // to Orthanc. Each line must contain the tag (formatted as 2
   // hexadecimal numbers), the value representation (2 upcase