comparison OrthancServer/Search/LookupIdentifierQuery.cpp @ 1758:318c2e83c2bd db-changes

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 28 Oct 2015 12:53:45 +0100
parents fb569ee09a69
children 9ead18ef460a
comparison
equal deleted inserted replaced
1757:98abb8d7f905 1758:318c2e83c2bd
33 #include "../PrecompiledHeadersServer.h" 33 #include "../PrecompiledHeadersServer.h"
34 #include "LookupIdentifierQuery.h" 34 #include "LookupIdentifierQuery.h"
35 35
36 #include "../../Core/OrthancException.h" 36 #include "../../Core/OrthancException.h"
37 #include "SetOfResources.h" 37 #include "SetOfResources.h"
38 #include "../FromDcmtkBridge.h"
38 39
39 #include <cassert> 40 #include <cassert>
40 41
41 42
42 43
228 229
229 result.Intersect(a); 230 result.Intersect(a);
230 } 231 }
231 } 232 }
232 233
234
235 void LookupIdentifierQuery::Print(std::ostream& s) const
236 {
237 s << "Constraint: " << std::endl;
238 for (Constraints::const_iterator
239 it = constraints_.begin(); it != constraints_.end(); ++it)
240 {
241 if (it == constraints_.begin())
242 s << " ";
243 else
244 s << "OR ";
245
246 for (size_t j = 0; j < (*it)->GetSize(); j++)
247 {
248 const Constraint& c = (*it)->GetConstraint(j);
249 s << FromDcmtkBridge::GetName(c.GetTag());
250
251 switch (c.GetType())
252 {
253 case IdentifierConstraintType_Equal: s << " == "; break;
254 case IdentifierConstraintType_SmallerOrEqual: s << " <= "; break;
255 case IdentifierConstraintType_GreaterOrEqual: s << " >= "; break;
256 case IdentifierConstraintType_Wildcard: s << " ~= "; break;
257 default:
258 s << " ? ";
259 }
260
261 s << c.GetValue() << std::endl;
262 }
263 }
264 }
233 } 265 }