annotate OrthancServer/Sources/Database/FindRequest.h @ 5668:bd1352bd9d82 find-refactoring

configuring requests for ModalitiesInStudy and SOPClassesInStudy
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 04 Jul 2024 21:57:39 +0200
parents 93dff1fccf36
children 74f3aab95886
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
5641
3f13db27b399 integration mainline->find-refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5621
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
3f13db27b399 integration mainline->find-refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5621
diff changeset
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * This program is free software: you can redistribute it and/or
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * modify it under the terms of the GNU General Public License as
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * published by the Free Software Foundation, either version 3 of the
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * License, or (at your option) any later version.
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 *
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful, but
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * General Public License for more details.
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 *
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #pragma once
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "../../../OrthancFramework/Sources/DicomFormat/DicomTag.h"
5591
043c8016ed6a removing standalone OrthancServer/Sources/Search/LabelsConstraint.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5590
diff changeset
27 #include "../Search/DatabaseConstraint.h"
043c8016ed6a removing standalone OrthancServer/Sources/Search/LabelsConstraint.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5590
diff changeset
28 #include "../Search/DicomTagConstraint.h"
043c8016ed6a removing standalone OrthancServer/Sources/Search/LabelsConstraint.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5590
diff changeset
29 #include "../Search/ISqlLookupFormatter.h"
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #include "../ServerEnumerations.h"
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 #include "OrthancIdentifiers.h"
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 #include <deque>
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #include <map>
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include <set>
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
36 #include <cassert>
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
37 #include <boost/shared_ptr.hpp>
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 namespace Orthanc
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 {
5614
4640b7ae9a11 moving normalization of constraints into FindRequest
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5610
diff changeset
41 class MainDicomTagsRegistry;
4640b7ae9a11 moving normalization of constraints into FindRequest
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5610
diff changeset
42
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 class FindRequest : public boost::noncopyable
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 public:
5590
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
46 /**
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
47
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
48 TO DISCUSS:
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
49
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
50 (1) 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
5565
def06a42e5ef Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents: 5554
diff changeset
51
5590
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
52 if (requestedTags.size() > 0 && resourceType != ResourceType_Instance) // if we are requesting specific tags that might be outside of the MainDicomTags, we must get a childInstanceId too
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
53 {
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
54 responseContent = static_cast<FindRequest::ResponseContent>(responseContent | FindRequest::ResponseContent_ChildInstanceId);
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
55 }
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
5590
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
57
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
58 (2) ResponseContent_IsStable = (1 << 8), // This is currently not saved in DB but it could be in the future.
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
59
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
60 **/
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
61
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
63 enum KeyType // used for ordering and filters
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
64 {
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
65 KeyType_DicomTag,
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
66 KeyType_Metadata
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
67 };
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68
5590
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
69
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
70 enum OrderingDirection
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
71 {
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
72 OrderingDirection_Ascending,
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
73 OrderingDirection_Descending
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
74 };
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
75
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
76
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
77 class Key
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 {
5583
74cc31c8db2b removed FindResponse::Item::responseContent_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5574
diff changeset
79 private:
5595
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
80 KeyType type_;
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
81 DicomTag dicomTag_;
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
82 MetadataType metadata_;
5568
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
83
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
84 // TODO-FIND: to execute the query, we actually need:
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
85 // ResourceType level_;
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
86 // DicomTagType dicomTagType_;
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
87 // these are however only populated in StatelessDatabaseOperations -> we had to add the normalized lookup arg to ExecuteFind
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
88
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
89 public:
5583
74cc31c8db2b removed FindResponse::Item::responseContent_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5574
diff changeset
90 explicit Key(const DicomTag& dicomTag) :
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
91 type_(KeyType_DicomTag),
5595
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
92 dicomTag_(dicomTag),
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
93 metadata_(MetadataType_EndUser)
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
94 {
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
95 }
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
96
5583
74cc31c8db2b removed FindResponse::Item::responseContent_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5574
diff changeset
97 explicit Key(MetadataType metadata) :
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
98 type_(KeyType_Metadata),
5595
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
99 dicomTag_(0, 0),
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
100 metadata_(metadata)
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
101 {
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
102 }
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
103
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
104 KeyType GetType() const
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
105 {
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
106 return type_;
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
107 }
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
108
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
109 const DicomTag& GetDicomTag() const
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
110 {
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
111 assert(GetType() == KeyType_DicomTag);
5595
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
112 return dicomTag_;
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
113 }
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
114
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
115 MetadataType GetMetadataType() const
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
116 {
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
117 assert(GetType() == KeyType_Metadata);
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
118 return metadata_;
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
119 }
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
120 };
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
121
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
122 class Ordering : public boost::noncopyable
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
123 {
5583
74cc31c8db2b removed FindResponse::Item::responseContent_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5574
diff changeset
124 private:
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
125 OrderingDirection direction_;
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
126 Key key_;
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
127
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
128 public:
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
129 Ordering(const Key& key,
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
130 OrderingDirection direction) :
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
131 direction_(direction),
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
132 key_(key)
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
133 {
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
134 }
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
135
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
136 KeyType GetKeyType() const
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
137 {
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
138 return key_.GetType();
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
139 }
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
140
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
141 OrderingDirection GetDirection() const
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
142 {
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
143 return direction_;
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
144 }
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
145
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
146 MetadataType GetMetadataType() const
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
147 {
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
148 return key_.GetMetadataType();
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
149 }
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
150
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
151 DicomTag GetDicomTag() const
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
152 {
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
153 return key_.GetDicomTag();
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
154 }
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 };
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157
5619
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
158 class ParentRetrieveSpecification : public boost::noncopyable
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
159 {
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
160 private:
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
161 bool mainDicomTags_;
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
162 bool metadata_;
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
163
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
164 public:
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
165 ParentRetrieveSpecification() :
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
166 mainDicomTags_(false),
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
167 metadata_(false)
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
168 {
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
169 }
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
170
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
171 void SetRetrieveMainDicomTags(bool retrieve)
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
172 {
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
173 mainDicomTags_ = retrieve;
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
174 }
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
175
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
176 bool IsRetrieveMainDicomTags() const
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
177 {
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
178 return mainDicomTags_;
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
179 }
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
180
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
181 void SetRetrieveMetadata(bool retrieve)
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
182 {
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
183 metadata_ = retrieve;
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
184 }
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
185
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
186 bool IsRetrieveMetadata() const
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
187 {
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
188 return metadata_;
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
189 }
5667
93dff1fccf36 recursive descent to the children
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
190
93dff1fccf36 recursive descent to the children
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
191 bool IsOfInterest() const
93dff1fccf36 recursive descent to the children
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
192 {
93dff1fccf36 recursive descent to the children
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
193 return (mainDicomTags_ || metadata_);
93dff1fccf36 recursive descent to the children
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
194 }
5619
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
195 };
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
196
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
197
5621
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
198 class ChildrenRetrieveSpecification : public boost::noncopyable
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
199 {
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
200 private:
5668
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
201 bool identifiers_;
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
202 std::set<MetadataType> metadata_;
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
203 std::set<DicomTag> mainDicomTags_;
5621
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
204
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
205 public:
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
206 ChildrenRetrieveSpecification() :
5667
93dff1fccf36 recursive descent to the children
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
207 identifiers_(false)
5621
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
208 {
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
209 }
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
210
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
211 void SetRetrieveIdentifiers(bool retrieve)
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
212 {
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
213 identifiers_ = retrieve;
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
214 }
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
215
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
216 bool IsRetrieveIdentifiers() const
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
217 {
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
218 return identifiers_;
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
219 }
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
220
5668
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
221 void AddMetadata(MetadataType metadata)
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
222 {
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
223 metadata_.insert(metadata);
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
224 }
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
225
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
226 const std::set<MetadataType>& GetMetadata() const
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
227 {
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
228 return metadata_;
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
229 }
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
230
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
231 void AddMainDicomTag(const DicomTag& tag)
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
232 {
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
233 mainDicomTags_.insert(tag);
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
234 }
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
235
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
236 const std::set<DicomTag>& GetMainDicomTags() const
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
237 {
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
238 return mainDicomTags_;
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
239 }
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
240
5667
93dff1fccf36 recursive descent to the children
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
241 bool IsOfInterest() const
5621
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
242 {
5668
bd1352bd9d82 configuring requests for ModalitiesInStudy and SOPClassesInStudy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5667
diff changeset
243 return (identifiers_ || !metadata_.empty() || !mainDicomTags_.empty());
5621
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
244 }
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
245 };
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
246
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
247
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 private:
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
249 // filter & ordering fields
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
250 ResourceType level_; // The level of the response (the filtering on tags, labels and metadata also happens at this level)
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
251 OrthancIdentifiers orthancIdentifiers_; // The response must belong to this Orthanc resources hierarchy
5614
4640b7ae9a11 moving normalization of constraints into FindRequest
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5610
diff changeset
252 std::deque<DatabaseConstraint> dicomTagConstraints_; // All tags filters (note: the order is not important)
5568
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
253 std::deque<void*> /* TODO-FIND */ metadataConstraints_; // All metadata filters (note: the order is not important)
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 bool hasLimits_;
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 uint64_t limitsSince_;
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 uint64_t limitsCount_;
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
257 std::set<std::string> labels_;
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
258 LabelsConstraint labelsContraint_;
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
259 std::deque<Ordering*> ordering_; // The ordering criteria (note: the order is important !)
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
260
5619
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
261 bool retrieveMainDicomTags_;
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
262 bool retrieveMetadata_;
5590
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
263 bool retrieveLabels_;
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
264 bool retrieveAttachments_;
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
265 bool retrieveParentIdentifier_;
5619
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
266 ParentRetrieveSpecification retrieveParentPatient_;
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
267 ParentRetrieveSpecification retrieveParentStudy_;
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
268 ParentRetrieveSpecification retrieveParentSeries_;
5621
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
269 ChildrenRetrieveSpecification retrieveChildrenStudies_;
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
270 ChildrenRetrieveSpecification retrieveChildrenSeries_;
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
271 ChildrenRetrieveSpecification retrieveChildrenInstances_;
5595
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
272 std::set<MetadataType> retrieveChildrenMetadata_;
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5596
diff changeset
273 bool retrieveOneInstanceIdentifier_;
5590
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
274
5614
4640b7ae9a11 moving normalization of constraints into FindRequest
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5610
diff changeset
275 std::unique_ptr<MainDicomTagsRegistry> mainDicomTagsRegistry_;
4640b7ae9a11 moving normalization of constraints into FindRequest
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5610
diff changeset
276
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 public:
5583
74cc31c8db2b removed FindResponse::Item::responseContent_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5574
diff changeset
278 explicit FindRequest(ResourceType level);
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 ~FindRequest();
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 ResourceType GetLevel() const
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 return level_;
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 }
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5596
diff changeset
287 void SetOrthancId(ResourceType level,
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5596
diff changeset
288 const std::string& id);
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5596
diff changeset
290 void SetOrthancPatientId(const std::string& id);
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5596
diff changeset
292 void SetOrthancStudyId(const std::string& id);
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5596
diff changeset
294 void SetOrthancSeriesId(const std::string& id);
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5596
diff changeset
295
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5596
diff changeset
296 void SetOrthancInstanceId(const std::string& id);
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 const OrthancIdentifiers& GetOrthancIdentifiers() const
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 return orthancIdentifiers_;
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 }
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302
5568
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
303 void AddDicomTagConstraint(const DicomTagConstraint& constraint);
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304
5568
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
305 size_t GetDicomTagConstraintsCount() const
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306 {
5568
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
307 return dicomTagConstraints_.size();
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308 }
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309
5614
4640b7ae9a11 moving normalization of constraints into FindRequest
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5610
diff changeset
310 const DatabaseConstraint& GetDicomTagConstraint(size_t index) const;
4640b7ae9a11 moving normalization of constraints into FindRequest
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5610
diff changeset
311
5568
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
312 size_t GetMetadataConstraintsCount() const
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
313 {
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
314 return metadataConstraints_.size();
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
315 }
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
316
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317 void SetLimits(uint64_t since,
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 uint64_t count);
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320 bool HasLimits() const
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322 return hasLimits_;
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323 }
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
325 uint64_t GetLimitsSince() const;
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327 uint64_t GetLimitsCount() const;
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
329 void AddOrdering(const DicomTag& tag, OrderingDirection direction);
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
330
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
331 void AddOrdering(MetadataType metadataType, OrderingDirection direction);
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
333 const std::deque<Ordering*>& GetOrdering() const
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 {
5567
f3562c1a150d FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
335 return ordering_;
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
336 }
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338 void AddLabel(const std::string& label)
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340 labels_.insert(label);
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
341 }
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
342
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 const std::set<std::string>& GetLabels() const
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345 return labels_;
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
346 }
5568
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
347
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
348 LabelsConstraint GetLabelsConstraint() const
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
349 {
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
350 return labelsContraint_;
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5567
diff changeset
351 }
5590
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
352
5619
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
353 void SetRetrieveMainDicomTags(bool retrieve)
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
354 {
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
355 retrieveMainDicomTags_ = retrieve;
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
356 }
5590
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
357
5619
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
358 bool IsRetrieveMainDicomTags() const
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
359 {
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
360 return retrieveMainDicomTags_;
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
361 }
5592
1e2631b8b9af GenericFind::Execute() is working for a basic request
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5591
diff changeset
362
5619
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
363 void SetRetrieveMetadata(bool retrieve)
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
364 {
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
365 retrieveMetadata_ = retrieve;
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
366 }
5592
1e2631b8b9af GenericFind::Execute() is working for a basic request
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5591
diff changeset
367
5619
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
368 bool IsRetrieveMetadata() const
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
369 {
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
370 return retrieveMetadata_;
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
371 }
5590
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
372
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
373 void SetRetrieveLabels(bool retrieve)
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
374 {
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
375 retrieveLabels_ = retrieve;
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
376 }
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
377
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
378 bool IsRetrieveLabels() const
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
379 {
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
380 return retrieveLabels_;
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
381 }
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
382
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
383 void SetRetrieveAttachments(bool retrieve)
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
384 {
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
385 retrieveAttachments_ = retrieve;
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
386 }
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
387
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
388 bool IsRetrieveAttachments() const
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
389 {
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
390 return retrieveAttachments_;
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
391 }
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
392
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
393 void SetRetrieveParentIdentifier(bool retrieve);
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
394
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
395 bool IsRetrieveParentIdentifier() const
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
396 {
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
397 return retrieveParentIdentifier_;
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
398 }
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
399
5619
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
400 ParentRetrieveSpecification& GetParentRetrieveSpecification(ResourceType level);
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
401
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
402 const ParentRetrieveSpecification& GetParentRetrieveSpecification(ResourceType level) const
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
403 {
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
404 return const_cast<FindRequest&>(*this).GetParentRetrieveSpecification(level);
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
405 }
1864b16bc7b1 added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5614
diff changeset
406
5621
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
407 ChildrenRetrieveSpecification& GetChildrenRetrieveSpecification(ResourceType level);
5590
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
408
5621
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
409 const ChildrenRetrieveSpecification& GetChildrenRetrieveSpecification(ResourceType level) const
5590
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
410 {
5621
732ec9feeea8 introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5619
diff changeset
411 return const_cast<FindRequest&>(*this).GetChildrenRetrieveSpecification(level);
5590
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
412 }
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
413
5595
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
414 void AddRetrieveChildrenMetadata(MetadataType metadata);
5590
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
415
5595
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
416 bool IsRetrieveChildrenMetadata(MetadataType metadata) const
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
417 {
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
418 return retrieveChildrenMetadata_.find(metadata) != retrieveChildrenMetadata_.end();
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
419 }
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
420
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
421 const std::set<MetadataType>& GetRetrieveChildrenMetadata() const
5590
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
422 {
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
423 return retrieveChildrenMetadata_;
8b32213af23e replaced FindRequest::ResponseContent by booleans
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
424 }
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
425
5610
d4b570834d3a adding safeguards around FindRequest::SetRetrieveOneInstanceIdentifier()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5609
diff changeset
426 void SetRetrieveOneInstanceIdentifier(bool retrieve);
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
427
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5596
diff changeset
428 bool IsRetrieveOneInstanceIdentifier() const
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
429 {
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
430 return (retrieveOneInstanceIdentifier_ ||
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
431 GetChildrenRetrieveSpecification(ResourceType_Instance).IsRetrieveIdentifiers());
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
432 }
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433 };
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434 }