# HG changeset patch # User Sebastien Jodogne # Date 1585207215 -3600 # Node ID 1b09b29434105c53b14d838bcc9019d5322ca4a0 # Parent d513e29bcd098c1485bc6e6a824053f2195ab613 more intuitive QidoCaseSensitive, cf. issue #56 diff -r d513e29bcd09 -r 1b09b2943410 NEWS --- a/NEWS Thu Mar 19 14:00:37 2020 +0100 +++ b/NEWS Thu Mar 26 08:20:15 2020 +0100 @@ -2,6 +2,12 @@ =============================== +Maintenance +----------- + +* "QidoCaseSensitive" defaults to "CaseSensitivePN" of Orthanc configuration (instead of "true") + + Version 1.1 (2020-03-04) ======================== diff -r d513e29bcd09 -r 1b09b2943410 Plugin/Configuration.cpp --- a/Plugin/Configuration.cpp Thu Mar 19 14:00:37 2020 +0100 +++ b/Plugin/Configuration.cpp Thu Mar 26 08:20:15 2020 +0100 @@ -334,6 +334,14 @@ } + bool LookupBooleanValue(bool& target, + const std::string& key) + { + assert(configuration_.get() != NULL); + return configuration_->LookupBooleanValue(target, key); + } + + unsigned int GetUnsignedIntegerValue(const std::string& key, unsigned int defaultValue) { diff -r d513e29bcd09 -r 1b09b2943410 Plugin/Configuration.h --- a/Plugin/Configuration.h Thu Mar 19 14:00:37 2020 +0100 +++ b/Plugin/Configuration.h Thu Mar 26 08:20:15 2020 +0100 @@ -92,12 +92,14 @@ { void Initialize(); - std::string GetStringValue(const std::string& key, - const std::string& defaultValue); - + bool HasKey(const std::string& key); + bool GetBooleanValue(const std::string& key, bool defaultValue); + bool LookupBooleanValue(bool& target, + const std::string& key); + unsigned int GetUnsignedIntegerValue(const std::string& key, unsigned int defaultValue); diff -r d513e29bcd09 -r 1b09b2943410 Plugin/QidoRs.cpp --- a/Plugin/QidoRs.cpp Thu Mar 19 14:00:37 2020 +0100 +++ b/Plugin/QidoRs.cpp Thu Mar 26 08:20:15 2020 +0100 @@ -265,8 +265,13 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } + bool caseSensitive; + if (OrthancPlugins::Configuration::LookupBooleanValue(caseSensitive, "QidoCaseSensitive")) + { + result["CaseSensitive"] = caseSensitive; + } + result["Expand"] = false; - result["CaseSensitive"] = OrthancPlugins::Configuration::GetBooleanValue("QidoCaseSensitive", true); result["Query"] = Json::objectValue; result["Limit"] = limit_; result["Since"] = offset_; @@ -483,6 +488,8 @@ Json::Value find; matcher.ConvertToOrthanc(find, level); + LOG(INFO) << "Body of the call from QIDO-RS to /tools/find: " << find.toStyledString(); + std::string body; {