Mercurial > hg > orthanc
annotate Resources/Graveyard/DatabasePluginSample/DatabaseWrapperBase.h @ 3788:626d5f4a5afb
disable RTLD_DEEPBIND if loading plugins
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 20 Mar 2020 12:37:41 +0100 |
parents | 94f4a18a79cc |
children |
rev | line source |
---|---|
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
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:
3060
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * modify it under the terms of the GNU General Public License as |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * published by the Free Software Foundation, either version 3 of the |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * License, or (at your option) any later version. |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * In addition, as a special exception, the copyright holders of this |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * program give permission to link the code of its release with the |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * that use the same license as the "OpenSSL" library), and distribute |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * the linked executables. You must obey the GNU General Public License |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * in all respects for all of the code used other than "OpenSSL". If you |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * modify file(s) with this exception, you may extend this exception to |
16955f8fec4d
refactoring: DatabaseWrapperBase
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 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 * you do not wish to do so, delete this exception statement from your |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 * version. If you delete this exception statement from all source files |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 * in the program, then also delete it here. |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 * |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 * This program is distributed in the hope that it will be useful, but |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 * WITHOUT ANY WARRANTY; without even the implied warranty of |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 * General Public License for more details. |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 * |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 * You should have received a copy of the GNU General Public License |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 **/ |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 #pragma once |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 #include "../Core/DicomFormat/DicomMap.h" |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 #include "../Core/DicomFormat/DicomTag.h" |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 #include "../Core/Enumerations.h" |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 #include "../Core/FileStorage/FileInfo.h" |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 #include "../Core/SQLite/Connection.h" |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
41 #include "../OrthancServer/ExportedResource.h" |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 #include "../OrthancServer/ServerIndexChange.h" |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 #include "ServerEnumerations.h" |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 #include <list> |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 namespace Orthanc |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 { |
1672
4c5a85c3ff43
sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
50 /** |
4c5a85c3ff43
sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
51 * This class is shared between the Orthanc core and the sample |
4c5a85c3ff43
sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
52 * database plugin whose code is in |
4c5a85c3ff43
sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
53 * "../Plugins/Samples/DatabasePlugin". |
4c5a85c3ff43
sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
54 **/ |
1711
5ebd6cbb3da8
Backed out changeset 2ad22b2970a2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1709
diff
changeset
|
55 class DatabaseWrapperBase |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 { |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 private: |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 SQLite::Connection& db_; |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
60 ErrorCode GetChangesInternal(std::list<ServerIndexChange>& target, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
61 bool& done, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
62 SQLite::Statement& s, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
63 uint32_t maxResults); |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 void GetExportedResourcesInternal(std::list<ExportedResource>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 bool& done, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 SQLite::Statement& s, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 uint32_t maxResults); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 public: |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 DatabaseWrapperBase(SQLite::Connection& db) : db_(db) |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 { |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 } |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 void SetGlobalProperty(GlobalProperty property, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 const std::string& value); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 bool LookupGlobalProperty(std::string& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 GlobalProperty property); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 int64_t CreateResource(const std::string& publicId, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 ResourceType type); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 bool LookupResource(int64_t& id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 ResourceType& type, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 const std::string& publicId); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
88 ErrorCode LookupParent(bool& found, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
89 int64_t& parentId, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
90 int64_t resourceId); |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
92 bool GetPublicId(std::string& result, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
93 int64_t resourceId); |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
95 ErrorCode GetResourceType(ResourceType& result, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
96 int64_t resourceId); |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 void AttachChild(int64_t parent, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 int64_t child); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 void SetMetadata(int64_t id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 MetadataType type, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 const std::string& value); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 void DeleteMetadata(int64_t id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 MetadataType type); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
107 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 bool LookupMetadata(std::string& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 int64_t id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 MetadataType type); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
112 void ListAvailableMetadata(std::list<MetadataType>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 int64_t id); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 void AddAttachment(int64_t id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 const FileInfo& attachment); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
117 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 void DeleteAttachment(int64_t id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 FileContentType attachment); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 void ListAvailableAttachments(std::list<FileContentType>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 int64_t id); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 bool LookupAttachment(FileInfo& attachment, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 int64_t id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 FileContentType contentType); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 void ClearMainDicomTags(int64_t id); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
131 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 void SetMainDicomTag(int64_t id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 const DicomTag& tag, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 const std::string& value); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 |
1713 | 136 void SetIdentifierTag(int64_t id, |
137 const DicomTag& tag, | |
138 const std::string& value); | |
139 | |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 void GetMainDicomTags(DicomMap& map, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 int64_t id); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
143 void GetChildrenPublicId(std::list<std::string>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 int64_t id); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 void GetChildrenInternalId(std::list<int64_t>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 int64_t id); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
148 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 void LogChange(int64_t internalId, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 const ServerIndexChange& change); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
152 ErrorCode GetChanges(std::list<ServerIndexChange>& target, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
153 bool& done, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
154 int64_t since, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
155 uint32_t maxResults); |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
157 ErrorCode GetLastChange(std::list<ServerIndexChange>& target); |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
159 void LogExportedResource(const ExportedResource& resource); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
160 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 void GetExportedResources(std::list<ExportedResource>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
162 bool& done, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
163 int64_t since, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
164 uint32_t maxResults); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
165 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
166 void GetLastExportedResource(std::list<ExportedResource>& target); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
167 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
168 uint64_t GetTotalCompressedSize(); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
169 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
170 uint64_t GetTotalUncompressedSize(); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
171 |
1750
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1747
diff
changeset
|
172 void GetAllInternalIds(std::list<int64_t>& target, |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1747
diff
changeset
|
173 ResourceType resourceType); |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1747
diff
changeset
|
174 |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
175 void GetAllPublicIds(std::list<std::string>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
176 ResourceType resourceType); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
177 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
178 void GetAllPublicIds(std::list<std::string>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
179 ResourceType resourceType, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
180 size_t since, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
181 size_t limit); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
182 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
183 uint64_t GetResourceCount(ResourceType resourceType); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
184 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
185 bool SelectPatientToRecycle(int64_t& internalId); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
186 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
187 bool SelectPatientToRecycle(int64_t& internalId, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
188 int64_t patientIdToAvoid); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
189 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
190 bool IsProtectedPatient(int64_t internalId); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
191 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
192 void SetProtectedPatient(int64_t internalId, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
193 bool isProtected); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
194 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
195 bool IsExistingResource(int64_t internalId); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
196 |
1746 | 197 void LookupIdentifier(std::list<int64_t>& result, |
198 ResourceType level, | |
199 const DicomTag& tag, | |
200 IdentifierConstraintType type, | |
201 const std::string& value); | |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
202 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
203 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:
2447
diff
changeset
|
204 ResourceType level, |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
205 const DicomTag& tag, |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
206 const std::string& start, |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
207 const std::string& end); |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
208 }; |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
209 } |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
210 |