# HG changeset patch # User Sebastien Jodogne # Date 1448978032 -3600 # Node ID d364926389e0a3ee2c43d8dfca3f28d5e2dd0e03 # Parent 68854412c7bcbe6656faf33a066465b197b8e6b5 OrthancFindRequestHandler::FilterQueryTag diff -r 68854412c7bc -r d364926389e0 OrthancServer/OrthancFindRequestHandler.cpp --- a/OrthancServer/OrthancFindRequestHandler.cpp Tue Dec 01 14:02:35 2015 +0100 +++ b/OrthancServer/OrthancFindRequestHandler.cpp Tue Dec 01 14:53:52 2015 +0100 @@ -88,6 +88,16 @@ } + + bool OrthancFindRequestHandler::FilterQueryTag(std::string& value /* can be modified */, + ResourceType level, + const DicomTag& tag, + ModalityManufacturer manufacturer) + { + return true; + } + + void OrthancFindRequestHandler::Handle(DicomFindAnswers& answers, const DicomMap& input, const std::string& remoteIp, @@ -105,8 +115,6 @@ throw OrthancException(ErrorCode_UnknownModality); } - // ModalityManufacturer manufacturer = modality.GetManufacturer(); - bool caseSensitivePN = Configuration::GetGlobalBoolParameter("CaseSensitivePN", false); @@ -119,6 +127,7 @@ levelTmp->IsNull() || levelTmp->IsBinary()) { + LOG(ERROR) << "C-FIND request without the tag 0008,0052 (QueryRetrieveLevel)"; throw OrthancException(ErrorCode_BadRequest); } @@ -171,17 +180,25 @@ continue; } - ValueRepresentation vr = FromDcmtkBridge::GetValueRepresentation(tag); + if (FilterQueryTag(value, level, tag, modality.GetManufacturer())) + { + ValueRepresentation vr = FromDcmtkBridge::GetValueRepresentation(tag); - // DICOM specifies that searches must be case sensitive, except - // for tags with a PN value representation - bool sensitive = true; - if (vr == ValueRepresentation_PatientName) + // DICOM specifies that searches must be case sensitive, except + // for tags with a PN value representation + bool sensitive = true; + if (vr == ValueRepresentation_PatientName) + { + sensitive = caseSensitivePN; + } + + finder.AddDicomConstraint(tag, value, sensitive); + } + else { - sensitive = caseSensitivePN; + LOG(INFO) << "Because of a patch for the manufacturer of the remote modality, " + << "ignoring constraint on tag (" << tag.Format() << ") " << FromDcmtkBridge::GetName(tag); } - - finder.AddDicomConstraint(tag, value, sensitive); } diff -r 68854412c7bc -r d364926389e0 OrthancServer/OrthancFindRequestHandler.h --- a/OrthancServer/OrthancFindRequestHandler.h Tue Dec 01 14:02:35 2015 +0100 +++ b/OrthancServer/OrthancFindRequestHandler.h Tue Dec 01 14:53:52 2015 +0100 @@ -47,6 +47,11 @@ bool HasReachedLimit(const DicomFindAnswers& answers, ResourceType level) const; + bool FilterQueryTag(std::string& value /* can be modified */, + ResourceType level, + const DicomTag& tag, + ModalityManufacturer manufacturer); + public: OrthancFindRequestHandler(ServerContext& context) : context_(context), diff -r 68854412c7bc -r d364926389e0 OrthancServer/main.cpp --- a/OrthancServer/main.cpp Tue Dec 01 14:02:35 2015 +0100 +++ b/OrthancServer/main.cpp Tue Dec 01 14:53:52 2015 +0100 @@ -748,7 +748,8 @@ dicomServer.SetApplicationEntityFilter(dicomFilter); dicomServer.Start(); - LOG(WARNING) << "DICOM server listening on port: " << dicomServer.GetPortNumber(); + LOG(WARNING) << "DICOM server listening with AET " << dicomServer.GetApplicationEntityTitle() + << " on port: " << dicomServer.GetPortNumber(); bool restart; ErrorCode error = ErrorCode_Success;