Mercurial > hg > orthanc
comparison OrthancServer/OrthancFindRequestHandler.cpp @ 1800:30e97a1f4093 worklists
callback for handling worklists with plugins
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 20 Nov 2015 13:53:20 +0100 |
parents | 4f01c9d73f02 |
children | d364926389e0 |
comparison
equal
deleted
inserted
replaced
1799:4f01c9d73f02 | 1800:30e97a1f4093 |
---|---|
86 answers.Add(result); | 86 answers.Add(result); |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
90 | 90 |
91 bool OrthancFindRequestHandler::Handle(DicomFindAnswers& answers, | 91 void OrthancFindRequestHandler::Handle(DicomFindAnswers& answers, |
92 const DicomMap& input, | 92 const DicomMap& input, |
93 const std::string& remoteIp, | 93 const std::string& remoteIp, |
94 const std::string& remoteAet, | 94 const std::string& remoteAet, |
95 const std::string& calledAet) | 95 const std::string& calledAet) |
96 { | 96 { |
193 | 193 |
194 std::vector<std::string> resources, instances; | 194 std::vector<std::string> resources, instances; |
195 context_.GetIndex().FindCandidates(resources, instances, finder); | 195 context_.GetIndex().FindCandidates(resources, instances, finder); |
196 | 196 |
197 assert(resources.size() == instances.size()); | 197 assert(resources.size() == instances.size()); |
198 bool finished = true; | 198 bool complete = true; |
199 | 199 |
200 for (size_t i = 0; i < instances.size(); i++) | 200 for (size_t i = 0; i < instances.size(); i++) |
201 { | 201 { |
202 Json::Value dicom; | 202 Json::Value dicom; |
203 context_.ReadJson(dicom, instances[i]); | 203 context_.ReadJson(dicom, instances[i]); |
205 if (finder.IsMatch(dicom)) | 205 if (finder.IsMatch(dicom)) |
206 { | 206 { |
207 if (maxResults != 0 && | 207 if (maxResults != 0 && |
208 answers.GetSize() >= maxResults) | 208 answers.GetSize() >= maxResults) |
209 { | 209 { |
210 finished = false; | 210 complete = false; |
211 break; | 211 break; |
212 } | 212 } |
213 else | 213 else |
214 { | 214 { |
215 AddAnswer(answers, dicom, query); | 215 AddAnswer(answers, dicom, query); |
217 } | 217 } |
218 } | 218 } |
219 | 219 |
220 LOG(INFO) << "Number of matching resources: " << answers.GetSize(); | 220 LOG(INFO) << "Number of matching resources: " << answers.GetSize(); |
221 | 221 |
222 return finished; | 222 answers.SetComplete(complete); |
223 } | 223 } |
224 } | 224 } |