annotate Plugins/Engine/OrthancPluginDatabase.h @ 4064:7176ebf08765

Semaphore: allow acquiring/releasing multiple resources
author Alain Mazy
date Thu, 11 Jun 2020 16:42:27 +0200
parents 94f4a18a79cc
children
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
3640
94f4a18a79cc upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3189
diff changeset
5 * Copyright (C) 2017-2020 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
2463
be5c0f4155f6 move SharedLibrary into OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
38 #include "../../Core/SharedLibrary.h"
3093
2e1808b6146a reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3091
diff changeset
39 #include "../../OrthancServer/Database/Compatibility/ICreateInstance.h"
2e1808b6146a reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3091
diff changeset
40 #include "../../OrthancServer/Database/Compatibility/IGetChildrenMetadata.h"
2e1808b6146a reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3091
diff changeset
41 #include "../../OrthancServer/Database/Compatibility/ILookupResources.h"
3187
4bbadcd03966 refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3124
diff changeset
42 #include "../../OrthancServer/Database/Compatibility/ILookupResourceAndParent.h"
3093
2e1808b6146a reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3091
diff changeset
43 #include "../../OrthancServer/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_;
3076
8bc2cb1335f4 OrthancPluginDatabase::ApplyLookupResources() using fast lookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3075
diff changeset
84 std::list<std::string>* answerMatchingResources_;
8bc2cb1335f4 OrthancPluginDatabase::ApplyLookupResources() using fast lookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3075
diff changeset
85 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
86 AnswerMetadata* answerMetadata_;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 OrthancPluginDatabaseContext* GetContext()
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 {
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 return reinterpret_cast<OrthancPluginDatabaseContext*>(this);
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 }
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92
1672
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
93 void CheckSuccess(OrthancPluginErrorCode code);
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
94
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 void ResetAnswers();
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 void ForwardAnswers(std::list<int64_t>& target);
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 void ForwardAnswers(std::list<std::string>& target);
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 bool ForwardSingleAnswer(std::string& target);
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 bool ForwardSingleAnswer(int64_t& target);
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 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
106 OrthancPluginDatabase(SharedLibrary& library,
1651
2e692c83e2f3 improved custom error login
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1632
diff changeset
107 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
108 const OrthancPluginDatabaseBackend& backend,
1609
c74495267acf Implementation of the "GetAllPublicIdsWithLimit" extension
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1509
diff changeset
109 const OrthancPluginDatabaseExtensions* extensions,
c74495267acf Implementation of the "GetAllPublicIdsWithLimit" extension
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1509
diff changeset
110 size_t extensionsSize,
1314
01be1432bda9 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1309
diff changeset
111 void *payload);
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
113 virtual void Open()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
114 ORTHANC_OVERRIDE;
1672
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
115
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
116 virtual void Close()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
117 ORTHANC_OVERRIDE
1672
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
118 {
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
119 CheckSuccess(backend_.close(payload_));
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
120 }
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
121
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
122 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
123 {
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 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
125 }
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
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 virtual void AddAttachment(int64_t id,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
128 const FileInfo& attachment)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
129 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 virtual void AttachChild(int64_t parent,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
132 int64_t child)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
133 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
135 virtual void ClearChanges()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
136 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
138 virtual void ClearExportedResources()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
139 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 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
142 ResourceType type)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
143 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 virtual void DeleteAttachment(int64_t id,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
146 FileContentType attachment)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
147 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 virtual void DeleteMetadata(int64_t id,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
150 MetadataType type)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
151 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
153 virtual void DeleteResource(int64_t id)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
154 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
156 virtual void FlushToDisk()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
157 ORTHANC_OVERRIDE
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 {
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
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
161 virtual bool HasFlushToDisk() const
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
162 ORTHANC_OVERRIDE
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 {
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 return false;
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 }
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 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
168 int64_t id)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
169 ORTHANC_OVERRIDE;
1750
55d52567bebb LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
170
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 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
172 ResourceType resourceType)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
173 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174
1509
0586ed8897f1 limit and since arguments while retrieving DICOM resources in the REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1432
diff changeset
175 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
176 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
177 size_t since,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
178 size_t limit)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
179 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 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
182 bool& done /*out*/,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 int64_t since,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
184 uint32_t maxResults)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
185 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 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
188 int64_t id)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
189 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 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
192 int64_t id)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
193 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 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
196 bool& done /*out*/,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 int64_t since,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
198 uint32_t maxResults)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
199 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
201 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
202 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
204 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
205 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 virtual void GetMainDicomTags(DicomMap& map,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
208 int64_t id)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
209 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
211 virtual std::string GetPublicId(int64_t resourceId)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
212 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
214 virtual uint64_t GetResourceCount(ResourceType resourceType)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
215 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
217 virtual ResourceType GetResourceType(int64_t resourceId)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
218 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
220 virtual uint64_t GetTotalCompressedSize()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
221 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
223 virtual uint64_t GetTotalUncompressedSize()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
224 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
226 virtual bool IsExistingResource(int64_t internalId)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
227 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
229 virtual bool IsProtectedPatient(int64_t internalId)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
230 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 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
233 int64_t id)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
234 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 virtual void LogChange(int64_t internalId,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
237 const ServerIndexChange& change)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
238 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
240 virtual void LogExportedResource(const ExportedResource& resource)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
241 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 virtual bool LookupAttachment(FileInfo& attachment,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 int64_t id,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
245 FileContentType contentType)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
246 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 virtual bool LookupGlobalProperty(std::string& target,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
249 GlobalProperty property)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
250 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 virtual bool LookupMetadata(std::string& target,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 int64_t id,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
254 MetadataType type)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
255 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 virtual bool LookupParent(int64_t& parentId,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
258 int64_t resourceId)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
259 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 virtual bool LookupResource(int64_t& id,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 ResourceType& type,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
263 const std::string& publicId)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
264 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
266 virtual bool SelectPatientToRecycle(int64_t& internalId)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
267 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 virtual bool SelectPatientToRecycle(int64_t& internalId,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
270 int64_t patientIdToAvoid)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
271 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 virtual void SetGlobalProperty(GlobalProperty property,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
274 const std::string& value)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
275 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
277 virtual void ClearMainDicomTags(int64_t id)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
278 ORTHANC_OVERRIDE;
1668
de1413733c97 reconstructing main dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
279
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 virtual void SetMainDicomTag(int64_t id,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 const DicomTag& tag,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
282 const std::string& value)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
283 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284
1713
4db9200c7f46 SetIdentifierTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1711
diff changeset
285 virtual void SetIdentifierTag(int64_t id,
4db9200c7f46 SetIdentifierTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1711
diff changeset
286 const DicomTag& tag,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
287 const std::string& value)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
288 ORTHANC_OVERRIDE;
1713
4db9200c7f46 SetIdentifierTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1711
diff changeset
289
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 virtual void SetMetadata(int64_t id,
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 MetadataType type,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
292 const std::string& value)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
293 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 virtual void SetProtectedPatient(int64_t internalId,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
296 bool isProtected)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
297 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
299 virtual IDatabaseWrapper::ITransaction* StartTransaction()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
300 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
302 virtual void SetListener(IDatabaseListener& listener)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
303 ORTHANC_OVERRIDE
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 {
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305 listener_ = &listener;
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306 }
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
308 virtual unsigned int GetDatabaseVersion()
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
309 ORTHANC_OVERRIDE;
1615
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1609
diff changeset
310
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1609
diff changeset
311 virtual void Upgrade(unsigned int targetVersion,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
312 IStorageArea& storageArea)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
313 ORTHANC_OVERRIDE;
1615
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1609
diff changeset
314
3051
39db63e68dcf fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3050
diff changeset
315 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
316
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
317 virtual bool IsDiskSizeAbove(uint64_t threshold)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
318 ORTHANC_OVERRIDE;
3025
039a9d262d64 preparing to speed up find in databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3020
diff changeset
319
3075
ead8576a02ef IDatabaseWrapper::ApplyLookupResources now returns lists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
320 virtual void ApplyLookupResources(std::list<std::string>& resourcesId,
ead8576a02ef IDatabaseWrapper::ApplyLookupResources now returns lists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
321 std::list<std::string>* instancesId,
ead8576a02ef IDatabaseWrapper::ApplyLookupResources now returns lists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
322 const std::vector<DatabaseConstraint>& lookup,
ead8576a02ef IDatabaseWrapper::ApplyLookupResources now returns lists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
323 ResourceType queryLevel,
ead8576a02ef IDatabaseWrapper::ApplyLookupResources now returns lists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
324 size_t limit)
ead8576a02ef IDatabaseWrapper::ApplyLookupResources now returns lists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
325 ORTHANC_OVERRIDE;
ead8576a02ef IDatabaseWrapper::ApplyLookupResources now returns lists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
326
3080
1a75595d8e44 started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3076
diff changeset
327 virtual bool CreateInstance(CreateInstanceResult& result,
1a75595d8e44 started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3076
diff changeset
328 int64_t& instanceId,
1a75595d8e44 started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3076
diff changeset
329 const std::string& patient,
1a75595d8e44 started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3076
diff changeset
330 const std::string& study,
1a75595d8e44 started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3076
diff changeset
331 const std::string& series,
3082
847a0ed92654 new extension for database plugin SDK: createInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3080
diff changeset
332 const std::string& instance)
3080
1a75595d8e44 started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3076
diff changeset
333 ORTHANC_OVERRIDE;
1a75595d8e44 started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3076
diff changeset
334
3085
c829758b9ca0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3084
diff changeset
335 // From the "ILookupResources" interface
3057
87f52703ebbc reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3054
diff changeset
336 virtual void GetAllInternalIds(std::list<int64_t>& target,
87f52703ebbc reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3054
diff changeset
337 ResourceType resourceType)
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
338 ORTHANC_OVERRIDE;
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
339
3085
c829758b9ca0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3084
diff changeset
340 // From the "ILookupResources" interface
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1745
diff changeset
341 virtual void LookupIdentifier(std::list<int64_t>& result,
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1745
diff changeset
342 ResourceType level,
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1745
diff changeset
343 const DicomTag& tag,
3054
3638de45a08c backward compatibility with filtering identifiers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3053
diff changeset
344 Compatibility::IdentifierConstraintType type,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
345 const std::string& value)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
346 ORTHANC_OVERRIDE;
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
347
3085
c829758b9ca0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3084
diff changeset
348 // 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
349 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
350 ResourceType level,
e583478e0c6c New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2463
diff changeset
351 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
352 const std::string& start,
3050
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
353 const std::string& end)
d8a91acb7424 working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3038
diff changeset
354 ORTHANC_OVERRIDE;
3084
195ba4cbac3f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3082
diff changeset
355
195ba4cbac3f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3082
diff changeset
356 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
357 ORTHANC_OVERRIDE;
3091
476cba12c2b0 IDatabaseWrapper::GetChildrenMetadata()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3089
diff changeset
358
476cba12c2b0 IDatabaseWrapper::GetChildrenMetadata()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3089
diff changeset
359 virtual void GetChildrenMetadata(std::list<std::string>& target,
476cba12c2b0 IDatabaseWrapper::GetChildrenMetadata()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3089
diff changeset
360 int64_t resourceId,
476cba12c2b0 IDatabaseWrapper::GetChildrenMetadata()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3089
diff changeset
361 MetadataType metadata)
476cba12c2b0 IDatabaseWrapper::GetChildrenMetadata()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3089
diff changeset
362 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
363
2e1711f80f74 More consistent handling of the "Last" field returned by the "/changes" URI
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3093
diff changeset
364 virtual int64_t GetLastChangeIndex() ORTHANC_OVERRIDE;
3121
f86ebf971a72 fix unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3105
diff changeset
365
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
366 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
367
4bbadcd03966 refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3124
diff changeset
368 virtual bool LookupResourceAndParent(int64_t& id,
4bbadcd03966 refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3124
diff changeset
369 ResourceType& type,
4bbadcd03966 refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3124
diff changeset
370 std::string& parentPublicId,
4bbadcd03966 refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3124
diff changeset
371 const std::string& publicId)
4bbadcd03966 refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3124
diff changeset
372 ORTHANC_OVERRIDE;
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373 };
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374 }
1632
eb8fbcf008b5 fix build with plugins disabled
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
375
eb8fbcf008b5 fix build with plugins disabled
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
376 #endif