Mercurial > hg > orthanc
annotate Plugins/Include/orthanc/OrthancCPlugin.h @ 1596:f2e3d030ea59
BadJson error code
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 27 Aug 2015 15:36:43 +0200 |
parents | e1e54a73ba8b |
children | c6b50b803387 |
rev | line source |
---|---|
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
1 /** |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
2 * \mainpage |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
3 * |
907 | 4 * This C/C++ SDK allows external developers to create plugins that |
5 * can be loaded into Orthanc to extend its functionality. Each | |
6 * Orthanc plugin must expose 4 public functions with the following | |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
7 * signatures: |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
8 * |
907 | 9 * -# <tt>int32_t OrthancPluginInitialize(const OrthancPluginContext* context)</tt>: |
10 * This function is invoked by Orthanc when it loads the plugin on startup. | |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
11 * The plugin must: |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
12 * - Check its compatibility with the Orthanc version using |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
13 * ::OrthancPluginCheckVersion(). |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
14 * - Store the context pointer so that it can use the plugin |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
15 * services of Orthanc. |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
16 * - Register all its REST callbacks using ::OrthancPluginRegisterRestCallback(). |
1466
0cd0f2ad3599
Fix potential deadlock in the callbacks of plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1430
diff
changeset
|
17 * - Possibly register its callback for received DICOM instances using ::OrthancPluginRegisterOnStoredInstanceCallback(). |
0cd0f2ad3599
Fix potential deadlock in the callbacks of plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1430
diff
changeset
|
18 * - Possibly register its callback for changes to the DICOM store using ::OrthancPluginRegisterOnChangeCallback(). |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
19 * - Possibly register a custom storage area using ::OrthancPluginRegisterStorageArea(). |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
20 * - Possibly register a custom database back-end area using OrthancPluginRegisterDatabaseBackend(). |
907 | 21 * -# <tt>void OrthancPluginFinalize()</tt>: |
22 * This function is invoked by Orthanc during its shutdown. The plugin | |
23 * must free all its memory. | |
24 * -# <tt>const char* OrthancPluginGetName()</tt>: | |
25 * The plugin must return a short string to identify itself. | |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
26 * -# <tt>const char* OrthancPluginGetVersion()</tt>: |
907 | 27 * The plugin must return a string containing its version number. |
28 * | |
29 * The name and the version of a plugin is only used to prevent it | |
30 * from being loaded twice. | |
31 * | |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
32 * To ensure multi-threading safety, the various REST callbacks are |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
33 * guaranteed to be executed in mutual exclusion since Orthanc |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
34 * 0.8.5. If this feature is undesired (notably when developing |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
35 * high-performance plugins handling simultaneous requests), use |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
36 * ::OrthancPluginRegisterRestCallbackNoLock(). |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
37 **/ |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
38 |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
39 |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
40 |
900 | 41 /** |
42 * @defgroup CInterface C Interface | |
43 * @brief The C interface to create Orthanc plugins. | |
44 * | |
45 * These functions must be used to create C plugins for Orthanc. | |
46 **/ | |
47 | |
48 | |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
49 |
886 | 50 /** |
51 * Orthanc - A Lightweight, RESTful DICOM Store | |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1282
diff
changeset
|
52 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics |
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1282
diff
changeset
|
53 * Department, University Hospital of Liege, Belgium |
886 | 54 * |
55 * This program is free software: you can redistribute it and/or | |
56 * modify it under the terms of the GNU General Public License as | |
57 * published by the Free Software Foundation, either version 3 of the | |
58 * License, or (at your option) any later version. | |
59 * | |
60 * In addition, as a special exception, the copyright holders of this | |
61 * program give permission to link the code of its release with the | |
62 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
63 * that use the same license as the "OpenSSL" library), and distribute | |
64 * the linked executables. You must obey the GNU General Public License | |
65 * in all respects for all of the code used other than "OpenSSL". If you | |
66 * modify file(s) with this exception, you may extend this exception to | |
67 * your version of the file(s), but you are not obligated to do so. If | |
68 * you do not wish to do so, delete this exception statement from your | |
69 * version. If you delete this exception statement from all source files | |
70 * in the program, then also delete it here. | |
71 * | |
72 * This program is distributed in the hope that it will be useful, but | |
73 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
74 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
75 * General Public License for more details. | |
76 * | |
77 * You should have received a copy of the GNU General Public License | |
78 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
79 **/ | |
80 | |
81 | |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
82 |
886 | 83 #pragma once |
84 | |
85 | |
900 | 86 #include <stdio.h> |
87 #include <string.h> | |
88 | |
886 | 89 #ifdef WIN32 |
90 #define ORTHANC_PLUGINS_API __declspec(dllexport) | |
91 #else | |
92 #define ORTHANC_PLUGINS_API | |
93 #endif | |
94 | |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
95 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 0 |
1407
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
96 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 9 |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
97 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 4 |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
98 |
886 | 99 |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
100 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
101 /******************************************************************** |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
102 ** Check that function inlining is properly supported. The use of |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
103 ** inlining is required, to avoid the duplication of object code |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
104 ** between two compilation modules that would use the Orthanc Plugin |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
105 ** API. |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
106 ********************************************************************/ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
107 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
108 /* If the auto-detection of the "inline" keyword below does not work |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
109 automatically and that your compiler is known to properly support |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
110 inlining, uncomment the following #define and adapt the definition |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
111 of "static inline". */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
112 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
113 /* #define ORTHANC_PLUGIN_INLINE static inline */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
114 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
115 #ifndef ORTHANC_PLUGIN_INLINE |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
116 # if __STDC_VERSION__ >= 199901L |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
117 /* This is C99 or above: http://predef.sourceforge.net/prestd.html */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
118 # define ORTHANC_PLUGIN_INLINE static inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
119 # elif defined(__cplusplus) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
120 /* This is C++ */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
121 # define ORTHANC_PLUGIN_INLINE static inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
122 # elif defined(__GNUC__) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
123 /* This is GCC running in C89 mode */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
124 # define ORTHANC_PLUGIN_INLINE static __inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
125 # elif defined(_MSC_VER) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
126 /* This is Visual Studio running in C89 mode */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
127 # define ORTHANC_PLUGIN_INLINE static __inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
128 # else |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
129 # error Your compiler is not known to support the "inline" keyword |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
130 # endif |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
131 #endif |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
132 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
133 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
134 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
135 /******************************************************************** |
907 | 136 ** Inclusion of standard libraries. |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
137 ********************************************************************/ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
138 |
1322
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1313
diff
changeset
|
139 /** |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1313
diff
changeset
|
140 * For Microsoft Visual Studio, a compatibility "stdint.h" can be |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1313
diff
changeset
|
141 * downloaded at the following URL: |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1313
diff
changeset
|
142 * https://orthanc.googlecode.com/hg/Resources/ThirdParty/VisualStudio/stdint.h |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1313
diff
changeset
|
143 **/ |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
144 #include <stdint.h> |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
145 |
886 | 146 #include <stdlib.h> |
147 | |
148 | |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
149 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
150 /******************************************************************** |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
151 ** Definition of the Orthanc Plugin API. |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
152 ********************************************************************/ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
153 |
900 | 154 /** @{ */ |
155 | |
886 | 156 #ifdef __cplusplus |
157 extern "C" | |
158 { | |
159 #endif | |
160 | |
907 | 161 /** |
1578 | 162 * The various error codes that can be returned by the Orthanc core. |
163 **/ | |
164 typedef enum | |
165 { | |
1579
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
166 OrthancPluginErrorCode_InternalError = -1 /*!< Internal error */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
167 OrthancPluginErrorCode_Success = 0 /*!< Success */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
168 OrthancPluginErrorCode_Plugin = 1 /*!< Error encountered within the plugin engine */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
169 OrthancPluginErrorCode_NotImplemented = 2 /*!< Not implemented yet */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
170 OrthancPluginErrorCode_ParameterOutOfRange = 3 /*!< Parameter out of range */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
171 OrthancPluginErrorCode_NotEnoughMemory = 4 /*!< Not enough memory */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
172 OrthancPluginErrorCode_BadParameterType = 5 /*!< Bad type for a parameter */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
173 OrthancPluginErrorCode_BadSequenceOfCalls = 6 /*!< Bad sequence of calls */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
174 OrthancPluginErrorCode_InexistentItem = 7 /*!< Accessing an inexistent item */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
175 OrthancPluginErrorCode_BadRequest = 8 /*!< Bad request */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
176 OrthancPluginErrorCode_NetworkProtocol = 9 /*!< Error in the network protocol */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
177 OrthancPluginErrorCode_SystemCommand = 10 /*!< Error while calling a system command */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
178 OrthancPluginErrorCode_Database = 11 /*!< Error with the database engine */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
179 OrthancPluginErrorCode_UriSyntax = 12 /*!< Badly formatted URI */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
180 OrthancPluginErrorCode_InexistentFile = 13 /*!< Inexistent file */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
181 OrthancPluginErrorCode_CannotWriteFile = 14 /*!< Cannot write to file */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
182 OrthancPluginErrorCode_BadFileFormat = 15 /*!< Bad file format */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
183 OrthancPluginErrorCode_Timeout = 16 /*!< Timeout */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
184 OrthancPluginErrorCode_UnknownResource = 17 /*!< Unknown resource */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
185 OrthancPluginErrorCode_IncompatibleDatabaseVersion = 18 /*!< Incompatible version of the database */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
186 OrthancPluginErrorCode_FullStorage = 19 /*!< The file storage is full */, |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
187 OrthancPluginErrorCode_CorruptedFile = 20 /*!< Corrupted file (e.g. inconsistent MD5 hash) */, |
1579
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
188 OrthancPluginErrorCode_InexistentTag = 21 /*!< Inexistent tag */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
189 OrthancPluginErrorCode_ReadOnly = 22 /*!< Cannot modify a read-only data structure */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
190 OrthancPluginErrorCode_IncompatibleImageFormat = 23 /*!< Incompatible format of the images */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
191 OrthancPluginErrorCode_IncompatibleImageSize = 24 /*!< Incompatible size of the images */, |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
192 OrthancPluginErrorCode_SharedLibrary = 25 /*!< Error while using a shared library (plugin) */, |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
193 OrthancPluginErrorCode_UnknownPluginService = 26 /*!< Plugin invoking an unknown service */, |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
194 OrthancPluginErrorCode_UnknownDicomTag = 27 /*!< Unknown DICOM tag */, |
1596
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1595
diff
changeset
|
195 OrthancPluginErrorCode_BadJson = 28 /*!< Cannot parse a JSON document */, |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
196 OrthancPluginErrorCode_SQLiteNotOpened = 1000 /*!< SQLite: The database is not opened */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
197 OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001 /*!< SQLite: Connection is already open */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
198 OrthancPluginErrorCode_SQLiteCannotOpen = 1002 /*!< SQLite: Unable to open the database */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
199 OrthancPluginErrorCode_SQLiteStatementAlreadyUsed = 1003 /*!< SQLite: This cached statement is already being referred to */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
200 OrthancPluginErrorCode_SQLiteExecute = 1004 /*!< SQLite: Cannot execute a command */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
201 OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction = 1005 /*!< SQLite: Rolling back a nonexistent transaction (have you called Begin()?) */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
202 OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006 /*!< SQLite: Committing a nonexistent transaction */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
203 OrthancPluginErrorCode_SQLiteRegisterFunction = 1007 /*!< SQLite: Unable to register a function */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
204 OrthancPluginErrorCode_SQLiteFlush = 1008 /*!< SQLite: Unable to flush the database */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
205 OrthancPluginErrorCode_SQLiteCannotRun = 1009 /*!< SQLite: Cannot run a cached statement */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
206 OrthancPluginErrorCode_SQLiteCannotStep = 1010 /*!< SQLite: Cannot step over a cached statement */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
207 OrthancPluginErrorCode_SQLiteBindOutOfRange = 1011 /*!< SQLite: Bing a value while out of range (serious error) */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
208 OrthancPluginErrorCode_SQLitePrepareStatement = 1012 /*!< SQLite: Cannot prepare a cached statement */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
209 OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013 /*!< SQLite: Beginning the same transaction twice */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
210 OrthancPluginErrorCode_SQLiteTransactionCommit = 1014 /*!< SQLite: Failure when committing the transaction */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
211 OrthancPluginErrorCode_SQLiteTransactionBegin = 1015 /*!< SQLite: Cannot start a transaction */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
212 OrthancPluginErrorCode_DirectoryOverFile = 2000 /*!< The directory to be created is already occupied by a regular file */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
213 OrthancPluginErrorCode_FileStorageCannotWrite = 2001 /*!< Unable to create a subdirectory or a file in the file storage */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
214 OrthancPluginErrorCode_DirectoryExpected = 2002 /*!< The specified path does not point to a directory */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
215 OrthancPluginErrorCode_HttpPortInUse = 2003 /*!< The TCP port of the HTTP server is already in use */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
216 OrthancPluginErrorCode_DicomPortInUse = 2004 /*!< The TCP port of the DICOM server is already in use */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
217 OrthancPluginErrorCode_BadHttpStatusInRest = 2005 /*!< This HTTP status is not allowed in a REST API */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
218 OrthancPluginErrorCode_RegularFileExpected = 2006 /*!< The specified path does not point to a regular file */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
219 OrthancPluginErrorCode_PathToExecutable = 2007 /*!< Unable to get the path to the executable */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
220 OrthancPluginErrorCode_MakeDirectory = 2008 /*!< Cannot create a directory */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
221 OrthancPluginErrorCode_BadApplicationEntityTitle = 2009 /*!< An application entity title (AET) cannot be empty or be longer than 16 characters */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
222 OrthancPluginErrorCode_NoCFindHandler = 2010 /*!< No request handler factory for DICOM C-FIND SCP */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
223 OrthancPluginErrorCode_NoCMoveHandler = 2011 /*!< No request handler factory for DICOM C-MOVE SCP */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
224 OrthancPluginErrorCode_NoCStoreHandler = 2012 /*!< No request handler factory for DICOM C-STORE SCP */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
225 OrthancPluginErrorCode_NoApplicationEntityFilter = 2013 /*!< No application entity filter */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
226 OrthancPluginErrorCode_NoSopClassOrInstance = 2014 /*!< DicomUserConnection: Unable to find the SOP class and instance */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
227 OrthancPluginErrorCode_NoPresentationContext = 2015 /*!< DicomUserConnection: No acceptable presentation context for modality */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
228 OrthancPluginErrorCode_DicomFindUnavailable = 2016 /*!< DicomUserConnection: The C-FIND command is not supported by the remote SCP */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
229 OrthancPluginErrorCode_DicomMoveUnavailable = 2017 /*!< DicomUserConnection: The C-MOVE command is not supported by the remote SCP */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
230 OrthancPluginErrorCode_CannotStoreInstance = 2018 /*!< Cannot store an instance */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
231 OrthancPluginErrorCode_CreateDicomNotString = 2019 /*!< Only string values are supported when creating DICOM instances */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
232 OrthancPluginErrorCode_CreateDicomOverrideTag = 2020 /*!< Trying to override a value inherited from a parent module */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
233 OrthancPluginErrorCode_CreateDicomUseContent = 2021 /*!< Use \"Content\" to inject an image into a new DICOM instance */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
234 OrthancPluginErrorCode_CreateDicomNoPayload = 2022 /*!< No payload is present for one instance in the series */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
235 OrthancPluginErrorCode_CreateDicomUseDataUriScheme = 2023 /*!< The payload of the DICOM instance must be specified according to Data URI scheme */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
236 OrthancPluginErrorCode_CreateDicomBadParent = 2024 /*!< Trying to attach a new DICOM instance to an inexistent resource */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
237 OrthancPluginErrorCode_CreateDicomParentIsInstance = 2025 /*!< Trying to attach a new DICOM instance to an instance (must be a series, study or patient) */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
238 OrthancPluginErrorCode_CreateDicomParentEncoding = 2026 /*!< Unable to get the encoding of the parent resource */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
239 OrthancPluginErrorCode_UnknownModality = 2027 /*!< Unknown modality */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
240 OrthancPluginErrorCode_BadJobOrdering = 2028 /*!< Bad ordering of filters in a job */, |
1583
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
241 OrthancPluginErrorCode_JsonToLuaTable = 2029 /*!< Cannot convert the given JSON object to a Lua table */, |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
242 OrthancPluginErrorCode_CannotCreateLua = 2030 /*!< Cannot create the Lua context */, |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
243 OrthancPluginErrorCode_CannotExecuteLua = 2031 /*!< Cannot execute a Lua command */, |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
244 OrthancPluginErrorCode_LuaAlreadyExecuted = 2032 /*!< Arguments cannot be pushed after the Lua function is executed */, |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
245 OrthancPluginErrorCode_LuaBadOutput = 2033 /*!< The Lua function does not give the expected number of outputs */, |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
246 OrthancPluginErrorCode_NotLuaPredicate = 2034 /*!< The Lua function is not a predicate (only true/false outputs allowed) */, |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
247 OrthancPluginErrorCode_LuaReturnsNoString = 2035 /*!< The Lua function does not return a string */, |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
248 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
249 _OrthancPluginErrorCode_INTERNAL = 0x7fffffff |
1578 | 250 } OrthancPluginErrorCode; |
251 | |
252 | |
253 /** | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
254 * Forward declaration of one of the mandatory functions for Orthanc |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
255 * plugins. |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
256 **/ |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
257 ORTHANC_PLUGINS_API const char* OrthancPluginGetName(); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
258 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
259 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
260 /** |
907 | 261 * The various HTTP methods for a REST call. |
262 **/ | |
894 | 263 typedef enum |
264 { | |
907 | 265 OrthancPluginHttpMethod_Get = 1, /*!< GET request */ |
266 OrthancPluginHttpMethod_Post = 2, /*!< POST request */ | |
267 OrthancPluginHttpMethod_Put = 3, /*!< PUT request */ | |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
268 OrthancPluginHttpMethod_Delete = 4, /*!< DELETE request */ |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
269 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
270 _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff |
896 | 271 } OrthancPluginHttpMethod; |
886 | 272 |
907 | 273 |
274 /** | |
275 * @brief The parameters of a REST request. | |
276 **/ | |
899 | 277 typedef struct |
278 { | |
907 | 279 /** |
280 * @brief The HTTP method. | |
281 **/ | |
282 OrthancPluginHttpMethod method; | |
899 | 283 |
907 | 284 /** |
285 * @brief The number of groups of the regular expression. | |
286 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
287 uint32_t groupsCount; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
288 |
907 | 289 /** |
290 * @brief The matched values for the groups of the regular expression. | |
291 **/ | |
292 const char* const* groups; | |
293 | |
294 /** | |
295 * @brief For a GET request, the number of GET parameters. | |
296 **/ | |
899 | 297 uint32_t getCount; |
298 | |
907 | 299 /** |
300 * @brief For a GET request, the keys of the GET parameters. | |
301 **/ | |
302 const char* const* getKeys; | |
303 | |
304 /** | |
305 * @brief For a GET request, the values of the GET parameters. | |
306 **/ | |
307 const char* const* getValues; | |
308 | |
309 /** | |
310 * @brief For a PUT or POST request, the content of the body. | |
311 **/ | |
899 | 312 const char* body; |
907 | 313 |
314 /** | |
315 * @brief For a PUT or POST request, the number of bytes of the body. | |
316 **/ | |
899 | 317 uint32_t bodySize; |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
318 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
319 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
320 /* -------------------------------------------------- |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
321 New in version 0.8.1 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
322 -------------------------------------------------- */ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
323 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
324 /** |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
325 * @brief The number of HTTP headers. |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
326 **/ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
327 uint32_t headersCount; |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
328 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
329 /** |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
330 * @brief The keys of the HTTP headers (always converted to low-case). |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
331 **/ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
332 const char* const* headersKeys; |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
333 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
334 /** |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
335 * @brief The values of the HTTP headers. |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
336 **/ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
337 const char* const* headersValues; |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
338 |
899 | 339 } OrthancPluginHttpRequest; |
340 | |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
341 |
900 | 342 typedef enum |
886 | 343 { |
900 | 344 /* Generic services */ |
907 | 345 _OrthancPluginService_LogInfo = 1, |
346 _OrthancPluginService_LogWarning = 2, | |
347 _OrthancPluginService_LogError = 3, | |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
348 _OrthancPluginService_GetOrthancPath = 4, |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
349 _OrthancPluginService_GetOrthancDirectory = 5, |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
350 _OrthancPluginService_GetConfigurationPath = 6, |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
351 _OrthancPluginService_SetPluginProperty = 7, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
352 _OrthancPluginService_GetGlobalProperty = 8, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
353 _OrthancPluginService_SetGlobalProperty = 9, |
1280
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
354 _OrthancPluginService_GetCommandLineArgumentsCount = 10, |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
355 _OrthancPluginService_GetCommandLineArgument = 11, |
1407
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
356 _OrthancPluginService_GetExpectedDatabaseVersion = 12, |
1424
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
357 _OrthancPluginService_GetConfiguration = 13, |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
358 _OrthancPluginService_BufferCompression = 14, |
1588
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
359 _OrthancPluginService_ReadFile = 15, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
360 _OrthancPluginService_WriteFile = 16, |
1593
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
361 _OrthancPluginService_GetErrorDescription = 17, |
900 | 362 |
363 /* Registration of callbacks */ | |
907 | 364 _OrthancPluginService_RegisterRestCallback = 1000, |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
365 _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001, |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
366 _OrthancPluginService_RegisterStorageArea = 1002, |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
367 _OrthancPluginService_RegisterOnChangeCallback = 1003, |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
368 _OrthancPluginService_RegisterRestCallbackNoLock = 1004, |
900 | 369 |
370 /* Sending answers to REST calls */ | |
907 | 371 _OrthancPluginService_AnswerBuffer = 2000, |
372 _OrthancPluginService_CompressAndAnswerPngImage = 2001, | |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
373 _OrthancPluginService_Redirect = 2002, |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
374 _OrthancPluginService_SendHttpStatusCode = 2003, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
375 _OrthancPluginService_SendUnauthorized = 2004, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
376 _OrthancPluginService_SendMethodNotAllowed = 2005, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
377 _OrthancPluginService_SetCookie = 2006, |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
378 _OrthancPluginService_SetHttpHeader = 2007, |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
379 _OrthancPluginService_StartMultipartAnswer = 2008, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
380 _OrthancPluginService_SendMultipartItem = 2009, |
1593
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
381 _OrthancPluginService_SendHttpStatus = 2010, |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
382 |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
383 /* Access to the Orthanc database and API */ |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
384 _OrthancPluginService_GetDicomForInstance = 3000, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
385 _OrthancPluginService_RestApiGet = 3001, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
386 _OrthancPluginService_RestApiPost = 3002, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
387 _OrthancPluginService_RestApiDelete = 3003, |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
388 _OrthancPluginService_RestApiPut = 3004, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
389 _OrthancPluginService_LookupPatient = 3005, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
390 _OrthancPluginService_LookupStudy = 3006, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
391 _OrthancPluginService_LookupSeries = 3007, |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
392 _OrthancPluginService_LookupInstance = 3008, |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
393 _OrthancPluginService_LookupStudyWithAccessionNumber = 3009, |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
394 _OrthancPluginService_RestApiGetAfterPlugins = 3010, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
395 _OrthancPluginService_RestApiPostAfterPlugins = 3011, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
396 _OrthancPluginService_RestApiDeleteAfterPlugins = 3012, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
397 _OrthancPluginService_RestApiPutAfterPlugins = 3013, |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
398 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
399 /* Access to DICOM instances */ |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
400 _OrthancPluginService_GetInstanceRemoteAet = 4000, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
401 _OrthancPluginService_GetInstanceSize = 4001, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
402 _OrthancPluginService_GetInstanceData = 4002, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
403 _OrthancPluginService_GetInstanceJson = 4003, |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
404 _OrthancPluginService_GetInstanceSimplifiedJson = 4004, |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
405 _OrthancPluginService_HasInstanceMetadata = 4005, |
1309
8f4487d8f79e
new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1303
diff
changeset
|
406 _OrthancPluginService_GetInstanceMetadata = 4006, |
8f4487d8f79e
new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1303
diff
changeset
|
407 |
8f4487d8f79e
new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1303
diff
changeset
|
408 /* Services for plugins implementing a database back-end */ |
8f4487d8f79e
new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1303
diff
changeset
|
409 _OrthancPluginService_RegisterDatabaseBackend = 5000, |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
410 _OrthancPluginService_DatabaseAnswer = 5001, |
1309
8f4487d8f79e
new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1303
diff
changeset
|
411 |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
412 _OrthancPluginService_INTERNAL = 0x7fffffff |
907 | 413 } _OrthancPluginService; |
900 | 414 |
415 | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
416 typedef enum |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
417 { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
418 _OrthancPluginProperty_Description = 1, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
419 _OrthancPluginProperty_RootUri = 2, |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
420 _OrthancPluginProperty_OrthancExplorer = 3, |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
421 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
422 _OrthancPluginProperty_INTERNAL = 0x7fffffff |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
423 } _OrthancPluginProperty; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
424 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
425 |
900 | 426 |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
427 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
428 * The memory layout of the pixels of an image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
429 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
430 typedef enum |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
431 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
432 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
433 * @brief Graylevel 8bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
434 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
435 * The image is graylevel. Each pixel is unsigned and stored in |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
436 * one byte. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
437 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
438 OrthancPluginPixelFormat_Grayscale8 = 1, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
439 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
440 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
441 * @brief Graylevel, unsigned 16bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
442 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
443 * The image is graylevel. Each pixel is unsigned and stored in |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
444 * two bytes. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
445 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
446 OrthancPluginPixelFormat_Grayscale16 = 2, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
447 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
448 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
449 * @brief Graylevel, signed 16bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
450 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
451 * The image is graylevel. Each pixel is signed and stored in two |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
452 * bytes. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
453 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
454 OrthancPluginPixelFormat_SignedGrayscale16 = 3, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
455 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
456 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
457 * @brief Color image in RGB24 format. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
458 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
459 * This format describes a color image. The pixels are stored in 3 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
460 * consecutive bytes. The memory layout is RGB. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
461 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
462 OrthancPluginPixelFormat_RGB24 = 4, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
463 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
464 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
465 * @brief Color image in RGBA32 format. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
466 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
467 * This format describes a color image. The pixels are stored in 4 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
468 * consecutive bytes. The memory layout is RGBA. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
469 **/ |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
470 OrthancPluginPixelFormat_RGBA32 = 5, |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
471 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
472 _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
473 } OrthancPluginPixelFormat; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
474 |
894 | 475 |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
476 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
477 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
478 * The content types that are supported by Orthanc plugins. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
479 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
480 typedef enum |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
481 { |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
482 OrthancPluginContentType_Unknown = 0, /*!< Unknown content type */ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
483 OrthancPluginContentType_Dicom = 1, /*!< DICOM */ |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
484 OrthancPluginContentType_DicomAsJson = 2, /*!< JSON summary of a DICOM file */ |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
485 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
486 _OrthancPluginContentType_INTERNAL = 0x7fffffff |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
487 } OrthancPluginContentType; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
488 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
489 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
490 |
907 | 491 /** |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
492 * The supported types of DICOM resources. |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
493 **/ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
494 typedef enum |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
495 { |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
496 OrthancPluginResourceType_Patient = 0, /*!< Patient */ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
497 OrthancPluginResourceType_Study = 1, /*!< Study */ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
498 OrthancPluginResourceType_Series = 2, /*!< Series */ |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
499 OrthancPluginResourceType_Instance = 3, /*!< Instance */ |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
500 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
501 _OrthancPluginResourceType_INTERNAL = 0x7fffffff |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
502 } OrthancPluginResourceType; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
503 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
504 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
505 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
506 /** |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
507 * The supported types of changes that can happen to DICOM resources. |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
508 **/ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
509 typedef enum |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
510 { |
1198 | 511 OrthancPluginChangeType_CompletedSeries = 0, /*!< Series is now complete */ |
512 OrthancPluginChangeType_Deleted = 1, /*!< Deleted resource */ | |
513 OrthancPluginChangeType_NewChildInstance = 2, /*!< A new instance was added to this resource */ | |
514 OrthancPluginChangeType_NewInstance = 3, /*!< New instance received */ | |
515 OrthancPluginChangeType_NewPatient = 4, /*!< New patient created */ | |
516 OrthancPluginChangeType_NewSeries = 5, /*!< New series created */ | |
517 OrthancPluginChangeType_NewStudy = 6, /*!< New study created */ | |
518 OrthancPluginChangeType_StablePatient = 7, /*!< Timeout: No new instance in this patient */ | |
519 OrthancPluginChangeType_StableSeries = 8, /*!< Timeout: No new instance in this series */ | |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
520 OrthancPluginChangeType_StableStudy = 9, /*!< Timeout: No new instance in this study */ |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
521 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
522 _OrthancPluginChangeType_INTERNAL = 0x7fffffff |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
523 } OrthancPluginChangeType; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
524 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
525 |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
526 /** |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
527 * The compression algorithms that are known by the Orthanc core. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
528 **/ |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
529 typedef enum |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
530 { |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
531 OrthancPluginCompressionType_Zlib = 0, /*!< Standard zlib compression */ |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
532 OrthancPluginCompressionType_ZlibWithSize = 1, /*!< zlib, prefixed with uncompressed size (uint64_t) */ |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
533 OrthancPluginCompressionType_Gzip = 2, /*!< Standard gzip compression */ |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
534 OrthancPluginCompressionType_GzipWithSize = 3, /*!< gzip, prefixed with uncompressed size (uint64_t) */ |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
535 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
536 _OrthancPluginCompressionType_INTERNAL = 0x7fffffff |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
537 } OrthancPluginCompressionType; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
538 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
539 |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
540 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
541 /** |
907 | 542 * @brief A memory buffer allocated by the core system of Orthanc. |
543 * | |
544 * A memory buffer allocated by the core system of Orthanc. When the | |
545 * content of the buffer is not useful anymore, it must be free by a | |
546 * call to ::OrthancPluginFreeMemoryBuffer(). | |
547 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
548 typedef struct |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
549 { |
907 | 550 /** |
551 * @brief The content of the buffer. | |
552 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
553 void* data; |
907 | 554 |
555 /** | |
556 * @brief The number of bytes in the buffer. | |
557 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
558 uint32_t size; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
559 } OrthancPluginMemoryBuffer; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
560 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
561 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
562 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
563 |
907 | 564 /** |
565 * @brief Opaque structure that represents the HTTP connection to the client application. | |
566 **/ | |
900 | 567 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput; |
568 | |
907 | 569 |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
570 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
571 /** |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
572 * @brief Opaque structure that represents a DICOM instance received by Orthanc. |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
573 **/ |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
574 typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
575 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
576 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
577 |
907 | 578 /** |
908
e078ea944089
refactoring HttpOutput
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
907
diff
changeset
|
579 * @brief Signature of a callback function that answers to a REST request. |
907 | 580 **/ |
900 | 581 typedef int32_t (*OrthancPluginRestCallback) ( |
582 OrthancPluginRestOutput* output, | |
583 const char* url, | |
584 const OrthancPluginHttpRequest* request); | |
585 | |
907 | 586 |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
587 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
588 /** |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
589 * @brief Signature of a callback function that is triggered when Orthanc receives a DICOM instance. |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
590 **/ |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
591 typedef int32_t (*OrthancPluginOnStoredInstanceCallback) ( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
592 OrthancPluginDicomInstance* instance, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
593 const char* instanceId); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
594 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
595 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
596 |
907 | 597 /** |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
598 * @brief Signature of a callback function that is triggered when a change happens to some DICOM resource. |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
599 **/ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
600 typedef int32_t (*OrthancPluginOnChangeCallback) ( |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
601 OrthancPluginChangeType changeType, |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
602 OrthancPluginResourceType resourceType, |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
603 const char* resourceId); |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
604 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
605 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
606 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
607 /** |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
608 * @brief Signature of a function to free dynamic memory. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
609 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
610 typedef void (*OrthancPluginFree) (void* buffer); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
611 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
612 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
613 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
614 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
615 * @brief Callback for writing to the storage area. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
616 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
617 * Signature of a callback function that is triggered when Orthanc writes a file to the storage area. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
618 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
619 * @param uuid The UUID of the file. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
620 * @param content The content of the file. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
621 * @param size The size of the file. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
622 * @param type The content type corresponding to this file. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
623 * @return 0 if success, other value if error. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
624 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
625 typedef int32_t (*OrthancPluginStorageCreate) ( |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
626 const char* uuid, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
627 const void* content, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
628 int64_t size, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
629 OrthancPluginContentType type); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
630 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
631 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
632 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
633 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
634 * @brief Callback for reading from the storage area. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
635 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
636 * Signature of a callback function that is triggered when Orthanc reads a file from the storage area. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
637 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
638 * @param content The content of the file (output). |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
639 * @param size The size of the file (output). |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
640 * @param uuid The UUID of the file of interest. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
641 * @param type The content type corresponding to this file. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
642 * @return 0 if success, other value if error. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
643 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
644 typedef int32_t (*OrthancPluginStorageRead) ( |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
645 void** content, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
646 int64_t* size, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
647 const char* uuid, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
648 OrthancPluginContentType type); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
649 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
650 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
651 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
652 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
653 * @brief Callback for removing a file from the storage area. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
654 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
655 * Signature of a callback function that is triggered when Orthanc deletes a file from the storage area. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
656 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
657 * @param uuid The UUID of the file to be removed. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
658 * @param type The content type corresponding to this file. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
659 * @return 0 if success, other value if error. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
660 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
661 typedef int32_t (*OrthancPluginStorageRemove) ( |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
662 const char* uuid, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
663 OrthancPluginContentType type); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
664 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
665 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
666 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
667 /** |
1297 | 668 * @brief Data structure that contains information about the Orthanc core. |
907 | 669 **/ |
900 | 670 typedef struct _OrthancPluginContext_t |
671 { | |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
672 void* pluginsManager; |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
673 const char* orthancVersion; |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
674 OrthancPluginFree Free; |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
675 OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context, |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
676 _OrthancPluginService service, |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
677 const void* params); |
899 | 678 } OrthancPluginContext; |
679 | |
886 | 680 |
907 | 681 |
682 /** | |
683 * @brief Free a string. | |
684 * | |
685 * Free a string that was allocated by the core system of Orthanc. | |
686 * | |
687 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
688 * @param str The string to be freed. | |
689 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
690 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString( |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
691 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
692 char* str) |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
693 { |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
694 if (str != NULL) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
695 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
696 context->Free(str); |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
697 } |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
698 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
699 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
700 |
907 | 701 /** |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
702 * @brief Check the compatibility of the plugin wrt. the version of its hosting Orthanc. |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
703 * |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
704 * This function checks whether the version of this C header is |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
705 * compatible with the current version of Orthanc. The result of |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
706 * this function should always be checked in the |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
707 * OrthancPluginInitialize() entry point of the plugin. |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
708 * |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
709 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
710 * @return 1 if and only if the versions are compatible. If the |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
711 * result is 0, the initialization of the plugin should fail. |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
712 **/ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
713 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion( |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
714 OrthancPluginContext* context) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
715 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
716 int major, minor, revision; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
717 |
1579
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
718 if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
719 sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
720 sizeof(int32_t) != sizeof(_OrthancPluginService) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
721 sizeof(int32_t) != sizeof(_OrthancPluginProperty) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
722 sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
723 sizeof(int32_t) != sizeof(OrthancPluginContentType) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
724 sizeof(int32_t) != sizeof(OrthancPluginResourceType) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
725 sizeof(int32_t) != sizeof(OrthancPluginChangeType) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
726 sizeof(int32_t) != sizeof(OrthancPluginCompressionType)) |
1578 | 727 { |
728 /* Mismatch in the size of the enumerations */ | |
729 return 0; | |
730 } | |
731 | |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
732 /* Assume compatibility with the mainline */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
733 if (!strcmp(context->orthancVersion, "mainline")) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
734 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
735 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
736 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
737 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
738 /* Parse the version of the Orthanc core */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
739 if ( |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
740 #ifdef _MSC_VER |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
741 sscanf_s |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
742 #else |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
743 sscanf |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
744 #endif |
1303 | 745 (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3) |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
746 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
747 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
748 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
749 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
750 /* Check the major number of the version */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
751 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
752 if (major > ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
753 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
754 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
755 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
756 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
757 if (major < ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
758 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
759 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
760 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
761 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
762 /* Check the minor number of the version */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
763 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
764 if (minor > ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
765 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
766 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
767 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
768 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
769 if (minor < ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
770 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
771 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
772 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
773 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
774 /* Check the revision number of the version */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
775 |
1040
d06186cdc502
check plugin version in samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1039
diff
changeset
|
776 if (revision >= ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER) |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
777 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
778 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
779 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
780 else |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
781 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
782 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
783 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
784 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
785 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
786 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
787 /** |
907 | 788 * @brief Free a memory buffer. |
789 * | |
790 * Free a memory buffer that was allocated by the core system of Orthanc. | |
791 * | |
792 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
793 * @param buffer The memory buffer to release. | |
794 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
795 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer( |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
796 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
797 OrthancPluginMemoryBuffer* buffer) |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
798 { |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
799 context->Free(buffer->data); |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
800 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
801 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
802 |
907 | 803 /** |
804 * @brief Log an error. | |
805 * | |
806 * Log an error message using the Orthanc logging system. | |
807 * | |
808 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
809 * @param message The message to be logged. | |
810 **/ | |
900 | 811 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError( |
812 OrthancPluginContext* context, | |
907 | 813 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
814 { |
907 | 815 context->InvokeService(context, _OrthancPluginService_LogError, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
816 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
817 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
818 |
907 | 819 /** |
820 * @brief Log a warning. | |
821 * | |
822 * Log a warning message using the Orthanc logging system. | |
823 * | |
824 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
825 * @param message The message to be logged. | |
826 **/ | |
900 | 827 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning( |
828 OrthancPluginContext* context, | |
907 | 829 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
830 { |
907 | 831 context->InvokeService(context, _OrthancPluginService_LogWarning, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
832 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
833 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
834 |
907 | 835 /** |
836 * @brief Log an information. | |
837 * | |
838 * Log an information message using the Orthanc logging system. | |
839 * | |
840 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
841 * @param message The message to be logged. | |
842 **/ | |
900 | 843 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo( |
844 OrthancPluginContext* context, | |
907 | 845 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
846 { |
907 | 847 context->InvokeService(context, _OrthancPluginService_LogInfo, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
848 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
849 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
850 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
851 |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
852 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
853 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
854 const char* pathRegularExpression; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
855 OrthancPluginRestCallback callback; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
856 } _OrthancPluginRestCallback; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
857 |
907 | 858 /** |
859 * @brief Register a REST callback. | |
860 * | |
861 * This function registers a REST callback against a regular | |
862 * expression for a URI. This function must be called during the | |
863 * initialization of the plugin, i.e. inside the | |
864 * OrthancPluginInitialize() public function. | |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
865 * |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
866 * Each REST callback is guaranteed to run in mutual exclusion. |
907 | 867 * |
868 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
869 * @param pathRegularExpression Regular expression for the URI. May contain groups. | |
870 * @param callback The callback function to handle the REST call. | |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
871 * @see OrthancPluginRegisterRestCallbackNoLock() |
907 | 872 **/ |
900 | 873 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback( |
874 OrthancPluginContext* context, | |
875 const char* pathRegularExpression, | |
876 OrthancPluginRestCallback callback) | |
899 | 877 { |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
878 _OrthancPluginRestCallback params; |
899 | 879 params.pathRegularExpression = pathRegularExpression; |
880 params.callback = callback; | |
907 | 881 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, ¶ms); |
899 | 882 } |
883 | |
884 | |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
885 |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
886 /** |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
887 * @brief Register a REST callback, without locking. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
888 * |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
889 * This function registers a REST callback against a regular |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
890 * expression for a URI. This function must be called during the |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
891 * initialization of the plugin, i.e. inside the |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
892 * OrthancPluginInitialize() public function. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
893 * |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
894 * Contrarily to OrthancPluginRegisterRestCallback(), the callback |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
895 * will NOT be invoked in mutual exclusion. This can be useful for |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
896 * high-performance plugins that must handle concurrent requests |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
897 * (Orthanc uses a pool of threads, one thread being assigned to |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
898 * each incoming HTTP request). Of course, it is up to the plugin to |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
899 * implement the required locking mechanisms. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
900 * |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
901 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
902 * @param pathRegularExpression Regular expression for the URI. May contain groups. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
903 * @param callback The callback function to handle the REST call. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
904 * @see OrthancPluginRegisterRestCallback() |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
905 **/ |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
906 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock( |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
907 OrthancPluginContext* context, |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
908 const char* pathRegularExpression, |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
909 OrthancPluginRestCallback callback) |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
910 { |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
911 _OrthancPluginRestCallback params; |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
912 params.pathRegularExpression = pathRegularExpression; |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
913 params.callback = callback; |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
914 context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, ¶ms); |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
915 } |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
916 |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
917 |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
918 |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
919 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
920 { |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
921 OrthancPluginOnStoredInstanceCallback callback; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
922 } _OrthancPluginOnStoredInstanceCallback; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
923 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
924 /** |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
925 * @brief Register a callback for received instances. |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
926 * |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
927 * This function registers a callback function that is called |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
928 * whenever a new DICOM instance is stored into the Orthanc core. |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
929 * |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
930 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
931 * @param callback The callback function. |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
932 **/ |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
933 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
934 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
935 OrthancPluginOnStoredInstanceCallback callback) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
936 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
937 _OrthancPluginOnStoredInstanceCallback params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
938 params.callback = callback; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
939 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
940 context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, ¶ms); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
941 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
942 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
943 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
944 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
945 typedef struct |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
946 { |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
947 OrthancPluginRestOutput* output; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
948 const char* answer; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
949 uint32_t answerSize; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
950 const char* mimeType; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
951 } _OrthancPluginAnswerBuffer; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
952 |
907 | 953 /** |
954 * @brief Answer to a REST request. | |
955 * | |
956 * This function answers to a REST request with the content of a memory buffer. | |
957 * | |
958 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
959 * @param output The HTTP connection to the client application. | |
960 * @param answer Pointer to the memory buffer containing the answer. | |
961 * @param answerSize Number of bytes of the answer. | |
962 * @param mimeType The MIME type of the answer. | |
963 **/ | |
900 | 964 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer( |
965 OrthancPluginContext* context, | |
966 OrthancPluginRestOutput* output, | |
967 const char* answer, | |
968 uint32_t answerSize, | |
969 const char* mimeType) | |
899 | 970 { |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
971 _OrthancPluginAnswerBuffer params; |
899 | 972 params.output = output; |
973 params.answer = answer; | |
974 params.answerSize = answerSize; | |
975 params.mimeType = mimeType; | |
907 | 976 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, ¶ms); |
899 | 977 } |
978 | |
979 | |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
980 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
981 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
982 OrthancPluginRestOutput* output; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
983 OrthancPluginPixelFormat format; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
984 uint32_t width; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
985 uint32_t height; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
986 uint32_t pitch; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
987 const void* buffer; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
988 } _OrthancPluginCompressAndAnswerPngImage; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
989 |
907 | 990 /** |
991 * @brief Answer to a REST request with a PNG image. | |
992 * | |
993 * This function answers to a REST request with a PNG image. The | |
994 * parameters of this function describe a memory buffer that | |
995 * contains an uncompressed image. The image will be automatically compressed | |
996 * as a PNG image by the core system of Orthanc. | |
997 * | |
998 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
999 * @param output The HTTP connection to the client application. | |
1000 * @param format The memory layout of the uncompressed image. | |
1001 * @param width The width of the image. | |
1002 * @param height The height of the image. | |
1003 * @param pitch The pitch of the image (i.e. the number of bytes | |
1004 * between 2 successive lines of the image in the memory buffer. | |
1005 * @param buffer The memory buffer containing the uncompressed image. | |
1006 **/ | |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1007 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage( |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1008 OrthancPluginContext* context, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1009 OrthancPluginRestOutput* output, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1010 OrthancPluginPixelFormat format, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1011 uint32_t width, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1012 uint32_t height, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1013 uint32_t pitch, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1014 const void* buffer) |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1015 { |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1016 _OrthancPluginCompressAndAnswerPngImage params; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1017 params.output = output; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1018 params.format = format; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1019 params.width = width; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1020 params.height = height; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1021 params.pitch = pitch; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1022 params.buffer = buffer; |
907 | 1023 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerPngImage, ¶ms); |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1024 } |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1025 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1026 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1027 |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1028 typedef struct |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1029 { |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1030 OrthancPluginMemoryBuffer* target; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1031 const char* instanceId; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1032 } _OrthancPluginGetDicomForInstance; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1033 |
907 | 1034 /** |
1035 * @brief Retrieve a DICOM instance using its Orthanc identifier. | |
1036 * | |
1037 * Retrieve a DICOM instance using its Orthanc identifier. The DICOM | |
1038 * file is stored into a newly allocated memory buffer. | |
1039 * | |
1040 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1041 * @param target The target memory buffer. | |
1042 * @param instanceId The Orthanc identifier of the DICOM instance of interest. | |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1043 * @return 0 if success, or the error code if failure. |
907 | 1044 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1045 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetDicomForInstance( |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1046 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1047 OrthancPluginMemoryBuffer* target, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1048 const char* instanceId) |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1049 { |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1050 _OrthancPluginGetDicomForInstance params; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1051 params.target = target; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1052 params.instanceId = instanceId; |
907 | 1053 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, ¶ms); |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1054 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1055 |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1056 |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1057 |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1058 typedef struct |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1059 { |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1060 OrthancPluginMemoryBuffer* target; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1061 const char* uri; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1062 } _OrthancPluginRestApiGet; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1063 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1064 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1065 * @brief Make a GET call to the built-in Orthanc REST API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1066 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1067 * Make a GET call to the built-in Orthanc REST API. The result to |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1068 * the query is stored into a newly allocated memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1069 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1070 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1071 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1072 * @param uri The URI in the built-in Orthanc API. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1073 * @return 0 if success, or the error code if failure. |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1074 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1075 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet( |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1076 OrthancPluginContext* context, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1077 OrthancPluginMemoryBuffer* target, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1078 const char* uri) |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1079 { |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1080 _OrthancPluginRestApiGet params; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1081 params.target = target; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1082 params.uri = uri; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1083 return context->InvokeService(context, _OrthancPluginService_RestApiGet, ¶ms); |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1084 } |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1085 |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1086 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1087 |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1088 /** |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1089 * @brief Make a GET call to the REST API, as tainted by the plugins. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1090 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1091 * Make a GET call to the Orthanc REST API, after all the plugins |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1092 * are applied. In other words, if some plugin overrides or adds the |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1093 * called URI to the built-in Orthanc REST API, this call will |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1094 * return the result provided by this plugin. The result to the |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1095 * query is stored into a newly allocated memory buffer. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1096 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1097 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1098 * @param target The target memory buffer. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1099 * @param uri The URI in the built-in Orthanc API. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1100 * @return 0 if success, or the error code if failure. |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1101 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1102 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGetAfterPlugins( |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1103 OrthancPluginContext* context, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1104 OrthancPluginMemoryBuffer* target, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1105 const char* uri) |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1106 { |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1107 _OrthancPluginRestApiGet params; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1108 params.target = target; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1109 params.uri = uri; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1110 return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, ¶ms); |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1111 } |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1112 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1113 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1114 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1115 typedef struct |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1116 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1117 OrthancPluginMemoryBuffer* target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1118 const char* uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1119 const char* body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1120 uint32_t bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1121 } _OrthancPluginRestApiPostPut; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1122 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1123 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1124 * @brief Make a POST call to the built-in Orthanc REST API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1125 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1126 * Make a POST call to the built-in Orthanc REST API. The result to |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1127 * the query is stored into a newly allocated memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1128 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1129 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1130 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1131 * @param uri The URI in the built-in Orthanc API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1132 * @param body The body of the POST request. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1133 * @param bodySize The size of the body. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1134 * @return 0 if success, or the error code if failure. |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1135 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1136 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPost( |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1137 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1138 OrthancPluginMemoryBuffer* target, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1139 const char* uri, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1140 const char* body, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1141 uint32_t bodySize) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1142 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1143 _OrthancPluginRestApiPostPut params; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1144 params.target = target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1145 params.uri = uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1146 params.body = body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1147 params.bodySize = bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1148 return context->InvokeService(context, _OrthancPluginService_RestApiPost, ¶ms); |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1149 } |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1150 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1151 |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1152 /** |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1153 * @brief Make a POST call to the REST API, as tainted by the plugins. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1154 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1155 * Make a POST call to the Orthanc REST API, after all the plugins |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1156 * are applied. In other words, if some plugin overrides or adds the |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1157 * called URI to the built-in Orthanc REST API, this call will |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1158 * return the result provided by this plugin. The result to the |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1159 * query is stored into a newly allocated memory buffer. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1160 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1161 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1162 * @param target The target memory buffer. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1163 * @param uri The URI in the built-in Orthanc API. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1164 * @param body The body of the POST request. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1165 * @param bodySize The size of the body. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1166 * @return 0 if success, or the error code if failure. |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1167 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1168 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins( |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1169 OrthancPluginContext* context, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1170 OrthancPluginMemoryBuffer* target, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1171 const char* uri, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1172 const char* body, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1173 uint32_t bodySize) |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1174 { |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1175 _OrthancPluginRestApiPostPut params; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1176 params.target = target; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1177 params.uri = uri; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1178 params.body = body; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1179 params.bodySize = bodySize; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1180 return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, ¶ms); |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1181 } |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1182 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1183 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1184 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1185 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1186 * @brief Make a DELETE call to the built-in Orthanc REST API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1187 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1188 * Make a DELETE call to the built-in Orthanc REST API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1189 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1190 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1191 * @param uri The URI to delete in the built-in Orthanc API. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1192 * @return 0 if success, or the error code if failure. |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1193 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1194 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDelete( |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1195 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1196 const char* uri) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1197 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1198 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri); |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1199 } |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1200 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1201 |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1202 /** |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1203 * @brief Make a DELETE call to the REST API, as tainted by the plugins. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1204 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1205 * Make a DELETE call to the Orthanc REST API, after all the plugins |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1206 * are applied. In other words, if some plugin overrides or adds the |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1207 * called URI to the built-in Orthanc REST API, this call will |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1208 * return the result provided by this plugin. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1209 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1210 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1211 * @param uri The URI to delete in the built-in Orthanc API. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1212 * @return 0 if success, or the error code if failure. |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1213 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1214 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins( |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1215 OrthancPluginContext* context, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1216 const char* uri) |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1217 { |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1218 return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri); |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1219 } |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1220 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1221 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1222 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1223 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1224 * @brief Make a PUT call to the built-in Orthanc REST API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1225 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1226 * Make a PUT call to the built-in Orthanc REST API. The result to |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1227 * the query is stored into a newly allocated memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1228 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1229 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1230 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1231 * @param uri The URI in the built-in Orthanc API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1232 * @param body The body of the PUT request. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1233 * @param bodySize The size of the body. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1234 * @return 0 if success, or the error code if failure. |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1235 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1236 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPut( |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1237 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1238 OrthancPluginMemoryBuffer* target, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1239 const char* uri, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1240 const char* body, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1241 uint32_t bodySize) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1242 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1243 _OrthancPluginRestApiPostPut params; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1244 params.target = target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1245 params.uri = uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1246 params.body = body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1247 params.bodySize = bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1248 return context->InvokeService(context, _OrthancPluginService_RestApiPut, ¶ms); |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1249 } |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1250 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1251 |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1252 |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1253 /** |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1254 * @brief Make a PUT call to the REST API, as tainted by the plugins. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1255 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1256 * Make a PUT call to the Orthanc REST API, after all the plugins |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1257 * are applied. In other words, if some plugin overrides or adds the |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1258 * called URI to the built-in Orthanc REST API, this call will |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1259 * return the result provided by this plugin. The result to the |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1260 * query is stored into a newly allocated memory buffer. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1261 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1262 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1263 * @param target The target memory buffer. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1264 * @param uri The URI in the built-in Orthanc API. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1265 * @param body The body of the PUT request. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1266 * @param bodySize The size of the body. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1267 * @return 0 if success, or the error code if failure. |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1268 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1269 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins( |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1270 OrthancPluginContext* context, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1271 OrthancPluginMemoryBuffer* target, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1272 const char* uri, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1273 const char* body, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1274 uint32_t bodySize) |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1275 { |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1276 _OrthancPluginRestApiPostPut params; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1277 params.target = target; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1278 params.uri = uri; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1279 params.body = body; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1280 params.bodySize = bodySize; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1281 return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, ¶ms); |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1282 } |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1283 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1284 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1285 |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1286 typedef struct |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1287 { |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1288 OrthancPluginRestOutput* output; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1289 const char* argument; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1290 } _OrthancPluginOutputPlusArgument; |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1291 |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1292 /** |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1293 * @brief Redirect a REST request. |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1294 * |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1295 * This function answers to a REST request by redirecting the user |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1296 * to another URI using HTTP status 301. |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1297 * |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1298 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1299 * @param output The HTTP connection to the client application. |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1300 * @param redirection Where to redirect. |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1301 **/ |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1302 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect( |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1303 OrthancPluginContext* context, |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1304 OrthancPluginRestOutput* output, |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1305 const char* redirection) |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1306 { |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1307 _OrthancPluginOutputPlusArgument params; |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1308 params.output = output; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1309 params.argument = redirection; |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1310 context->InvokeService(context, _OrthancPluginService_Redirect, ¶ms); |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1311 } |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1312 |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1313 |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1314 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1315 typedef struct |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1316 { |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1317 char** result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1318 const char* argument; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1319 } _OrthancPluginRetrieveDynamicString; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1320 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1321 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1322 * @brief Look for a patient. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1323 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1324 * Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020). |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1325 * This function uses the database index to run as fast as possible (it does not loop |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1326 * over all the stored patients). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1327 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1328 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1329 * @param patientID The Patient ID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1330 * @return The NULL value if the patient is non-existent, or a string containing the |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1331 * Orthanc ID of the patient. This string must be freed by OrthancPluginFreeString(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1332 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1333 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1334 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1335 const char* patientID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1336 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1337 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1338 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1339 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1340 params.result = &result; |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1341 params.argument = patientID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1342 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1343 if (context->InvokeService(context, _OrthancPluginService_LookupPatient, ¶ms)) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1344 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1345 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1346 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1347 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1348 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1349 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1350 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1351 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1352 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1353 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1354 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1355 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1356 * @brief Look for a study. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1357 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1358 * Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020, 0x000d). |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1359 * This function uses the database index to run as fast as possible (it does not loop |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1360 * over all the stored studies). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1361 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1362 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1363 * @param studyUID The Study Instance UID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1364 * @return The NULL value if the study is non-existent, or a string containing the |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1365 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1366 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1367 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1368 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1369 const char* studyUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1370 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1371 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1372 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1373 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1374 params.result = &result; |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1375 params.argument = studyUID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1376 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1377 if (context->InvokeService(context, _OrthancPluginService_LookupStudy, ¶ms)) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1378 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1379 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1380 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1381 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1382 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1383 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1384 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1385 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1386 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1387 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1388 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1389 /** |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1390 * @brief Look for a study, using the accession number. |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1391 * |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1392 * Look for a study stored in Orthanc, using its Accession Number tag (0x0008, 0x0050). |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1393 * This function uses the database index to run as fast as possible (it does not loop |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1394 * over all the stored studies). |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1395 * |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1396 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1397 * @param accessionNumber The Accession Number of interest. |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1398 * @return The NULL value if the study is non-existent, or a string containing the |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1399 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString(). |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1400 **/ |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1401 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber( |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1402 OrthancPluginContext* context, |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1403 const char* accessionNumber) |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1404 { |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1405 char* result; |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1406 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1407 _OrthancPluginRetrieveDynamicString params; |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1408 params.result = &result; |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1409 params.argument = accessionNumber; |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1410 |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1411 if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, ¶ms)) |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1412 { |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1413 /* Error */ |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1414 return NULL; |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1415 } |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1416 else |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1417 { |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1418 return result; |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1419 } |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1420 } |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1421 |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1422 |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1423 /** |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1424 * @brief Look for a series. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1425 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1426 * Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020, 0x000e). |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1427 * This function uses the database index to run as fast as possible (it does not loop |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1428 * over all the stored series). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1429 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1430 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1431 * @param seriesUID The Series Instance UID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1432 * @return The NULL value if the series is non-existent, or a string containing the |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1433 * Orthanc ID of the series. This string must be freed by OrthancPluginFreeString(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1434 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1435 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1436 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1437 const char* seriesUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1438 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1439 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1440 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1441 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1442 params.result = &result; |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1443 params.argument = seriesUID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1444 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1445 if (context->InvokeService(context, _OrthancPluginService_LookupSeries, ¶ms)) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1446 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1447 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1448 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1449 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1450 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1451 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1452 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1453 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1454 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1455 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1456 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1457 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1458 * @brief Look for an instance. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1459 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1460 * Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008, 0x0018). |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1461 * This function uses the database index to run as fast as possible (it does not loop |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1462 * over all the stored instances). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1463 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1464 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1465 * @param sopInstanceUID The SOP Instance UID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1466 * @return The NULL value if the instance is non-existent, or a string containing the |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1467 * Orthanc ID of the instance. This string must be freed by OrthancPluginFreeString(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1468 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1469 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1470 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1471 const char* sopInstanceUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1472 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1473 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1474 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1475 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1476 params.result = &result; |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1477 params.argument = sopInstanceUID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1478 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1479 if (context->InvokeService(context, _OrthancPluginService_LookupInstance, ¶ms)) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1480 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1481 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1482 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1483 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1484 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1485 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1486 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1487 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1488 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1489 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1490 |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1491 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1492 typedef struct |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1493 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1494 OrthancPluginRestOutput* output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1495 uint16_t status; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1496 } _OrthancPluginSendHttpStatusCode; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1497 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1498 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1499 * @brief Send a HTTP status code. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1500 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1501 * This function answers to a REST request by sending a HTTP status |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1502 * code (such as "400 - Bad Request"). Note that: |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1503 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1504 * - Redirections (status 301) must use ::OrthancPluginRedirect(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1505 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1506 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1507 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1508 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1509 * @param output The HTTP connection to the client application. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1510 * @param status The HTTP status code to be sent. |
1594
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
1511 * @see OrthancPluginSendHttpStatus() |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1512 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1513 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1514 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1515 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1516 uint16_t status) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1517 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1518 _OrthancPluginSendHttpStatusCode params; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1519 params.output = output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1520 params.status = status; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1521 context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, ¶ms); |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1522 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1523 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1524 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1525 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1526 * @brief Signal that a REST request is not authorized. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1527 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1528 * This function answers to a REST request by signaling that it is |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1529 * not authorized. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1530 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1531 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1532 * @param output The HTTP connection to the client application. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1533 * @param realm The realm for the authorization process. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1534 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1535 ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1536 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1537 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1538 const char* realm) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1539 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1540 _OrthancPluginOutputPlusArgument params; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1541 params.output = output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1542 params.argument = realm; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1543 context->InvokeService(context, _OrthancPluginService_SendUnauthorized, ¶ms); |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1544 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1545 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1546 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1547 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1548 * @brief Signal that this URI does not support this HTTP method. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1549 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1550 * This function answers to a REST request by signaling that the |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1551 * queried URI does not support this method. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1552 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1553 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1554 * @param output The HTTP connection to the client application. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1555 * @param allowedMethods The allowed methods for this URI (e.g. "GET,POST" after a PUT or a POST request). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1556 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1557 ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1558 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1559 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1560 const char* allowedMethods) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1561 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1562 _OrthancPluginOutputPlusArgument params; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1563 params.output = output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1564 params.argument = allowedMethods; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1565 context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, ¶ms); |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1566 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1567 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1568 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1569 typedef struct |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1570 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1571 OrthancPluginRestOutput* output; |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1572 const char* key; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1573 const char* value; |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1574 } _OrthancPluginSetHttpHeader; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1575 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1576 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1577 * @brief Set a cookie. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1578 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1579 * This function sets a cookie in the HTTP client. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1580 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1581 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1582 * @param output The HTTP connection to the client application. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1583 * @param cookie The cookie to be set. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1584 * @param value The value of the cookie. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1585 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1586 ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1587 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1588 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1589 const char* cookie, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1590 const char* value) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1591 { |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1592 _OrthancPluginSetHttpHeader params; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1593 params.output = output; |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1594 params.key = cookie; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1595 params.value = value; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1596 context->InvokeService(context, _OrthancPluginService_SetCookie, ¶ms); |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1597 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1598 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1599 |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1600 /** |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1601 * @brief Set some HTTP header. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1602 * |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1603 * This function sets a HTTP header in the HTTP answer. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1604 * |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1605 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1606 * @param output The HTTP connection to the client application. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1607 * @param key The HTTP header to be set. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1608 * @param value The value of the HTTP header. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1609 **/ |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1610 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader( |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1611 OrthancPluginContext* context, |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1612 OrthancPluginRestOutput* output, |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1613 const char* key, |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1614 const char* value) |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1615 { |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1616 _OrthancPluginSetHttpHeader params; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1617 params.output = output; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1618 params.key = key; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1619 params.value = value; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1620 context->InvokeService(context, _OrthancPluginService_SetHttpHeader, ¶ms); |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1621 } |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1622 |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1623 |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1624 typedef struct |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1625 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1626 char** resultStringToFree; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1627 const char** resultString; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1628 int64_t* resultInt64; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1629 const char* key; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1630 OrthancPluginDicomInstance* instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1631 } _OrthancPluginAccessDicomInstance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1632 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1633 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1634 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1635 * @brief Get the AET of a DICOM instance. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1636 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1637 * This function returns the Application Entity Title (AET) of the |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1638 * DICOM modality from which a DICOM instance originates. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1639 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1640 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1641 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1642 * @return The AET if success, NULL if error. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1643 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1644 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1645 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1646 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1647 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1648 const char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1649 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1650 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1651 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1652 params.resultString = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1653 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1654 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1655 if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, ¶ms)) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1656 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1657 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1658 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1659 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1660 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1661 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1662 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1663 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1664 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1665 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1666 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1667 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1668 * @brief Get the size of a DICOM file. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1669 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1670 * This function returns the number of bytes of the given DICOM instance. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1671 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1672 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1673 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1674 * @return The size of the file, -1 in case of error. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1675 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1676 ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1677 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1678 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1679 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1680 int64_t size; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1681 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1682 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1683 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1684 params.resultInt64 = &size; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1685 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1686 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1687 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, ¶ms)) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1688 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1689 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1690 return -1; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1691 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1692 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1693 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1694 return size; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1695 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1696 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1697 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1698 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1699 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1700 * @brief Get the data of a DICOM file. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1701 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1702 * This function returns a pointer to the content of the given DICOM instance. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1703 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1704 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1705 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1706 * @return The pointer to the DICOM data, NULL in case of error. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1707 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1708 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceData( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1709 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1710 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1711 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1712 const char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1713 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1714 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1715 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1716 params.resultString = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1717 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1718 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1719 if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, ¶ms)) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1720 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1721 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1722 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1723 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1724 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1725 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1726 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1727 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1728 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1729 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1730 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1731 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1732 * @brief Get the DICOM tag hierarchy as a JSON file. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1733 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1734 * This function returns a pointer to a newly created string |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1735 * containing a JSON file. This JSON file encodes the tag hierarchy |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1736 * of the given DICOM instance. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1737 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1738 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1739 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1740 * @return The NULL value in case of error, or a string containing the JSON file. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1741 * This string must be freed by OrthancPluginFreeString(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1742 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1743 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1744 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1745 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1746 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1747 char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1748 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1749 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1750 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1751 params.resultStringToFree = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1752 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1753 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1754 if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, ¶ms)) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1755 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1756 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1757 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1758 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1759 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1760 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1761 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1762 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1763 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1764 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1765 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1766 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1767 * @brief Get the DICOM tag hierarchy as a JSON file (with simplification). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1768 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1769 * This function returns a pointer to a newly created string |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1770 * containing a JSON file. This JSON file encodes the tag hierarchy |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1771 * of the given DICOM instance. In contrast with |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1772 * ::OrthancPluginGetInstanceJson(), the returned JSON file is in |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1773 * its simplified version. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1774 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1775 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1776 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1777 * @return The NULL value in case of error, or a string containing the JSON file. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1778 * This string must be freed by OrthancPluginFreeString(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1779 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1780 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1781 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1782 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1783 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1784 char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1785 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1786 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1787 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1788 params.resultStringToFree = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1789 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1790 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1791 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, ¶ms)) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1792 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1793 /* Error */ |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1794 return NULL; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1795 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1796 else |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1797 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1798 return result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1799 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1800 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1801 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1802 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1803 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1804 * @brief Check whether a DICOM instance is associated with some metadata. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1805 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1806 * This function checks whether the DICOM instance of interest is |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1807 * associated with some metadata. As of Orthanc 0.8.1, in the |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1808 * callbacks registered by |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1809 * ::OrthancPluginRegisterOnStoredInstanceCallback(), the only |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1810 * possibly available metadata are "ReceptionDate", "RemoteAET" and |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1811 * "IndexInSeries". |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1812 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1813 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1814 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1815 * @param metadata The metadata of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1816 * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1817 **/ |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1818 ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata( |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1819 OrthancPluginContext* context, |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1820 OrthancPluginDicomInstance* instance, |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1821 const char* metadata) |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1822 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1823 int64_t result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1824 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1825 _OrthancPluginAccessDicomInstance params; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1826 memset(¶ms, 0, sizeof(params)); |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1827 params.resultInt64 = &result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1828 params.instance = instance; |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1829 params.key = metadata; |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1830 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1831 if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, ¶ms)) |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1832 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1833 /* Error */ |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1834 return -1; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1835 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1836 else |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1837 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1838 return (result != 0); |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1839 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1840 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1841 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1842 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1843 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1844 * @brief Get the value of some metadata associated with a given DICOM instance. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1845 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1846 * This functions returns the value of some metadata that is associated with the DICOM instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1847 * Before calling this function, the existence of the metadata must have been checked with |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1848 * ::OrthancPluginHasInstanceMetadata(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1849 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1850 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1851 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1852 * @param metadata The metadata of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1853 * @return The metadata value if success, NULL if error. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1854 **/ |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1855 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata( |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1856 OrthancPluginContext* context, |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1857 OrthancPluginDicomInstance* instance, |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1858 const char* metadata) |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1859 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1860 const char* result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1861 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1862 _OrthancPluginAccessDicomInstance params; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1863 memset(¶ms, 0, sizeof(params)); |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1864 params.resultString = &result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1865 params.instance = instance; |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1866 params.key = metadata; |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1867 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1868 if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, ¶ms)) |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1869 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1870 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1871 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1872 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1873 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1874 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1875 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1876 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1877 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1878 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1879 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1880 |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1881 typedef struct |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1882 { |
1295 | 1883 OrthancPluginStorageCreate create; |
1884 OrthancPluginStorageRead read; | |
1885 OrthancPluginStorageRemove remove; | |
1886 OrthancPluginFree free; | |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1887 } _OrthancPluginRegisterStorageArea; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1888 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1889 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1890 * @brief Register a custom storage area. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1891 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1892 * This function registers a custom storage area, to replace the |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1893 * built-in way Orthanc stores its files on the filesystem. This |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1894 * function must be called during the initialization of the plugin, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1895 * i.e. inside the OrthancPluginInitialize() public function. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1896 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1897 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
1141 | 1898 * @param create The callback function to store a file on the custom storage area. |
1899 * @param read The callback function to read a file from the custom storage area. | |
1900 * @param remove The callback function to remove a file from the custom storage area. | |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1901 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1902 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea( |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1903 OrthancPluginContext* context, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1904 OrthancPluginStorageCreate create, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1905 OrthancPluginStorageRead read, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1906 OrthancPluginStorageRemove remove) |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1907 { |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1908 _OrthancPluginRegisterStorageArea params; |
1295 | 1909 params.create = create; |
1910 params.read = read; | |
1911 params.remove = remove; | |
1136
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
1912 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
1913 #ifdef __cplusplus |
1295 | 1914 params.free = ::free; |
1136
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
1915 #else |
1295 | 1916 params.free = free; |
1136
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
1917 #endif |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
1918 |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1919 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, ¶ms); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1920 } |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1921 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1922 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1923 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1924 /** |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1925 * @brief Return the path to the Orthanc executable. |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1926 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1927 * This function returns the path to the Orthanc executable. |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1928 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1929 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1930 * @return NULL in the case of an error, or a newly allocated string |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1931 * containing the path. This string must be freed by |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1932 * OrthancPluginFreeString(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1933 **/ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1934 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context) |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1935 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1936 char* result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1937 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1938 _OrthancPluginRetrieveDynamicString params; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1939 params.result = &result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1940 params.argument = NULL; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1941 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1942 if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, ¶ms)) |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1943 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1944 /* Error */ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1945 return NULL; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1946 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1947 else |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1948 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1949 return result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1950 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1951 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1952 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1953 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1954 /** |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1955 * @brief Return the directory containing the Orthanc. |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1956 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1957 * This function returns the path to the directory containing the Orthanc executable. |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1958 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1959 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1960 * @return NULL in the case of an error, or a newly allocated string |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1961 * containing the path. This string must be freed by |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1962 * OrthancPluginFreeString(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1963 **/ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1964 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context) |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1965 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1966 char* result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1967 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1968 _OrthancPluginRetrieveDynamicString params; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1969 params.result = &result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1970 params.argument = NULL; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1971 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1972 if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, ¶ms)) |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1973 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1974 /* Error */ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1975 return NULL; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1976 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1977 else |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1978 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1979 return result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1980 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1981 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1982 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1983 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1984 /** |
1423
7b7d597a190c
The configuration can be splitted into several files stored inside the same folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1407
diff
changeset
|
1985 * @brief Return the path to the configuration file(s). |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1986 * |
1423
7b7d597a190c
The configuration can be splitted into several files stored inside the same folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1407
diff
changeset
|
1987 * This function returns the path to the configuration file(s) that |
7b7d597a190c
The configuration can be splitted into several files stored inside the same folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1407
diff
changeset
|
1988 * was specified when starting Orthanc. Since version 0.9.1, this |
7b7d597a190c
The configuration can be splitted into several files stored inside the same folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1407
diff
changeset
|
1989 * path can refer to a folder that stores a set of configuration |
1424
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
1990 * files. This function is deprecated in favor of |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
1991 * OrthancPluginGetConfiguration(). |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1992 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1993 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1994 * @return NULL in the case of an error, or a newly allocated string |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1995 * containing the path. This string must be freed by |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1996 * OrthancPluginFreeString(). |
1424
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
1997 * @see OrthancPluginGetConfiguration() |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1998 **/ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1999 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context) |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2000 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2001 char* result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2002 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2003 _OrthancPluginRetrieveDynamicString params; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2004 params.result = &result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2005 params.argument = NULL; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2006 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2007 if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, ¶ms)) |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2008 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2009 /* Error */ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2010 return NULL; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2011 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2012 else |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2013 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2014 return result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2015 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2016 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2017 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2018 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2019 |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2020 typedef struct |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2021 { |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2022 OrthancPluginOnChangeCallback callback; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2023 } _OrthancPluginOnChangeCallback; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2024 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2025 /** |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2026 * @brief Register a callback to monitor changes. |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2027 * |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2028 * This function registers a callback function that is called |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2029 * whenever a change happens to some DICOM resource. |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2030 * |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2031 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2032 * @param callback The callback function. |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2033 **/ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2034 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback( |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2035 OrthancPluginContext* context, |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2036 OrthancPluginOnChangeCallback callback) |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2037 { |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2038 _OrthancPluginOnChangeCallback params; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2039 params.callback = callback; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2040 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2041 context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, ¶ms); |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2042 } |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2043 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2044 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2045 |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2046 typedef struct |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2047 { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2048 const char* plugin; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2049 _OrthancPluginProperty property; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2050 const char* value; |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2051 } _OrthancPluginSetPluginProperty; |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2052 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2053 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2054 /** |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2055 * @brief Set the URI where the plugin provides its Web interface. |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2056 * |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2057 * For plugins that come with a Web interface, this function |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2058 * declares the entry path where to find this interface. This |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2059 * information is notably used in the "Plugins" page of Orthanc |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2060 * Explorer. |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2061 * |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2062 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2063 * @param uri The root URI for this plugin. |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2064 **/ |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2065 ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri( |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2066 OrthancPluginContext* context, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2067 const char* uri) |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2068 { |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2069 _OrthancPluginSetPluginProperty params; |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2070 params.plugin = OrthancPluginGetName(); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2071 params.property = _OrthancPluginProperty_RootUri; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2072 params.value = uri; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2073 |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2074 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, ¶ms); |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2075 } |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2076 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2077 |
1233 | 2078 /** |
2079 * @brief Set a description for this plugin. | |
2080 * | |
2081 * Set a description for this plugin. It is displayed in the | |
2082 * "Plugins" page of Orthanc Explorer. | |
2083 * | |
2084 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
2085 * @param description The description. | |
2086 **/ | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2087 ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription( |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2088 OrthancPluginContext* context, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2089 const char* description) |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2090 { |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2091 _OrthancPluginSetPluginProperty params; |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2092 params.plugin = OrthancPluginGetName(); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2093 params.property = _OrthancPluginProperty_Description; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2094 params.value = description; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2095 |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2096 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, ¶ms); |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2097 } |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2098 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2099 |
1233 | 2100 /** |
2101 * @brief Extend the JavaScript code of Orthanc Explorer. | |
2102 * | |
2103 * Add JavaScript code to customize the default behavior of Orthanc | |
2104 * Explorer. This can for instance be used to add new buttons. | |
2105 * | |
2106 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
2107 * @param javascript The custom JavaScript code. | |
2108 **/ | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2109 ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer( |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2110 OrthancPluginContext* context, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2111 const char* javascript) |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2112 { |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2113 _OrthancPluginSetPluginProperty params; |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2114 params.plugin = OrthancPluginGetName(); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2115 params.property = _OrthancPluginProperty_OrthancExplorer; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2116 params.value = javascript; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2117 |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2118 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, ¶ms); |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2119 } |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2120 |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2121 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2122 typedef struct |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2123 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2124 char** result; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2125 int32_t property; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2126 const char* value; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2127 } _OrthancPluginGlobalProperty; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2128 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2129 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2130 /** |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2131 * @brief Get the value of a global property. |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2132 * |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2133 * Get the value of a global property that is stored in the Orthanc database. Global |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2134 * properties whose index is below 1024 are reserved by Orthanc. |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2135 * |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2136 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2137 * @param property The global property of interest. |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2138 * @param defaultValue The value to return, if the global property is unset. |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2139 * @return The value of the global property, or NULL in the case of an error. This |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2140 * string must be freed by OrthancPluginFreeString(). |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2141 **/ |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2142 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty( |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2143 OrthancPluginContext* context, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2144 int32_t property, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2145 const char* defaultValue) |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2146 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2147 char* result; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2148 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2149 _OrthancPluginGlobalProperty params; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2150 params.result = &result; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2151 params.property = property; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2152 params.value = defaultValue; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2153 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2154 if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, ¶ms)) |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2155 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2156 /* Error */ |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2157 return NULL; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2158 } |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2159 else |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2160 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2161 return result; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2162 } |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2163 } |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2164 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2165 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2166 /** |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2167 * @brief Set the value of a global property. |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2168 * |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2169 * Set the value of a global property into the Orthanc |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2170 * database. Setting a global property can be used by plugins to |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2171 * save their internal parameters. Plugins are only allowed to set |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2172 * properties whose index are above or equal to 1024 (properties |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2173 * below 1024 are read-only and reserved by Orthanc). |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2174 * |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2175 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2176 * @param property The global property of interest. |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2177 * @param value The value to be set in the global property. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2178 * @return 0 if success, or the error code if failure. |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2179 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2180 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetGlobalProperty( |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2181 OrthancPluginContext* context, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2182 int32_t property, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2183 const char* value) |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2184 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2185 _OrthancPluginGlobalProperty params; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2186 params.result = NULL; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2187 params.property = property; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2188 params.value = value; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2189 |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2190 return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, ¶ms); |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2191 } |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2192 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2193 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2194 |
1280
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2195 typedef struct |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2196 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2197 int32_t *resultInt32; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2198 uint32_t *resultUint32; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2199 int64_t *resultInt64; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2200 uint64_t *resultUint64; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2201 } _OrthancPluginReturnSingleValue; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2202 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2203 /** |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2204 * @brief Get the number of command-line arguments. |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2205 * |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2206 * Retrieve the number of command-line arguments that were used to launch Orthanc. |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2207 * |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2208 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2209 * @return The number of arguments. |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2210 **/ |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2211 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount( |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2212 OrthancPluginContext* context) |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2213 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2214 uint32_t count = 0; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2215 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2216 _OrthancPluginReturnSingleValue params; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2217 memset(¶ms, 0, sizeof(params)); |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2218 params.resultUint32 = &count; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2219 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2220 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, ¶ms)) |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2221 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2222 /* Error */ |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2223 return 0; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2224 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2225 else |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2226 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2227 return count; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2228 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2229 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2230 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2231 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2232 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2233 /** |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2234 * @brief Get the value of a command-line argument. |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2235 * |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2236 * Get the value of one of the command-line arguments that were used |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2237 * to launch Orthanc. The number of available arguments can be |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2238 * retrieved by OrthancPluginGetCommandLineArgumentsCount(). |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2239 * |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2240 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2241 * @param argument The index of the argument. |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2242 * @return The value of the argument, or NULL in the case of an error. This |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2243 * string must be freed by OrthancPluginFreeString(). |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2244 **/ |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2245 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument( |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2246 OrthancPluginContext* context, |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2247 uint32_t argument) |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2248 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2249 char* result; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2250 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2251 _OrthancPluginGlobalProperty params; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2252 params.result = &result; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2253 params.property = (int32_t) argument; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2254 params.value = NULL; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2255 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2256 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, ¶ms)) |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2257 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2258 /* Error */ |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2259 return NULL; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2260 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2261 else |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2262 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2263 return result; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2264 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2265 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2266 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2267 |
1407
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2268 /** |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2269 * @brief Get the expected version of the database schema. |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2270 * |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2271 * Retrieve the expected version of the database schema. |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2272 * |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2273 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2274 * @return The version. |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2275 **/ |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2276 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion( |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2277 OrthancPluginContext* context) |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2278 { |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2279 uint32_t count = 0; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2280 |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2281 _OrthancPluginReturnSingleValue params; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2282 memset(¶ms, 0, sizeof(params)); |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2283 params.resultUint32 = &count; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2284 |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2285 if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, ¶ms)) |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2286 { |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2287 /* Error */ |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2288 return 0; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2289 } |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2290 else |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2291 { |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2292 return count; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2293 } |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2294 } |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2295 |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2296 |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2297 |
1424
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2298 /** |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2299 * @brief Return the content of the configuration file(s). |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2300 * |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2301 * This function returns the content of the configuration that is |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2302 * used by Orthanc, formatted as a JSON string. |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2303 * |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2304 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2305 * @return NULL in the case of an error, or a newly allocated string |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2306 * containing the configuration. This string must be freed by |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2307 * OrthancPluginFreeString(). |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2308 **/ |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2309 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context) |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2310 { |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2311 char* result; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2312 |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2313 _OrthancPluginRetrieveDynamicString params; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2314 params.result = &result; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2315 params.argument = NULL; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2316 |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2317 if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, ¶ms)) |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2318 { |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2319 /* Error */ |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2320 return NULL; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2321 } |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2322 else |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2323 { |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2324 return result; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2325 } |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2326 } |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2327 |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2328 |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2329 |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2330 typedef struct |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2331 { |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2332 OrthancPluginRestOutput* output; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2333 const char* subType; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2334 const char* contentType; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2335 } _OrthancPluginStartMultipartAnswer; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2336 |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2337 /** |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2338 * @brief Start an HTTP multipart answer. |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2339 * |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2340 * Initiates a HTTP multipart answer, as the result of a REST request. |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2341 * |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2342 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2343 * @param output The HTTP connection to the client application. |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2344 * @param subType The sub-type of the multipart answer ("mixed" or "related"). |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2345 * @param contentType The MIME type of the items in the multipart answer. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2346 * @return 0 if success, or the error code if failure. |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2347 * @see OrthancPluginSendMultipartItem() |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2348 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2349 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer( |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2350 OrthancPluginContext* context, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2351 OrthancPluginRestOutput* output, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2352 const char* subType, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2353 const char* contentType) |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2354 { |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2355 _OrthancPluginStartMultipartAnswer params; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2356 params.output = output; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2357 params.subType = subType; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2358 params.contentType = contentType; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2359 return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, ¶ms); |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2360 } |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2361 |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2362 |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2363 /** |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2364 * @brief Send an item as a part of some HTTP multipart answer. |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2365 * |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2366 * This function sends an item as a part of some HTTP multipart |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2367 * answer that was initiated by OrthancPluginStartMultipartAnswer(). |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2368 * |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2369 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2370 * @param output The HTTP connection to the client application. |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2371 * @param answer Pointer to the memory buffer containing the item. |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2372 * @param answerSize Number of bytes of the item. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2373 * @return 0 if success, or the error code if failure (this notably happens |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2374 * if the connection is closed by the client). |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2375 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2376 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem( |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2377 OrthancPluginContext* context, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2378 OrthancPluginRestOutput* output, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2379 const char* answer, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2380 uint32_t answerSize) |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2381 { |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2382 _OrthancPluginAnswerBuffer params; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2383 params.output = output; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2384 params.answer = answer; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2385 params.answerSize = answerSize; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2386 params.mimeType = NULL; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2387 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, ¶ms); |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2388 } |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2389 |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2390 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2391 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2392 typedef struct |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2393 { |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2394 OrthancPluginMemoryBuffer* target; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2395 const void* source; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2396 uint32_t size; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2397 OrthancPluginCompressionType compression; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2398 uint8_t uncompress; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2399 } _OrthancPluginBufferCompression; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2400 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2401 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2402 /** |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2403 * @brief Compress or decompress a buffer. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2404 * |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2405 * This function compresses or decompresses a buffer, using the |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2406 * version of the zlib library that is used by the Orthanc core. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2407 * |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2408 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2409 * @param target The target memory buffer. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2410 * @param source The source buffer. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2411 * @param size The size in bytes of the source buffer. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2412 * @param compression The compression algorithm. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2413 * @param uncompress If set to "0", the buffer must be compressed. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2414 * If set to "1", the buffer must be uncompressed. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2415 * @return 0 if success, or the error code if failure. |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2416 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2417 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginBufferCompression( |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2418 OrthancPluginContext* context, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2419 OrthancPluginMemoryBuffer* target, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2420 const void* source, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2421 uint32_t size, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2422 OrthancPluginCompressionType compression, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2423 uint8_t uncompress) |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2424 { |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2425 _OrthancPluginBufferCompression params; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2426 params.target = target; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2427 params.source = source; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2428 params.size = size; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2429 params.compression = compression; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2430 params.uncompress = uncompress; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2431 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2432 return context->InvokeService(context, _OrthancPluginService_BufferCompression, ¶ms); |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2433 } |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2434 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2435 |
1588
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2436 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2437 typedef struct |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2438 { |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2439 OrthancPluginMemoryBuffer* target; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2440 const char* path; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2441 } _OrthancPluginReadFile; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2442 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2443 /** |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2444 * @brief Read a file. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2445 * |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2446 * Read the content of a file on the filesystem, and returns it into |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2447 * a newly allocated memory buffer. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2448 * |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2449 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2450 * @param target The target memory buffer. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2451 * @param path The path of the file to be read. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2452 * @return 0 if success, or the error code if failure. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2453 **/ |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2454 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReadFile( |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2455 OrthancPluginContext* context, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2456 OrthancPluginMemoryBuffer* target, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2457 const char* path) |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2458 { |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2459 _OrthancPluginReadFile params; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2460 params.target = target; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2461 params.path = path; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2462 return context->InvokeService(context, _OrthancPluginService_ReadFile, ¶ms); |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2463 } |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2464 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2465 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2466 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2467 typedef struct |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2468 { |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2469 const char* path; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2470 const void* data; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2471 uint32_t size; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2472 } _OrthancPluginWriteFile; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2473 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2474 /** |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2475 * @brief Write a file. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2476 * |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2477 * Write the content of a memory buffer to the filesystem. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2478 * |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2479 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2480 * @param path The path of the file to be written. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2481 * @param data The content of the memory buffer. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2482 * @param size The size of the memory buffer. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2483 * @return 0 if success, or the error code if failure. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2484 **/ |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2485 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWriteFile( |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2486 OrthancPluginContext* context, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2487 const char* path, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2488 const void* data, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2489 uint32_t size) |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2490 { |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2491 _OrthancPluginWriteFile params; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2492 params.path = path; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2493 params.data = data; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2494 params.size = size; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2495 return context->InvokeService(context, _OrthancPluginService_WriteFile, ¶ms); |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2496 } |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2497 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2498 |
1593
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2499 |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2500 typedef struct |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2501 { |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2502 const char** target; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2503 OrthancPluginErrorCode error; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2504 } _OrthancPluginGetErrorDescription; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2505 |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2506 /** |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2507 * @brief Get the description of a given error code. |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2508 * |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2509 * This function returns the description of a given error code. |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2510 * |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2511 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
2512 * @param error The error code of interest. |
1593
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2513 * @return The error description. This is a statically-allocated |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2514 * string, do not free it. |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2515 **/ |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2516 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription( |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2517 OrthancPluginContext* context, |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2518 OrthancPluginErrorCode error) |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2519 { |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2520 const char* result = NULL; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2521 |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2522 _OrthancPluginGetErrorDescription params; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2523 params.target = &result; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2524 params.error = error; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2525 |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2526 if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, ¶ms) || |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2527 result == NULL) |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2528 { |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2529 return "Unknown error code"; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2530 } |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2531 else |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2532 { |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2533 return result; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2534 } |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2535 } |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2536 |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2537 |
1594
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2538 |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2539 typedef struct |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2540 { |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2541 OrthancPluginRestOutput* output; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2542 uint16_t status; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2543 const char* body; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2544 uint32_t bodySize; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2545 } _OrthancPluginSendHttpStatus; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2546 |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2547 /** |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2548 * @brief Send a HTTP status, with a custom body. |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2549 * |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2550 * This function answers to a HTTP request by sending a HTTP status |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2551 * code (such as "400 - Bad Request"), together with a body |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2552 * describing the error. The body will only be returned if the |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2553 * configuration option "HttpDescribeErrors" of Orthanc is set to "true". |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2554 * |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2555 * Note that: |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2556 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2557 * - Redirections (status 301) must use ::OrthancPluginRedirect(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2558 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2559 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2560 * |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2561 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2562 * @param output The HTTP connection to the client application. |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2563 * @param status The HTTP status code to be sent. |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
2564 * @param body The body of the answer. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
2565 * @param bodySize The size of the body. |
1594
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2566 * @see OrthancPluginSendHttpStatusCode() |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2567 **/ |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2568 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus( |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2569 OrthancPluginContext* context, |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2570 OrthancPluginRestOutput* output, |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2571 uint16_t status, |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2572 const char* body, |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2573 uint32_t bodySize) |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2574 { |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2575 _OrthancPluginSendHttpStatus params; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2576 params.output = output; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2577 params.status = status; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2578 params.body = body; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2579 params.bodySize = bodySize; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2580 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, ¶ms); |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2581 } |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2582 |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2583 |
886 | 2584 #ifdef __cplusplus |
2585 } | |
2586 #endif | |
900 | 2587 |
2588 | |
2589 /** @} */ | |
2590 |