annotate OrthancServer/IDatabaseWrapper.h @ 1729:54d78925cbb6 db-changes

notes
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 20 Oct 2015 17:39:58 +0200
parents 4941494b5dd8
children 38dda23c7d7d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1288
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1286
diff changeset
3 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1286
diff changeset
4 * Department, University Hospital of Liege, Belgium
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 *
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * This program is free software: you can redistribute it and/or
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * modify it under the terms of the GNU General Public License as
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * published by the Free Software Foundation, either version 3 of the
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * License, or (at your option) any later version.
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 *
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * In addition, as a special exception, the copyright holders of this
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * program give permission to link the code of its release with the
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * that use the same license as the "OpenSSL" library), and distribute
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * the linked executables. You must obey the GNU General Public License
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * in all respects for all of the code used other than "OpenSSL". If you
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * modify file(s) with this exception, you may extend this exception to
32fcc5dc7562 abstraction
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
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * you do not wish to do so, delete this exception statement from your
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * version. If you delete this exception statement from all source files
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * in the program, then also delete it here.
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 *
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 * This program is distributed in the hope that it will be useful, but
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * WITHOUT ANY WARRANTY; without even the implied warranty of
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * General Public License for more details.
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 *
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 * You should have received a copy of the GNU General Public License
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * along with this program. If not, see <http://www.gnu.org/licenses/>.
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 **/
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 #pragma once
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include "../Core/DicomFormat/DicomMap.h"
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 #include "../Core/SQLite/ITransaction.h"
1615
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1509
diff changeset
37 #include "../Core/FileStorage/IStorageArea.h"
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 #include "../Core/FileStorage/FileInfo.h"
1432
0ac74fa21db8 rename IServerIndexListener as IDatabaseListener
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1306
diff changeset
39 #include "IDatabaseListener.h"
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 #include "ExportedResource.h"
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 #include <list>
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 #include <boost/noncopyable.hpp>
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 namespace Orthanc
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 {
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 class IDatabaseWrapper : public boost::noncopyable
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 {
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 public:
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 virtual ~IDatabaseWrapper()
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 {
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 }
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
1672
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
54 virtual void Open() = 0;
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
55
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
56 virtual void Close() = 0;
4c5a85c3ff43 sample database plugin now working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1668
diff changeset
57
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 virtual void AddAttachment(int64_t id,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 const FileInfo& attachment) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 virtual void AttachChild(int64_t parent,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 int64_t child) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
1286
b4acdb37e43b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1252
diff changeset
64 virtual void ClearChanges() = 0;
b4acdb37e43b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1252
diff changeset
65
b4acdb37e43b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1252
diff changeset
66 virtual void ClearExportedResources() = 0;
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 virtual int64_t CreateResource(const std::string& publicId,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 ResourceType type) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 virtual void DeleteAttachment(int64_t id,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 FileContentType attachment) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 virtual void DeleteMetadata(int64_t id,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 MetadataType type) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 virtual void DeleteResource(int64_t id) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 virtual void FlushToDisk() = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80
1306
8cd5784a6d80 IDatabaseWrapper::HasFlushToDisk()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1302
diff changeset
81 virtual bool HasFlushToDisk() const = 0;
8cd5784a6d80 IDatabaseWrapper::HasFlushToDisk()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1302
diff changeset
82
1301
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1294
diff changeset
83 virtual void GetAllMetadata(std::map<MetadataType, std::string>& target,
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 int64_t id) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 virtual void GetAllPublicIds(std::list<std::string>& target,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 ResourceType resourceType) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88
1509
0586ed8897f1 limit and since arguments while retrieving DICOM resources in the REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1432
diff changeset
89 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
90 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
91 size_t since,
0586ed8897f1 limit and since arguments while retrieving DICOM resources in the REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1432
diff changeset
92 size_t limit) = 0;
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 virtual void GetChanges(std::list<ServerIndexChange>& target /*out*/,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 bool& done /*out*/,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 int64_t since,
1302
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1301
diff changeset
97 uint32_t maxResults) = 0;
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98
1301
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1294
diff changeset
99 virtual void GetChildrenInternalId(std::list<int64_t>& target,
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 int64_t id) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101
1301
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1294
diff changeset
102 virtual void GetChildrenPublicId(std::list<std::string>& target,
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 int64_t id) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 virtual void GetExportedResources(std::list<ExportedResource>& target /*out*/,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 bool& done /*out*/,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 int64_t since,
1302
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1301
diff changeset
108 uint32_t maxResults) = 0;
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 virtual void GetLastChange(std::list<ServerIndexChange>& target /*out*/) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 virtual void GetLastExportedResource(std::list<ExportedResource>& target /*out*/) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 virtual void GetMainDicomTags(DicomMap& map,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 int64_t id) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 virtual std::string GetPublicId(int64_t resourceId) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 virtual uint64_t GetResourceCount(ResourceType resourceType) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 virtual ResourceType GetResourceType(int64_t resourceId) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 virtual uint64_t GetTotalCompressedSize() = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 virtual uint64_t GetTotalUncompressedSize() = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 virtual bool IsExistingResource(int64_t internalId) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 virtual bool IsProtectedPatient(int64_t internalId) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 virtual void ListAvailableMetadata(std::list<MetadataType>& target,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 int64_t id) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133
1301
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1294
diff changeset
134 virtual void ListAvailableAttachments(std::list<FileContentType>& target,
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 int64_t id) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 virtual void LogChange(int64_t internalId,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 const ServerIndexChange& change) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 virtual void LogExportedResource(const ExportedResource& resource) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 virtual bool LookupAttachment(FileInfo& attachment,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 int64_t id,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 FileContentType contentType) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 virtual bool LookupGlobalProperty(std::string& target,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 GlobalProperty property) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
1728
4941494b5dd8 rename LookupIdentifier as LookupIdentifierExact
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1727
diff changeset
149 virtual void LookupIdentifierExact(std::list<int64_t>& target,
4941494b5dd8 rename LookupIdentifier as LookupIdentifierExact
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1727
diff changeset
150 ResourceType level,
4941494b5dd8 rename LookupIdentifier as LookupIdentifierExact
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1727
diff changeset
151 const DicomTag& tag,
4941494b5dd8 rename LookupIdentifier as LookupIdentifierExact
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1727
diff changeset
152 const std::string& value) = 0;
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153
1729
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
154 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
155 * Primitive for wildcard matching, as defined in DICOM:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
156 * http://dicom.nema.org/dicom/2013/output/chtml/part04/sect_C.2.html#sect_C.2.2.2.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
157 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
158 * "Any occurrence of an "*" or a "?", then "*" shall match any
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
159 * sequence of characters (including a zero length value) and "?"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
160 * shall match any single character. This matching is case
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
161 * sensitive, except for Attributes with an PN Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
162 * Representation (e.g., Patient Name (0010,0010))."
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
163 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
164 * Pay attention to the fact that "*" (resp. "?") generally
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
165 * corresponds to "%" (resp. "_") in primitive LIKE of SQL. The
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
166 * values "%", "_", "\" should in the user request should
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
167 * respectively be escaped as "\%", "\_" and "\\".
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
168 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
169 * This matching must be case sensitive: The special case of PN VR
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
170 * is taken into consideration by normalizing the query string in
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
171 * method "ServerIndex::LookupIdentifierWildcard()".
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
172 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
173 virtual void LookupIdentifierWildcard(std::list<int64_t>& target,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
174 const DicomTag& tag,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
175 const std::string& value) = 0;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1728
diff changeset
176
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 virtual bool LookupMetadata(std::string& target,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 int64_t id,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 MetadataType type) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 virtual bool LookupParent(int64_t& parentId,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 int64_t resourceId) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183
1294
910478b2d4e4 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
184 virtual bool LookupResource(int64_t& id,
910478b2d4e4 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
185 ResourceType& type,
910478b2d4e4 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
186 const std::string& publicId) = 0;
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 virtual bool SelectPatientToRecycle(int64_t& internalId) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 virtual bool SelectPatientToRecycle(int64_t& internalId,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 int64_t patientIdToAvoid) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 virtual void SetGlobalProperty(GlobalProperty property,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 const std::string& value) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195
1668
de1413733c97 reconstructing main dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
196 virtual void ClearMainDicomTags(int64_t id) = 0;
de1413733c97 reconstructing main dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
197
1286
b4acdb37e43b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1252
diff changeset
198 virtual void SetMainDicomTag(int64_t id,
b4acdb37e43b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1252
diff changeset
199 const DicomTag& tag,
b4acdb37e43b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1252
diff changeset
200 const std::string& value) = 0;
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201
1713
4db9200c7f46 SetIdentifierTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1711
diff changeset
202 virtual void SetIdentifierTag(int64_t id,
4db9200c7f46 SetIdentifierTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1711
diff changeset
203 const DicomTag& tag,
4db9200c7f46 SetIdentifierTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1711
diff changeset
204 const std::string& value) = 0;
4db9200c7f46 SetIdentifierTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1711
diff changeset
205
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 virtual void SetMetadata(int64_t id,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 MetadataType type,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 const std::string& value) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 virtual void SetProtectedPatient(int64_t internalId,
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 bool isProtected) = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 virtual SQLite::ITransaction* StartTransaction() = 0;
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214
1432
0ac74fa21db8 rename IServerIndexListener as IDatabaseListener
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1306
diff changeset
215 virtual void SetListener(IDatabaseListener& listener) = 0;
1615
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1509
diff changeset
216
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1509
diff changeset
217 virtual unsigned int GetDatabaseVersion() = 0;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1509
diff changeset
218
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1509
diff changeset
219 virtual void Upgrade(unsigned int targetVersion,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1509
diff changeset
220 IStorageArea& storageArea) = 0;
1247
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 };
32fcc5dc7562 abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 }