annotate OrthancServer/Sources/Database/BaseDatabaseWrapper.cpp @ 5606:6e2dad336446 find-refactoring

added "IsStable" field in expanded resources
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 08 May 2024 10:46:11 +0200
parents 862b54b4cfe2
children 4640b7ae9a11
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5516
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * Copyright (C) 2017-2024 Osimis S.A., Belgium
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * modify it under the terms of the GNU General Public License as
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * published by the Free Software Foundation, either version 3 of the
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * License, or (at your option) any later version.
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * General Public License for more details.
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 *
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #include "BaseDatabaseWrapper.h"
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include "../../../OrthancFramework/Sources/OrthancException.h"
5593
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
26 #include "Compatibility/GenericFind.h"
5516
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 namespace Orthanc
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 {
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 int64_t BaseDatabaseWrapper::BaseTransaction::IncrementGlobalProperty(GlobalProperty property,
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 int64_t increment,
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 bool shared)
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 throw OrthancException(ErrorCode_NotImplemented); // Not supported
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 }
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 void BaseDatabaseWrapper::BaseTransaction::UpdateAndGetStatistics(int64_t& patientsCount,
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 int64_t& studiesCount,
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 int64_t& seriesCount,
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 int64_t& instancesCount,
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 int64_t& compressedSize,
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 int64_t& uncompressedSize)
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 {
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 throw OrthancException(ErrorCode_NotImplemented); // Not supported
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 }
5518
bbe45a71f5cd reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5516
diff changeset
47
bbe45a71f5cd reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5516
diff changeset
48
5593
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
49 void BaseDatabaseWrapper::BaseTransaction::ExecuteFind(FindResponse& response,
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
50 const FindRequest& request,
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
51 const std::vector<DatabaseConstraint>& normalized)
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
52 {
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
53 throw OrthancException(ErrorCode_NotImplemented); // Not supported
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
54 }
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
55
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
56
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
57 void BaseDatabaseWrapper::BaseTransaction::ExecuteFind(std::list<std::string>& identifiers,
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
58 const FindRequest& request,
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
59 const std::vector<DatabaseConstraint>& normalized)
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
60 {
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
61 Compatibility::GenericFind find(*this);
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
62 find.ExecuteFind(identifiers, request, normalized);
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
63 }
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
64
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
65
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
66 void BaseDatabaseWrapper::BaseTransaction::ExecuteExpand(FindResponse& response,
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
67 const FindRequest& request,
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
68 const std::string& identifier)
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
69 {
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
70 Compatibility::GenericFind find(*this);
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
71 find.ExecuteExpand(response, request, identifier);
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
72 }
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
73
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
74
5518
bbe45a71f5cd reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5516
diff changeset
75 uint64_t BaseDatabaseWrapper::MeasureLatency()
bbe45a71f5cd reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5516
diff changeset
76 {
bbe45a71f5cd reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5516
diff changeset
77 throw OrthancException(ErrorCode_NotImplemented); // only implemented in V4
bbe45a71f5cd reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5516
diff changeset
78 }
5516
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 }