Mercurial > hg > orthanc
comparison OrthancServer/Sources/Database/FindRequest.h @ 5565:def06a42e5ef find-refactoring
Updated FindRequest & FindResponse definitions
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Tue, 23 Apr 2024 13:07:38 +0200 |
parents | 12d8a1a266e9 |
children | f3562c1a150d |
comparison
equal
deleted
inserted
replaced
5554:12d8a1a266e9 | 5565:def06a42e5ef |
---|---|
34 namespace Orthanc | 34 namespace Orthanc |
35 { | 35 { |
36 class FindRequest : public boost::noncopyable | 36 class FindRequest : public boost::noncopyable |
37 { | 37 { |
38 public: | 38 public: |
39 enum ResponseType | 39 enum ResponseContent |
40 { | 40 { |
41 ResponseType_OrthancIdentifiers, | 41 ResponseContent_MainDicomTags = (1 << 0), // retrieve all tags from MainDicomTags and DicomIdentifiers |
42 ResponseType_DicomMap | 42 ResponseContent_Metadata = (1 << 1), // retrieve all metadata, their values and revision |
43 ResponseContent_Labels = (1 << 2), // get all labels | |
44 ResponseContent_Attachments = (1 << 3), // retrieve all attachments, their values and revision | |
45 ResponseContent_Parent = (1 << 4), // get the id of the parent | |
46 ResponseContent_Children = (1 << 5), // retrieve the list of children ids | |
47 ResponseContent_ChildInstanceId = (1 << 6), // When you need to access all tags from a patient/study/series, you might need to open the DICOM file of a child instance | |
48 ResponseContent_IsStable = (1 << 7), // This is currently not saved in DB but it could be in the future. | |
49 | |
50 ResponseContent_IdentifiersOnly = 0, | |
51 ResponseContent_INTERNAL = 0x7FFFFFFF | |
43 }; | 52 }; |
44 | 53 |
45 enum ConstraintType | 54 enum ConstraintType |
46 { | 55 { |
47 ConstraintType_Mandatory, | 56 ConstraintType_Mandatory, |
49 ConstraintType_Range, | 58 ConstraintType_Range, |
50 ConstraintType_Wildcard, | 59 ConstraintType_Wildcard, |
51 ConstraintType_List | 60 ConstraintType_List |
52 }; | 61 }; |
53 | 62 |
54 enum MetadataMode | |
55 { | |
56 MetadataMode_None, | |
57 MetadataMode_List, | |
58 MetadataMode_Retrieve | |
59 }; | |
60 | 63 |
61 enum Ordering | 64 enum Ordering |
62 { | 65 { |
63 Ordering_Ascending, | 66 Ordering_Ascending, |
64 Ordering_Descending, | 67 Ordering_Descending, |
232 }; | 235 }; |
233 | 236 |
234 | 237 |
235 private: | 238 private: |
236 ResourceType level_; | 239 ResourceType level_; |
237 ResponseType responseType_; | 240 ResponseContent responseContent_; |
238 OrthancIdentifiers orthancIdentifiers_; | 241 OrthancIdentifiers orthancIdentifiers_; |
239 std::deque<TagConstraint*> tagConstraints_; | 242 std::deque<TagConstraint*> tagConstraints_; |
240 bool hasLimits_; | 243 bool hasLimits_; |
241 uint64_t limitsSince_; | 244 uint64_t limitsSince_; |
242 uint64_t limitsCount_; | 245 uint64_t limitsCount_; |
243 MetadataMode metadataMode_; | |
244 bool retrievePatientTags_; | 246 bool retrievePatientTags_; |
245 bool retrieveStudyTags_; | 247 bool retrieveStudyTags_; |
246 bool retrieveSeriesTags_; | 248 bool retrieveSeriesTags_; |
247 bool retrieveInstanceTags_; | 249 bool retrieveInstanceTags_; |
248 std::map<DicomTag, Ordering> tagOrdering_; | 250 std::map<DicomTag, Ordering> tagOrdering_; |
259 ResourceType GetLevel() const | 261 ResourceType GetLevel() const |
260 { | 262 { |
261 return level_; | 263 return level_; |
262 } | 264 } |
263 | 265 |
264 void SetResponseType(ResponseType type) | 266 void SetResponseContent(ResponseContent content) |
265 { | 267 { |
266 responseType_ = type; | 268 responseContent_ = content; |
267 } | 269 } |
268 | 270 |
269 ResponseType GetResponseType() const | 271 void AddResponseContent(ResponseContent content) |
270 { | 272 { |
271 return responseType_; | 273 responseContent_ = static_cast<ResponseContent>(static_cast<uint32_t>(responseContent_) | content); |
274 } | |
275 | |
276 ResponseContent GetResponseContent() const | |
277 { | |
278 return responseContent_; | |
279 } | |
280 | |
281 bool HasResponseContent(ResponseContent content) const | |
282 { | |
283 return (responseContent_ & content) == content; | |
272 } | 284 } |
273 | 285 |
274 void SetOrthancPatientId(const std::string& id) | 286 void SetOrthancPatientId(const std::string& id) |
275 { | 287 { |
276 orthancIdentifiers_.SetPatientId(id); | 288 orthancIdentifiers_.SetPatientId(id); |
315 | 327 |
316 uint64_t GetLimitsSince() const; | 328 uint64_t GetLimitsSince() const; |
317 | 329 |
318 uint64_t GetLimitsCount() const; | 330 uint64_t GetLimitsCount() const; |
319 | 331 |
320 void SetMetadataMode(MetadataMode mode) | |
321 { | |
322 metadataMode_ = mode; | |
323 } | |
324 | |
325 MetadataMode GetMetadataMode() const | |
326 { | |
327 return metadataMode_; | |
328 } | |
329 | 332 |
330 void SetRetrieveTagsAtLevel(ResourceType levelOfInterest, | 333 void SetRetrieveTagsAtLevel(ResourceType levelOfInterest, |
331 bool retrieve); | 334 bool retrieve); |
332 | 335 |
333 bool IsRetrieveTagsAtLevel(ResourceType levelOfInterest) const; | 336 bool IsRetrieveTagsAtLevel(ResourceType levelOfInterest) const; |