Mercurial > hg > orthanc
diff OrthancServer/OrthancFindRequestHandler.cpp @ 2876:ae8e72009e64
notes
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 09 Oct 2018 20:09:35 +0200 |
parents | d4fd4614f275 |
children | ce310baccda6 |
line wrap: on
line diff
--- a/OrthancServer/OrthancFindRequestHandler.cpp Tue Oct 09 16:44:28 2018 +0200 +++ b/OrthancServer/OrthancFindRequestHandler.cpp Tue Oct 09 20:09:35 2018 +0200 @@ -588,7 +588,7 @@ * Build up the query object. **/ - LookupResource finder(level); + LookupResource lookup(level); const bool caseSensitivePN = Configuration::GetGlobalBoolParameter("CaseSensitivePN", false); @@ -623,7 +623,7 @@ sensitive = caseSensitivePN; } - finder.AddDicomConstraint(tag, value, sensitive); + lookup.AddDicomConstraint(tag, value, sensitive); } else { @@ -637,10 +637,12 @@ * Run the query. **/ - size_t maxResults = (level == ResourceType_Instance) ? maxInstances_ : maxResults_; + size_t limit = (level == ResourceType_Instance) ? maxInstances_ : maxResults_; + // TODO - Use ServerContext::Apply() at this point, in order to + // share the code with the "/tools/find" REST URI std::vector<std::string> resources, instances; - context_.GetIndex().FindCandidates(resources, instances, finder); + context_.GetIndex().FindCandidates(resources, instances, lookup); LOG(INFO) << "Number of candidate resources after fast DB filtering: " << resources.size(); @@ -654,10 +656,10 @@ Json::Value dicom; context_.ReadDicomAsJson(dicom, instances[i]); - if (finder.IsMatch(dicom)) + if (lookup.IsMatch(dicom)) { - if (maxResults != 0 && - answers.GetSize() >= maxResults) + if (limit != 0 && + answers.GetSize() >= limit) { complete = false; break;