annotate OrthancServer/Sources/ResourceFinder.h @ 5857:39996519afce find-refactoring

fix limit/since restrictions
author Alain Mazy <am@orthanc.team>
date Mon, 04 Nov 2024 22:06:45 +0100
parents d1dea8ad74a6
children 66fd63b8601e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5608
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
3d0aa94b44b3 reorganization
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
5608
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * This program is free software: you can redistribute it and/or
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * modify it under the terms of the GNU General Public License as
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * published by the Free Software Foundation, either version 3 of the
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * License, or (at your option) any later version.
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 *
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful, but
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * General Public License for more details.
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 *
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #pragma once
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "Database/FindRequest.h"
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #include "Database/FindResponse.h"
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 namespace Orthanc
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 {
5682
fd4c5e064cbe started refactoring of ServerContext::Apply()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5677
diff changeset
31 class DatabaseLookup;
5608
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 class ServerContext;
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 class ServerIndex;
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 class ResourceFinder : public boost::noncopyable
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 {
5688
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
37 public:
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
38 class IVisitor : public boost::noncopyable
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
39 {
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
40 public:
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
41 virtual ~IVisitor()
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
42 {
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
43 }
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
44
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
45 virtual void Apply(const FindResponse::Resource& resource,
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
46 const DicomMap& requestedTags) = 0;
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
47
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
48 virtual void MarkAsComplete() = 0;
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
49 };
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
50
5608
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 private:
5693
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5689
diff changeset
52 enum PagingMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5689
diff changeset
53 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5689
diff changeset
54 PagingMode_FullDatabase,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5689
diff changeset
55 PagingMode_FullManual,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5689
diff changeset
56 PagingMode_ManualSkip
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5689
diff changeset
57 };
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5689
diff changeset
58
5686
11575590e493 integrating DatabaseLookup into ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5682
diff changeset
59 FindRequest request_;
5688
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
60 uint64_t databaseLimits_;
5686
11575590e493 integrating DatabaseLookup into ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5682
diff changeset
61 std::unique_ptr<DatabaseLookup> lookup_;
5693
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5689
diff changeset
62 bool isSimpleLookup_;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5689
diff changeset
63 PagingMode pagingMode_;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5689
diff changeset
64 bool hasLimitsSince_;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5689
diff changeset
65 bool hasLimitsCount_;
5688
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
66 uint64_t limitsSince_;
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
67 uint64_t limitsCount_;
5829
963945d780d6 tools/find ResponseContent
Alain Mazy <am@orthanc.team>
parents: 5828
diff changeset
68 ResponseContentFlags responseContent_;
5856
d1dea8ad74a6 implement StorageAccessOnFind for answers
Alain Mazy <am@orthanc.team>
parents: 5840
diff changeset
69 FindStorageAccessMode storageAccessMode_;
5788
61c9e5df64d7 handling of sequences from DB in RequestedTags
Alain Mazy <am@orthanc.team>
parents: 5772
diff changeset
70 std::set<DicomTag> requestedTags_;
5686
11575590e493 integrating DatabaseLookup into ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5682
diff changeset
71 std::set<DicomTag> requestedComputedTags_;
5608
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72
5789
40ad08b75d84 cleanup + W005
Alain Mazy <am@orthanc.team>
parents: 5788
diff changeset
73 bool isWarning002Enabled_;
40ad08b75d84 cleanup + W005
Alain Mazy <am@orthanc.team>
parents: 5788
diff changeset
74 bool isWarning004Enabled_;
40ad08b75d84 cleanup + W005
Alain Mazy <am@orthanc.team>
parents: 5788
diff changeset
75 bool isWarning005Enabled_;
40ad08b75d84 cleanup + W005
Alain Mazy <am@orthanc.team>
parents: 5788
diff changeset
76
5665
d8c86698110c implemented computed tag: Instance Availability
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
77 bool IsRequestedComputedTag(const DicomTag& tag) const
d8c86698110c implemented computed tag: Instance Availability
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
78 {
d8c86698110c implemented computed tag: Instance Availability
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
79 return requestedComputedTags_.find(tag) != requestedComputedTags_.end();
d8c86698110c implemented computed tag: Instance Availability
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
80 }
d8c86698110c implemented computed tag: Instance Availability
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
81
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5665
diff changeset
82 void ConfigureChildrenCountComputedTag(DicomTag tag,
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5665
diff changeset
83 ResourceType parentLevel,
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5665
diff changeset
84 ResourceType childLevel);
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5665
diff changeset
85
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5665
diff changeset
86 void InjectChildrenCountComputedTag(DicomMap& requestedTags,
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5665
diff changeset
87 DicomTag tag,
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5665
diff changeset
88 const FindResponse::Resource& resource,
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5665
diff changeset
89 ResourceType level) const;
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5665
diff changeset
90
5689
c14776d25491 simplification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5688
diff changeset
91 static SeriesStatus GetSeriesStatus(uint32_t& expectedNumberOfInstances,
c14776d25491 simplification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5688
diff changeset
92 const FindResponse::Resource& resource);
5608
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
5665
d8c86698110c implemented computed tag: Instance Availability
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
94 void InjectComputedTags(DicomMap& requestedTags,
d8c86698110c implemented computed tag: Instance Availability
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
95 const FindResponse::Resource& resource) const;
d8c86698110c implemented computed tag: Instance Availability
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
96
5840
b24b61331566 pagination: fixed compat with ODBC that does not support ExtendedFind
Alain Mazy <am@orthanc.team>
parents: 5837
diff changeset
97 void UpdateRequestLimits(ServerContext& context);
5688
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
98
5789
40ad08b75d84 cleanup + W005
Alain Mazy <am@orthanc.team>
parents: 5788
diff changeset
99 bool HasRequestedTags() const
40ad08b75d84 cleanup + W005
Alain Mazy <am@orthanc.team>
parents: 5788
diff changeset
100 {
40ad08b75d84 cleanup + W005
Alain Mazy <am@orthanc.team>
parents: 5788
diff changeset
101 return requestedTags_.size() > 0;
40ad08b75d84 cleanup + W005
Alain Mazy <am@orthanc.team>
parents: 5788
diff changeset
102 }
40ad08b75d84 cleanup + W005
Alain Mazy <am@orthanc.team>
parents: 5788
diff changeset
103
5856
d1dea8ad74a6 implement StorageAccessOnFind for answers
Alain Mazy <am@orthanc.team>
parents: 5840
diff changeset
104 bool IsStorageAccessAllowedOnAnswers();
d1dea8ad74a6 implement StorageAccessOnFind for answers
Alain Mazy <am@orthanc.team>
parents: 5840
diff changeset
105
d1dea8ad74a6 implement StorageAccessOnFind for answers
Alain Mazy <am@orthanc.team>
parents: 5840
diff changeset
106 bool IsStorageAccessOnLookup();
d1dea8ad74a6 implement StorageAccessOnFind for answers
Alain Mazy <am@orthanc.team>
parents: 5840
diff changeset
107
5608
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 public:
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 ResourceFinder(ResourceType level,
5856
d1dea8ad74a6 implement StorageAccessOnFind for answers
Alain Mazy <am@orthanc.team>
parents: 5840
diff changeset
110 ResponseContentFlags responseContent,
d1dea8ad74a6 implement StorageAccessOnFind for answers
Alain Mazy <am@orthanc.team>
parents: 5840
diff changeset
111 FindStorageAccessMode storageAccessMode);
5608
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112
5688
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
113 void SetDatabaseLimits(uint64_t limits);
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
114
5615
a10978a5e65c expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5609
diff changeset
115 void SetOrthancId(ResourceType level,
a10978a5e65c expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5609
diff changeset
116 const std::string& id)
a10978a5e65c expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5609
diff changeset
117 {
a10978a5e65c expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5609
diff changeset
118 request_.SetOrthancId(level, id);
a10978a5e65c expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5609
diff changeset
119 }
a10978a5e65c expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5609
diff changeset
120
5693
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5689
diff changeset
121 void SetLimitsSince(uint64_t since);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5689
diff changeset
122
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5689
diff changeset
123 void SetLimitsCount(uint64_t count);
5608
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124
5682
fd4c5e064cbe started refactoring of ServerContext::Apply()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5677
diff changeset
125 void SetDatabaseLookup(const DatabaseLookup& lookup);
fd4c5e064cbe started refactoring of ServerContext::Apply()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5677
diff changeset
126
5686
11575590e493 integrating DatabaseLookup into ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5682
diff changeset
127 void AddRequestedTag(const DicomTag& tag);
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5608
diff changeset
128
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5608
diff changeset
129 void AddRequestedTags(const std::set<DicomTag>& tags);
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5608
diff changeset
130
5825
881cd0965146 added OrderBy support in SQLite
Alain Mazy <am@orthanc.team>
parents: 5789
diff changeset
131 void AddOrdering(const DicomTag& tag,
881cd0965146 added OrderBy support in SQLite
Alain Mazy <am@orthanc.team>
parents: 5789
diff changeset
132 FindRequest::OrderingDirection direction)
881cd0965146 added OrderBy support in SQLite
Alain Mazy <am@orthanc.team>
parents: 5789
diff changeset
133 {
881cd0965146 added OrderBy support in SQLite
Alain Mazy <am@orthanc.team>
parents: 5789
diff changeset
134 request_.AddOrdering(tag, direction);
881cd0965146 added OrderBy support in SQLite
Alain Mazy <am@orthanc.team>
parents: 5789
diff changeset
135 }
881cd0965146 added OrderBy support in SQLite
Alain Mazy <am@orthanc.team>
parents: 5789
diff changeset
136
881cd0965146 added OrderBy support in SQLite
Alain Mazy <am@orthanc.team>
parents: 5789
diff changeset
137 void AddOrdering(MetadataType metadataType,
881cd0965146 added OrderBy support in SQLite
Alain Mazy <am@orthanc.team>
parents: 5789
diff changeset
138 FindRequest::OrderingDirection direction)
881cd0965146 added OrderBy support in SQLite
Alain Mazy <am@orthanc.team>
parents: 5789
diff changeset
139 {
881cd0965146 added OrderBy support in SQLite
Alain Mazy <am@orthanc.team>
parents: 5789
diff changeset
140 request_.AddOrdering(metadataType, direction);
881cd0965146 added OrderBy support in SQLite
Alain Mazy <am@orthanc.team>
parents: 5789
diff changeset
141 }
881cd0965146 added OrderBy support in SQLite
Alain Mazy <am@orthanc.team>
parents: 5789
diff changeset
142
5828
7030fa489669 tools/find: QueryMetadata
Alain Mazy <am@orthanc.team>
parents: 5825
diff changeset
143 void AddMetadataConstraint(DatabaseMetadataConstraint* constraint)
7030fa489669 tools/find: QueryMetadata
Alain Mazy <am@orthanc.team>
parents: 5825
diff changeset
144 {
7030fa489669 tools/find: QueryMetadata
Alain Mazy <am@orthanc.team>
parents: 5825
diff changeset
145 request_.AddMetadataConstraint(constraint);
7030fa489669 tools/find: QueryMetadata
Alain Mazy <am@orthanc.team>
parents: 5825
diff changeset
146 }
5825
881cd0965146 added OrderBy support in SQLite
Alain Mazy <am@orthanc.team>
parents: 5789
diff changeset
147
5682
fd4c5e064cbe started refactoring of ServerContext::Apply()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5677
diff changeset
148 void SetLabels(const std::set<std::string>& labels)
fd4c5e064cbe started refactoring of ServerContext::Apply()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5677
diff changeset
149 {
fd4c5e064cbe started refactoring of ServerContext::Apply()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5677
diff changeset
150 request_.SetLabels(labels);
fd4c5e064cbe started refactoring of ServerContext::Apply()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5677
diff changeset
151 }
fd4c5e064cbe started refactoring of ServerContext::Apply()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5677
diff changeset
152
5677
dc96401dbe88 starting the refactoring of /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
153 void AddLabel(const std::string& label)
dc96401dbe88 starting the refactoring of /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
154 {
dc96401dbe88 starting the refactoring of /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
155 request_.AddLabel(label);
dc96401dbe88 starting the refactoring of /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
156 }
dc96401dbe88 starting the refactoring of /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
157
dc96401dbe88 starting the refactoring of /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
158 void SetLabelsConstraint(LabelsConstraint constraint)
dc96401dbe88 starting the refactoring of /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
159 {
dc96401dbe88 starting the refactoring of /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
160 request_.SetLabelsConstraint(constraint);
dc96401dbe88 starting the refactoring of /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
161 }
dc96401dbe88 starting the refactoring of /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
162
5772
093a8693ba16 replaced SetRetrieveOneInstanceIdentifier() by SetRetrieveOneInstanceMetadataAndAttachments()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5714
diff changeset
163 void SetRetrieveOneInstanceMetadataAndAttachments(bool retrieve)
5682
fd4c5e064cbe started refactoring of ServerContext::Apply()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5677
diff changeset
164 {
5772
093a8693ba16 replaced SetRetrieveOneInstanceIdentifier() by SetRetrieveOneInstanceMetadataAndAttachments()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5714
diff changeset
165 request_.SetRetrieveOneInstanceMetadataAndAttachments(retrieve);
5682
fd4c5e064cbe started refactoring of ServerContext::Apply()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5677
diff changeset
166 }
fd4c5e064cbe started refactoring of ServerContext::Apply()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5677
diff changeset
167
5700
1fab9ddaf702 webdav using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5696
diff changeset
168 void SetRetrieveMetadata(bool retrieve)
1fab9ddaf702 webdav using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5696
diff changeset
169 {
1fab9ddaf702 webdav using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5696
diff changeset
170 request_.SetRetrieveMetadata(retrieve);
1fab9ddaf702 webdav using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5696
diff changeset
171 }
1fab9ddaf702 webdav using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5696
diff changeset
172
1fab9ddaf702 webdav using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5696
diff changeset
173 void SetRetrieveAttachments(bool retrieve)
1fab9ddaf702 webdav using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5696
diff changeset
174 {
1fab9ddaf702 webdav using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5696
diff changeset
175 request_.SetRetrieveAttachments(retrieve);
1fab9ddaf702 webdav using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5696
diff changeset
176 }
1fab9ddaf702 webdav using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5696
diff changeset
177
5713
d851a54e49b7 removed "includeAllMetadata_" member from ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5709
diff changeset
178 // NB: "index" is only used in this method to fill the "IsStable" information
5708
1891a8c2dbb4 added ExpandResource utility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5700
diff changeset
179 void Expand(Json::Value& target,
1891a8c2dbb4 added ExpandResource utility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5700
diff changeset
180 const FindResponse::Resource& resource,
5709
476b1db52110 removed the "format_" member from ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5708
diff changeset
181 ServerIndex& index,
5829
963945d780d6 tools/find ResponseContent
Alain Mazy <am@orthanc.team>
parents: 5828
diff changeset
182 DicomToJsonFormat format) const;
5708
1891a8c2dbb4 added ExpandResource utility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5700
diff changeset
183
5688
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
184 void Execute(IVisitor& visitor,
5840
b24b61331566 pagination: fixed compat with ODBC that does not support ExtendedFind
Alain Mazy <am@orthanc.team>
parents: 5837
diff changeset
185 ServerContext& context);
5688
d0a264b803f1 first implementation of database paging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5686
diff changeset
186
5608
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 void Execute(Json::Value& target,
5709
476b1db52110 removed the "format_" member from ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5708
diff changeset
188 ServerContext& context,
5713
d851a54e49b7 removed "includeAllMetadata_" member from ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5709
diff changeset
189 DicomToJsonFormat format,
5840
b24b61331566 pagination: fixed compat with ODBC that does not support ExtendedFind
Alain Mazy <am@orthanc.team>
parents: 5837
diff changeset
190 bool includeAllMetadata);
5615
a10978a5e65c expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5609
diff changeset
191
a10978a5e65c expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5609
diff changeset
192 bool ExecuteOneResource(Json::Value& target,
5709
476b1db52110 removed the "format_" member from ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5708
diff changeset
193 ServerContext& context,
5713
d851a54e49b7 removed "includeAllMetadata_" member from ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5709
diff changeset
194 DicomToJsonFormat format,
5840
b24b61331566 pagination: fixed compat with ODBC that does not support ExtendedFind
Alain Mazy <am@orthanc.team>
parents: 5837
diff changeset
195 bool includeAllMetadata);
5837
82fc95cc168c /tools/count-resources
Alain Mazy <am@orthanc.team>
parents: 5829
diff changeset
196
82fc95cc168c /tools/count-resources
Alain Mazy <am@orthanc.team>
parents: 5829
diff changeset
197 uint64_t Count(ServerContext& context) const;
5608
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 };
3d0aa94b44b3 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 }