comparison OrthancServer/Sources/Database/FindRequest.h @ 5676:b744a2cf408a find-refactoring

shorten ParentRetrieveSpecification/ChildrenRetrieveSpecification as ParentSpecification/ChildrenSpecification
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 06 Jul 2024 15:04:28 +0200
parents 74f3aab95886
children dc96401dbe88
comparison
equal deleted inserted replaced
5675:2b65f25cb1c8 5676:b744a2cf408a
153 return key_.GetDicomTag(); 153 return key_.GetDicomTag();
154 } 154 }
155 }; 155 };
156 156
157 157
158 class ParentRetrieveSpecification : public boost::noncopyable 158 class ParentSpecification : public boost::noncopyable
159 { 159 {
160 private: 160 private:
161 bool mainDicomTags_; 161 bool mainDicomTags_;
162 bool metadata_; 162 bool metadata_;
163 163
164 public: 164 public:
165 ParentRetrieveSpecification() : 165 ParentSpecification() :
166 mainDicomTags_(false), 166 mainDicomTags_(false),
167 metadata_(false) 167 metadata_(false)
168 { 168 {
169 } 169 }
170 170
193 return (mainDicomTags_ || metadata_); 193 return (mainDicomTags_ || metadata_);
194 } 194 }
195 }; 195 };
196 196
197 197
198 class ChildrenRetrieveSpecification : public boost::noncopyable 198 class ChildrenSpecification : public boost::noncopyable
199 { 199 {
200 private: 200 private:
201 bool identifiers_; 201 bool identifiers_;
202 std::set<MetadataType> metadata_; 202 std::set<MetadataType> metadata_;
203 std::set<DicomTag> mainDicomTags_; 203 std::set<DicomTag> mainDicomTags_;
204 204
205 public: 205 public:
206 ChildrenRetrieveSpecification() : 206 ChildrenSpecification() :
207 identifiers_(false) 207 identifiers_(false)
208 { 208 {
209 } 209 }
210 210
211 void SetRetrieveIdentifiers(bool retrieve) 211 void SetRetrieveIdentifiers(bool retrieve)
261 bool retrieveMainDicomTags_; 261 bool retrieveMainDicomTags_;
262 bool retrieveMetadata_; 262 bool retrieveMetadata_;
263 bool retrieveLabels_; 263 bool retrieveLabels_;
264 bool retrieveAttachments_; 264 bool retrieveAttachments_;
265 bool retrieveParentIdentifier_; 265 bool retrieveParentIdentifier_;
266 ParentRetrieveSpecification retrieveParentPatient_; 266 ParentSpecification retrieveParentPatient_;
267 ParentRetrieveSpecification retrieveParentStudy_; 267 ParentSpecification retrieveParentStudy_;
268 ParentRetrieveSpecification retrieveParentSeries_; 268 ParentSpecification retrieveParentSeries_;
269 ChildrenRetrieveSpecification retrieveChildrenStudies_; 269 ChildrenSpecification retrieveChildrenStudies_;
270 ChildrenRetrieveSpecification retrieveChildrenSeries_; 270 ChildrenSpecification retrieveChildrenSeries_;
271 ChildrenRetrieveSpecification retrieveChildrenInstances_; 271 ChildrenSpecification retrieveChildrenInstances_;
272 bool retrieveOneInstanceIdentifier_; 272 bool retrieveOneInstanceIdentifier_;
273 273
274 std::unique_ptr<MainDicomTagsRegistry> mainDicomTagsRegistry_; 274 std::unique_ptr<MainDicomTagsRegistry> mainDicomTagsRegistry_;
275 275
276 public: 276 public:
394 bool IsRetrieveParentIdentifier() const 394 bool IsRetrieveParentIdentifier() const
395 { 395 {
396 return retrieveParentIdentifier_; 396 return retrieveParentIdentifier_;
397 } 397 }
398 398
399 ParentRetrieveSpecification& GetParentRetrieveSpecification(ResourceType level); 399 ParentSpecification& GetParentSpecification(ResourceType level);
400 400
401 const ParentRetrieveSpecification& GetParentRetrieveSpecification(ResourceType level) const 401 const ParentSpecification& GetParentSpecification(ResourceType level) const
402 { 402 {
403 return const_cast<FindRequest&>(*this).GetParentRetrieveSpecification(level); 403 return const_cast<FindRequest&>(*this).GetParentSpecification(level);
404 } 404 }
405 405
406 ChildrenRetrieveSpecification& GetChildrenRetrieveSpecification(ResourceType level); 406 ChildrenSpecification& GetChildrenSpecification(ResourceType level);
407 407
408 const ChildrenRetrieveSpecification& GetChildrenRetrieveSpecification(ResourceType level) const 408 const ChildrenSpecification& GetChildrenSpecification(ResourceType level) const
409 { 409 {
410 return const_cast<FindRequest&>(*this).GetChildrenRetrieveSpecification(level); 410 return const_cast<FindRequest&>(*this).GetChildrenSpecification(level);
411 } 411 }
412 412
413 void SetRetrieveOneInstanceIdentifier(bool retrieve); 413 void SetRetrieveOneInstanceIdentifier(bool retrieve);
414 414
415 bool IsRetrieveOneInstanceIdentifier() const 415 bool IsRetrieveOneInstanceIdentifier() const
416 { 416 {
417 return (retrieveOneInstanceIdentifier_ || 417 return (retrieveOneInstanceIdentifier_ ||
418 GetChildrenRetrieveSpecification(ResourceType_Instance).IsRetrieveIdentifiers()); 418 GetChildrenSpecification(ResourceType_Instance).IsRetrieveIdentifiers());
419 } 419 }
420 }; 420 };
421 } 421 }