Mercurial > hg > orthanc
annotate OrthancServer/DatabaseWrapperBase.h @ 1671:2f2e2ec17bc4 db-changes
sample database plugin
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 01 Oct 2015 17:44:43 +0200 |
parents | 16955f8fec4d |
children | 4c5a85c3ff43 |
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 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics |
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 { |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 class DatabaseWrapperBase |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 { |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 private: |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 SQLite::Connection& db_; |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
54 ErrorCode GetChangesInternal(std::list<ServerIndexChange>& target, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
55 bool& done, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
56 SQLite::Statement& s, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
57 uint32_t maxResults); |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 void GetExportedResourcesInternal(std::list<ExportedResource>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 bool& done, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 SQLite::Statement& s, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 uint32_t maxResults); |
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 public: |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 DatabaseWrapperBase(SQLite::Connection& db) : db_(db) |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 { |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 } |
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 void SetGlobalProperty(GlobalProperty property, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 const std::string& value); |
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 bool LookupGlobalProperty(std::string& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 GlobalProperty property); |
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 int64_t CreateResource(const std::string& publicId, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 ResourceType type); |
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 LookupResource(int64_t& id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 ResourceType& type, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 const std::string& publicId); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
82 ErrorCode LookupParent(bool& found, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
83 int64_t& parentId, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
84 int64_t resourceId); |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
86 bool GetPublicId(std::string& result, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
87 int64_t resourceId); |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
89 ErrorCode GetResourceType(ResourceType& result, |
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 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 void AttachChild(int64_t parent, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 int64_t child); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 void SetMetadata(int64_t id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 MetadataType type, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 const std::string& value); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 void DeleteMetadata(int64_t id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 MetadataType type); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 bool LookupMetadata(std::string& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 int64_t id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 MetadataType type); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 void ListAvailableMetadata(std::list<MetadataType>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
107 int64_t id); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 void AddAttachment(int64_t id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 const FileInfo& attachment); |
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 DeleteAttachment(int64_t id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 FileContentType attachment); |
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 ListAvailableAttachments(std::list<FileContentType>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 int64_t id); |
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 bool LookupAttachment(FileInfo& attachment, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 int64_t id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 FileContentType contentType); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 |
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 void ClearMainDicomTags(int64_t id); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 void SetMainDicomTag(int64_t id, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 const DicomTag& tag, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 const std::string& value); |
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 void GetMainDicomTags(DicomMap& map, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
131 int64_t id); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 void GetChildrenPublicId(std::list<std::string>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 int64_t id); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 void GetChildrenInternalId(std::list<int64_t>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
137 int64_t id); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
139 void LogChange(int64_t internalId, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 const ServerIndexChange& change); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
142 ErrorCode GetChanges(std::list<ServerIndexChange>& target, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
143 bool& done, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
144 int64_t since, |
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
145 uint32_t maxResults); |
1670
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1670
diff
changeset
|
147 ErrorCode GetLastChange(std::list<ServerIndexChange>& target); |
1670
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 LogExportedResource(const ExportedResource& resource); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 void GetExportedResources(std::list<ExportedResource>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 bool& done, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 int64_t since, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
154 uint32_t maxResults); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 void GetLastExportedResource(std::list<ExportedResource>& target); |
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 uint64_t GetTotalCompressedSize(); |
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 uint64_t GetTotalUncompressedSize(); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
162 void GetAllPublicIds(std::list<std::string>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
163 ResourceType resourceType); |
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 GetAllPublicIds(std::list<std::string>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
166 ResourceType resourceType, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
167 size_t since, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
168 size_t limit); |
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 GetResourceCount(ResourceType resourceType); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
171 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
172 bool SelectPatientToRecycle(int64_t& internalId); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
173 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
174 bool SelectPatientToRecycle(int64_t& internalId, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
175 int64_t patientIdToAvoid); |
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 bool IsProtectedPatient(int64_t internalId); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
178 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
179 void SetProtectedPatient(int64_t internalId, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
180 bool isProtected); |
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 bool IsExistingResource(int64_t internalId); |
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 void LookupIdentifier(std::list<int64_t>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
185 const DicomTag& tag, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
186 const std::string& value); |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
187 |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
188 void LookupIdentifier(std::list<int64_t>& target, |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
189 const std::string& value); |
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 } |
16955f8fec4d
refactoring: DatabaseWrapperBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
192 |