Mercurial > hg > orthanc-databases
annotate MySQL/Plugins/MySQLIndex.h @ 518:e3102bad13a4
fix SDK 1.12.4 protobuf
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Thu, 06 Jun 2024 12:38:28 +0200 |
parents | 54d518dcd74a |
children | 451125122692 |
rev | line source |
---|---|
0 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
507
54d518dcd74a
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
459
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
54d518dcd74a
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
459
diff
changeset
|
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
459
ecd0b719cff5
update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
403
diff
changeset
|
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
0 | 8 * |
9 * This program is free software: you can redistribute it and/or | |
10 * modify it under the terms of the GNU Affero General Public License | |
11 * as published by the Free Software Foundation, either version 3 of | |
12 * the License, or (at your option) any later version. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, but | |
15 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 * Affero General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU Affero General Public License | |
20 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
21 **/ | |
22 | |
23 | |
24 #pragma once | |
25 | |
26 #include "../../Framework/Plugins/IndexBackend.h" | |
27 #include "../../Framework/MySQL/MySQLParameters.h" | |
28 | |
29 namespace OrthancDatabases | |
30 { | |
31 class MySQLIndex : public IndexBackend | |
32 { | |
33 private: | |
34 MySQLParameters parameters_; | |
35 bool clearAll_; | |
36 | |
37 public: | |
201
42990b2dd51b
create IDatabaseBackendOutput only if needed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
38 MySQLIndex(OrthancPluginContext* context, |
42990b2dd51b
create IDatabaseBackendOutput only if needed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
39 const MySQLParameters& parameters); |
0 | 40 |
41 void SetClearAll(bool clear) | |
42 { | |
43 clearAll_ = clear; | |
44 } | |
45 | |
255
d663d9e44f8d
reintroduction of IDatabaseFactory into DatabaseManager
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
237
diff
changeset
|
46 virtual IDatabaseFactory* CreateDatabaseFactory() ORTHANC_OVERRIDE; |
224
61c309e06797
added internal class DatabaseBackendAdapterV2::Adapter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
203
diff
changeset
|
47 |
403
91124cc8a8c7
database plugins are informed about the identifier tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
400
diff
changeset
|
48 virtual void ConfigureDatabase(DatabaseManager& database, |
91124cc8a8c7
database plugins are informed about the identifier tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
400
diff
changeset
|
49 bool hasIdentifierTags, |
91124cc8a8c7
database plugins are informed about the identifier tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
400
diff
changeset
|
50 const std::list<IdentifierTag>& identifierTags) ORTHANC_OVERRIDE; |
226
a4918d57435c
DatabaseManager doesn't IDatabaseFactory anymore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
225
diff
changeset
|
51 |
260
793bbbe11287
IDatabaseBackend::HasRevisionsSupport()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
255
diff
changeset
|
52 virtual bool HasRevisionsSupport() const ORTHANC_OVERRIDE |
793bbbe11287
IDatabaseBackend::HasRevisionsSupport()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
255
diff
changeset
|
53 { |
793bbbe11287
IDatabaseBackend::HasRevisionsSupport()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
255
diff
changeset
|
54 return false; // TODO - REVISIONS |
793bbbe11287
IDatabaseBackend::HasRevisionsSupport()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
255
diff
changeset
|
55 } |
793bbbe11287
IDatabaseBackend::HasRevisionsSupport()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
255
diff
changeset
|
56 |
225
94c9908e6aca
removed DatabaseManager member out of class IndexBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
57 virtual int64_t CreateResource(DatabaseManager& manager, |
94c9908e6aca
removed DatabaseManager member out of class IndexBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
58 const char* publicId, |
111 | 59 OrthancPluginResourceType type) |
60 ORTHANC_OVERRIDE; | |
0 | 61 |
203
2089d4071408
moving classes out of OrthancPlugins namespace, to OrthancDatabases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
62 virtual void DeleteResource(IDatabaseBackendOutput& output, |
225
94c9908e6aca
removed DatabaseManager member out of class IndexBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
63 DatabaseManager& manager, |
201
42990b2dd51b
create IDatabaseBackendOutput only if needed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
64 int64_t id) ORTHANC_OVERRIDE; |
87
48d445f756db
new extension implemented for MySQL: GetLastChangeIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
67
diff
changeset
|
65 |
225
94c9908e6aca
removed DatabaseManager member out of class IndexBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
66 virtual int64_t GetLastChangeIndex(DatabaseManager& manager) ORTHANC_OVERRIDE; |
110
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
67 |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
68 virtual bool HasCreateInstance() const ORTHANC_OVERRIDE |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
69 { |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
70 return true; |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
71 } |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
72 |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
73 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
74 virtual void CreateInstance(OrthancPluginCreateInstanceResult& result, |
225
94c9908e6aca
removed DatabaseManager member out of class IndexBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
75 DatabaseManager& manager, |
110
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
76 const char* hashPatient, |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
77 const char* hashStudy, |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
78 const char* hashSeries, |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
79 const char* hashInstance) |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
80 ORTHANC_OVERRIDE; |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
81 #endif |
391
d14e6ff04a5c
added primitives to handle labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
389
diff
changeset
|
82 |
d14e6ff04a5c
added primitives to handle labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
389
diff
changeset
|
83 // New primitive since Orthanc 1.12.0 |
d14e6ff04a5c
added primitives to handle labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
389
diff
changeset
|
84 virtual bool HasLabelsSupport() const ORTHANC_OVERRIDE |
d14e6ff04a5c
added primitives to handle labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
389
diff
changeset
|
85 { |
400
897253c21208
support for labels in mysql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
391
diff
changeset
|
86 return true; |
391
d14e6ff04a5c
added primitives to handle labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
389
diff
changeset
|
87 } |
0 | 88 }; |
89 } |