Mercurial > hg > orthanc
annotate OrthancServer/ServerIndex.h @ 3143:30b1bec25aac Orthanc-1.4.2
closing branch Orthanc-1.4.2
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 17 Jan 2019 18:34:08 +0100 |
parents | 8aa6aef11b70 |
children | a27b0e9a3fd9 |
rev | line source |
---|---|
0 | 1 /** |
62 | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1286
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
2447
878b59270859
upgrade to year 2018
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
5 * Copyright (C) 2017-2018 Osimis S.A., Belgium |
0 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU General Public License as | |
9 * published by the Free Software Foundation, either version 3 of the | |
10 * License, or (at your option) any later version. | |
136 | 11 * |
12 * In addition, as a special exception, the copyright holders of this | |
13 * program give permission to link the code of its release with the | |
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
15 * that use the same license as the "OpenSSL" library), and distribute | |
16 * the linked executables. You must obey the GNU General Public License | |
17 * in all respects for all of the code used other than "OpenSSL". If you | |
18 * modify file(s) with this exception, you may extend this exception to | |
19 * your version of the file(s), but you are not obligated to do so. If | |
20 * you do not wish to do so, delete this exception statement from your | |
21 * version. If you delete this exception statement from all source files | |
22 * in the program, then also delete it here. | |
0 | 23 * |
24 * This program is distributed in the hope that it will be useful, but | |
25 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
27 * General Public License for more details. | |
28 * | |
29 * You should have received a copy of the GNU General Public License | |
30 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
31 **/ | |
32 | |
33 | |
34 #pragma once | |
35 | |
36 #include <boost/thread.hpp> | |
220 | 37 #include <boost/noncopyable.hpp> |
511
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
440
diff
changeset
|
38 #include "../Core/Cache/LeastRecentlyUsedIndex.h" |
0 | 39 #include "../Core/SQLite/Connection.h" |
40 #include "../Core/DicomFormat/DicomMap.h" | |
179 | 41 #include "../Core/DicomFormat/DicomInstanceHasher.h" |
183 | 42 #include "ServerEnumerations.h" |
0 | 43 |
1247 | 44 #include "IDatabaseWrapper.h" |
186
f68c039b0571
preparing refactoring of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
183
diff
changeset
|
45 |
62 | 46 namespace Orthanc |
0 | 47 { |
1750
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1728
diff
changeset
|
48 class LookupResource; |
226
8a26a8e85edf
refactoring to read files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
49 class ServerContext; |
1822 | 50 class DicomInstanceToStore; |
2209
e3fd5bc429a2
URI to reconstruct the main DICOM tags, the JSON summary and the metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2188
diff
changeset
|
51 class ParsedDicomFile; |
226
8a26a8e85edf
refactoring to read files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
52 |
220 | 53 class ServerIndex : public boost::noncopyable |
0 | 54 { |
1002
b067017a8a5b
anonymization refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
739
diff
changeset
|
55 public: |
b067017a8a5b
anonymization refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
739
diff
changeset
|
56 typedef std::list<FileInfo> Attachments; |
b067017a8a5b
anonymization refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
739
diff
changeset
|
57 typedef std::map< std::pair<ResourceType, MetadataType>, std::string> MetadataMap; |
b067017a8a5b
anonymization refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
739
diff
changeset
|
58 |
0 | 59 private: |
1432
0ac74fa21db8
rename IServerIndexListener as IDatabaseListener
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1364
diff
changeset
|
60 class Listener; |
278
771f12042be9
more efficient determination of storage size for recycling
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
272
diff
changeset
|
61 class Transaction; |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1162
diff
changeset
|
62 class UnstableResourcePayload; |
278
771f12042be9
more efficient determination of storage size for recycling
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
272
diff
changeset
|
63 |
511
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
440
diff
changeset
|
64 bool done_; |
0 | 65 boost::mutex mutex_; |
206
4453a010d0db
flush to disk thread
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
66 boost::thread flushThread_; |
511
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
440
diff
changeset
|
67 boost::thread unstableResourcesMonitorThread_; |
0 | 68 |
1432
0ac74fa21db8
rename IServerIndexListener as IDatabaseListener
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1364
diff
changeset
|
69 std::auto_ptr<Listener> listener_; |
1247 | 70 IDatabaseWrapper& db_; |
511
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
440
diff
changeset
|
71 LeastRecentlyUsedIndex<int64_t, UnstableResourcePayload> unstableResources_; |
180
626777d01dc4
use of hashes to index dicom objects
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
179
diff
changeset
|
72 |
2825
8aa6aef11b70
New configuration option "OverwriteInstances" to choose how duplicate SOPInstanceUID are handled
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2668
diff
changeset
|
73 uint64_t currentStorageSize_; |
8aa6aef11b70
New configuration option "OverwriteInstances" to choose how duplicate SOPInstanceUID are handled
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2668
diff
changeset
|
74 uint64_t maximumStorageSize_; |
269
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
75 unsigned int maximumPatients_; |
2825
8aa6aef11b70
New configuration option "OverwriteInstances" to choose how duplicate SOPInstanceUID are handled
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2668
diff
changeset
|
76 bool overwrite_; |
269
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
77 |
2665
389d050a2e66
fix deadlock, speed up unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
78 static void FlushThread(ServerIndex* that, |
389d050a2e66
fix deadlock, speed up unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
79 unsigned int threadSleep); |
511
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
440
diff
changeset
|
80 |
2665
389d050a2e66
fix deadlock, speed up unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
81 static void UnstableResourcesMonitorThread(ServerIndex* that, |
389d050a2e66
fix deadlock, speed up unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
82 unsigned int threadSleep); |
511
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
440
diff
changeset
|
83 |
202 | 84 void MainDicomTagsToJson(Json::Value& result, |
1668
de1413733c97
reconstructing main dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
85 int64_t resourceId, |
de1413733c97
reconstructing main dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
86 ResourceType resourceType); |
198
663cc6c46d0a
before refactoring of ServerIndex::GetXXX
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
87 |
585 | 88 SeriesStatus GetSeriesStatus(int64_t id); |
199 | 89 |
268
4bc02e2254ec
preparing ServerIndex for recycling
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
238
diff
changeset
|
90 bool IsRecyclingNeeded(uint64_t instanceSize); |
4bc02e2254ec
preparing ServerIndex for recycling
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
238
diff
changeset
|
91 |
4bc02e2254ec
preparing ServerIndex for recycling
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
238
diff
changeset
|
92 void Recycle(uint64_t instanceSize, |
4bc02e2254ec
preparing ServerIndex for recycling
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
238
diff
changeset
|
93 const std::string& newPatientId); |
4bc02e2254ec
preparing ServerIndex for recycling
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
238
diff
changeset
|
94 |
269
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
95 void StandaloneRecycling(); |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
96 |
511
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
440
diff
changeset
|
97 void MarkAsUnstable(int64_t id, |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1162
diff
changeset
|
98 Orthanc::ResourceType type, |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1162
diff
changeset
|
99 const std::string& publicId); |
511
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
440
diff
changeset
|
100 |
646 | 101 void GetStatisticsInternal(/* out */ uint64_t& compressedSize, |
102 /* out */ uint64_t& uncompressedSize, | |
103 /* out */ unsigned int& countStudies, | |
104 /* out */ unsigned int& countSeries, | |
105 /* out */ unsigned int& countInstances, | |
106 /* in */ int64_t id, | |
107 /* in */ ResourceType type); | |
108 | |
1238 | 109 bool GetMetadataAsInteger(int64_t& result, |
1237 | 110 int64_t id, |
111 MetadataType type); | |
112 | |
113 void LogChange(int64_t internalId, | |
114 ChangeType changeType, | |
115 ResourceType resourceType, | |
1297 | 116 const std::string& publicId); |
1237 | 117 |
118 uint64_t IncrementGlobalSequenceInternal(GlobalProperty property); | |
119 | |
1299 | 120 int64_t CreateResource(const std::string& publicId, |
121 ResourceType type); | |
122 | |
2188 | 123 void SetInstanceMetadata(std::map<MetadataType, std::string>& instanceMetadata, |
124 int64_t instance, | |
125 MetadataType metadata, | |
126 const std::string& value); | |
127 | |
0 | 128 public: |
226
8a26a8e85edf
refactoring to read files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
129 ServerIndex(ServerContext& context, |
2665
389d050a2e66
fix deadlock, speed up unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
130 IDatabaseWrapper& database, |
389d050a2e66
fix deadlock, speed up unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
131 unsigned int threadSleep); |
0 | 132 |
206
4453a010d0db
flush to disk thread
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
133 ~ServerIndex(); |
4453a010d0db
flush to disk thread
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
134 |
1453
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1432
diff
changeset
|
135 void Stop(); |
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1432
diff
changeset
|
136 |
269
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
137 uint64_t GetMaximumStorageSize() const |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
138 { |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
139 return maximumStorageSize_; |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
140 } |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
141 |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
142 uint64_t GetMaximumPatientCount() const |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
143 { |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
144 return maximumPatients_; |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
145 } |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
146 |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
147 // "size == 0" means no limit on the storage size |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
148 void SetMaximumStorageSize(uint64_t size); |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
149 |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
150 // "count == 0" means no limit on the number of patients |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
151 void SetMaximumPatientCount(unsigned int count); |
f6fdf5abe751
recycling up and running
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
268
diff
changeset
|
152 |
2825
8aa6aef11b70
New configuration option "OverwriteInstances" to choose how duplicate SOPInstanceUID are handled
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2668
diff
changeset
|
153 void SetOverwriteInstances(bool overwrite); |
8aa6aef11b70
New configuration option "OverwriteInstances" to choose how duplicate SOPInstanceUID are handled
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2668
diff
changeset
|
154 |
1006
649d47854314
proper handling of metadata in Store
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1004
diff
changeset
|
155 StoreStatus Store(std::map<MetadataType, std::string>& instanceMetadata, |
1822 | 156 DicomInstanceToStore& instance, |
157 const Attachments& attachments); | |
0 | 158 |
238 | 159 void ComputeStatistics(Json::Value& target); |
0 | 160 |
212 | 161 bool LookupResource(Json::Value& result, |
162 const std::string& publicId, | |
163 ResourceType expectedType); | |
0 | 164 |
232
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
165 bool LookupAttachment(FileInfo& attachment, |
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
166 const std::string& instanceUuid, |
233 | 167 FileContentType contentType); |
0 | 168 |
1354 | 169 void GetAllUuids(std::list<std::string>& target, |
190 | 170 ResourceType resourceType); |
0 | 171 |
1509
0586ed8897f1
limit and since arguments while retrieving DICOM resources in the REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1453
diff
changeset
|
172 void GetAllUuids(std::list<std::string>& target, |
0586ed8897f1
limit and since arguments while retrieving DICOM resources in the REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1453
diff
changeset
|
173 ResourceType resourceType, |
0586ed8897f1
limit and since arguments while retrieving DICOM resources in the REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1453
diff
changeset
|
174 size_t since, |
0586ed8897f1
limit and since arguments while retrieving DICOM resources in the REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1453
diff
changeset
|
175 size_t limit); |
0586ed8897f1
limit and since arguments while retrieving DICOM resources in the REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1453
diff
changeset
|
176 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1139
diff
changeset
|
177 bool DeleteResource(Json::Value& target /* out */, |
212 | 178 const std::string& uuid, |
179 ResourceType expectedType); | |
0 | 180 |
1247 | 181 void GetChanges(Json::Value& target, |
0 | 182 int64_t since, |
183 unsigned int maxResults); | |
231 | 184 |
1247 | 185 void GetLastChange(Json::Value& target); |
237
16a4ac70bd8a
last change and export
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
233
diff
changeset
|
186 |
231 | 187 void LogExportedResource(const std::string& publicId, |
188 const std::string& remoteModality); | |
189 | |
1247 | 190 void GetExportedResources(Json::Value& target, |
231 | 191 int64_t since, |
192 unsigned int maxResults); | |
237
16a4ac70bd8a
last change and export
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
233
diff
changeset
|
193 |
1247 | 194 void GetLastExportedResource(Json::Value& target); |
237
16a4ac70bd8a
last change and export
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
233
diff
changeset
|
195 |
272
337c506461d2
protection from rest api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
269
diff
changeset
|
196 bool IsProtectedPatient(const std::string& publicId); |
337c506461d2
protection from rest api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
269
diff
changeset
|
197 |
337c506461d2
protection from rest api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
269
diff
changeset
|
198 void SetProtectedPatient(const std::string& publicId, |
337c506461d2
protection from rest api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
269
diff
changeset
|
199 bool isProtected); |
304 | 200 |
714
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
702
diff
changeset
|
201 void GetChildren(std::list<std::string>& result, |
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
702
diff
changeset
|
202 const std::string& publicId); |
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
702
diff
changeset
|
203 |
304 | 204 void GetChildInstances(std::list<std::string>& result, |
205 const std::string& publicId); | |
206 | |
306
326d5a4a5af3
modification of instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
304
diff
changeset
|
207 void SetMetadata(const std::string& publicId, |
326d5a4a5af3
modification of instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
304
diff
changeset
|
208 MetadataType type, |
326d5a4a5af3
modification of instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
304
diff
changeset
|
209 const std::string& value); |
326d5a4a5af3
modification of instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
304
diff
changeset
|
210 |
438 | 211 void DeleteMetadata(const std::string& publicId, |
212 MetadataType type); | |
213 | |
306
326d5a4a5af3
modification of instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
304
diff
changeset
|
214 bool LookupMetadata(std::string& target, |
326d5a4a5af3
modification of instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
304
diff
changeset
|
215 const std::string& publicId, |
326d5a4a5af3
modification of instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
304
diff
changeset
|
216 MetadataType type); |
326d5a4a5af3
modification of instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
304
diff
changeset
|
217 |
739 | 218 void ListAvailableMetadata(std::list<MetadataType>& target, |
436
d51186bf7602
read access to metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
413
diff
changeset
|
219 const std::string& publicId); |
d51186bf7602
read access to metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
413
diff
changeset
|
220 |
1002
b067017a8a5b
anonymization refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
739
diff
changeset
|
221 bool GetMetadata(Json::Value& target, |
b067017a8a5b
anonymization refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
739
diff
changeset
|
222 const std::string& publicId); |
b067017a8a5b
anonymization refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
739
diff
changeset
|
223 |
697
dd1ce9a2844c
access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
224 void ListAvailableAttachments(std::list<FileContentType>& target, |
dd1ce9a2844c
access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
225 const std::string& publicId, |
dd1ce9a2844c
access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
226 ResourceType expectedType); |
dd1ce9a2844c
access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
227 |
306
326d5a4a5af3
modification of instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
304
diff
changeset
|
228 bool LookupParent(std::string& target, |
326d5a4a5af3
modification of instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
304
diff
changeset
|
229 const std::string& publicId); |
310 | 230 |
231 uint64_t IncrementGlobalSequence(GlobalProperty sequence); | |
315 | 232 |
233 void LogChange(ChangeType changeType, | |
234 const std::string& publicId); | |
413
47d63c941902
clearing /exports and /changes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
235 |
47d63c941902
clearing /exports and /changes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
236 void DeleteChanges(); |
47d63c941902
clearing /exports and /changes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
237 |
47d63c941902
clearing /exports and /changes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
238 void DeleteExportedResources(); |
440
23e5b35e3c5c
statistics for patient/studies/series/instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
438
diff
changeset
|
239 |
23e5b35e3c5c
statistics for patient/studies/series/instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
438
diff
changeset
|
240 void GetStatistics(Json::Value& target, |
23e5b35e3c5c
statistics for patient/studies/series/instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
438
diff
changeset
|
241 const std::string& publicId); |
521 | 242 |
646 | 243 void GetStatistics(/* out */ uint64_t& compressedSize, |
244 /* out */ uint64_t& uncompressedSize, | |
245 /* out */ unsigned int& countStudies, | |
246 /* out */ unsigned int& countSeries, | |
247 /* out */ unsigned int& countInstances, | |
248 const std::string& publicId); | |
249 | |
1728
4941494b5dd8
rename LookupIdentifier as LookupIdentifierExact
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1727
diff
changeset
|
250 void LookupIdentifierExact(std::list<std::string>& result, |
4941494b5dd8
rename LookupIdentifier as LookupIdentifierExact
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1727
diff
changeset
|
251 ResourceType level, |
4941494b5dd8
rename LookupIdentifier as LookupIdentifierExact
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1727
diff
changeset
|
252 const DicomTag& tag, |
4941494b5dd8
rename LookupIdentifier as LookupIdentifierExact
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1727
diff
changeset
|
253 const std::string& value); |
615 | 254 |
699
2929e17f8447
add attachments to resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
255 StoreStatus AddAttachment(const FileInfo& attachment, |
2929e17f8447
add attachments to resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
256 const std::string& publicId); |
2929e17f8447
add attachments to resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
257 |
702
7592a48e97e4
delete custom attachment
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
699
diff
changeset
|
258 void DeleteAttachment(const std::string& publicId, |
7592a48e97e4
delete custom attachment
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
699
diff
changeset
|
259 FileContentType type); |
1218
efece308018e
report database version in /system
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1177
diff
changeset
|
260 |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1247
diff
changeset
|
261 void SetGlobalProperty(GlobalProperty property, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1247
diff
changeset
|
262 const std::string& value); |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1247
diff
changeset
|
263 |
2668
d26dd081df97
saving jobs engine on exit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2665
diff
changeset
|
264 bool LookupGlobalProperty(std::string& value, |
d26dd081df97
saving jobs engine on exit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2665
diff
changeset
|
265 GlobalProperty property); |
d26dd081df97
saving jobs engine on exit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2665
diff
changeset
|
266 |
1218
efece308018e
report database version in /system
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1177
diff
changeset
|
267 std::string GetGlobalProperty(GlobalProperty property, |
efece308018e
report database version in /system
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1177
diff
changeset
|
268 const std::string& defaultValue); |
1352 | 269 |
270 bool GetMainDicomTags(DicomMap& result, | |
271 const std::string& publicId, | |
1677
a903d57d9f0c
adaptation of search with patient tags at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1668
diff
changeset
|
272 ResourceType expectedType, |
a903d57d9f0c
adaptation of search with patient tags at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1668
diff
changeset
|
273 ResourceType levelOfInterest); |
1555
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1509
diff
changeset
|
274 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1509
diff
changeset
|
275 bool LookupResourceType(ResourceType& type, |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1509
diff
changeset
|
276 const std::string& publicId); |
1668
de1413733c97
reconstructing main dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
277 |
de1413733c97
reconstructing main dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
278 unsigned int GetDatabaseVersion(); |
1750
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1728
diff
changeset
|
279 |
1753 | 280 void FindCandidates(std::vector<std::string>& resources, |
281 std::vector<std::string>& instances, | |
1757
98abb8d7f905
ServerContext::Apply lookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1753
diff
changeset
|
282 const ::Orthanc::LookupResource& lookup); |
1898
e018037d4d0e
Support of optional tags for counting resources in C-Find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1822
diff
changeset
|
283 |
e018037d4d0e
Support of optional tags for counting resources in C-Find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1822
diff
changeset
|
284 bool LookupParent(std::string& target, |
e018037d4d0e
Support of optional tags for counting resources in C-Find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1822
diff
changeset
|
285 const std::string& publicId, |
e018037d4d0e
Support of optional tags for counting resources in C-Find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1822
diff
changeset
|
286 ResourceType parentType); |
2209
e3fd5bc429a2
URI to reconstruct the main DICOM tags, the JSON summary and the metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2188
diff
changeset
|
287 |
e3fd5bc429a2
URI to reconstruct the main DICOM tags, the JSON summary and the metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2188
diff
changeset
|
288 void ReconstructInstance(ParsedDicomFile& dicom); |
0 | 289 }; |
290 } |