annotate OrthancServer/Plugins/Engine/OrthancPluginDatabase.h @ 4437:d9473bd5ed43

upgrade to year 2021
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 06 Jan 2021 17:27:28 +0100
parents 318c16cfccab
children 5b929e6b3c36
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1750
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
4437
d9473bd5ed43 upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4204
diff changeset
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * License, or (at your option) any later version.
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * In addition, as a special exception, the copyright holders of this
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * program give permission to link the code of its release with the
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * that use the same license as the "OpenSSL" library), and distribute
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * the linked executables. You must obey the GNU General Public License
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * in all respects for all of the code used other than "OpenSSL". If you
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * modify file(s) with this exception, you may extend this exception to
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * your version of the file(s), but you are not obligated to do so. If
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * you do not wish to do so, delete this exception statement from your
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * version. If you delete this exception statement from all source files
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * in the program, then also delete it here.
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 *
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * This program is distributed in the hope that it will be useful, but
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * General Public License for more details.
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 *
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * You should have received a copy of the GNU General Public License
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 **/
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #pragma once
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35
2136
dd609a99d39a uniformization of the macro naming
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
36 #if ORTHANC_ENABLE_PLUGINS == 1
1632
eb8fbcf008b5 fix build with plugins disabled
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
37
4045
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
38 #include "../../../OrthancFramework/Sources/SharedLibrary.h"
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
39 #include "../../Sources/Database/Compatibility/ICreateInstance.h"
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
40 #include "../../Sources/Database/Compatibility/IGetChildrenMetadata.h"
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
41 #include "../../Sources/Database/Compatibility/ILookupResources.h"
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
42 #include "../../Sources/Database/Compatibility/ILookupResourceAndParent.h"
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
43 #include "../../Sources/Database/Compatibility/ISetResourcesContent.h"
1425
97268448bdfc refactoring of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1314
diff changeset
44 #include "../Include/orthanc/OrthancCDatabasePlugin.h"
1651
2e692c83e2f3 improved custom error login
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1632
diff changeset
45 #include "PluginsErrorDictionary.h"
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 namespace Orthanc
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 {
3084
195ba4cbac3f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3082
diff changeset
49 class OrthancPluginDatabase :
195ba4cbac3f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3082
diff changeset
50 public IDatabaseWrapper,
3091
476cba12c2b0 IDatabaseWrapper::GetChildrenMetadata()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3089
diff changeset
51 public Compatibility::ICreateInstance,
476cba12c2b0 IDatabaseWrapper::GetChildrenMetadata()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3089
diff changeset
52 public Compatibility::IGetChildrenMetadata,
3085
c829758b9ca0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3084
diff changeset
53 public Compatibility::ILookupResources,
3187
4bbadcd03966 refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3124
diff changeset
54 public Compatibility::ILookupResourceAndParent,
3091
476cba12c2b0 IDatabaseWrapper::GetChildrenMetadata()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3089
diff changeset
55 public Compatibility::ISetResourcesContent
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 {
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 private:
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 class Transaction;
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
3189
6f89d22a6ec0 New extensions in the database SDK: LookupResourceAndParent and GetAllMetadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
60 typedef std::pair<int64_t, ResourceType> AnswerResource;
6f89d22a6ec0 New extensions in the database SDK: LookupResourceAndParent and GetAllMetadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
61 typedef std::map<MetadataType, std::string> AnswerMetadata;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
1630
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
63 SharedLibrary& library_;
1651
2e692c83e2f3 improved custom error login
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1632
diff changeset
64 PluginsErrorDictionary& errorDictionary_;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 _OrthancPluginDatabaseAnswerType type_;
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 OrthancPluginDatabaseBackend backend_;
1609
c74495267acf Implementation of the "GetAllPublicIdsWithLimit" extension
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1509
diff changeset
67 OrthancPluginDatabaseExtensions extensions_;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 void* payload_;
1432
0ac74fa21db8 rename IServerIndexListener as IDatabaseListener
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1425
diff changeset
69 IDatabaseListener* listener_;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
3019
8336204d95dc refactoring computation of disk size for recycling
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2697
diff changeset
71 bool fastGetTotalSize_;
8336204d95dc refactoring computation of disk size for recycling
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2697
diff changeset
72 uint64_t currentDiskSize_;
8336204d95dc refactoring computation of disk size for recycling
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2697
diff changeset
73
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 std::list<std::string> answerStrings_;
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 std::list<int32_t> answerInt32_;
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 std::list<int64_t> answerInt64_;
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 std::list<AnswerResource> answerResources_;
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 std::list<FileInfo> answerAttachments_;
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 DicomMap* answerDicomMap_;
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 std::list<ServerIndexChange>* answerChanges_;
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 std::list<ExportedResource>* answerExportedResources_;
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 bool* answerDone_;
4204
318c16cfccab cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
84 bool answerDoneIgnored_;
3076
8bc2cb1335f4 OrthancPluginDatabase::ApplyLookupResources() using fast lookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3075
diff changeset
85 std::list<std::string>* answerMatchingResources_;
8bc2cb1335f4 OrthancPluginDatabase::ApplyLookupResources() using fast lookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3075
diff changeset
86 std::list<std::string>* answerMatchingInstances_;
3189
6f89d22a6ec0 New extensions in the database SDK: LookupResourceAndParent and GetAllMetadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
87 AnswerMetadata* answerMetadata_;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 OrthancPluginDatabaseContext* GetContext()
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 {
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 return reinterpret_cast<OrthancPluginDatabaseContext*>(this);
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 }
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
1672
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
94 void CheckSuccess(OrthancPluginErrorCode code);
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
95
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 void ResetAnswers();
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 void ForwardAnswers(std::list<int64_t>& target);
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 void ForwardAnswers(std::list<std::string>& target);
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 bool ForwardSingleAnswer(std::string& target);
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 bool ForwardSingleAnswer(int64_t& target);
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 public:
1630
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
107 OrthancPluginDatabase(SharedLibrary& library,
1651
2e692c83e2f3 improved custom error login
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1632
diff changeset
108 PluginsErrorDictionary& errorDictionary,
1630
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
109 const OrthancPluginDatabaseBackend& backend,
1609
c74495267acf Implementation of the "GetAllPublicIdsWithLimit" extension
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1509
diff changeset
110 const OrthancPluginDatabaseExtensions* extensions,
c74495267acf Implementation of the "GetAllPublicIdsWithLimit" extension
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1509
diff changeset
111 size_t extensionsSize,
1314
01be1432bda9 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1309
diff changeset
112 void *payload);
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
114 virtual void Open()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
115 ORTHANC_OVERRIDE;
1672
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
116
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
117 virtual void Close()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
118 ORTHANC_OVERRIDE
1672
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
119 {
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
120 CheckSuccess(backend_.close(payload_));
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
121 }
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
122
1630
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
123 const SharedLibrary& GetSharedLibrary() const
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
124 {
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
125 return library_;
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
126 }
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
127
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 virtual void AddAttachment(int64_t id,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
129 const FileInfo& attachment)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
130 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 virtual void AttachChild(int64_t parent,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
133 int64_t child)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
134 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
136 virtual void ClearChanges()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
137 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
139 virtual void ClearExportedResources()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
140 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 virtual int64_t CreateResource(const std::string& publicId,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
143 ResourceType type)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
144 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 virtual void DeleteAttachment(int64_t id,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
147 FileContentType attachment)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
148 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 virtual void DeleteMetadata(int64_t id,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
151 MetadataType type)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
152 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
154 virtual void DeleteResource(int64_t id)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
155 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
157 virtual void FlushToDisk()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
158 ORTHANC_OVERRIDE
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 {
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 }
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
162 virtual bool HasFlushToDisk() const
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
163 ORTHANC_OVERRIDE
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 {
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 return false;
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 }
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 virtual void GetAllMetadata(std::map<MetadataType, std::string>& target,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
169 int64_t id)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
170 ORTHANC_OVERRIDE;
1750
55d52567bebb LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
171
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 virtual void GetAllPublicIds(std::list<std::string>& target,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
173 ResourceType resourceType)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
174 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175
1509
0586ed8897f1 limit and since arguments while retrieving DICOM resources in the REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1432
diff changeset
176 virtual void GetAllPublicIds(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: 1432
diff changeset
177 ResourceType resourceType,
0586ed8897f1 limit and since arguments while retrieving DICOM resources in the REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1432
diff changeset
178 size_t since,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
179 size_t limit)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
180 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 virtual void GetChanges(std::list<ServerIndexChange>& target /*out*/,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 bool& done /*out*/,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 int64_t since,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
185 uint32_t maxResults)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
186 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 virtual void GetChildrenInternalId(std::list<int64_t>& target,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
189 int64_t id)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
190 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 virtual void GetChildrenPublicId(std::list<std::string>& target,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
193 int64_t id)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
194 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 virtual void GetExportedResources(std::list<ExportedResource>& target /*out*/,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 bool& done /*out*/,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 int64_t since,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
199 uint32_t maxResults)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
200 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
202 virtual void GetLastChange(std::list<ServerIndexChange>& target /*out*/)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
203 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
205 virtual void GetLastExportedResource(std::list<ExportedResource>& target /*out*/)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
206 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 virtual void GetMainDicomTags(DicomMap& map,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
209 int64_t id)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
210 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
212 virtual std::string GetPublicId(int64_t resourceId)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
213 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
215 virtual uint64_t GetResourceCount(ResourceType resourceType)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
216 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
218 virtual ResourceType GetResourceType(int64_t resourceId)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
219 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
221 virtual uint64_t GetTotalCompressedSize()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
222 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
224 virtual uint64_t GetTotalUncompressedSize()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
225 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
227 virtual bool IsExistingResource(int64_t internalId)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
228 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
230 virtual bool IsProtectedPatient(int64_t internalId)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
231 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 virtual void ListAvailableAttachments(std::list<FileContentType>& target,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
234 int64_t id)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
235 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 virtual void LogChange(int64_t internalId,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
238 const ServerIndexChange& change)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
239 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
241 virtual void LogExportedResource(const ExportedResource& resource)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
242 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 virtual bool LookupAttachment(FileInfo& attachment,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245 int64_t id,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
246 FileContentType contentType)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
247 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 virtual bool LookupGlobalProperty(std::string& target,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
250 GlobalProperty property)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
251 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 virtual bool LookupMetadata(std::string& target,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 int64_t id,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
255 MetadataType type)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
256 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 virtual bool LookupParent(int64_t& parentId,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
259 int64_t resourceId)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
260 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 virtual bool LookupResource(int64_t& id,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 ResourceType& type,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
264 const std::string& publicId)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
265 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
267 virtual bool SelectPatientToRecycle(int64_t& internalId)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
268 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 virtual bool SelectPatientToRecycle(int64_t& internalId,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
271 int64_t patientIdToAvoid)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
272 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 virtual void SetGlobalProperty(GlobalProperty property,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
275 const std::string& value)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
276 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
278 virtual void ClearMainDicomTags(int64_t id)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
279 ORTHANC_OVERRIDE;
1668
de1413733c97 reconstructing main dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
280
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 virtual void SetMainDicomTag(int64_t id,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 const DicomTag& tag,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
283 const std::string& value)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
284 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285
1713
4db9200c7f46 SetIdentifierTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1711
diff changeset
286 virtual void SetIdentifierTag(int64_t id,
4db9200c7f46 SetIdentifierTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1711
diff changeset
287 const DicomTag& tag,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
288 const std::string& value)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
289 ORTHANC_OVERRIDE;
1713
4db9200c7f46 SetIdentifierTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1711
diff changeset
290
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 virtual void SetMetadata(int64_t id,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 MetadataType type,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
293 const std::string& value)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
294 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 virtual void SetProtectedPatient(int64_t internalId,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
297 bool isProtected)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
298 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
300 virtual IDatabaseWrapper::ITransaction* StartTransaction()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
301 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
303 virtual void SetListener(IDatabaseListener& listener)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
304 ORTHANC_OVERRIDE
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305 {
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306 listener_ = &listener;
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307 }
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
309 virtual unsigned int GetDatabaseVersion()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
310 ORTHANC_OVERRIDE;
1615
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1609
diff changeset
311
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1609
diff changeset
312 virtual void Upgrade(unsigned int targetVersion,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
313 IStorageArea& storageArea)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
314 ORTHANC_OVERRIDE;
1615
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1609
diff changeset
315
3051
39db63e68dcf fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3050
diff changeset
316 void AnswerReceived(const _OrthancPluginDatabaseAnswer& answer);
3020
d207f6ac1f86 tracking disk size by the database engine to ensure consistency across transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3019
diff changeset
317
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
318 virtual bool IsDiskSizeAbove(uint64_t threshold)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
319 ORTHANC_OVERRIDE;
3025
039a9d262d64 preparing to speed up find in databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3020
diff changeset
320
3075
ead8576a02ef IDatabaseWrapper::ApplyLookupResources now returns lists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
321 virtual void ApplyLookupResources(std::list<std::string>& resourcesId,
ead8576a02ef IDatabaseWrapper::ApplyLookupResources now returns lists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
322 std::list<std::string>* instancesId,
ead8576a02ef IDatabaseWrapper::ApplyLookupResources now returns lists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
323 const std::vector<DatabaseConstraint>& lookup,
ead8576a02ef IDatabaseWrapper::ApplyLookupResources now returns lists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
324 ResourceType queryLevel,
ead8576a02ef IDatabaseWrapper::ApplyLookupResources now returns lists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
325 size_t limit)
ead8576a02ef IDatabaseWrapper::ApplyLookupResources now returns lists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
326 ORTHANC_OVERRIDE;
ead8576a02ef IDatabaseWrapper::ApplyLookupResources now returns lists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
327
3080
1a75595d8e44 started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3076
diff changeset
328 virtual bool CreateInstance(CreateInstanceResult& result,
1a75595d8e44 started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3076
diff changeset
329 int64_t& instanceId,
1a75595d8e44 started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3076
diff changeset
330 const std::string& patient,
1a75595d8e44 started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3076
diff changeset
331 const std::string& study,
1a75595d8e44 started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3076
diff changeset
332 const std::string& series,
3082
847a0ed92654 new extension for database plugin SDK: createInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3080
diff changeset
333 const std::string& instance)
3080
1a75595d8e44 started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3076
diff changeset
334 ORTHANC_OVERRIDE;
1a75595d8e44 started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3076
diff changeset
335
3085
c829758b9ca0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3084
diff changeset
336 // From the "ILookupResources" interface
3057
87f52703ebbc reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3054
diff changeset
337 virtual void GetAllInternalIds(std::list<int64_t>& target,
87f52703ebbc reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3054
diff changeset
338 ResourceType resourceType)
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
339 ORTHANC_OVERRIDE;
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
340
3085
c829758b9ca0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3084
diff changeset
341 // From the "ILookupResources" interface
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1745
diff changeset
342 virtual void LookupIdentifier(std::list<int64_t>& result,
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1745
diff changeset
343 ResourceType level,
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1745
diff changeset
344 const DicomTag& tag,
3054
3638de45a08c backward compatibility with filtering identifiers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3053
diff changeset
345 Compatibility::IdentifierConstraintType type,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
346 const std::string& value)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
347 ORTHANC_OVERRIDE;
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
348
3085
c829758b9ca0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3084
diff changeset
349 // From the "ILookupResources" interface
2697
e583478e0c6c New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2463
diff changeset
350 virtual void LookupIdentifierRange(std::list<int64_t>& result,
e583478e0c6c New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2463
diff changeset
351 ResourceType level,
e583478e0c6c New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2463
diff changeset
352 const DicomTag& tag,
e583478e0c6c New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2463
diff changeset
353 const std::string& start,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
354 const std::string& end)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
355 ORTHANC_OVERRIDE;
3084
195ba4cbac3f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3082
diff changeset
356
195ba4cbac3f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3082
diff changeset
357 virtual void SetResourcesContent(const Orthanc::ResourcesContent& content)
3089
fb8ee0786b1e new extension for database plugin SDK: setResourcesContent
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3085
diff changeset
358 ORTHANC_OVERRIDE;
3091
476cba12c2b0 IDatabaseWrapper::GetChildrenMetadata()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3089
diff changeset
359
476cba12c2b0 IDatabaseWrapper::GetChildrenMetadata()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3089
diff changeset
360 virtual void GetChildrenMetadata(std::list<std::string>& target,
476cba12c2b0 IDatabaseWrapper::GetChildrenMetadata()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3089
diff changeset
361 int64_t resourceId,
476cba12c2b0 IDatabaseWrapper::GetChildrenMetadata()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3089
diff changeset
362 MetadataType metadata)
476cba12c2b0 IDatabaseWrapper::GetChildrenMetadata()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3089
diff changeset
363 ORTHANC_OVERRIDE;
3105
2e1711f80f74 More consistent handling of the "Last" field returned by the "/changes" URI
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3093
diff changeset
364
2e1711f80f74 More consistent handling of the "Last" field returned by the "/changes" URI
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3093
diff changeset
365 virtual int64_t GetLastChangeIndex() ORTHANC_OVERRIDE;
3121
f86ebf971a72 fix unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3105
diff changeset
366
3124
c0d7aee8c3f8 Fix issue #58 (Patient recycling order should be defined by their received last instance)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3121
diff changeset
367 virtual void TagMostRecentPatient(int64_t patient) ORTHANC_OVERRIDE;
3187
4bbadcd03966 refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3124
diff changeset
368
4bbadcd03966 refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3124
diff changeset
369 virtual bool LookupResourceAndParent(int64_t& id,
4bbadcd03966 refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3124
diff changeset
370 ResourceType& type,
4bbadcd03966 refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3124
diff changeset
371 std::string& parentPublicId,
4bbadcd03966 refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3124
diff changeset
372 const std::string& publicId)
4bbadcd03966 refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3124
diff changeset
373 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374 };
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375 }
1632
eb8fbcf008b5 fix build with plugins disabled
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
376
eb8fbcf008b5 fix build with plugins disabled
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
377 #endif