Mercurial > hg > orthanc
annotate OrthancServer/Sources/Database/FindRequest.h @ 5574:5a13483d12c5 find-refactoring
find-refactoring: attachments
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Fri, 26 Apr 2024 16:32:18 +0200 |
parents | b0b5546f1b9f |
children | 74cc31c8db2b |
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 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * Copyright (C) 2017-2024 Osimis S.A., Belgium |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * 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
|
9 * 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
|
10 * 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
|
11 * License, or (at your option) any later version. |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * 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
|
14 * WITHOUT ANY WARRANTY; without even the implied warranty of |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * 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
|
16 * General Public License for more details. |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * 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
|
19 * 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
|
20 **/ |
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 #pragma once |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 #include "../../../OrthancFramework/Sources/DicomFormat/DicomTag.h" |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 #include "../ServerEnumerations.h" |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 #include "OrthancIdentifiers.h" |
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
|
28 #include "../Search/DicomTagConstraint.h" |
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
|
29 #include "../Search/LabelsConstraint.h" |
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
|
30 #include "../Search/DatabaseConstraint.h" |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 #include <deque> |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 #include <map> |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 #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
|
35 #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
|
36 #include <boost/shared_ptr.hpp> |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 namespace Orthanc |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 { |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 class FindRequest : public boost::noncopyable |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 { |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 public: |
5565
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
43 enum ResponseContent |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 { |
5565
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
45 ResponseContent_MainDicomTags = (1 << 0), // retrieve all tags from MainDicomTags and DicomIdentifiers |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
46 ResponseContent_Metadata = (1 << 1), // retrieve all metadata, their values and revision |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
47 ResponseContent_Labels = (1 << 2), // get all labels |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
48 ResponseContent_Attachments = (1 << 3), // retrieve all attachments, their values and revision |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
49 ResponseContent_Parent = (1 << 4), // get the id of the parent |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
50 ResponseContent_Children = (1 << 5), // retrieve the list of children ids |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
51 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 |
5574
5a13483d12c5
find-refactoring: attachments
Alain Mazy <am@orthanc.team>
parents:
5568
diff
changeset
|
52 ResponseContent_ChildrenMetadata = (1 << 7), // That is actually required to compute the series status but could be usefull for other stuffs. |
5a13483d12c5
find-refactoring: attachments
Alain Mazy <am@orthanc.team>
parents:
5568
diff
changeset
|
53 ResponseContent_IsStable = (1 << 8), // This is currently not saved in DB but it could be in the future. |
5565
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
54 |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
55 ResponseContent_IdentifiersOnly = 0, |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
56 ResponseContent_INTERNAL = 0x7FFFFFFF |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 }; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 enum ConstraintType |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 { |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 ConstraintType_Mandatory, |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 ConstraintType_Equality, |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 ConstraintType_Range, |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 ConstraintType_Wildcard, |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 ConstraintType_List |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 }; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 |
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
|
68 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
|
69 { |
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 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
|
71 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
|
72 }; |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 |
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
|
74 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
|
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 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
|
77 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
|
78 }; |
f3562c1a150d
FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents:
5565
diff
changeset
|
79 |
f3562c1a150d
FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents:
5565
diff
changeset
|
80 |
f3562c1a150d
FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents:
5565
diff
changeset
|
81 class Key |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 { |
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
|
83 KeyType 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
|
84 boost::shared_ptr<DicomTag> 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
|
85 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
|
86 |
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 // 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
|
88 // 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
|
89 // 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
|
90 // 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
|
91 |
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
|
92 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
|
93 Key(const DicomTag& 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
|
94 type_(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
|
95 dicomTag_(new DicomTag(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
|
96 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
|
97 { |
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 } |
f3562c1a150d
FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents:
5565
diff
changeset
|
99 |
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 Key(MetadataType 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 type_(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
|
102 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
|
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 } |
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 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
|
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 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
|
109 } |
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 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
|
112 { |
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 assert(GetType() == 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
|
114 return *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
|
115 } |
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 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
|
118 { |
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 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
|
120 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
|
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 }; |
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 |
f3562c1a150d
FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents:
5565
diff
changeset
|
124 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
|
125 { |
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 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
|
127 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
|
128 |
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 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
|
130 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
|
131 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
|
132 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
|
133 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
|
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 |
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 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
|
138 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
|
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 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
|
141 } |
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 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
|
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 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
|
146 } |
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 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
|
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 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
|
151 } |
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 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
|
154 { |
f3562c1a150d
FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents:
5565
diff
changeset
|
155 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
|
156 } |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
157 }; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 |
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
|
159 // TODO-FIND: this class hierarchy actually adds complexity and is very redundant with DicomTagConstraint. |
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
|
160 // e.g, in this class hierarchy, it is difficult to implement an equivalent to DicomTagConstraint::ConvertToDatabaseConstraint |
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
|
161 // I have the feeling we can just have a MetadataConstraint in the same way as DicomTagConstraint |
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
|
162 // and both convert to a DatabaseConstraint in StatelessDatabaseOperations |
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
|
163 // class FilterConstraint : public boost::noncopyable |
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
|
164 // { |
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
|
165 // Key key_; |
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
|
166 |
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
|
167 // protected: |
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
|
168 // FilterConstraint(const Key& key) : |
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
|
169 // key_(key) |
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
|
170 // { |
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
|
171 // } |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
172 |
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
|
173 // public: |
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
|
174 // virtual ~FilterConstraint() |
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
|
175 // { |
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
|
176 // } |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
177 |
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
|
178 // const Key& GetKey() 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
|
179 // { |
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
|
180 // return key_; |
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
|
181 // } |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
182 |
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
|
183 // virtual ConstraintType GetType() const = 0; |
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
|
184 // virtual bool IsCaseSensitive() const = 0; // Needed for PN VR |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
185 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
186 |
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
|
187 // }; |
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
|
188 |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
189 |
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
|
190 // class MandatoryConstraint : public FilterConstraint |
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
|
191 // { |
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
|
192 // public: |
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
|
193 // virtual ConstraintType GetType() const ORTHANC_OVERRIDE |
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
|
194 // { |
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
|
195 // return ConstraintType_Mandatory; |
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
|
196 // } |
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
|
197 // }; |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
198 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
199 |
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
|
200 // class StringConstraint : public FilterConstraint |
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
|
201 // { |
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
|
202 // private: |
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
|
203 // bool caseSensitive_; |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
204 |
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
|
205 // public: |
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
|
206 // StringConstraint(Key key, |
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
|
207 // bool caseSensitive) : |
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
|
208 // FilterConstraint(key), |
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
|
209 // caseSensitive_(caseSensitive) |
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
|
210 // { |
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
|
211 // } |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
212 |
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
|
213 // bool IsCaseSensitive() 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
|
214 // { |
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
|
215 // return caseSensitive_; |
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
|
216 // } |
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
|
217 // }; |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
218 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
219 |
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
|
220 // class EqualityConstraint : public StringConstraint |
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
|
221 // { |
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
|
222 // private: |
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
|
223 // std::string value_; |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
224 |
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
|
225 // public: |
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
|
226 // explicit EqualityConstraint(Key key, |
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
|
227 // bool caseSensitive, |
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
|
228 // const std::string& value) : |
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
|
229 // StringConstraint(key, caseSensitive), |
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
|
230 // value_(value) |
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
|
231 // { |
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
|
232 // } |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
233 |
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
|
234 // virtual ConstraintType GetType() const ORTHANC_OVERRIDE |
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
|
235 // { |
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
|
236 // return ConstraintType_Equality; |
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
|
237 // } |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
238 |
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
|
239 // const std::string& GetValue() 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
|
240 // { |
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
|
241 // return value_; |
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
|
242 // } |
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
|
243 // }; |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
244 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
245 |
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
|
246 // class RangeConstraint : public StringConstraint |
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
|
247 // { |
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
|
248 // private: |
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
|
249 // std::string start_; |
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
|
250 // std::string end_; // Inclusive |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
251 |
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
|
252 // public: |
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 // RangeConstraint(Key key, |
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
|
254 // bool caseSensitive, |
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
|
255 // const std::string& start, |
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
|
256 // const std::string& end) : |
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
|
257 // StringConstraint(key, caseSensitive), |
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
|
258 // start_(start), |
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
|
259 // end_(end) |
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
|
260 // { |
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
|
261 // } |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
262 |
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
|
263 // virtual ConstraintType GetType() const ORTHANC_OVERRIDE |
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
|
264 // { |
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
|
265 // return ConstraintType_Range; |
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
|
266 // } |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
267 |
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
|
268 // const std::string& GetStart() 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
|
269 // { |
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
|
270 // return start_; |
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
|
271 // } |
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
|
272 |
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
|
273 // const std::string& GetEnd() 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
|
274 // { |
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
|
275 // return end_; |
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
|
276 // } |
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
|
277 // }; |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
278 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
279 |
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
|
280 // class WildcardConstraint : public StringConstraint |
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
|
281 // { |
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
|
282 // private: |
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
|
283 // std::string value_; |
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
|
284 |
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
|
285 // public: |
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
|
286 // explicit WildcardConstraint(Key& key, |
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
|
287 // bool caseSensitive, |
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
|
288 // const std::string& value) : |
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
|
289 // StringConstraint(key, caseSensitive), |
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
|
290 // value_(value) |
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
|
291 // { |
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
|
292 // } |
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
|
293 |
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
|
294 // virtual ConstraintType GetType() const ORTHANC_OVERRIDE |
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
|
295 // { |
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
|
296 // return ConstraintType_Wildcard; |
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
|
297 // } |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
298 |
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
|
299 // const std::string& GetValue() 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
|
300 // { |
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
|
301 // return value_; |
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
|
302 // } |
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 // }; |
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
|
304 |
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 |
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
|
306 // class ListConstraint : public StringConstraint |
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 // { |
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
|
308 // private: |
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
|
309 // std::set<std::string> values_; |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
310 |
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
|
311 // public: |
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 // ListConstraint(Key key, |
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 // bool caseSensitive) : |
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 // StringConstraint(key, caseSensitive) |
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 |
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
|
318 // virtual ConstraintType GetType() const ORTHANC_OVERRIDE |
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
|
319 // { |
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
|
320 // return ConstraintType_List; |
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
|
321 // } |
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
|
322 |
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
|
323 // const std::set<std::string>& GetValues() 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
|
324 // { |
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
|
325 // return values_; |
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
|
326 // } |
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
|
327 // }; |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
328 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
329 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
330 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
|
331 |
f3562c1a150d
FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents:
5565
diff
changeset
|
332 // 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
|
333 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
|
334 OrthancIdentifiers orthancIdentifiers_; // The response must belong to this Orthanc resources hierarchy |
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
|
335 // std::deque<FilterConstraint*> filterConstraints_; // All tags and metadata filters (note: the order is not important) |
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
|
336 std::vector<DicomTagConstraint> dicomTagConstraints_; // All tags filters (note: the order is not important) |
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
|
337 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
|
338 bool hasLimits_; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
339 uint64_t limitsSince_; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
340 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
|
341 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
|
342 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
|
343 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
|
344 |
f3562c1a150d
FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents:
5565
diff
changeset
|
345 // response 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
|
346 ResponseContent responseContent_; |
f3562c1a150d
FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents:
5565
diff
changeset
|
347 |
f3562c1a150d
FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents:
5565
diff
changeset
|
348 // TODO: check if these 4 options are required. We might just have a retrieveParentTags that could be part of the ResponseContent enum ? |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
349 bool retrievePatientTags_; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
350 bool retrieveStudyTags_; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
351 bool retrieveSeriesTags_; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
352 bool retrieveInstanceTags_; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
353 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
354 bool IsCompatibleLevel(ResourceType levelOfInterest) const; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
355 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
356 public: |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
357 FindRequest(ResourceType level); |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
358 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
359 ~FindRequest(); |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
360 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
361 ResourceType GetLevel() const |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
362 { |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
363 return level_; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
364 } |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
365 |
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
|
366 |
5565
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
367 void SetResponseContent(ResponseContent content) |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
368 { |
5565
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
369 responseContent_ = content; |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
370 } |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
371 |
5565
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
372 void AddResponseContent(ResponseContent content) |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
373 { |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
374 responseContent_ = static_cast<ResponseContent>(static_cast<uint32_t>(responseContent_) | content); |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
375 } |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
376 |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
377 ResponseContent GetResponseContent() const |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
378 { |
5565
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
379 return responseContent_; |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
380 } |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
381 |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
382 bool HasResponseContent(ResponseContent content) const |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
383 { |
def06a42e5ef
Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents:
5554
diff
changeset
|
384 return (responseContent_ & content) == content; |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
385 } |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
386 |
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
|
387 bool IsResponseIdentifiersOnly() 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
|
388 { |
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
|
389 return responseContent_ == ResponseContent_IdentifiersOnly; |
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
|
390 } |
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
|
391 |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
392 void SetOrthancPatientId(const std::string& id) |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
393 { |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
394 orthancIdentifiers_.SetPatientId(id); |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
395 } |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
396 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
397 void SetOrthancStudyId(const std::string& id) |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
398 { |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
399 orthancIdentifiers_.SetStudyId(id); |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
400 } |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
401 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
402 void SetOrthancSeriesId(const std::string& id) |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
403 { |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
404 orthancIdentifiers_.SetSeriesId(id); |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
405 } |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
406 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
407 void SetOrthancInstanceId(const std::string& id) |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
408 { |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
409 orthancIdentifiers_.SetInstanceId(id); |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
410 } |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
411 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
412 const OrthancIdentifiers& GetOrthancIdentifiers() const |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
413 { |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
414 return orthancIdentifiers_; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
415 } |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
416 |
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
|
417 |
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
|
418 void AddDicomTagConstraint(const DicomTagConstraint& constraint); |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
419 |
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
|
420 size_t GetDicomTagConstraintsCount() const |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
421 { |
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
|
422 return dicomTagConstraints_.size(); |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
423 } |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
424 |
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
|
425 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
|
426 { |
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
|
427 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
|
428 } |
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
|
429 |
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
|
430 const DicomTagConstraint& GetDicomTagConstraint(size_t index) const; |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
431 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
432 void SetLimits(uint64_t since, |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
433 uint64_t count); |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
434 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
435 bool HasLimits() const |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
436 { |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
437 return hasLimits_; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
438 } |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
439 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
440 uint64_t GetLimitsSince() const; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
441 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
442 uint64_t GetLimitsCount() const; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
443 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
444 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
445 void SetRetrieveTagsAtLevel(ResourceType levelOfInterest, |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
446 bool retrieve); |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
447 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
448 bool IsRetrieveTagsAtLevel(ResourceType levelOfInterest) const; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
449 |
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
|
450 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
|
451 |
f3562c1a150d
FindRequest: group metadata and tag constrains in a single class, allow ordering against metadata
Alain Mazy <am@orthanc.team>
parents:
5565
diff
changeset
|
452 void AddOrdering(MetadataType metadataType, OrderingDirection direction); |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
453 |
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
|
454 const std::deque<Ordering*>& GetOrdering() const |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
455 { |
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
|
456 return ordering_; |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
457 } |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
458 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
459 void AddLabel(const std::string& label) |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
460 { |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
461 labels_.insert(label); |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
462 } |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
463 |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
464 const std::set<std::string>& GetLabels() const |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
465 { |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
466 return labels_; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
467 } |
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
|
468 |
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
|
469 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
|
470 { |
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
|
471 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
|
472 } |
5554
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
473 }; |
12d8a1a266e9
introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
474 } |