annotate Resources/Orthanc/Sdk-1.12.0/orthanc/OrthancCDatabasePlugin.h @ 456:0ac99983abfa pg-transactions

missing drop function
author Alain Mazy <am@osimis.io>
date Tue, 23 Jan 2024 16:50:55 +0100
parents 1938ba8fba35
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
405
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * @ingroup CInterface
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * Orthanc - A Lightweight, RESTful DICOM Store
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * Department, University Hospital of Liege, Belgium
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * Copyright (C) 2017-2023 Osimis S.A., Belgium
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is free software: you can redistribute it and/or
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * modify it under the terms of the GNU General Public License as
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * published by the Free Software Foundation, either version 3 of the
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * License, or (at your option) any later version.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful, but
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * General Public License for more details.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 #pragma once
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #include "OrthancCPlugin.h"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 /** @{ */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #ifdef __cplusplus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 extern "C"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 #endif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 * Opaque structure that represents the context of a custom database engine.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 * @ingroup Callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 typedef struct _OrthancPluginDatabaseContext_t OrthancPluginDatabaseContext;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 * Opaque structure that represents a transaction of a custom database engine.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 * New in Orthanc 1.9.2.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 * @ingroup Callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 typedef struct _OrthancPluginDatabaseTransaction_t OrthancPluginDatabaseTransaction;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 /*<! @cond Doxygen_Suppress */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 typedef enum
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 _OrthancPluginDatabaseAnswerType_None = 0,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 /* Events */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 _OrthancPluginDatabaseAnswerType_DeletedAttachment = 1,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 _OrthancPluginDatabaseAnswerType_DeletedResource = 2,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 _OrthancPluginDatabaseAnswerType_RemainingAncestor = 3,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 /* Return value */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 _OrthancPluginDatabaseAnswerType_Attachment = 10,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 _OrthancPluginDatabaseAnswerType_Change = 11,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 _OrthancPluginDatabaseAnswerType_DicomTag = 12,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 _OrthancPluginDatabaseAnswerType_ExportedResource = 13,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 _OrthancPluginDatabaseAnswerType_Int32 = 14,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 _OrthancPluginDatabaseAnswerType_Int64 = 15,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 _OrthancPluginDatabaseAnswerType_Resource = 16,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 _OrthancPluginDatabaseAnswerType_String = 17,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 _OrthancPluginDatabaseAnswerType_MatchingResource = 18, /* New in Orthanc 1.5.2 */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 _OrthancPluginDatabaseAnswerType_Metadata = 19, /* New in Orthanc 1.5.4 */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 _OrthancPluginDatabaseAnswerType_INTERNAL = 0x7fffffff
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 } _OrthancPluginDatabaseAnswerType;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 typedef struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 const char* uuid;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 int32_t contentType;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 uint64_t uncompressedSize;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 const char* uncompressedHash;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 int32_t compressionType;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 uint64_t compressedSize;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 const char* compressedHash;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 } OrthancPluginAttachment;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 typedef struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 uint16_t group;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 uint16_t element;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 const char* value;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 } OrthancPluginDicomTag;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 typedef struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 int64_t seq;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 int32_t changeType;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 OrthancPluginResourceType resourceType;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 const char* publicId;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 const char* date;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 } OrthancPluginChange;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 typedef struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 int64_t seq;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 OrthancPluginResourceType resourceType;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 const char* publicId;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 const char* modality;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 const char* date;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 const char* patientId;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 const char* studyInstanceUid;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 const char* seriesInstanceUid;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 const char* sopInstanceUid;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 } OrthancPluginExportedResource;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 typedef struct /* New in Orthanc 1.5.2 */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 OrthancPluginResourceType level;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 uint16_t tagGroup;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 uint16_t tagElement;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 uint8_t isIdentifierTag;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 uint8_t isCaseSensitive;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 uint8_t isMandatory;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 OrthancPluginConstraintType type;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 uint32_t valuesCount;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 const char* const* values;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 } OrthancPluginDatabaseConstraint;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 typedef struct /* New in Orthanc 1.5.2 */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 const char* resourceId;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 const char* someInstanceId; /* Can be NULL if not requested */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 } OrthancPluginMatchingResource;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 typedef struct /* New in Orthanc 1.5.2 */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 /* Mandatory field */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 uint8_t isNewInstance;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 int64_t instanceId;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 /* The following fields must only be set if "isNewInstance" is "true" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 uint8_t isNewPatient;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 uint8_t isNewStudy;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 uint8_t isNewSeries;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 int64_t patientId;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 int64_t studyId;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 int64_t seriesId;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 } OrthancPluginCreateInstanceResult;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 typedef struct /* New in Orthanc 1.5.2 */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 int64_t resource;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 uint16_t group;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 uint16_t element;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 const char* value;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 } OrthancPluginResourcesContentTags;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 typedef struct /* New in Orthanc 1.5.2 */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 int64_t resource;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 int32_t metadata;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 const char* value;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 } OrthancPluginResourcesContentMetadata;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 typedef struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 OrthancPluginDatabaseContext* database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 _OrthancPluginDatabaseAnswerType type;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 int32_t valueInt32;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 uint32_t valueUint32;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 int64_t valueInt64;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 const char *valueString;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 const void *valueGeneric;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 } _OrthancPluginDatabaseAnswer;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseAnswerString(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 OrthancPluginDatabaseContext* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 const char* value)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 params.type = _OrthancPluginDatabaseAnswerType_String;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 params.valueString = value;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseAnswerChange(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 OrthancPluginDatabaseContext* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 const OrthancPluginChange* change)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 params.type = _OrthancPluginDatabaseAnswerType_Change;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 params.valueUint32 = 0;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 params.valueGeneric = change;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseAnswerChangesDone(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 OrthancPluginDatabaseContext* database)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 params.type = _OrthancPluginDatabaseAnswerType_Change;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 params.valueUint32 = 1;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 params.valueGeneric = NULL;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseAnswerInt32(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 OrthancPluginDatabaseContext* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 int32_t value)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 params.type = _OrthancPluginDatabaseAnswerType_Int32;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 params.valueInt32 = value;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseAnswerInt64(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 OrthancPluginDatabaseContext* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 int64_t value)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 params.type = _OrthancPluginDatabaseAnswerType_Int64;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 params.valueInt64 = value;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseAnswerExportedResource(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 OrthancPluginDatabaseContext* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 const OrthancPluginExportedResource* exported)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 params.type = _OrthancPluginDatabaseAnswerType_ExportedResource;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 params.valueUint32 = 0;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 params.valueGeneric = exported;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseAnswerExportedResourcesDone(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 OrthancPluginDatabaseContext* database)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 params.type = _OrthancPluginDatabaseAnswerType_ExportedResource;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 params.valueUint32 = 1;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 params.valueGeneric = NULL;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseAnswerDicomTag(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 OrthancPluginDatabaseContext* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 const OrthancPluginDicomTag* tag)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 params.type = _OrthancPluginDatabaseAnswerType_DicomTag;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 params.valueGeneric = tag;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseAnswerAttachment(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 OrthancPluginDatabaseContext* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 const OrthancPluginAttachment* attachment)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303 params.type = _OrthancPluginDatabaseAnswerType_Attachment;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 params.valueGeneric = attachment;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseAnswerResource(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310 OrthancPluginDatabaseContext* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
312 OrthancPluginResourceType resourceType)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
313 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
314 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
315 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
316 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317 params.type = _OrthancPluginDatabaseAnswerType_Resource;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 params.valueInt64 = id;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319 params.valueInt32 = (int32_t) resourceType;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseAnswerMatchingResource(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
325 OrthancPluginDatabaseContext* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326 const OrthancPluginMatchingResource* match)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
329 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
330 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331 params.type = _OrthancPluginDatabaseAnswerType_MatchingResource;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332 params.valueGeneric = match;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
333 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
335
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
336 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseAnswerMetadata(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338 OrthancPluginDatabaseContext* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339 int64_t resourceId,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340 int32_t type,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
341 const char* value)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
342 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 OrthancPluginResourcesContentMetadata metadata;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345 metadata.resource = resourceId;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
346 metadata.metadata = type;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
347 metadata.value = value;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
348 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
349 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
350 params.type = _OrthancPluginDatabaseAnswerType_Metadata;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351 params.valueGeneric = &metadata;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
352 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
353 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
354
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
355 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseSignalDeletedAttachment(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
356 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357 OrthancPluginDatabaseContext* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358 const OrthancPluginAttachment* attachment)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
359 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
360 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
361 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
363 params.type = _OrthancPluginDatabaseAnswerType_DeletedAttachment;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
364 params.valueGeneric = attachment;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseSignalDeletedResource(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370 OrthancPluginDatabaseContext* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371 const char* publicId,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
372 OrthancPluginResourceType resourceType)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377 params.type = _OrthancPluginDatabaseAnswerType_DeletedResource;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378 params.valueString = publicId;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379 params.valueInt32 = (int32_t) resourceType;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383 ORTHANC_PLUGIN_INLINE void OrthancPluginDatabaseSignalRemainingAncestor(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385 OrthancPluginDatabaseContext* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386 const char* ancestorId,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 OrthancPluginResourceType ancestorType)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389 _OrthancPluginDatabaseAnswer params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392 params.type = _OrthancPluginDatabaseAnswerType_RemainingAncestor;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393 params.valueString = ancestorId;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394 params.valueInt32 = (int32_t) ancestorType;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 context->InvokeService(context, _OrthancPluginService_DatabaseAnswer, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 typedef struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 OrthancPluginErrorCode (*addAttachment) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408 const OrthancPluginAttachment* attachment);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410 OrthancPluginErrorCode (*attachChild) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
411 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
412 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413 int64_t parent,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414 int64_t child);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416 OrthancPluginErrorCode (*clearChanges) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
417 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 void* payload);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420 OrthancPluginErrorCode (*clearExportedResources) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422 void* payload);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
423
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 OrthancPluginErrorCode (*createResource) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
425 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426 int64_t* id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
429 const char* publicId,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
430 OrthancPluginResourceType resourceType);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
431
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
432 OrthancPluginErrorCode (*deleteAttachment) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
435 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
436 int32_t contentType);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438 OrthancPluginErrorCode (*deleteMetadata) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
439 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
440 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
441 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
442 int32_t metadataType);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
443
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
444 OrthancPluginErrorCode (*deleteResource) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
445 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
446 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
447 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
448
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
449 /* Output: Use OrthancPluginDatabaseAnswerString() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
450 OrthancPluginErrorCode (*getAllPublicIds) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
452 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
453 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
454 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
455 OrthancPluginResourceType resourceType);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
456
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
457 /* Output: Use OrthancPluginDatabaseAnswerChange() and
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
458 * OrthancPluginDatabaseAnswerChangesDone() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
459 OrthancPluginErrorCode (*getChanges) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
460 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
461 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
462 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
463 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
464 int64_t since,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
465 uint32_t maxResult);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
466
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
467 /* Output: Use OrthancPluginDatabaseAnswerInt64() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
468 OrthancPluginErrorCode (*getChildrenInternalId) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
469 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
471 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
472 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
473 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
474
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475 /* Output: Use OrthancPluginDatabaseAnswerString() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
476 OrthancPluginErrorCode (*getChildrenPublicId) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
479 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
480 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
481 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
482
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
483 /* Output: Use OrthancPluginDatabaseAnswerExportedResource() and
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
484 * OrthancPluginDatabaseAnswerExportedResourcesDone() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
485 OrthancPluginErrorCode (*getExportedResources) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
486 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
487 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
488 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
489 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
490 int64_t since,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
491 uint32_t maxResult);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
492
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
493 /* Output: Use OrthancPluginDatabaseAnswerChange() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
494 OrthancPluginErrorCode (*getLastChange) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
495 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
496 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
497 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
498 void* payload);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
499
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
500 /* Output: Use OrthancPluginDatabaseAnswerExportedResource() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
501 OrthancPluginErrorCode (*getLastExportedResource) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
502 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
503 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
504 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
505 void* payload);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
506
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
507 /* Output: Use OrthancPluginDatabaseAnswerDicomTag() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
508 OrthancPluginErrorCode (*getMainDicomTags) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
509 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
510 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
512 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
513 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
514
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
515 /* Output: Use OrthancPluginDatabaseAnswerString() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
516 OrthancPluginErrorCode (*getPublicId) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
517 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
518 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
519 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
520 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
521 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
522
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
523 OrthancPluginErrorCode (*getResourceCount) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
524 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
525 uint64_t* target,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
526 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
527 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
528 OrthancPluginResourceType resourceType);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
529
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
530 OrthancPluginErrorCode (*getResourceType) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
531 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
532 OrthancPluginResourceType* resourceType,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
533 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
534 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
535 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
536
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
537 OrthancPluginErrorCode (*getTotalCompressedSize) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
538 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
539 uint64_t* target,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
540 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
541 void* payload);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
542
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
543 OrthancPluginErrorCode (*getTotalUncompressedSize) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
544 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
545 uint64_t* target,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
546 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
547 void* payload);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
548
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
549 OrthancPluginErrorCode (*isExistingResource) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
550 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
551 int32_t* existing,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
552 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
553 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
554 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
555
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
556 OrthancPluginErrorCode (*isProtectedPatient) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
557 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
558 int32_t* isProtected,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
559 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
560 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
561 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
562
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
563 /* Output: Use OrthancPluginDatabaseAnswerInt32() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
564 OrthancPluginErrorCode (*listAvailableMetadata) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
565 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
566 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
567 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
568 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
569 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
570
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
571 /* Output: Use OrthancPluginDatabaseAnswerInt32() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
572 OrthancPluginErrorCode (*listAvailableAttachments) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
573 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
574 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
575 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
576 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
577 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
578
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
579 OrthancPluginErrorCode (*logChange) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
580 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
581 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
582 const OrthancPluginChange* change);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
583
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
584 OrthancPluginErrorCode (*logExportedResource) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
585 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
586 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
587 const OrthancPluginExportedResource* exported);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
588
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
589 /* Output: Use OrthancPluginDatabaseAnswerAttachment() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
590 OrthancPluginErrorCode (*lookupAttachment) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
591 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
592 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
593 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
594 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
595 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
596 int32_t contentType);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
597
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
598 /* Output: Use OrthancPluginDatabaseAnswerString() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
599 OrthancPluginErrorCode (*lookupGlobalProperty) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
600 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
601 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
602 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
603 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
604 int32_t property);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
605
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
606 /* Use "OrthancPluginDatabaseExtensions::lookupIdentifier3"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
607 instead of this function as of Orthanc 0.9.5 (db v6), can be set to NULL.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
608 Output: Use OrthancPluginDatabaseAnswerInt64() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
609 OrthancPluginErrorCode (*lookupIdentifier) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
610 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
611 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
612 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
613 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
614 const OrthancPluginDicomTag* tag);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
615
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
616 /* Unused starting with Orthanc 0.9.5 (db v6), can be set to NULL.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
617 Output: Use OrthancPluginDatabaseAnswerInt64() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
618 OrthancPluginErrorCode (*lookupIdentifier2) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
619 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
620 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
621 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
622 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
623 const char* value);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
624
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
625 /* Output: Use OrthancPluginDatabaseAnswerString() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
626 OrthancPluginErrorCode (*lookupMetadata) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
627 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
628 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
629 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
630 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
631 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
632 int32_t metadata);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
633
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
634 /* Output: Use OrthancPluginDatabaseAnswerInt64() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
635 OrthancPluginErrorCode (*lookupParent) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
636 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
637 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
638 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
639 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
640 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
641
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
642 /* Output: Use OrthancPluginDatabaseAnswerResource() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
643 OrthancPluginErrorCode (*lookupResource) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
644 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
645 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
646 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
647 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
648 const char* publicId);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
649
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
650 /* Output: Use OrthancPluginDatabaseAnswerInt64() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
651 OrthancPluginErrorCode (*selectPatientToRecycle) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
652 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
653 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
654 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
655 void* payload);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
656
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
657 /* Output: Use OrthancPluginDatabaseAnswerInt64() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
658 OrthancPluginErrorCode (*selectPatientToRecycle2) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
659 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
660 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
661 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
662 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
663 int64_t patientIdToAvoid);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
664
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
665 OrthancPluginErrorCode (*setGlobalProperty) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
666 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
667 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
668 int32_t property,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
669 const char* value);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
670
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
671 OrthancPluginErrorCode (*setMainDicomTag) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
672 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
673 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
674 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
675 const OrthancPluginDicomTag* tag);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
676
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
677 OrthancPluginErrorCode (*setIdentifierTag) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
678 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
679 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
680 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
681 const OrthancPluginDicomTag* tag);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
682
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
683 OrthancPluginErrorCode (*setMetadata) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
684 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
685 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
686 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
687 int32_t metadata,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
688 const char* value);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
689
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
690 OrthancPluginErrorCode (*setProtectedPatient) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
691 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
692 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
693 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
694 int32_t isProtected);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
695
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
696 OrthancPluginErrorCode (*startTransaction) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
697 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
698 void* payload);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
699
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
700 OrthancPluginErrorCode (*rollbackTransaction) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
701 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
702 void* payload);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
703
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
704 OrthancPluginErrorCode (*commitTransaction) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
705 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
706 void* payload);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
707
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
708 OrthancPluginErrorCode (*open) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
709 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
710 void* payload);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
711
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
712 OrthancPluginErrorCode (*close) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
713 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
714 void* payload);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
715
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
716 } OrthancPluginDatabaseBackend;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
717
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
718
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
719 typedef struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
720 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
721 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
722 * Base extensions since Orthanc 1.0.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
723 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
724
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
725 /* Output: Use OrthancPluginDatabaseAnswerString() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
726 OrthancPluginErrorCode (*getAllPublicIdsWithLimit) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
727 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
728 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
729 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
730 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
731 OrthancPluginResourceType resourceType,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
732 uint64_t since,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
733 uint64_t limit);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
734
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
735 OrthancPluginErrorCode (*getDatabaseVersion) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
736 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
737 uint32_t* version,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
738 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
739 void* payload);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
740
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
741 OrthancPluginErrorCode (*upgradeDatabase) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
742 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
743 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
744 uint32_t targetVersion,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
745 OrthancPluginStorageArea* storageArea);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
746
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
747 OrthancPluginErrorCode (*clearMainDicomTags) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
748 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
749 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
750 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
751
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
752 /* Output: Use OrthancPluginDatabaseAnswerInt64() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
753 OrthancPluginErrorCode (*getAllInternalIds) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
754 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
755 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
756 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
757 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
758 OrthancPluginResourceType resourceType);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
759
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
760 /* Output: Use OrthancPluginDatabaseAnswerInt64() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
761 OrthancPluginErrorCode (*lookupIdentifier3) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
762 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
763 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
764 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
765 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
766 OrthancPluginResourceType resourceType,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
767 const OrthancPluginDicomTag* tag,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
768 OrthancPluginIdentifierConstraint constraint);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
769
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
770
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
771 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
772 * Extensions since Orthanc 1.4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
773 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
774
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
775 /* Output: Use OrthancPluginDatabaseAnswerInt64() */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
776 OrthancPluginErrorCode (*lookupIdentifierRange) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
777 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
778 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
779 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
780 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
781 OrthancPluginResourceType resourceType,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
782 uint16_t group,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
783 uint16_t element,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
784 const char* start,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
785 const char* end);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
786
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
787
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
788 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
789 * Extensions since Orthanc 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
790 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
791
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
792 /* Ouput: Use OrthancPluginDatabaseAnswerMatchingResource */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
793 OrthancPluginErrorCode (*lookupResources) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
794 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
795 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
796 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
797 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
798 uint32_t constraintsCount,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
799 const OrthancPluginDatabaseConstraint* constraints,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
800 OrthancPluginResourceType queryLevel,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
801 uint32_t limit,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
802 uint8_t requestSomeInstance);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
803
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
804 OrthancPluginErrorCode (*createInstance) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
805 /* output */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
806 OrthancPluginCreateInstanceResult* output,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
807 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
808 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
809 const char* hashPatient,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
810 const char* hashStudy,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
811 const char* hashSeries,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
812 const char* hashInstance);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
813
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
814 OrthancPluginErrorCode (*setResourcesContent) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
815 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
816 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
817 uint32_t countIdentifierTags,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
818 const OrthancPluginResourcesContentTags* identifierTags,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
819 uint32_t countMainDicomTags,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
820 const OrthancPluginResourcesContentTags* mainDicomTags,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
821 uint32_t countMetadata,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
822 const OrthancPluginResourcesContentMetadata* metadata);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
823
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
824 /* Ouput: Use OrthancPluginDatabaseAnswerString */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
825 OrthancPluginErrorCode (*getChildrenMetadata) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
826 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
827 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
828 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
829 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
830 int64_t resourceId,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
831 int32_t metadata);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
832
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
833 OrthancPluginErrorCode (*getLastChangeIndex) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
834 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
835 int64_t* target,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
836 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
837 void* payload);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
838
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
839 OrthancPluginErrorCode (*tagMostRecentPatient) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
840 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
841 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
842 int64_t patientId);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
843
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
844
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
845 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
846 * Extensions since Orthanc 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
847 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
848
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
849 /* Ouput: Use OrthancPluginDatabaseAnswerMetadata */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
850 OrthancPluginErrorCode (*getAllMetadata) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
851 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
852 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
853 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
854 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
855 int64_t resourceId);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
856
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
857 /* Ouput: Use OrthancPluginDatabaseAnswerString to send
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
858 the public ID of the parent (if the resource is not a patient) */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
859 OrthancPluginErrorCode (*lookupResourceAndParent) (
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
860 /* outputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
861 OrthancPluginDatabaseContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
862 uint8_t* isExisting,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
863 int64_t* id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
864 OrthancPluginResourceType* type,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
865
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
866 /* inputs */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
867 void* payload,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
868 const char* publicId);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
869
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
870 } OrthancPluginDatabaseExtensions;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
871
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
872 /*<! @endcond */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
873
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
874
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
875 typedef struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
876 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
877 OrthancPluginDatabaseContext** result;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
878 const OrthancPluginDatabaseBackend* backend;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
879 void* payload;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
880 } _OrthancPluginRegisterDatabaseBackend;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
881
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
882 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
883 * Register a custom database back-end (for legacy plugins).
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
884 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
885 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
886 * @param backend The callbacks of the custom database engine.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
887 * @param payload Pointer containing private information for the database engine.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
888 * @return The context of the database engine (it must not be manually freed).
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
889 * @ingroup Callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
890 * @deprecated
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
891 * @see OrthancPluginRegisterDatabaseBackendV2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
892 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
893 ORTHANC_PLUGIN_INLINE OrthancPluginDatabaseContext* OrthancPluginRegisterDatabaseBackend(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
894 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
895 const OrthancPluginDatabaseBackend* backend,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
896 void* payload)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
897 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
898 OrthancPluginDatabaseContext* result = NULL;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
899 _OrthancPluginRegisterDatabaseBackend params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
900
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
901 if (sizeof(int32_t) != sizeof(_OrthancPluginDatabaseAnswerType))
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
902 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
903 return NULL;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
904 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
905
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
906 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
907 params.backend = backend;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
908 params.result = &result;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
909 params.payload = payload;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
910
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
911 if (context->InvokeService(context, _OrthancPluginService_RegisterDatabaseBackend, &params) ||
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
912 result == NULL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
913 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
914 /* Error */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
915 return NULL;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
916 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
917 else
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
918 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
919 return result;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
920 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
921 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
922
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
923
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
924 typedef struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
925 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
926 OrthancPluginDatabaseContext** result;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
927 const OrthancPluginDatabaseBackend* backend;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
928 void* payload;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
929 const OrthancPluginDatabaseExtensions* extensions;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
930 uint32_t extensionsSize;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
931 } _OrthancPluginRegisterDatabaseBackendV2;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
932
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
933
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
934 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
935 * Register a custom database back-end.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
936 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
937 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
938 * @param backend The callbacks of the custom database engine.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
939 * @param payload Pointer containing private information for the database engine.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
940 * @param extensions Extensions to the base database SDK that was shipped until Orthanc 0.9.3.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
941 * @return The context of the database engine (it must not be manually freed).
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
942 * @ingroup Callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
943 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
944 ORTHANC_PLUGIN_INLINE OrthancPluginDatabaseContext* OrthancPluginRegisterDatabaseBackendV2(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
945 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
946 const OrthancPluginDatabaseBackend* backend,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
947 const OrthancPluginDatabaseExtensions* extensions,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
948 void* payload)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
949 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
950 OrthancPluginDatabaseContext* result = NULL;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
951 _OrthancPluginRegisterDatabaseBackendV2 params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
952
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
953 if (sizeof(int32_t) != sizeof(_OrthancPluginDatabaseAnswerType))
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
954 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
955 return NULL;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
956 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
957
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
958 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
959 params.backend = backend;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
960 params.result = &result;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
961 params.payload = payload;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
962 params.extensions = extensions;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
963 params.extensionsSize = sizeof(OrthancPluginDatabaseExtensions);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
964
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
965 if (context->InvokeService(context, _OrthancPluginService_RegisterDatabaseBackendV2, &params) ||
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
966 result == NULL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
967 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
968 /* Error */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
969 return NULL;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
970 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
971 else
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
972 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
973 return result;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
974 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
975 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
976
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
977
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
978
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
979 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
980 * New interface starting with Orthanc 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
981 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
982
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
983 /*<! @cond Doxygen_Suppress */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
984 typedef enum
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
985 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
986 OrthancPluginDatabaseTransactionType_ReadOnly = 1,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
987 OrthancPluginDatabaseTransactionType_ReadWrite = 2,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
988 OrthancPluginDatabaseTransactionType_INTERNAL = 0x7fffffff
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
989 } OrthancPluginDatabaseTransactionType;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
990
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
991
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
992 typedef enum
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
993 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
994 OrthancPluginDatabaseEventType_DeletedAttachment = 1,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
995 OrthancPluginDatabaseEventType_DeletedResource = 2,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
996 OrthancPluginDatabaseEventType_RemainingAncestor = 3,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
997 OrthancPluginDatabaseEventType_INTERNAL = 0x7fffffff
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
998 } OrthancPluginDatabaseEventType;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
999
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1000
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1001 typedef struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1002 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1003 OrthancPluginDatabaseEventType type;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1004
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1005 union
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1006 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1007 struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1008 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1009 /* For ""DeletedResource" and "RemainingAncestor" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1010 OrthancPluginResourceType level;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1011 const char* publicId;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1012 } resource;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1013
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1014 /* For "DeletedAttachment" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1015 OrthancPluginAttachment attachment;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1016
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1017 } content;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1018
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1019 } OrthancPluginDatabaseEvent;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1022 typedef struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1023 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1024 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1025 * Functions to read the answers inside a transaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1026 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1027
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1028 OrthancPluginErrorCode (*readAnswersCount) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1029 uint32_t* target /* out */);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1030
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1031 OrthancPluginErrorCode (*readAnswerAttachment) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1032 OrthancPluginAttachment* target /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1033 uint32_t index);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1034
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1035 OrthancPluginErrorCode (*readAnswerChange) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1036 OrthancPluginChange* target /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1037 uint32_t index);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1038
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1039 OrthancPluginErrorCode (*readAnswerDicomTag) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1040 uint16_t* group,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1041 uint16_t* element,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1042 const char** value,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1043 uint32_t index);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1044
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1045 OrthancPluginErrorCode (*readAnswerExportedResource) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1046 OrthancPluginExportedResource* target /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1047 uint32_t index);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1048
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1049 OrthancPluginErrorCode (*readAnswerInt32) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1050 int32_t* target /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1051 uint32_t index);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1052
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1053 OrthancPluginErrorCode (*readAnswerInt64) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1054 int64_t* target /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1055 uint32_t index);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1056
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1057 OrthancPluginErrorCode (*readAnswerMatchingResource) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1058 OrthancPluginMatchingResource* target /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1059 uint32_t index);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1060
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1061 OrthancPluginErrorCode (*readAnswerMetadata) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1062 int32_t* metadata /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1063 const char** value /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1064 uint32_t index);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1065
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1066 OrthancPluginErrorCode (*readAnswerString) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1067 const char** target /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1068 uint32_t index);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1069
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1070 OrthancPluginErrorCode (*readEventsCount) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1071 uint32_t* target /* out */);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1072
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1073 OrthancPluginErrorCode (*readEvent) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1074 OrthancPluginDatabaseEvent* event /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1075 uint32_t index);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1076
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1077
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1078
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1079 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1080 * Functions to access the global database object
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1081 * (cf. "IDatabaseWrapper" class in Orthanc)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1082 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1083
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1084 OrthancPluginErrorCode (*open) (void* database);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1085
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1086 OrthancPluginErrorCode (*close) (void* database);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1087
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1088 OrthancPluginErrorCode (*destructDatabase) (void* database);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1089
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1090 OrthancPluginErrorCode (*getDatabaseVersion) (void* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1091 uint32_t* target /* out */);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1092
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1093 OrthancPluginErrorCode (*hasRevisionsSupport) (void* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1094 uint8_t* target /* out */);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1095
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1096 OrthancPluginErrorCode (*upgradeDatabase) (void* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1097 OrthancPluginStorageArea* storageArea,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1098 uint32_t targetVersion);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1099
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1100 OrthancPluginErrorCode (*startTransaction) (void* database,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1101 OrthancPluginDatabaseTransaction** target /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1102 OrthancPluginDatabaseTransactionType type);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1103
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1104 OrthancPluginErrorCode (*destructTransaction) (OrthancPluginDatabaseTransaction* transaction);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1105
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1106
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1107 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1108 * Functions to run operations within a database transaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1109 * (cf. "IDatabaseWrapper::ITransaction" class in Orthanc)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1110 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1111
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1112 OrthancPluginErrorCode (*rollback) (OrthancPluginDatabaseTransaction* transaction);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1113
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1114 OrthancPluginErrorCode (*commit) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1115 int64_t fileSizeDelta);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1116
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1117 /* A call to "addAttachment()" guarantees that this attachment is not already existing ("INSERT") */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1118 OrthancPluginErrorCode (*addAttachment) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1119 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1120 const OrthancPluginAttachment* attachment,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1121 int64_t revision);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1122
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1123 OrthancPluginErrorCode (*clearChanges) (OrthancPluginDatabaseTransaction* transaction);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1124
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1125 OrthancPluginErrorCode (*clearExportedResources) (OrthancPluginDatabaseTransaction* transaction);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1126
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1127 OrthancPluginErrorCode (*clearMainDicomTags) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1128 int64_t resourceId);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1129
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1130 OrthancPluginErrorCode (*createInstance) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1131 OrthancPluginCreateInstanceResult* target /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1132 const char* hashPatient,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1133 const char* hashStudy,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1134 const char* hashSeries,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1135 const char* hashInstance);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1136
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1137 OrthancPluginErrorCode (*deleteAttachment) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1138 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1139 int32_t contentType);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1140
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1141 OrthancPluginErrorCode (*deleteMetadata) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1142 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1143 int32_t metadataType);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1144
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1145 OrthancPluginErrorCode (*deleteResource) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1146 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1147
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1148 /* Answers are read using "readAnswerMetadata()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1149 OrthancPluginErrorCode (*getAllMetadata) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1150 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1151
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1152 /* Answers are read using "readAnswerString()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1153 OrthancPluginErrorCode (*getAllPublicIds) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1154 OrthancPluginResourceType resourceType);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1155
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1156 /* Answers are read using "readAnswerString()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1157 OrthancPluginErrorCode (*getAllPublicIdsWithLimit) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1158 OrthancPluginResourceType resourceType,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1159 uint64_t since,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1160 uint64_t limit);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1161
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1162 /* Answers are read using "readAnswerChange()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1163 OrthancPluginErrorCode (*getChanges) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1164 uint8_t* targetDone /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1165 int64_t since,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1166 uint32_t maxResults);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1167
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1168 /* Answers are read using "readAnswerInt64()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1169 OrthancPluginErrorCode (*getChildrenInternalId) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1170 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1171
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1172 /* Answers are read using "readAnswerString()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1173 OrthancPluginErrorCode (*getChildrenMetadata) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1174 int64_t resourceId,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1175 int32_t metadata);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1176
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1177 /* Answers are read using "readAnswerString()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1178 OrthancPluginErrorCode (*getChildrenPublicId) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1179 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1180
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1181 /* Answers are read using "readAnswerExportedResource()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1182 OrthancPluginErrorCode (*getExportedResources) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1183 uint8_t* targetDone /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1184 int64_t since,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1185 uint32_t maxResults);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1186
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1187 /* Answer is read using "readAnswerChange()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1188 OrthancPluginErrorCode (*getLastChange) (OrthancPluginDatabaseTransaction* transaction);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1189
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1190 OrthancPluginErrorCode (*getLastChangeIndex) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1191 int64_t* target /* out */);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1192
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1193 /* Answer is read using "readAnswerExportedResource()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1194 OrthancPluginErrorCode (*getLastExportedResource) (OrthancPluginDatabaseTransaction* transaction);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1195
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1196 /* Answers are read using "readAnswerDicomTag()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1197 OrthancPluginErrorCode (*getMainDicomTags) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1198 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1199
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1200 /* Answer is read using "readAnswerString()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1201 OrthancPluginErrorCode (*getPublicId) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1202 int64_t internalId);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1203
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1204 OrthancPluginErrorCode (*getResourcesCount) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1205 uint64_t* target /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1206 OrthancPluginResourceType resourceType);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1207
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1208 OrthancPluginErrorCode (*getResourceType) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1209 OrthancPluginResourceType* target /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1210 uint64_t resourceId);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1211
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1212 OrthancPluginErrorCode (*getTotalCompressedSize) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1213 uint64_t* target /* out */);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1214
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1215 OrthancPluginErrorCode (*getTotalUncompressedSize) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1216 uint64_t* target /* out */);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1217
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1218 OrthancPluginErrorCode (*isDiskSizeAbove) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1219 uint8_t* target /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1220 uint64_t threshold);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1221
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1222 OrthancPluginErrorCode (*isExistingResource) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1223 uint8_t* target /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1224 int64_t resourceId);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1225
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1226 OrthancPluginErrorCode (*isProtectedPatient) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1227 uint8_t* target /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1228 int64_t resourceId);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1229
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1230 /* Answers are read using "readAnswerInt32()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1231 OrthancPluginErrorCode (*listAvailableAttachments) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1232 int64_t internalId);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1233
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1234 OrthancPluginErrorCode (*logChange) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1235 int32_t changeType,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1236 int64_t resourceId,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1237 OrthancPluginResourceType resourceType,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1238 const char* date);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1239
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1240 OrthancPluginErrorCode (*logExportedResource) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1241 OrthancPluginResourceType resourceType,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1242 const char* publicId,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1243 const char* modality,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1244 const char* date,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1245 const char* patientId,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1246 const char* studyInstanceUid,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1247 const char* seriesInstanceUid,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1248 const char* sopInstanceUid);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1249
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1250 /* Answer is read using "readAnswerAttachment()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1251 OrthancPluginErrorCode (*lookupAttachment) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1252 int64_t* revision /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1253 int64_t resourceId,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1254 int32_t contentType);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1255
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1256 /* Answer is read using "readAnswerString()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1257 OrthancPluginErrorCode (*lookupGlobalProperty) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1258 const char* serverIdentifier,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1259 int32_t property);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1260
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1261 /* Answer is read using "readAnswerString()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1262 OrthancPluginErrorCode (*lookupMetadata) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1263 int64_t* revision /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1264 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1265 int32_t metadata);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1266
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1267 OrthancPluginErrorCode (*lookupParent) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1268 uint8_t* isExisting /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1269 int64_t* parentId /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1270 int64_t id);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1271
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1272 OrthancPluginErrorCode (*lookupResource) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1273 uint8_t* isExisting /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1274 int64_t* id /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1275 OrthancPluginResourceType* type /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1276 const char* publicId);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1277
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1278 /* Answers are read using "readAnswerMatchingResource()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1279 OrthancPluginErrorCode (*lookupResources) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1280 uint32_t constraintsCount,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1281 const OrthancPluginDatabaseConstraint* constraints,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1282 OrthancPluginResourceType queryLevel,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1283 uint32_t limit,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1284 uint8_t requestSomeInstanceId);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1285
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1286 /* The public ID of the parent resource is read using "readAnswerString()" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1287 OrthancPluginErrorCode (*lookupResourceAndParent) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1288 uint8_t* isExisting /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1289 int64_t* id /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1290 OrthancPluginResourceType* type /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1291 const char* publicId);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1292
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1293 OrthancPluginErrorCode (*selectPatientToRecycle) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1294 uint8_t* patientAvailable /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1295 int64_t* patientId /* out */);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1296
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1297 OrthancPluginErrorCode (*selectPatientToRecycle2) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1298 uint8_t* patientAvailable /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1299 int64_t* patientId /* out */,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1300 int64_t patientIdToAvoid);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1301
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1302 OrthancPluginErrorCode (*setGlobalProperty) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1303 const char* serverIdentifier,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1304 int32_t property,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1305 const char* value);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1306
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1307 /* In "setMetadata()", the metadata might already be existing ("INSERT OR REPLACE") */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1308 OrthancPluginErrorCode (*setMetadata) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1309 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1310 int32_t metadata,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1311 const char* value,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1312 int64_t revision);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1313
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1314 OrthancPluginErrorCode (*setProtectedPatient) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1315 int64_t id,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1316 uint8_t isProtected);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1317
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1318 OrthancPluginErrorCode (*setResourcesContent) (OrthancPluginDatabaseTransaction* transaction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1319 uint32_t countIdentifierTags,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1320 const OrthancPluginResourcesContentTags* identifierTags,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1321 uint32_t countMainDicomTags,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1322 const OrthancPluginResourcesContentTags* mainDicomTags,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1323 uint32_t countMetadata,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1324 const OrthancPluginResourcesContentMetadata* metadata);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1325
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1326
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1327 } OrthancPluginDatabaseBackendV3;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1328
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1329 /*<! @endcond */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1330
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1331
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1332 typedef struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1333 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1334 const OrthancPluginDatabaseBackendV3* backend;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1335 uint32_t backendSize;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1336 uint32_t maxDatabaseRetries;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1337 void* database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1338 } _OrthancPluginRegisterDatabaseBackendV3;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1339
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1340
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1341 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDatabaseBackendV3(
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1342 OrthancPluginContext* context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1343 const OrthancPluginDatabaseBackendV3* backend,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1344 uint32_t backendSize,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1345 uint32_t maxDatabaseRetries, /* To handle "OrthancPluginErrorCode_DatabaseCannotSerialize" */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1346 void* database)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1347 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1348 _OrthancPluginRegisterDatabaseBackendV3 params;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1349
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1350 if (sizeof(int32_t) != sizeof(_OrthancPluginDatabaseAnswerType))
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1351 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1352 return OrthancPluginErrorCode_Plugin;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1353 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1354
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1355 memset(&params, 0, sizeof(params));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1356 params.backend = backend;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1357 params.backendSize = sizeof(OrthancPluginDatabaseBackendV3);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1358 params.maxDatabaseRetries = maxDatabaseRetries;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1359 params.database = database;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1360
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1361 return context->InvokeService(context, _OrthancPluginService_RegisterDatabaseBackendV3, &params);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1362 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1363
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1364 #ifdef __cplusplus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1365 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1366 #endif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1367
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1368
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1369 /** @} */
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1370