# HG changeset patch # User Sebastien Jodogne # Date 1444748061 -7200 # Node ID 9a04ad916831718573c26661c1549298dd5319ea # Parent e8a7512a1e40252e74c74edb2b72ed45a919d0b2 more tolerant c-find scp diff -r e8a7512a1e40 -r 9a04ad916831 OrthancServer/DicomProtocol/DicomUserConnection.cpp --- a/OrthancServer/DicomProtocol/DicomUserConnection.cpp Tue Oct 13 16:48:02 2015 +0200 +++ b/OrthancServer/DicomProtocol/DicomUserConnection.cpp Tue Oct 13 16:54:21 2015 +0200 @@ -384,8 +384,9 @@ } - static void CheckFindQuery(ResourceType level, - const DicomMap& fields) + static void FixFindQuery(DicomMap& fixedQuery, + ResourceType level, + const DicomMap& fields) { std::set allowedTags; @@ -422,8 +423,11 @@ const DicomTag& tag = query.GetElement(i).GetTag(); if (allowedTags.find(tag) == allowedTags.end()) { - LOG(ERROR) << "Tag not allowed for this C-Find level: " << tag; - throw OrthancException(ErrorCode_BadRequest); + LOG(WARNING) << "Tag not allowed for this C-Find level, will be ignored: " << tag; + } + else + { + fixedQuery.SetValue(tag, query.GetElement(i).GetValue()); } } } @@ -471,9 +475,10 @@ void DicomUserConnection::Find(DicomFindAnswers& result, ResourceType level, - const DicomMap& fields) + const DicomMap& originalFields) { - CheckFindQuery(level, fields); + DicomMap fields; + FixFindQuery(fields, level, originalFields); CheckIsOpen();