comparison OrthancServer/Sources/Database/FindRequest.h @ 5587:0f5586c498d1 find-refactoring

removed FindRequest::FilterConstraint as it was mostly redundant with DicomTagConstraint
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 03 May 2024 17:06:42 +0200
parents 74cc31c8db2b
children 8b32213af23e
comparison
equal deleted inserted replaced
5586:fc3914c07dd3 5587:0f5586c498d1
155 { 155 {
156 return key_.GetDicomTag(); 156 return key_.GetDicomTag();
157 } 157 }
158 }; 158 };
159 159
160 // TODO-FIND: this class hierarchy actually adds complexity and is very redundant with DicomTagConstraint.
161 // e.g, in this class hierarchy, it is difficult to implement an equivalent to DicomTagConstraint::ConvertToDatabaseConstraint
162 // I have the feeling we can just have a MetadataConstraint in the same way as DicomTagConstraint
163 // and both convert to a DatabaseConstraint in StatelessDatabaseOperations
164 // class FilterConstraint : public boost::noncopyable
165 // {
166 // Key key_;
167
168 // protected:
169 // FilterConstraint(const Key& key) :
170 // key_(key)
171 // {
172 // }
173
174 // public:
175 // virtual ~FilterConstraint()
176 // {
177 // }
178
179 // const Key& GetKey() const
180 // {
181 // return key_;
182 // }
183
184 // virtual ConstraintType GetType() const = 0;
185 // virtual bool IsCaseSensitive() const = 0; // Needed for PN VR
186
187
188 // };
189
190
191 // class MandatoryConstraint : public FilterConstraint
192 // {
193 // public:
194 // virtual ConstraintType GetType() const ORTHANC_OVERRIDE
195 // {
196 // return ConstraintType_Mandatory;
197 // }
198 // };
199
200
201 // class StringConstraint : public FilterConstraint
202 // {
203 // private:
204 // bool caseSensitive_;
205
206 // public:
207 // StringConstraint(Key key,
208 // bool caseSensitive) :
209 // FilterConstraint(key),
210 // caseSensitive_(caseSensitive)
211 // {
212 // }
213
214 // bool IsCaseSensitive() const
215 // {
216 // return caseSensitive_;
217 // }
218 // };
219
220
221 // class EqualityConstraint : public StringConstraint
222 // {
223 // private:
224 // std::string value_;
225
226 // public:
227 // explicit EqualityConstraint(Key key,
228 // bool caseSensitive,
229 // const std::string& value) :
230 // StringConstraint(key, caseSensitive),
231 // value_(value)
232 // {
233 // }
234
235 // virtual ConstraintType GetType() const ORTHANC_OVERRIDE
236 // {
237 // return ConstraintType_Equality;
238 // }
239
240 // const std::string& GetValue() const
241 // {
242 // return value_;
243 // }
244 // };
245
246
247 // class RangeConstraint : public StringConstraint
248 // {
249 // private:
250 // std::string start_;
251 // std::string end_; // Inclusive
252
253 // public:
254 // RangeConstraint(Key key,
255 // bool caseSensitive,
256 // const std::string& start,
257 // const std::string& end) :
258 // StringConstraint(key, caseSensitive),
259 // start_(start),
260 // end_(end)
261 // {
262 // }
263
264 // virtual ConstraintType GetType() const ORTHANC_OVERRIDE
265 // {
266 // return ConstraintType_Range;
267 // }
268
269 // const std::string& GetStart() const
270 // {
271 // return start_;
272 // }
273
274 // const std::string& GetEnd() const
275 // {
276 // return end_;
277 // }
278 // };
279
280
281 // class WildcardConstraint : public StringConstraint
282 // {
283 // private:
284 // std::string value_;
285
286 // public:
287 // explicit WildcardConstraint(Key& key,
288 // bool caseSensitive,
289 // const std::string& value) :
290 // StringConstraint(key, caseSensitive),
291 // value_(value)
292 // {
293 // }
294
295 // virtual ConstraintType GetType() const ORTHANC_OVERRIDE
296 // {
297 // return ConstraintType_Wildcard;
298 // }
299
300 // const std::string& GetValue() const
301 // {
302 // return value_;
303 // }
304 // };
305
306
307 // class ListConstraint : public StringConstraint
308 // {
309 // private:
310 // std::set<std::string> values_;
311
312 // public:
313 // ListConstraint(Key key,
314 // bool caseSensitive) :
315 // StringConstraint(key, caseSensitive)
316 // {
317 // }
318
319 // virtual ConstraintType GetType() const ORTHANC_OVERRIDE
320 // {
321 // return ConstraintType_List;
322 // }
323
324 // const std::set<std::string>& GetValues() const
325 // {
326 // return values_;
327 // }
328 // };
329
330 160
331 private: 161 private:
332 162
333 // filter & ordering fields 163 // filter & ordering fields
334 ResourceType level_; // The level of the response (the filtering on tags, labels and metadata also happens at this level) 164 ResourceType level_; // The level of the response (the filtering on tags, labels and metadata also happens at this level)
335 OrthancIdentifiers orthancIdentifiers_; // The response must belong to this Orthanc resources hierarchy 165 OrthancIdentifiers orthancIdentifiers_; // The response must belong to this Orthanc resources hierarchy
336 // std::deque<FilterConstraint*> filterConstraints_; // All tags and metadata filters (note: the order is not important)
337 std::vector<DicomTagConstraint> dicomTagConstraints_; // All tags filters (note: the order is not important) 166 std::vector<DicomTagConstraint> dicomTagConstraints_; // All tags filters (note: the order is not important)
338 std::deque<void*> /* TODO-FIND */ metadataConstraints_; // All metadata filters (note: the order is not important) 167 std::deque<void*> /* TODO-FIND */ metadataConstraints_; // All metadata filters (note: the order is not important)
339 bool hasLimits_; 168 bool hasLimits_;
340 uint64_t limitsSince_; 169 uint64_t limitsSince_;
341 uint64_t limitsCount_; 170 uint64_t limitsCount_;