Mercurial > hg > orthanc
comparison OrthancServer/Search/LookupResource.h @ 1756:03b030680e3d db-changes
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 28 Oct 2015 12:14:06 +0100 |
parents | 39c37a994b2f |
children | 318c2e83c2bd |
comparison
equal
deleted
inserted
replaced
1755:39c37a994b2f | 1756:03b030680e3d |
---|---|
40 namespace Orthanc | 40 namespace Orthanc |
41 { | 41 { |
42 class LookupResource : public boost::noncopyable | 42 class LookupResource : public boost::noncopyable |
43 { | 43 { |
44 private: | 44 private: |
45 typedef std::list<IFindConstraint*> Constraints; | 45 typedef std::map<DicomTag, IFindConstraint*> Constraints; |
46 | 46 |
47 class Level | 47 class Level |
48 { | 48 { |
49 private: | 49 private: |
50 ResourceType level_; | 50 ResourceType level_; |
56 public: | 56 public: |
57 Level(ResourceType level); | 57 Level(ResourceType level); |
58 | 58 |
59 ~Level(); | 59 ~Level(); |
60 | 60 |
61 bool Add(std::auto_ptr<IFindConstraint>& constraint); | 61 bool Add(const DicomTag& tag, |
62 std::auto_ptr<IFindConstraint>& constraint); | |
62 | 63 |
63 void Apply(SetOfResources& candidates, | 64 void Apply(SetOfResources& candidates, |
64 IDatabaseWrapper& database) const; | 65 IDatabaseWrapper& database) const; |
65 }; | 66 }; |
66 | 67 |
70 Levels levels_; | 71 Levels levels_; |
71 Constraints unoptimizedConstraints_; | 72 Constraints unoptimizedConstraints_; |
72 std::auto_ptr<ListConstraint> modalitiesInStudy_; | 73 std::auto_ptr<ListConstraint> modalitiesInStudy_; |
73 | 74 |
74 bool AddInternal(ResourceType level, | 75 bool AddInternal(ResourceType level, |
76 const DicomTag& tag, | |
75 std::auto_ptr<IFindConstraint>& constraint); | 77 std::auto_ptr<IFindConstraint>& constraint); |
76 | 78 |
77 void ApplyLevel(SetOfResources& candidates, | 79 void ApplyLevel(SetOfResources& candidates, |
78 ResourceType level, | 80 ResourceType level, |
79 IDatabaseWrapper& database) const; | 81 IDatabaseWrapper& database) const; |
88 return level_; | 90 return level_; |
89 } | 91 } |
90 | 92 |
91 void SetModalitiesInStudy(const std::string& modalities); | 93 void SetModalitiesInStudy(const std::string& modalities); |
92 | 94 |
93 void Add(IFindConstraint* constraint); // Takes ownership | 95 void Add(const DicomTag& tag, |
96 IFindConstraint* constraint); // Takes ownership | |
94 | 97 |
95 void AddDicomConstraint(const DicomTag& tag, | 98 void AddDicomConstraint(const DicomTag& tag, |
96 const std::string& dicomQuery, | 99 const std::string& dicomQuery, |
97 bool caseSensitivePN); | 100 bool caseSensitivePN); |
98 | 101 |