comparison OrthancServer/OrthancFindRequestHandler.cpp @ 2940:4767d36679ed

refactoring access to Orthanc configuration
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 29 Nov 2018 11:47:00 +0100
parents ce310baccda6
children bbfd95a0c429
comparison
equal deleted inserted replaced
2939:577786f59252 2940:4767d36679ed
36 36
37 #include "../Core/DicomFormat/DicomArray.h" 37 #include "../Core/DicomFormat/DicomArray.h"
38 #include "../Core/Lua/LuaFunctionCall.h" 38 #include "../Core/Lua/LuaFunctionCall.h"
39 #include "../Core/Logging.h" 39 #include "../Core/Logging.h"
40 #include "../Core/DicomParsing/FromDcmtkBridge.h" 40 #include "../Core/DicomParsing/FromDcmtkBridge.h"
41 #include "OrthancInitialization.h" 41 #include "OrthancConfiguration.h"
42 #include "Search/LookupResource.h" 42 #include "Search/LookupResource.h"
43 #include "ServerToolbox.h" 43 #include "ServerToolbox.h"
44 44
45 #include <boost/regex.hpp> 45 #include <boost/regex.hpp>
46 46
256 if (ExtractMetadata(values, index, MetadataType_Instance_SopClassUid, instances)) 256 if (ExtractMetadata(values, index, MetadataType_Instance_SopClassUid, instances))
257 { 257 {
258 // The metadata "SopClassUid" is available for each of these instances 258 // The metadata "SopClassUid" is available for each of these instances
259 StoreSetOfStrings(result, DICOM_TAG_SOP_CLASSES_IN_STUDY, values); 259 StoreSetOfStrings(result, DICOM_TAG_SOP_CLASSES_IN_STUDY, values);
260 } 260 }
261 else if (Configuration::GetGlobalBoolParameter("AllowFindSopClassesInStudy", false))
262 {
263 ExtractTagFromInstancesOnDisk(values, context, DICOM_TAG_SOP_CLASS_UID, instances);
264 StoreSetOfStrings(result, DICOM_TAG_SOP_CLASSES_IN_STUDY, values);
265 }
266 else 261 else
267 { 262 {
268 result.SetValue(DICOM_TAG_SOP_CLASSES_IN_STUDY, "", false); 263 OrthancConfiguration::ReaderLock lock;
269 LOG(WARNING) << "The handling of \"SOP Classes in Study\" (0008,0062) " 264
270 << "in C-FIND requests is disabled"; 265 if (lock.GetConfiguration().GetBooleanParameter("AllowFindSopClassesInStudy", false))
266 {
267 ExtractTagFromInstancesOnDisk(values, context, DICOM_TAG_SOP_CLASS_UID, instances);
268 StoreSetOfStrings(result, DICOM_TAG_SOP_CLASSES_IN_STUDY, values);
269 }
270 else
271 {
272 result.SetValue(DICOM_TAG_SOP_CLASSES_IN_STUDY, "", false);
273 LOG(WARNING) << "The handling of \"SOP Classes in Study\" (0008,0062) "
274 << "in C-FIND requests is disabled";
275 }
271 } 276 }
272 } 277 }
273 } 278 }
274 279
275 280
588 * Build up the query object. 593 * Build up the query object.
589 **/ 594 **/
590 595
591 LookupResource lookup(level); 596 LookupResource lookup(level);
592 597
593 const bool caseSensitivePN = Configuration::GetGlobalBoolParameter("CaseSensitivePN", false); 598 bool caseSensitivePN;
599
600 {
601 OrthancConfiguration::ReaderLock lock;
602 caseSensitivePN = lock.GetConfiguration().GetBooleanParameter("CaseSensitivePN", false);
603 }
594 604
595 for (size_t i = 0; i < query.GetSize(); i++) 605 for (size_t i = 0; i < query.GetSize(); i++)
596 { 606 {
597 const DicomElement& element = query.GetElement(i); 607 const DicomElement& element = query.GetElement(i);
598 const DicomTag tag = element.GetTag(); 608 const DicomTag tag = element.GetTag();