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