# HG changeset patch # User Sebastien Jodogne # Date 1720786111 -7200 # Node ID e8e028aed89f00948766e0a8d13fa809a71ca242 # Parent 075558c95cbbb66f6b98ee74fccaa9c7ff9608a8 c-find tests pass using ResourceFinder diff -r 075558c95cbb -r e8e028aed89f OrthancServer/Sources/OrthancFindRequestHandler.cpp --- a/OrthancServer/Sources/OrthancFindRequestHandler.cpp Fri Jul 12 12:48:37 2024 +0200 +++ b/OrthancServer/Sources/OrthancFindRequestHandler.cpp Fri Jul 12 14:08:31 2024 +0200 @@ -537,7 +537,6 @@ throw OrthancException(ErrorCode_NotImplemented); } - DicomArray query(*filteredInput); CLOG(INFO, DICOM) << "DICOM C-Find request at level: " << EnumerationToString(level); @@ -585,14 +584,21 @@ const DicomTag tag = element.GetTag(); // remove tags that are not used for matching - if (element.GetValue().IsNull() || - tag == DICOM_TAG_QUERY_RETRIEVE_LEVEL || + if (tag == DICOM_TAG_QUERY_RETRIEVE_LEVEL || tag == DICOM_TAG_SPECIFIC_CHARACTER_SET || tag == DICOM_TAG_TIMEZONE_OFFSET_FROM_UTC) // time zone is not directly used for matching. Once we support "Timezone query adjustment", we may use it to adjust date-time filters but for now, just ignore it { continue; } + requestedTags.insert(tag); + + if (element.GetValue().IsNull()) + { + // There is no constraint on this tag + continue; + } + std::string value = element.GetValue().GetContent(); if (value.size() == 0) { @@ -617,7 +623,6 @@ } else { - requestedTags.insert(tag); CLOG(INFO, DICOM) << "Because of a patch for the manufacturer of the remote modality, " << "ignoring constraint on tag (" << tag.Format() << ") " << FromDcmtkBridge::GetTagName(element); @@ -632,7 +637,7 @@ size_t limit = (level == ResourceType_Instance) ? maxInstances_ : maxResults_; - if (false) + if (true) { /** * EXPERIMENTAL VERSION diff -r 075558c95cbb -r e8e028aed89f OrthancServer/Sources/ResourceFinder.cpp --- a/OrthancServer/Sources/ResourceFinder.cpp Fri Jul 12 12:48:37 2024 +0200 +++ b/OrthancServer/Sources/ResourceFinder.cpp Fri Jul 12 14:08:31 2024 +0200 @@ -720,9 +720,8 @@ } else { - // Main DICOM tags from the instance level will be retrieved anyway - assert(request_.IsRetrieveMainDicomTags()); - assert(request_.IsRetrieveMetadata()); + request_.SetRetrieveMainDicomTags(true); + request_.SetRetrieveMetadata(true); requestedInstanceTags_.insert(tag); } @@ -834,7 +833,7 @@ std::string missings; FromDcmtkBridge::FormatListOfTags(missings, missingTags); - LOG(WARNING) << "W001: Accessing Dicom tags from storage when accessing " + LOG(WARNING) << "W001: Accessing DICOM tags from storage when accessing " << Orthanc::GetResourceTypeText(resource.GetLevel(), false, false) << ": " << missings; }