comparison OrthancServer/Sources/Database/FindRequest.h @ 5595:a87f2a56257d find-refactoring

implemented FindRequest::retrieveChildrenMetadata_
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 May 2024 12:53:12 +0200
parents 1e2631b8b9af
children 81a29ad7fb4b
comparison
equal deleted inserted replaced
5594:a906dc19264c 5595:a87f2a56257d
72 72
73 73
74 class Key 74 class Key
75 { 75 {
76 private: 76 private:
77 KeyType type_; 77 KeyType type_;
78 boost::shared_ptr<DicomTag> dicomTag_; 78 DicomTag dicomTag_;
79 MetadataType metadata_; 79 MetadataType metadata_;
80 80
81 // TODO-FIND: to execute the query, we actually need: 81 // TODO-FIND: to execute the query, we actually need:
82 // ResourceType level_; 82 // ResourceType level_;
83 // DicomTagType dicomTagType_; 83 // DicomTagType dicomTagType_;
84 // these are however only populated in StatelessDatabaseOperations -> we had to add the normalized lookup arg to ExecuteFind 84 // these are however only populated in StatelessDatabaseOperations -> we had to add the normalized lookup arg to ExecuteFind
85 85
86 public: 86 public:
87 explicit Key(const DicomTag& dicomTag) : 87 explicit Key(const DicomTag& dicomTag) :
88 type_(KeyType_DicomTag), 88 type_(KeyType_DicomTag),
89 dicomTag_(new DicomTag(dicomTag)), 89 dicomTag_(dicomTag),
90 metadata_(MetadataType_EndUser) 90 metadata_(MetadataType_EndUser)
91 { 91 {
92 } 92 }
93 93
94 explicit Key(MetadataType metadata) : 94 explicit Key(MetadataType metadata) :
95 type_(KeyType_Metadata), 95 type_(KeyType_Metadata),
96 dicomTag_(0, 0),
96 metadata_(metadata) 97 metadata_(metadata)
97 { 98 {
98 } 99 }
99 100
100 KeyType GetType() const 101 KeyType GetType() const
103 } 104 }
104 105
105 const DicomTag& GetDicomTag() const 106 const DicomTag& GetDicomTag() const
106 { 107 {
107 assert(GetType() == KeyType_DicomTag); 108 assert(GetType() == KeyType_DicomTag);
108 return *dicomTag_; 109 return dicomTag_;
109 } 110 }
110 111
111 MetadataType GetMetadataType() const 112 MetadataType GetMetadataType() const
112 { 113 {
113 assert(GetType() == KeyType_Metadata); 114 assert(GetType() == KeyType_Metadata);
169 bool retrieveMetadata_; 170 bool retrieveMetadata_;
170 bool retrieveLabels_; 171 bool retrieveLabels_;
171 bool retrieveAttachments_; 172 bool retrieveAttachments_;
172 bool retrieveParentIdentifier_; 173 bool retrieveParentIdentifier_;
173 bool retrieveChildrenIdentifiers_; 174 bool retrieveChildrenIdentifiers_;
174 bool retrieveChildrenMetadata_; 175 std::set<MetadataType> retrieveChildrenMetadata_;
175 176
176 public: 177 public:
177 explicit FindRequest(ResourceType level); 178 explicit FindRequest(ResourceType level);
178 179
179 ~FindRequest(); 180 ~FindRequest();
310 bool IsRetrieveChildrenIdentifiers() const 311 bool IsRetrieveChildrenIdentifiers() const
311 { 312 {
312 return retrieveChildrenIdentifiers_; 313 return retrieveChildrenIdentifiers_;
313 } 314 }
314 315
315 void SetRetrieveChildrenMetadata(bool retrieve); 316 void AddRetrieveChildrenMetadata(MetadataType metadata);
316 317
317 bool IsRetrieveChildrenMetadata() const 318 bool IsRetrieveChildrenMetadata(MetadataType metadata) const
319 {
320 return retrieveChildrenMetadata_.find(metadata) != retrieveChildrenMetadata_.end();
321 }
322
323 const std::set<MetadataType>& GetRetrieveChildrenMetadata() const
318 { 324 {
319 return retrieveChildrenMetadata_; 325 return retrieveChildrenMetadata_;
320 } 326 }
321 }; 327 };
322 } 328 }