comparison OrthancServer/Sources/Database/FindRequest.h @ 5619:1864b16bc7b1 find-refactoring

added FindRequest::ParentRetrieveSpecification
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 11 May 2024 12:13:31 +0200
parents 4640b7ae9a11
children 732ec9feeea8
comparison
equal deleted inserted replaced
5618:824a5fb0774e 5619:1864b16bc7b1
152 return key_.GetDicomTag(); 152 return key_.GetDicomTag();
153 } 153 }
154 }; 154 };
155 155
156 156
157 class ParentRetrieveSpecification : public boost::noncopyable
158 {
159 private:
160 bool mainDicomTags_;
161 bool metadata_;
162
163 public:
164 ParentRetrieveSpecification() :
165 mainDicomTags_(false),
166 metadata_(false)
167 {
168 }
169
170 void SetRetrieveMainDicomTags(bool retrieve)
171 {
172 mainDicomTags_ = retrieve;
173 }
174
175 bool IsRetrieveMainDicomTags() const
176 {
177 return mainDicomTags_;
178 }
179
180 void SetRetrieveMetadata(bool retrieve)
181 {
182 metadata_ = retrieve;
183 }
184
185 bool IsRetrieveMetadata() const
186 {
187 return metadata_;
188 }
189 };
190
191
157 private: 192 private:
158 // filter & ordering fields 193 // filter & ordering fields
159 ResourceType level_; // The level of the response (the filtering on tags, labels and metadata also happens at this level) 194 ResourceType level_; // The level of the response (the filtering on tags, labels and metadata also happens at this level)
160 OrthancIdentifiers orthancIdentifiers_; // The response must belong to this Orthanc resources hierarchy 195 OrthancIdentifiers orthancIdentifiers_; // The response must belong to this Orthanc resources hierarchy
161 std::deque<DatabaseConstraint> dicomTagConstraints_; // All tags filters (note: the order is not important) 196 std::deque<DatabaseConstraint> dicomTagConstraints_; // All tags filters (note: the order is not important)
165 uint64_t limitsCount_; 200 uint64_t limitsCount_;
166 std::set<std::string> labels_; 201 std::set<std::string> labels_;
167 LabelsConstraint labelsContraint_; 202 LabelsConstraint labelsContraint_;
168 std::deque<Ordering*> ordering_; // The ordering criteria (note: the order is important !) 203 std::deque<Ordering*> ordering_; // The ordering criteria (note: the order is important !)
169 204
170 bool retrieveMainDicomTagsPatients_; 205 bool retrieveMainDicomTags_;
171 bool retrieveMainDicomTagsStudies_; 206 bool retrieveMetadata_;
172 bool retrieveMainDicomTagsSeries_;
173 bool retrieveMainDicomTagsInstances_;
174 bool retrieveMetadataPatients_;
175 bool retrieveMetadataStudies_;
176 bool retrieveMetadataSeries_;
177 bool retrieveMetadataInstances_;
178 bool retrieveLabels_; 207 bool retrieveLabels_;
179 bool retrieveAttachments_; 208 bool retrieveAttachments_;
180 bool retrieveParentIdentifier_; 209 bool retrieveParentIdentifier_;
210 ParentRetrieveSpecification retrieveParentPatient_;
211 ParentRetrieveSpecification retrieveParentStudy_;
212 ParentRetrieveSpecification retrieveParentSeries_;
181 bool retrieveChildrenIdentifiers_; 213 bool retrieveChildrenIdentifiers_;
182 std::set<MetadataType> retrieveChildrenMetadata_; 214 std::set<MetadataType> retrieveChildrenMetadata_;
183 bool retrieveOneInstanceIdentifier_; 215 bool retrieveOneInstanceIdentifier_;
184 216
185 std::unique_ptr<MainDicomTagsRegistry> mainDicomTagsRegistry_; 217 std::unique_ptr<MainDicomTagsRegistry> mainDicomTagsRegistry_;
258 LabelsConstraint GetLabelsConstraint() const 290 LabelsConstraint GetLabelsConstraint() const
259 { 291 {
260 return labelsContraint_; 292 return labelsContraint_;
261 } 293 }
262 294
263 void SetRetrieveMainDicomTags(ResourceType level, 295 void SetRetrieveMainDicomTags(bool retrieve)
264 bool retrieve); 296 {
265 297 retrieveMainDicomTags_ = retrieve;
266 bool IsRetrieveMainDicomTags(ResourceType level) const; 298 }
267 299
268 void SetRetrieveMetadata(ResourceType level, 300 bool IsRetrieveMainDicomTags() const
269 bool retrieve); 301 {
270 302 return retrieveMainDicomTags_;
271 bool IsRetrieveMetadata(ResourceType level) const; 303 }
304
305 void SetRetrieveMetadata(bool retrieve)
306 {
307 retrieveMetadata_ = retrieve;
308 }
309
310 bool IsRetrieveMetadata() const
311 {
312 return retrieveMetadata_;
313 }
272 314
273 void SetRetrieveLabels(bool retrieve) 315 void SetRetrieveLabels(bool retrieve)
274 { 316 {
275 retrieveLabels_ = retrieve; 317 retrieveLabels_ = retrieve;
276 } 318 }
293 void SetRetrieveParentIdentifier(bool retrieve); 335 void SetRetrieveParentIdentifier(bool retrieve);
294 336
295 bool IsRetrieveParentIdentifier() const 337 bool IsRetrieveParentIdentifier() const
296 { 338 {
297 return retrieveParentIdentifier_; 339 return retrieveParentIdentifier_;
340 }
341
342 ParentRetrieveSpecification& GetParentRetrieveSpecification(ResourceType level);
343
344 const ParentRetrieveSpecification& GetParentRetrieveSpecification(ResourceType level) const
345 {
346 return const_cast<FindRequest&>(*this).GetParentRetrieveSpecification(level);
298 } 347 }
299 348
300 void SetRetrieveChildrenIdentifiers(bool retrieve); 349 void SetRetrieveChildrenIdentifiers(bool retrieve);
301 350
302 bool IsRetrieveChildrenIdentifiers() const 351 bool IsRetrieveChildrenIdentifiers() const