comparison OrthancServer/Search/ListConstraint.cpp @ 3036:8fd203510d8b db-changes

moving LookupIdentifierQuery to the graveyard
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 19 Dec 2018 16:27:07 +0100
parents 878b59270859
children ce272138f15e
comparison
equal deleted inserted replaced
3034:54e422fe31ce 3036:8fd203510d8b
32 32
33 33
34 #include "../PrecompiledHeadersServer.h" 34 #include "../PrecompiledHeadersServer.h"
35 #include "ListConstraint.h" 35 #include "ListConstraint.h"
36 36
37 #include "../../Core/Toolbox.h"
37 38
38 namespace Orthanc 39 namespace Orthanc
39 { 40 {
40 void ListConstraint::AddAllowedValue(const std::string& value) 41 void ListConstraint::AddAllowedValue(const std::string& value)
41 { 42 {
44 allowedValues_.insert(value); 45 allowedValues_.insert(value);
45 } 46 }
46 else 47 else
47 { 48 {
48 allowedValues_.insert(Toolbox::ToUpperCaseWithAccents(value)); 49 allowedValues_.insert(Toolbox::ToUpperCaseWithAccents(value));
49 }
50 }
51
52
53 void ListConstraint::Setup(LookupIdentifierQuery& lookup,
54 const DicomTag& tag) const
55 {
56 LookupIdentifierQuery::Disjunction& target = lookup.AddDisjunction();
57
58 for (std::set<std::string>::const_iterator
59 it = allowedValues_.begin(); it != allowedValues_.end(); ++it)
60 {
61 target.Add(tag, IdentifierConstraintType_Equal, *it);
62 } 50 }
63 } 51 }
64 52
65 53
66 bool ListConstraint::Match(const std::string& value) const 54 bool ListConstraint::Match(const std::string& value) const