annotate OrthancFramework/Sources/Enumerations.cpp @ 5326:fbe857e942cd

store metrics as integers instead of floats to avoid precision loss in increments
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 25 Jun 2023 18:28:49 +0200
parents 800261398381
children f26ed26a7793 5b2a5cc64cb1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1823
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1288
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1206
diff changeset
4 * Department, University Hospital of Liege, Belgium
5185
0ea402b4d901 upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5113
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
0ea402b4d901 upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5113
diff changeset
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4074
diff changeset
9 * modify it under the terms of the GNU Lesser General Public License
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4074
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4074
diff changeset
11 * the License, or (at your option) any later version.
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4074
diff changeset
16 * Lesser General Public License for more details.
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 *
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4074
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4074
diff changeset
19 * License along with this program. If not, see
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4074
diff changeset
20 * <http://www.gnu.org/licenses/>.
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
824
a811bdf8b8eb precompiled headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 800
diff changeset
24 #include "PrecompiledHeaders.h"
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include "Enumerations.h"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #include "OrthancException.h"
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
28 #include "Toolbox.h"
2006
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
29 #include "Logging.h"
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
2407
5edec967055e fix sandboxed builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2401
diff changeset
31 #include <boost/thread/mutex.hpp>
1495
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
32 #include <string.h>
1993
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
33 #include <cassert>
5291
800261398381 Made Orthanc more resilient to common spelling errors in SpecificCharacterSet
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
34 #include <boost/algorithm/string/replace.hpp>
1495
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
35
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 namespace Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 {
2924
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
38 static const char* const MIME_CSS = "text/css";
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
39 static const char* const MIME_DICOM = "application/dicom";
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
40 static const char* const MIME_GIF = "image/gif";
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
41 static const char* const MIME_GZIP = "application/gzip";
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
42 static const char* const MIME_HTML = "text/html";
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
43 static const char* const MIME_JAVASCRIPT = "application/javascript";
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
44 static const char* const MIME_JPEG2000 = "image/jp2";
2984
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
45 static const char* const MIME_NACL = "application/x-nacl";
2924
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
46 static const char* const MIME_PLAIN_TEXT = "text/plain";
2984
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
47 static const char* const MIME_PNACL = "application/x-pnacl";
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
48 static const char* const MIME_SVG = "image/svg+xml";
2924
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
49 static const char* const MIME_WEB_ASSEMBLY = "application/wasm";
2984
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
50 static const char* const MIME_WOFF = "application/x-font-woff";
3435
c08bb6ac3b7f new mime type: font/woff2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3404
diff changeset
51 static const char* const MIME_WOFF2 = "font/woff2";
2924
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
52 static const char* const MIME_XML_2 = "text/xml";
2976
cb5d75143da0 Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2954
diff changeset
53 static const char* const MIME_ZIP = "application/zip";
3203
810772486249 URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3174
diff changeset
54 static const char* const MIME_DICOM_WEB_JSON = "application/dicom+json";
810772486249 URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3174
diff changeset
55 static const char* const MIME_DICOM_WEB_XML = "application/dicom+xml";
4887
a29a6bdba9dd mime type for .ico
Alain Mazy <am@osimis.io>
parents: 4870
diff changeset
56 static const char* const MIME_ICO = "image/x-icon";
2924
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
57
1578
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1577
diff changeset
58 // This function is autogenerated by the script
4932
b7ce2bb6b881 refactored the list of MainDicomTags to be able to change it dynamicaly. Unit tests and Integration tests ok
Alain Mazy <am@osimis.io>
parents: 4912
diff changeset
59 // "Resources/CodeGeneration/GenerateErrorCodes.py"
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
60 const char* EnumerationToString(ErrorCode error)
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
61 {
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
62 switch (error)
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
63 {
1579
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
64 case ErrorCode_InternalError:
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
65 return "Internal error";
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
66
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
67 case ErrorCode_Success:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
68 return "Success";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
69
1579
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
70 case ErrorCode_Plugin:
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
71 return "Error encountered within the plugin engine";
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
72
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
73 case ErrorCode_NotImplemented:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
74 return "Not implemented yet";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
75
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
76 case ErrorCode_ParameterOutOfRange:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
77 return "Parameter out of range";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
78
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
79 case ErrorCode_NotEnoughMemory:
2133
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2132
diff changeset
80 return "The server hosting Orthanc is running out of memory";
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
81
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
82 case ErrorCode_BadParameterType:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
83 return "Bad type for a parameter";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
84
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
85 case ErrorCode_BadSequenceOfCalls:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
86 return "Bad sequence of calls";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
87
1577
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
88 case ErrorCode_InexistentItem:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
89 return "Accessing an inexistent item";
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
90
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
91 case ErrorCode_BadRequest:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
92 return "Bad request";
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
93
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
94 case ErrorCode_NetworkProtocol:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
95 return "Error in the network protocol";
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
96
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
97 case ErrorCode_SystemCommand:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
98 return "Error while calling a system command";
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
99
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
100 case ErrorCode_Database:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
101 return "Error with the database engine";
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
102
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
103 case ErrorCode_UriSyntax:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
104 return "Badly formatted URI";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
105
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
106 case ErrorCode_InexistentFile:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
107 return "Inexistent file";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
108
1577
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
109 case ErrorCode_CannotWriteFile:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
110 return "Cannot write to file";
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
111
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
112 case ErrorCode_BadFileFormat:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
113 return "Bad file format";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
114
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
115 case ErrorCode_Timeout:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
116 return "Timeout";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
117
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
118 case ErrorCode_UnknownResource:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
119 return "Unknown resource";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
120
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
121 case ErrorCode_IncompatibleDatabaseVersion:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
122 return "Incompatible version of the database";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
123
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
124 case ErrorCode_FullStorage:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
125 return "The file storage is full";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
126
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
127 case ErrorCode_CorruptedFile:
1582
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
128 return "Corrupted file (e.g. inconsistent MD5 hash)";
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
129
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
130 case ErrorCode_InexistentTag:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
131 return "Inexistent tag";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
132
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
133 case ErrorCode_ReadOnly:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
134 return "Cannot modify a read-only data structure";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
135
1577
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
136 case ErrorCode_IncompatibleImageFormat:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
137 return "Incompatible format of the images";
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
138
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
139 case ErrorCode_IncompatibleImageSize:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
140 return "Incompatible size of the images";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
141
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
142 case ErrorCode_SharedLibrary:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
143 return "Error while using a shared library (plugin)";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
144
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
145 case ErrorCode_UnknownPluginService:
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
146 return "Plugin invoking an unknown service";
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
147
1582
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
148 case ErrorCode_UnknownDicomTag:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
149 return "Unknown DICOM tag";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
150
1596
f2e3d030ea59 BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
151 case ErrorCode_BadJson:
f2e3d030ea59 BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
152 return "Cannot parse a JSON document";
f2e3d030ea59 BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
153
1606
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
154 case ErrorCode_Unauthorized:
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
155 return "Bad credentials were provided to an HTTP request";
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
156
1610
2dff2bdffdb8 font support within Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
157 case ErrorCode_BadFont:
2dff2bdffdb8 font support within Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
158 return "Badly formatted font file";
2dff2bdffdb8 font support within Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
159
1643
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
160 case ErrorCode_DatabasePlugin:
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
161 return "The plugin implementing a custom database back-end does not fulfill the proper interface";
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
162
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
163 case ErrorCode_StorageAreaPlugin:
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
164 return "Error in the plugin implementing a custom storage area";
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
165
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
166 case ErrorCode_EmptyRequest:
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
167 return "The request is empty";
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
168
1781
5ad4e4d92ecb AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
169 case ErrorCode_NotAcceptable:
5ad4e4d92ecb AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
170 return "Cannot send a response which is acceptable according to the Accept HTTP header";
5ad4e4d92ecb AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
171
2132
a43708636890 ErrorCode_NotEnoughMemory and ErrorCode_NullPointer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2089
diff changeset
172 case ErrorCode_NullPointer:
a43708636890 ErrorCode_NotEnoughMemory and ErrorCode_NullPointer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2089
diff changeset
173 return "Cannot handle a NULL pointer";
a43708636890 ErrorCode_NotEnoughMemory and ErrorCode_NullPointer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2089
diff changeset
174
2486
ad8f30fc28d1 new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
175 case ErrorCode_DatabaseUnavailable:
ad8f30fc28d1 new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
176 return "The database is currently not available (probably a transient situation)";
ad8f30fc28d1 new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
177
2581
8da2cffc2378 JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2569
diff changeset
178 case ErrorCode_CanceledJob:
8da2cffc2378 JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2569
diff changeset
179 return "This job was canceled";
8da2cffc2378 JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2569
diff changeset
180
3376
56ea9c476dba new error code for Stone: BadGeometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3226
diff changeset
181 case ErrorCode_BadGeometry:
56ea9c476dba new error code for Stone: BadGeometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3226
diff changeset
182 return "Geometry error encountered in Stone";
56ea9c476dba new error code for Stone: BadGeometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3226
diff changeset
183
3801
9fe1d64a748c upgrade to civetweb 1.12, error reporting if OpenSSL failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3737
diff changeset
184 case ErrorCode_SslInitialization:
9fe1d64a748c upgrade to civetweb 1.12, error reporting if OpenSSL failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3737
diff changeset
185 return "Cannot initialize SSL encryption, check out your certificates";
9fe1d64a748c upgrade to civetweb 1.12, error reporting if OpenSSL failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3737
diff changeset
186
4347
3dffe8f7af48 new error code: ErrorCode_DiscontinuedAbi
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4245
diff changeset
187 case ErrorCode_DiscontinuedAbi:
3dffe8f7af48 new error code: ErrorCode_DiscontinuedAbi
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4245
diff changeset
188 return "Calling a function that has been removed from the Orthanc Framework";
3dffe8f7af48 new error code: ErrorCode_DiscontinuedAbi
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4245
diff changeset
189
4442
f77ee6e6cf47 new error code: ErrorCode_BadRange
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
190 case ErrorCode_BadRange:
f77ee6e6cf47 new error code: ErrorCode_BadRange
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
191 return "Incorrect range request";
f77ee6e6cf47 new error code: ErrorCode_BadRange
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
192
4551
350a22c094f2 testing replay of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
193 case ErrorCode_DatabaseCannotSerialize:
350a22c094f2 testing replay of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
194 return "Database could not serialize access due to concurrent update, the transaction should be retried";
350a22c094f2 testing replay of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
195
4608
de5e6b04442d added ErrorCode_Revision
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4551
diff changeset
196 case ErrorCode_Revision:
4623
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4608
diff changeset
197 return "A bad revision number was provided, which might indicate conflict between multiple writers";
4608
de5e6b04442d added ErrorCode_Revision
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4551
diff changeset
198
4932
b7ce2bb6b881 refactored the list of MainDicomTags to be able to change it dynamicaly. Unit tests and Integration tests ok
Alain Mazy <am@osimis.io>
parents: 4912
diff changeset
199 case ErrorCode_MainDicomTagsMultiplyDefined:
b7ce2bb6b881 refactored the list of MainDicomTags to be able to change it dynamicaly. Unit tests and Integration tests ok
Alain Mazy <am@osimis.io>
parents: 4912
diff changeset
200 return "A main DICOM Tag has been defined multiple times for the same resource level";
b7ce2bb6b881 refactored the list of MainDicomTags to be able to change it dynamicaly. Unit tests and Integration tests ok
Alain Mazy <am@osimis.io>
parents: 4912
diff changeset
201
1582
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
202 case ErrorCode_SQLiteNotOpened:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
203 return "SQLite: The database is not opened";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
204
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
205 case ErrorCode_SQLiteAlreadyOpened:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
206 return "SQLite: Connection is already open";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
207
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
208 case ErrorCode_SQLiteCannotOpen:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
209 return "SQLite: Unable to open the database";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
210
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
211 case ErrorCode_SQLiteStatementAlreadyUsed:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
212 return "SQLite: This cached statement is already being referred to";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
213
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
214 case ErrorCode_SQLiteExecute:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
215 return "SQLite: Cannot execute a command";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
216
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
217 case ErrorCode_SQLiteRollbackWithoutTransaction:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
218 return "SQLite: Rolling back a nonexistent transaction (have you called Begin()?)";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
219
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
220 case ErrorCode_SQLiteCommitWithoutTransaction:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
221 return "SQLite: Committing a nonexistent transaction";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
222
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
223 case ErrorCode_SQLiteRegisterFunction:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
224 return "SQLite: Unable to register a function";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
225
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
226 case ErrorCode_SQLiteFlush:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
227 return "SQLite: Unable to flush the database";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
228
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
229 case ErrorCode_SQLiteCannotRun:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
230 return "SQLite: Cannot run a cached statement";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
231
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
232 case ErrorCode_SQLiteCannotStep:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
233 return "SQLite: Cannot step over a cached statement";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
234
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
235 case ErrorCode_SQLiteBindOutOfRange:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
236 return "SQLite: Bing a value while out of range (serious error)";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
237
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
238 case ErrorCode_SQLitePrepareStatement:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
239 return "SQLite: Cannot prepare a cached statement";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
240
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
241 case ErrorCode_SQLiteTransactionAlreadyStarted:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
242 return "SQLite: Beginning the same transaction twice";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
243
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
244 case ErrorCode_SQLiteTransactionCommit:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
245 return "SQLite: Failure when committing the transaction";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
246
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
247 case ErrorCode_SQLiteTransactionBegin:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
248 return "SQLite: Cannot start a transaction";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
249
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
250 case ErrorCode_DirectoryOverFile:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
251 return "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
252
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
253 case ErrorCode_FileStorageCannotWrite:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
254 return "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
255
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
256 case ErrorCode_DirectoryExpected:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
257 return "The specified path does not point to a directory";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
258
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
259 case ErrorCode_HttpPortInUse:
1949
d90f737f2dde warn about the use of privileged ports
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1926
diff changeset
260 return "The TCP port of the HTTP server is privileged or already in use";
1582
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
261
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
262 case ErrorCode_DicomPortInUse:
1949
d90f737f2dde warn about the use of privileged ports
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1926
diff changeset
263 return "The TCP port of the DICOM server is privileged or already in use";
1582
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
264
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
265 case ErrorCode_BadHttpStatusInRest:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
266 return "This HTTP status is not allowed in a REST API";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
267
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
268 case ErrorCode_RegularFileExpected:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
269 return "The specified path does not point to a regular file";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
270
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
271 case ErrorCode_PathToExecutable:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
272 return "Unable to get the path to the executable";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
273
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
274 case ErrorCode_MakeDirectory:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
275 return "Cannot create a directory";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
276
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
277 case ErrorCode_BadApplicationEntityTitle:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
278 return "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
279
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
280 case ErrorCode_NoCFindHandler:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
281 return "No request handler factory for DICOM C-FIND SCP";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
282
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
283 case ErrorCode_NoCMoveHandler:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
284 return "No request handler factory for DICOM C-MOVE SCP";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
285
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
286 case ErrorCode_NoCStoreHandler:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
287 return "No request handler factory for DICOM C-STORE SCP";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
288
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
289 case ErrorCode_NoApplicationEntityFilter:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
290 return "No application entity filter";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
291
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
292 case ErrorCode_NoSopClassOrInstance:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
293 return "DicomUserConnection: Unable to find the SOP class and instance";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
294
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
295 case ErrorCode_NoPresentationContext:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
296 return "DicomUserConnection: No acceptable presentation context for modality";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
297
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
298 case ErrorCode_DicomFindUnavailable:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
299 return "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
300
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
301 case ErrorCode_DicomMoveUnavailable:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
302 return "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
303
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
304 case ErrorCode_CannotStoreInstance:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
305 return "Cannot store an instance";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
306
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
307 case ErrorCode_CreateDicomNotString:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
308 return "Only string values are supported when creating DICOM instances";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
309
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
310 case ErrorCode_CreateDicomOverrideTag:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
311 return "Trying to override a value inherited from a parent module";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
312
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
313 case ErrorCode_CreateDicomUseContent:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
314 return "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
315
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
316 case ErrorCode_CreateDicomNoPayload:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
317 return "No payload is present for one instance in the series";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
318
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
319 case ErrorCode_CreateDicomUseDataUriScheme:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
320 return "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
321
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
322 case ErrorCode_CreateDicomBadParent:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
323 return "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
324
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
325 case ErrorCode_CreateDicomParentIsInstance:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
326 return "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
327
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
328 case ErrorCode_CreateDicomParentEncoding:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
329 return "Unable to get the encoding of the parent resource";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
330
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
331 case ErrorCode_UnknownModality:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
332 return "Unknown modality";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
333
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
334 case ErrorCode_BadJobOrdering:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
335 return "Bad ordering of filters in a job";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
336
1583
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
337 case ErrorCode_JsonToLuaTable:
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
338 return "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
339
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
340 case ErrorCode_CannotCreateLua:
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
341 return "Cannot create the Lua context";
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
342
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
343 case ErrorCode_CannotExecuteLua:
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
344 return "Cannot execute a Lua command";
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
345
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
346 case ErrorCode_LuaAlreadyExecuted:
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
347 return "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
348
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
349 case ErrorCode_LuaBadOutput:
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
350 return "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
351
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
352 case ErrorCode_NotLuaPredicate:
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
353 return "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
354
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
355 case ErrorCode_LuaReturnsNoString:
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
356 return "The Lua function does not return a string";
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
357
1630
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
358 case ErrorCode_StorageAreaAlreadyRegistered:
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
359 return "Another plugin has already registered a custom storage area";
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
360
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
361 case ErrorCode_DatabaseBackendAlreadyRegistered:
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
362 return "Another plugin has already registered a custom database back-end";
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
363
1643
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
364 case ErrorCode_DatabaseNotInitialized:
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
365 return "Plugin trying to call the database during its initialization";
1630
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
366
1703
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
367 case ErrorCode_SslDisabled:
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
368 return "Orthanc has been built without SSL support";
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
369
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
370 case ErrorCode_CannotOrderSlices:
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
371 return "Unable to order the slices of the series";
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
372
1786
164d78911382 primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1781
diff changeset
373 case ErrorCode_NoWorklistHandler:
164d78911382 primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1781
diff changeset
374 return "No request handler factory for DICOM C-Find Modality SCP";
164d78911382 primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1781
diff changeset
375
1980
ebce5f456b8e new error code: ErrorCode_AlreadyExistingTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1949
diff changeset
376 case ErrorCode_AlreadyExistingTag:
ebce5f456b8e new error code: ErrorCode_AlreadyExistingTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1949
diff changeset
377 return "Cannot override the value of a tag that already exists";
ebce5f456b8e new error code: ErrorCode_AlreadyExistingTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1949
diff changeset
378
4047
0327421506ad fix paths in GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
379 case ErrorCode_NoStorageCommitmentHandler:
0327421506ad fix paths in GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
380 return "No request handler factory for DICOM N-ACTION SCP (storage commitment)";
0327421506ad fix paths in GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
381
3818
4f78da5613a1 Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents: 3801
diff changeset
382 case ErrorCode_NoCGetHandler:
4f78da5613a1 Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents: 3801
diff changeset
383 return "No request handler factory for DICOM C-GET SCP";
4f78da5613a1 Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents: 3801
diff changeset
384
3404
e280ced38a4c ErrorCode_UnsupportedMediaType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3376
diff changeset
385 case ErrorCode_UnsupportedMediaType:
e280ced38a4c ErrorCode_UnsupportedMediaType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3376
diff changeset
386 return "Unsupported media type";
e280ced38a4c ErrorCode_UnsupportedMediaType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3376
diff changeset
387
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
388 default:
1703
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
389 if (error >= ErrorCode_START_PLUGINS)
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
390 {
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
391 return "Error encountered within some plugin";
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
392 }
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
393 else
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
394 {
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
395 return "Unknown error code";
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
396 }
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
397 }
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
398 }
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
399
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
400
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401 const char* EnumerationToString(HttpMethod method)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 switch (method)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405 case HttpMethod_Get:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406 return "GET";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408 case HttpMethod_Post:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409 return "POST";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
411 case HttpMethod_Delete:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
412 return "DELETE";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414 case HttpMethod_Put:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415 return "PUT";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
417 default:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 return "?";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
423 const char* EnumerationToString(HttpStatus status)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
425 switch (status)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427 case HttpStatus_100_Continue:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428 return "Continue";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
429
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
430 case HttpStatus_101_SwitchingProtocols:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
431 return "Switching Protocols";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
432
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433 case HttpStatus_102_Processing:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434 return "Processing";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
435
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
436 case HttpStatus_200_Ok:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437 return "OK";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
439 case HttpStatus_201_Created:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
440 return "Created";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
441
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
442 case HttpStatus_202_Accepted:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
443 return "Accepted";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
444
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
445 case HttpStatus_203_NonAuthoritativeInformation:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
446 return "Non-Authoritative Information";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
447
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
448 case HttpStatus_204_NoContent:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
449 return "No Content";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
450
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451 case HttpStatus_205_ResetContent:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
452 return "Reset Content";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
453
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
454 case HttpStatus_206_PartialContent:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
455 return "Partial Content";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
456
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
457 case HttpStatus_207_MultiStatus:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
458 return "Multi-Status";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
459
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
460 case HttpStatus_208_AlreadyReported:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
461 return "Already Reported";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
462
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
463 case HttpStatus_226_IMUsed:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
464 return "IM Used";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
465
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
466 case HttpStatus_300_MultipleChoices:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
467 return "Multiple Choices";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
468
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
469 case HttpStatus_301_MovedPermanently:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470 return "Moved Permanently";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
471
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
472 case HttpStatus_302_Found:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
473 return "Found";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
474
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475 case HttpStatus_303_SeeOther:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
476 return "See Other";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478 case HttpStatus_304_NotModified:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
479 return "Not Modified";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
480
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
481 case HttpStatus_305_UseProxy:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
482 return "Use Proxy";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
483
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
484 case HttpStatus_307_TemporaryRedirect:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
485 return "Temporary Redirect";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
486
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
487 case HttpStatus_400_BadRequest:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
488 return "Bad Request";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
489
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
490 case HttpStatus_401_Unauthorized:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
491 return "Unauthorized";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
492
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
493 case HttpStatus_402_PaymentRequired:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
494 return "Payment Required";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
495
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
496 case HttpStatus_403_Forbidden:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
497 return "Forbidden";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
498
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
499 case HttpStatus_404_NotFound:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
500 return "Not Found";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
501
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
502 case HttpStatus_405_MethodNotAllowed:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
503 return "Method Not Allowed";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
504
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
505 case HttpStatus_406_NotAcceptable:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
506 return "Not Acceptable";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
507
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
508 case HttpStatus_407_ProxyAuthenticationRequired:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
509 return "Proxy Authentication Required";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
510
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511 case HttpStatus_408_RequestTimeout:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
512 return "Request Timeout";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
513
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
514 case HttpStatus_409_Conflict:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
515 return "Conflict";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
516
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
517 case HttpStatus_410_Gone:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
518 return "Gone";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
519
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
520 case HttpStatus_411_LengthRequired:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
521 return "Length Required";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
522
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
523 case HttpStatus_412_PreconditionFailed:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
524 return "Precondition Failed";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
525
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
526 case HttpStatus_413_RequestEntityTooLarge:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
527 return "Request Entity Too Large";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
528
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
529 case HttpStatus_414_RequestUriTooLong:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
530 return "Request-URI Too Long";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
531
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
532 case HttpStatus_415_UnsupportedMediaType:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
533 return "Unsupported Media Type";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
534
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
535 case HttpStatus_416_RequestedRangeNotSatisfiable:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
536 return "Requested Range Not Satisfiable";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
537
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
538 case HttpStatus_417_ExpectationFailed:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
539 return "Expectation Failed";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
540
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
541 case HttpStatus_422_UnprocessableEntity:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
542 return "Unprocessable Entity";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
543
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
544 case HttpStatus_423_Locked:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
545 return "Locked";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
546
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
547 case HttpStatus_424_FailedDependency:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
548 return "Failed Dependency";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
549
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
550 case HttpStatus_426_UpgradeRequired:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
551 return "Upgrade Required";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
552
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
553 case HttpStatus_500_InternalServerError:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
554 return "Internal Server Error";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
555
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
556 case HttpStatus_501_NotImplemented:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
557 return "Not Implemented";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
558
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
559 case HttpStatus_502_BadGateway:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
560 return "Bad Gateway";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
561
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
562 case HttpStatus_503_ServiceUnavailable:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
563 return "Service Unavailable";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
564
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
565 case HttpStatus_504_GatewayTimeout:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
566 return "Gateway Timeout";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
567
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
568 case HttpStatus_505_HttpVersionNotSupported:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
569 return "HTTP Version Not Supported";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
570
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
571 case HttpStatus_506_VariantAlsoNegotiates:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
572 return "Variant Also Negotiates";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
573
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
574 case HttpStatus_507_InsufficientStorage:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
575 return "Insufficient Storage";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
576
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
577 case HttpStatus_509_BandwidthLimitExceeded:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
578 return "Bandwidth Limit Exceeded";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
579
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
580 case HttpStatus_510_NotExtended:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
581 return "Not Extended";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
582
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
583 default:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
584 throw OrthancException(ErrorCode_ParameterOutOfRange);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
585 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
586 }
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
587
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
588
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
589 const char* EnumerationToString(ResourceType type)
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
590 {
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
591 switch (type)
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
592 {
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
593 case ResourceType_Patient:
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
594 return "Patient";
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
595
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
596 case ResourceType_Study:
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
597 return "Study";
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
598
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
599 case ResourceType_Series:
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
600 return "Series";
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
601
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
602 case ResourceType_Instance:
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
603 return "Instance";
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
604
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
605 default:
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
606 throw OrthancException(ErrorCode_ParameterOutOfRange);
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
607 }
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
608 }
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
609
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
610
800
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
611 const char* EnumerationToString(ImageFormat format)
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
612 {
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
613 switch (format)
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
614 {
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
615 case ImageFormat_Png:
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
616 return "Png";
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
617
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
618 default:
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
619 throw OrthancException(ErrorCode_ParameterOutOfRange);
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
620 }
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
621 }
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
622
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
623
1086
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
624 const char* EnumerationToString(Encoding encoding)
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
625 {
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
626 switch (encoding)
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
627 {
1087
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
628 case Encoding_Ascii:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
629 return "Ascii";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
630
1086
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
631 case Encoding_Utf8:
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
632 return "Utf8";
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
633
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
634 case Encoding_Latin1:
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
635 return "Latin1";
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
636
1087
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
637 case Encoding_Latin2:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
638 return "Latin2";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
639
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
640 case Encoding_Latin3:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
641 return "Latin3";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
642
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
643 case Encoding_Latin4:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
644 return "Latin4";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
645
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
646 case Encoding_Latin5:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
647 return "Latin5";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
648
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
649 case Encoding_Cyrillic:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
650 return "Cyrillic";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
651
1347
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
652 case Encoding_Windows1251:
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
653 return "Windows1251";
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
654
1087
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
655 case Encoding_Arabic:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
656 return "Arabic";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
657
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
658 case Encoding_Greek:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
659 return "Greek";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
660
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
661 case Encoding_Hebrew:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
662 return "Hebrew";
1086
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
663
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
664 case Encoding_Thai:
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
665 return "Thai";
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
666
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
667 case Encoding_Japanese:
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
668 return "Japanese";
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
669
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
670 case Encoding_Chinese:
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
671 return "Chinese";
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
672
3217
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
673 case Encoding_Korean:
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
674 return "Korean";
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
675
3218
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
676 case Encoding_JapaneseKanji:
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
677 return "JapaneseKanji";
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
678
3226
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
679 case Encoding_SimplifiedChinese:
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
680 return "SimplifiedChinese";
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
681
1086
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
682 default:
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
683 throw OrthancException(ErrorCode_ParameterOutOfRange);
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
684 }
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
685 }
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
686
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
687
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
688 const char* EnumerationToString(PhotometricInterpretation photometric)
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
689 {
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
690 switch (photometric)
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
691 {
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
692 case PhotometricInterpretation_RGB:
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
693 return "RGB";
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
694
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
695 case PhotometricInterpretation_Monochrome1:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
696 return "MONOCHROME1";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
697
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
698 case PhotometricInterpretation_Monochrome2:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
699 return "MONOCHROME2";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
700
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
701 case PhotometricInterpretation_ARGB:
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
702 return "ARGB";
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
703
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
704 case PhotometricInterpretation_CMYK:
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
705 return "CMYK";
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
706
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
707 case PhotometricInterpretation_HSV:
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
708 return "HSV";
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
709
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
710 case PhotometricInterpretation_Palette:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
711 return "PALETTE COLOR";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
712
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
713 case PhotometricInterpretation_YBRFull:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
714 return "YBR_FULL";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
715
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
716 case PhotometricInterpretation_YBRFull422:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
717 return "YBR_FULL_422";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
718
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
719 case PhotometricInterpretation_YBRPartial420:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
720 return "YBR_PARTIAL_420";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
721
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
722 case PhotometricInterpretation_YBRPartial422:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
723 return "YBR_PARTIAL_422";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
724
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
725 case PhotometricInterpretation_YBR_ICT:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
726 return "YBR_ICT";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
727
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
728 case PhotometricInterpretation_YBR_RCT:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
729 return "YBR_RCT";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
730
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
731 case PhotometricInterpretation_Unknown:
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
732 return "Unknown";
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
733
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
734 default:
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
735 throw OrthancException(ErrorCode_ParameterOutOfRange);
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
736 }
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
737 }
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
738
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
739
1571
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
740 const char* EnumerationToString(RequestOrigin origin)
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
741 {
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
742 switch (origin)
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
743 {
1572
904096e7367e More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
744 case RequestOrigin_Unknown:
904096e7367e More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
745 return "Unknown";
904096e7367e More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
746
1571
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
747 case RequestOrigin_DicomProtocol:
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
748 return "DicomProtocol";
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
749
1823
0ef4e6e66b56 "Origin" metadata for the instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
750 case RequestOrigin_RestApi:
0ef4e6e66b56 "Origin" metadata for the instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
751 return "RestApi";
1571
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
752
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
753 case RequestOrigin_Plugins:
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
754 return "Plugins";
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
755
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
756 case RequestOrigin_Lua:
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
757 return "Lua";
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
758
4245
c70df925151e RequestOrigin_WebDav
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4177
diff changeset
759 case RequestOrigin_WebDav:
c70df925151e RequestOrigin_WebDav
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4177
diff changeset
760 return "WebDav";
c70df925151e RequestOrigin_WebDav
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4177
diff changeset
761
1571
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
762 default:
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
763 throw OrthancException(ErrorCode_ParameterOutOfRange);
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
764 }
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
765 }
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
766
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
767
1926
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
768 const char* EnumerationToString(PixelFormat format)
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
769 {
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
770 switch (format)
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
771 {
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
772 case PixelFormat_RGB24:
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
773 return "RGB24";
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
774
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
775 case PixelFormat_RGBA32:
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
776 return "RGBA32";
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
777
2089
7a969f235adf PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2007
diff changeset
778 case PixelFormat_BGRA32:
7a969f235adf PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2007
diff changeset
779 return "BGRA32";
7a969f235adf PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2007
diff changeset
780
1926
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
781 case PixelFormat_Grayscale8:
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
782 return "Grayscale (unsigned 8bpp)";
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
783
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
784 case PixelFormat_Grayscale16:
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
785 return "Grayscale (unsigned 16bpp)";
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
786
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
787 case PixelFormat_SignedGrayscale16:
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
788 return "Grayscale (signed 16bpp)";
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
789
1993
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
790 case PixelFormat_Float32:
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
791 return "Grayscale (float 32bpp)";
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
792
2415
7e217a1cc63f PixelFormat_Float32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2407
diff changeset
793 case PixelFormat_Grayscale32:
7e217a1cc63f PixelFormat_Float32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2407
diff changeset
794 return "Grayscale (unsigned 32bpp)";
7e217a1cc63f PixelFormat_Float32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2407
diff changeset
795
2645
89b789366596 Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
796 case PixelFormat_Grayscale64:
89b789366596 Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
797 return "Grayscale (unsigned 64bpp)";
89b789366596 Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
798
2423
5a7c5c541a1d Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2415
diff changeset
799 case PixelFormat_RGB48:
5a7c5c541a1d Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2415
diff changeset
800 return "RGB48";
5a7c5c541a1d Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2415
diff changeset
801
1926
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
802 default:
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
803 throw OrthancException(ErrorCode_ParameterOutOfRange);
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
804 }
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
805 }
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
806
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
807
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
808 const char* EnumerationToString(ModalityManufacturer manufacturer)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
809 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
810 switch (manufacturer)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
811 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
812 case ModalityManufacturer_Generic:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
813 return "Generic";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
814
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
815 case ModalityManufacturer_GenericNoWildcardInDates:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
816 return "GenericNoWildcardInDates";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
817
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
818 case ModalityManufacturer_GenericNoUniversalWildcard:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
819 return "GenericNoUniversalWildcard";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
820
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
821 case ModalityManufacturer_Vitrea:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
822 return "Vitrea";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
823
2888
61a5667f37d9 New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
824 case ModalityManufacturer_GE:
61a5667f37d9 New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
825 return "GE";
61a5667f37d9 New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
826
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
827 default:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
828 throw OrthancException(ErrorCode_ParameterOutOfRange);
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
829 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
830 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
831
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
832
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
833 const char* EnumerationToString(DicomRequestType type)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
834 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
835 switch (type)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
836 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
837 case DicomRequestType_Echo:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
838 return "Echo";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
839 break;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
840
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
841 case DicomRequestType_Find:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
842 return "Find";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
843 break;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
844
4888
8523078f3f4b added new configuration to authorize C-Find for worklist independently from other C-Find
Alain Mazy <am@osimis.io>
parents: 4887
diff changeset
845 case DicomRequestType_FindWorklist:
4912
45d6ce72a84e fix linking of Sanitizer sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4888
diff changeset
846 return "FindWorklist";
4888
8523078f3f4b added new configuration to authorize C-Find for worklist independently from other C-Find
Alain Mazy <am@osimis.io>
parents: 4887
diff changeset
847 break;
8523078f3f4b added new configuration to authorize C-Find for worklist independently from other C-Find
Alain Mazy <am@osimis.io>
parents: 4887
diff changeset
848
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
849 case DicomRequestType_Get:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
850 return "Get";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
851 break;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
852
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
853 case DicomRequestType_Move:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
854 return "Move";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
855 break;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
856
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
857 case DicomRequestType_Store:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
858 return "Store";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
859 break;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
860
3602
085283445db0 AllowNAction in remote modality parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3561
diff changeset
861 case DicomRequestType_NAction:
3613
c1e2b91c2ab4 all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3603
diff changeset
862 return "N-ACTION";
c1e2b91c2ab4 all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3603
diff changeset
863 break;
c1e2b91c2ab4 all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3603
diff changeset
864
c1e2b91c2ab4 all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3603
diff changeset
865 case DicomRequestType_NEventReport:
c1e2b91c2ab4 all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3603
diff changeset
866 return "N-EVENT-REPORT";
3602
085283445db0 AllowNAction in remote modality parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3561
diff changeset
867 break;
085283445db0 AllowNAction in remote modality parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3561
diff changeset
868
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
869 default:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
870 throw OrthancException(ErrorCode_ParameterOutOfRange);
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
871 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
872 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
873
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
874
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
875 const char* EnumerationToString(DicomVersion version)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
876 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
877 switch (version)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
878 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
879 case DicomVersion_2008:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
880 return "2008";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
881 break;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
882
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
883 case DicomVersion_2017c:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
884 return "2017c";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
885 break;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
886
4677
521e39b3f2c0 Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4623
diff changeset
887 case DicomVersion_2021b:
521e39b3f2c0 Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4623
diff changeset
888 return "2021b";
521e39b3f2c0 Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4623
diff changeset
889 break;
521e39b3f2c0 Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4623
diff changeset
890
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
891 default:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
892 throw OrthancException(ErrorCode_ParameterOutOfRange);
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
893 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
894 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
895
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
896
2499
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
897 const char* EnumerationToString(ValueRepresentation vr)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
898 {
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
899 switch (vr)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
900 {
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
901 case ValueRepresentation_ApplicationEntity: // AE
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
902 return "AE";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
903
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
904 case ValueRepresentation_AgeString: // AS
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
905 return "AS";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
906
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
907 case ValueRepresentation_AttributeTag: // AT (2 x uint16_t)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
908 return "AT";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
909
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
910 case ValueRepresentation_CodeString: // CS
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
911 return "CS";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
912
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
913 case ValueRepresentation_Date: // DA
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
914 return "DA";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
915
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
916 case ValueRepresentation_DecimalString: // DS
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
917 return "DS";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
918
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
919 case ValueRepresentation_DateTime: // DT
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
920 return "DT";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
921
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
922 case ValueRepresentation_FloatingPointSingle: // FL (float)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
923 return "FL";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
924
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
925 case ValueRepresentation_FloatingPointDouble: // FD (double)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
926 return "FD";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
927
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
928 case ValueRepresentation_IntegerString: // IS
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
929 return "IS";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
930
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
931 case ValueRepresentation_LongString: // LO
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
932 return "LO";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
933
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
934 case ValueRepresentation_LongText: // LT
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
935 return "LT";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
936
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
937 case ValueRepresentation_OtherByte: // OB
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
938 return "OB";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
939
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
940 case ValueRepresentation_OtherDouble: // OD
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
941 return "OD";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
942
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
943 case ValueRepresentation_OtherFloat: // OF
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
944 return "OF";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
945
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
946 case ValueRepresentation_OtherLong: // OL
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
947 return "OL";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
948
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
949 case ValueRepresentation_OtherWord: // OW
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
950 return "OW";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
951
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
952 case ValueRepresentation_PersonName: // PN
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
953 return "PN";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
954
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
955 case ValueRepresentation_ShortString: // SH
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
956 return "SH";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
957
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
958 case ValueRepresentation_SignedLong: // SL (int32_t)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
959 return "SL";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
960
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
961 case ValueRepresentation_Sequence: // SQ
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
962 return "SQ";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
963
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
964 case ValueRepresentation_SignedShort: // SS (int16_t)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
965 return "SS";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
966
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
967 case ValueRepresentation_ShortText: // ST
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
968 return "ST";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
969
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
970 case ValueRepresentation_Time: // TM
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
971 return "TM";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
972
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
973 case ValueRepresentation_UnlimitedCharacters: // UC
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
974 return "UC";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
975
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
976 case ValueRepresentation_UniqueIdentifier: // UI (UID)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
977 return "UI";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
978
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
979 case ValueRepresentation_UnsignedLong: // UL (uint32_t)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
980 return "UL";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
981
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
982 case ValueRepresentation_Unknown: // UN
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
983 return "UN";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
984
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
985 case ValueRepresentation_UniversalResource: // UR (URI or URL)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
986 return "UR";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
987
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
988 case ValueRepresentation_UnsignedShort: // US (uint16_t)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
989 return "US";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
990
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
991 case ValueRepresentation_UnlimitedText: // UT
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
992 return "UT";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
993
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
994 case ValueRepresentation_NotSupported:
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
995 return "Not supported";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
996
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
997 default:
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
998 throw OrthancException(ErrorCode_ParameterOutOfRange);
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
999 }
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1000 }
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1001
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1002
2569
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1003 const char* EnumerationToString(JobState state)
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1004 {
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1005 switch (state)
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1006 {
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1007 case JobState_Pending:
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1008 return "Pending";
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1009
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1010 case JobState_Running:
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1011 return "Running";
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1012
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1013 case JobState_Success:
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1014 return "Success";
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1015
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1016 case JobState_Failure:
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1017 return "Failure";
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1018
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1019 case JobState_Paused:
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1020 return "Paused";
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1021
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1022 case JobState_Retry:
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1023 return "Retry";
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1024
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1025 default:
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1026 throw OrthancException(ErrorCode_ParameterOutOfRange);
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1027 }
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1028 }
2908
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1029
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1030
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1031 const char* EnumerationToString(MimeType mime)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1032 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1033 switch (mime)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1034 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1035 case MimeType_Binary:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1036 return MIME_BINARY;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1037
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1038 case MimeType_Dicom:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1039 return MIME_DICOM;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1040
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1041 case MimeType_Jpeg:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1042 return MIME_JPEG;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1043
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1044 case MimeType_Jpeg2000:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1045 return MIME_JPEG2000;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1046
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1047 case MimeType_Json:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1048 return MIME_JSON;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1049
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1050 case MimeType_Pdf:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1051 return MIME_PDF;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1052
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1053 case MimeType_Png:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1054 return MIME_PNG;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1055
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1056 case MimeType_Xml:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1057 return MIME_XML;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1058
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1059 case MimeType_PlainText:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1060 return MIME_PLAIN_TEXT;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1061
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1062 case MimeType_Pam:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1063 return MIME_PAM;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1064
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1065 case MimeType_Html:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1066 return MIME_HTML;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1067
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1068 case MimeType_Gzip:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1069 return MIME_GZIP;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1070
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1071 case MimeType_JavaScript:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1072 return MIME_JAVASCRIPT;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1073
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1074 case MimeType_Css:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1075 return MIME_CSS;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1076
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1077 case MimeType_WebAssembly:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1078 return MIME_WEB_ASSEMBLY;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1079
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1080 case MimeType_Gif:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1081 return MIME_GIF;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1082
2976
cb5d75143da0 Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2954
diff changeset
1083 case MimeType_Zip:
cb5d75143da0 Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2954
diff changeset
1084 return MIME_ZIP;
cb5d75143da0 Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2954
diff changeset
1085
2984
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1086 case MimeType_NaCl:
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1087 return MIME_NACL;
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1088
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1089 case MimeType_PNaCl:
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1090 return MIME_PNACL;
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1091
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1092 case MimeType_Svg:
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1093 return MIME_SVG;
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1094
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1095 case MimeType_Woff:
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1096 return MIME_WOFF;
3174
8ea7c4546c3a primitives to collect metrics in Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
1097
3435
c08bb6ac3b7f new mime type: font/woff2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3404
diff changeset
1098 case MimeType_Woff2:
c08bb6ac3b7f new mime type: font/woff2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3404
diff changeset
1099 return MIME_WOFF2;
c08bb6ac3b7f new mime type: font/woff2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3404
diff changeset
1100
3174
8ea7c4546c3a primitives to collect metrics in Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
1101 case MimeType_PrometheusText:
8ea7c4546c3a primitives to collect metrics in Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
1102 // https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format
8ea7c4546c3a primitives to collect metrics in Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
1103 return "text/plain; version=0.0.4";
3203
810772486249 URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3174
diff changeset
1104
810772486249 URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3174
diff changeset
1105 case MimeType_DicomWebJson:
810772486249 URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3174
diff changeset
1106 return MIME_DICOM_WEB_JSON;
810772486249 URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3174
diff changeset
1107
810772486249 URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3174
diff changeset
1108 case MimeType_DicomWebXml:
810772486249 URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3174
diff changeset
1109 return MIME_DICOM_WEB_XML;
4887
a29a6bdba9dd mime type for .ico
Alain Mazy <am@osimis.io>
parents: 4870
diff changeset
1110
a29a6bdba9dd mime type for .ico
Alain Mazy <am@osimis.io>
parents: 4870
diff changeset
1111 case MimeType_Ico:
a29a6bdba9dd mime type for .ico
Alain Mazy <am@osimis.io>
parents: 4870
diff changeset
1112 return MIME_ICO;
a29a6bdba9dd mime type for .ico
Alain Mazy <am@osimis.io>
parents: 4870
diff changeset
1113
2908
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1114 default:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1115 throw OrthancException(ErrorCode_ParameterOutOfRange);
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1116 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1117 }
2569
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1118
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1119
3530
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1120 const char* EnumerationToString(Endianness endianness)
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1121 {
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1122 switch (endianness)
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1123 {
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1124 case Endianness_Little:
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1125 return "Little-endian";
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1126
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1127 case Endianness_Big:
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1128 return "Big-endian";
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1129
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1130 case Endianness_Unknown:
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1131 return "Unknown endianness";
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1132
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1133 default:
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1134 throw OrthancException(ErrorCode_ParameterOutOfRange);
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1135 }
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1136 }
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1137
b26b6ea27648 endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3435
diff changeset
1138
3737
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1139 const char* EnumerationToString(StorageCommitmentFailureReason reason)
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1140 {
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1141 switch (reason)
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1142 {
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1143 case StorageCommitmentFailureReason_Success:
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1144 return "Success";
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1145
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1146 case StorageCommitmentFailureReason_ProcessingFailure:
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1147 return "A general failure in processing the operation was encountered";
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1148
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1149 case StorageCommitmentFailureReason_NoSuchObjectInstance:
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1150 return "One or more of the elements in the Referenced SOP "
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1151 "Instance Sequence was not available";
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1152
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1153 case StorageCommitmentFailureReason_ResourceLimitation:
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1154 return "The SCP does not currently have enough resources to "
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1155 "store the requested SOP Instance(s)";
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1156
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1157 case StorageCommitmentFailureReason_ReferencedSOPClassNotSupported:
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1158 return "Storage Commitment has been requested for a SOP Instance "
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1159 "with a SOP Class that is not supported by the SCP";
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1160
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1161 case StorageCommitmentFailureReason_ClassInstanceConflict:
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1162 return "The SOP Class of an element in the Referenced SOP Instance Sequence "
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1163 "did not correspond to the SOP class registered for this SOP Instance at the SCP";
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1164
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1165 case StorageCommitmentFailureReason_DuplicateTransactionUID:
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1166 return "The Transaction UID of the Storage Commitment Request is already in use";
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1167
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1168 default:
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1169 return "Unknown failure reason";
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1170 }
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1171 }
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1172
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
1173
4730
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1174 const char* EnumerationToString(DicomToJsonFormat format)
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1175 {
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1176 switch (format)
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1177 {
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1178 case DicomToJsonFormat_Full:
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1179 return "Full";
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1180
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1181 case DicomToJsonFormat_Human:
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1182 return "Simplify";
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1183
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1184 case DicomToJsonFormat_Short:
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1185 return "Short";
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1186
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1187 default:
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1188 throw OrthancException(ErrorCode_ParameterOutOfRange);
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1189 }
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1190 }
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1191
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1192
1086
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1193 Encoding StringToEncoding(const char* encoding)
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1194 {
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1195 std::string s(encoding);
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1196 Toolbox::ToUpperCase(s);
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1197
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1198 if (s == "UTF8")
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1199 {
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1200 return Encoding_Utf8;
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1201 }
1087
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1202
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1203 if (s == "ASCII")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1204 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1205 return Encoding_Ascii;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1206 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1207
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1208 if (s == "LATIN1")
1086
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1209 {
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1210 return Encoding_Latin1;
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1211 }
1087
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1212
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1213 if (s == "LATIN2")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1214 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1215 return Encoding_Latin2;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1216 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1217
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1218 if (s == "LATIN3")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1219 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1220 return Encoding_Latin3;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1221 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1222
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1223 if (s == "LATIN4")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1224 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1225 return Encoding_Latin4;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1226 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1227
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1228 if (s == "LATIN5")
1086
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1229 {
1087
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1230 return Encoding_Latin5;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1231 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1232
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1233 if (s == "CYRILLIC")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1234 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1235 return Encoding_Cyrillic;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1236 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1237
1347
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
1238 if (s == "WINDOWS1251")
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
1239 {
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
1240 return Encoding_Windows1251;
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
1241 }
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
1242
1087
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1243 if (s == "ARABIC")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1244 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1245 return Encoding_Arabic;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1246 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1247
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1248 if (s == "GREEK")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1249 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1250 return Encoding_Greek;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1251 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1252
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1253 if (s == "HEBREW")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1254 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1255 return Encoding_Hebrew;
1086
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1256 }
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1257
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1258 if (s == "THAI")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1259 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1260 return Encoding_Thai;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1261 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1262
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1263 if (s == "JAPANESE")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1264 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1265 return Encoding_Japanese;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1266 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1267
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1268 if (s == "CHINESE")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1269 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1270 return Encoding_Chinese;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1271 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1272
3217
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
1273 if (s == "KOREAN")
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
1274 {
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
1275 return Encoding_Korean;
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
1276 }
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
1277
3219
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3218
diff changeset
1278 if (s == "JAPANESEKANJI")
3218
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
1279 {
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
1280 return Encoding_JapaneseKanji;
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
1281 }
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
1282
3226
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
1283 if (s == "SIMPLIFIEDCHINESE")
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
1284 {
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
1285 return Encoding_SimplifiedChinese;
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
1286 }
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
1287
1086
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1288 throw OrthancException(ErrorCode_ParameterOutOfRange);
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1289 }
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1290
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1291
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1292 ResourceType StringToResourceType(const char* type)
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1293 {
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1294 std::string s(type);
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1295 Toolbox::ToUpperCase(s);
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1296
697
dd1ce9a2844c access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
1297 if (s == "PATIENT" || s == "PATIENTS")
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1298 {
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1299 return ResourceType_Patient;
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1300 }
697
dd1ce9a2844c access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
1301 else if (s == "STUDY" || s == "STUDIES")
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1302 {
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1303 return ResourceType_Study;
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1304 }
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1305 else if (s == "SERIES")
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1306 {
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1307 return ResourceType_Series;
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1308 }
697
dd1ce9a2844c access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
1309 else if (s == "INSTANCE" || s == "IMAGE" ||
dd1ce9a2844c access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
1310 s == "INSTANCES" || s == "IMAGES")
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1311 {
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1312 return ResourceType_Instance;
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1313 }
800
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1314
5037
3444990cf295 cleanup
Alain Mazy <am@osimis.io>
parents: 5025
diff changeset
1315 throw OrthancException(ErrorCode_ParameterOutOfRange, std::string("Invalid resource type '") + type + "'");
800
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1316 }
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1317
5025
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1318 const char* ResourceTypeToDicomQueryRetrieveLevel(ResourceType type)
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1319 {
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1320 if (type == ResourceType_Patient)
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1321 {
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1322 return "PATIENT";
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1323 }
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1324 else if (type == ResourceType_Study)
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1325 {
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1326 return "STUDY";
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1327 }
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1328 else if (type == ResourceType_Series)
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1329 {
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1330 return "SERIES";
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1331 }
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1332 else if (type == ResourceType_Instance)
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1333 {
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1334 return "IMAGE";
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1335 }
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1336
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1337 throw OrthancException(ErrorCode_ParameterOutOfRange);
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4932
diff changeset
1338 }
800
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1339
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1340 ImageFormat StringToImageFormat(const char* format)
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1341 {
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1342 std::string s(format);
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1343 Toolbox::ToUpperCase(s);
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1344
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1345 if (s == "PNG")
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1346 {
800
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1347 return ImageFormat_Png;
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1348 }
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1349
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1350 throw OrthancException(ErrorCode_ParameterOutOfRange);
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1351 }
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1352
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1353
2006
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1354 ValueRepresentation StringToValueRepresentation(const std::string& vr,
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1355 bool throwIfUnsupported)
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1356 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1357 if (vr == "AE")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1358 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1359 return ValueRepresentation_ApplicationEntity;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1360 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1361 else if (vr == "AS")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1362 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1363 return ValueRepresentation_AgeString;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1364 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1365 else if (vr == "AT")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1366 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1367 return ValueRepresentation_AttributeTag;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1368 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1369 else if (vr == "CS")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1370 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1371 return ValueRepresentation_CodeString;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1372 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1373 else if (vr == "DA")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1374 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1375 return ValueRepresentation_Date;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1376 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1377 else if (vr == "DS")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1378 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1379 return ValueRepresentation_DecimalString;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1380 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1381 else if (vr == "DT")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1382 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1383 return ValueRepresentation_DateTime;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1384 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1385 else if (vr == "FL")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1386 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1387 return ValueRepresentation_FloatingPointSingle;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1388 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1389 else if (vr == "FD")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1390 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1391 return ValueRepresentation_FloatingPointDouble;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1392 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1393 else if (vr == "IS")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1394 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1395 return ValueRepresentation_IntegerString;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1396 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1397 else if (vr == "LO")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1398 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1399 return ValueRepresentation_LongString;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1400 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1401 else if (vr == "LT")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1402 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1403 return ValueRepresentation_LongText;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1404 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1405 else if (vr == "OB")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1406 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1407 return ValueRepresentation_OtherByte;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1408 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1409 else if (vr == "OD")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1410 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1411 return ValueRepresentation_OtherDouble;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1412 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1413 else if (vr == "OF")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1414 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1415 return ValueRepresentation_OtherFloat;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1416 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1417 else if (vr == "OL")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1418 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1419 return ValueRepresentation_OtherLong;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1420 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1421 else if (vr == "OW")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1422 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1423 return ValueRepresentation_OtherWord;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1424 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1425 else if (vr == "PN")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1426 {
2007
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
1427 return ValueRepresentation_PersonName;
2006
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1428 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1429 else if (vr == "SH")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1430 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1431 return ValueRepresentation_ShortString;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1432 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1433 else if (vr == "SL")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1434 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1435 return ValueRepresentation_SignedLong;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1436 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1437 else if (vr == "SQ")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1438 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1439 return ValueRepresentation_Sequence;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1440 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1441 else if (vr == "SS")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1442 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1443 return ValueRepresentation_SignedShort;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1444 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1445 else if (vr == "ST")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1446 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1447 return ValueRepresentation_ShortText;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1448 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1449 else if (vr == "TM")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1450 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1451 return ValueRepresentation_Time;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1452 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1453 else if (vr == "UC")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1454 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1455 return ValueRepresentation_UnlimitedCharacters;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1456 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1457 else if (vr == "UI")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1458 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1459 return ValueRepresentation_UniqueIdentifier;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1460 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1461 else if (vr == "UL")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1462 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1463 return ValueRepresentation_UnsignedLong;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1464 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1465 else if (vr == "UN")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1466 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1467 return ValueRepresentation_Unknown;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1468 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1469 else if (vr == "UR")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1470 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1471 return ValueRepresentation_UniversalResource;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1472 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1473 else if (vr == "US")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1474 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1475 return ValueRepresentation_UnsignedShort;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1476 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1477 else if (vr == "UT")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1478 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1479 return ValueRepresentation_UnlimitedText;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1480 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1481 else
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1482 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1483 std::string s = "Unsupported value representation encountered: " + vr;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1484
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1485 if (throwIfUnsupported)
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1486 {
2954
d924f9bb61cc taking advantage of details in OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2953
diff changeset
1487 throw OrthancException(ErrorCode_ParameterOutOfRange, s);
2006
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1488 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1489 else
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1490 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1491 LOG(INFO) << s;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1492 return ValueRepresentation_NotSupported;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1493 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1494 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1495 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1496
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1497
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1498 PhotometricInterpretation StringToPhotometricInterpretation(const char* value)
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1499 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1500 // http://dicom.nema.org/medical/dicom/2017a/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1501 std::string s(value);
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1502
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1503 if (s == "MONOCHROME1")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1504 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1505 return PhotometricInterpretation_Monochrome1;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1506 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1507
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1508 if (s == "MONOCHROME2")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1509 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1510 return PhotometricInterpretation_Monochrome2;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1511 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1512
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1513 if (s == "PALETTE COLOR")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1514 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1515 return PhotometricInterpretation_Palette;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1516 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1517
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1518 if (s == "RGB")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1519 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1520 return PhotometricInterpretation_RGB;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1521 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1522
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1523 if (s == "HSV")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1524 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1525 return PhotometricInterpretation_HSV;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1526 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1527
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1528 if (s == "ARGB")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1529 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1530 return PhotometricInterpretation_ARGB;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1531 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1532
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1533 if (s == "CMYK")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1534 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1535 return PhotometricInterpretation_CMYK;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1536 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1537
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1538 if (s == "YBR_FULL")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1539 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1540 return PhotometricInterpretation_YBRFull;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1541 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1542
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1543 if (s == "YBR_FULL_422")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1544 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1545 return PhotometricInterpretation_YBRFull422;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1546 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1547
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1548 if (s == "YBR_PARTIAL_422")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1549 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1550 return PhotometricInterpretation_YBRPartial422;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1551 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1552
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1553 if (s == "YBR_PARTIAL_420")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1554 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1555 return PhotometricInterpretation_YBRPartial420;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1556 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1557
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1558 if (s == "YBR_ICT")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1559 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1560 return PhotometricInterpretation_YBR_ICT;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1561 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1562
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1563 if (s == "YBR_RCT")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1564 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1565 return PhotometricInterpretation_YBR_RCT;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1566 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1567
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1568 throw OrthancException(ErrorCode_ParameterOutOfRange);
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1569 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1570
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1571
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1572 ModalityManufacturer StringToModalityManufacturer(const std::string& manufacturer)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1573 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1574 ModalityManufacturer result;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1575 bool obsolete = false;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1576
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1577 if (manufacturer == "Generic")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1578 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1579 return ModalityManufacturer_Generic;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1580 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1581 else if (manufacturer == "GenericNoWildcardInDates")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1582 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1583 return ModalityManufacturer_GenericNoWildcardInDates;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1584 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1585 else if (manufacturer == "GenericNoUniversalWildcard")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1586 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1587 return ModalityManufacturer_GenericNoUniversalWildcard;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1588 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1589 else if (manufacturer == "Vitrea")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1590 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1591 return ModalityManufacturer_Vitrea;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1592 }
2888
61a5667f37d9 New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
1593 else if (manufacturer == "GE")
61a5667f37d9 New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
1594 {
61a5667f37d9 New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
1595 return ModalityManufacturer_GE;
61a5667f37d9 New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
1596 }
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1597 else if (manufacturer == "AgfaImpax" ||
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1598 manufacturer == "SyngoVia")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1599 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1600 result = ModalityManufacturer_GenericNoWildcardInDates;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1601 obsolete = true;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1602 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1603 else if (manufacturer == "EFilm2" ||
3561
bdafff1ce443 C-Find SCU at Instance level now sets the 0008,0052 tag to IMAGE per default (was INSTANCE). Source: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/orthanc-users/FYxHXzlaQ0M/rn6d0SowAAAJ
Alain Mazy <alain@mazy.be>
parents: 3530
diff changeset
1604 manufacturer == "MedInria" ||
bdafff1ce443 C-Find SCU at Instance level now sets the 0008,0052 tag to IMAGE per default (was INSTANCE). Source: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/orthanc-users/FYxHXzlaQ0M/rn6d0SowAAAJ
Alain Mazy <alain@mazy.be>
parents: 3530
diff changeset
1605 manufacturer == "ClearCanvas" ||
bdafff1ce443 C-Find SCU at Instance level now sets the 0008,0052 tag to IMAGE per default (was INSTANCE). Source: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/orthanc-users/FYxHXzlaQ0M/rn6d0SowAAAJ
Alain Mazy <alain@mazy.be>
parents: 3530
diff changeset
1606 manufacturer == "Dcm4Chee"
bdafff1ce443 C-Find SCU at Instance level now sets the 0008,0052 tag to IMAGE per default (was INSTANCE). Source: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/orthanc-users/FYxHXzlaQ0M/rn6d0SowAAAJ
Alain Mazy <alain@mazy.be>
parents: 3530
diff changeset
1607 )
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1608 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1609 result = ModalityManufacturer_Generic;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1610 obsolete = true;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1611 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1612 else
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1613 {
2954
d924f9bb61cc taking advantage of details in OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2953
diff changeset
1614 throw OrthancException(ErrorCode_ParameterOutOfRange,
d924f9bb61cc taking advantage of details in OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2953
diff changeset
1615 "Unknown modality manufacturer: \"" + manufacturer + "\"");
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1616 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1617
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1618 if (obsolete)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1619 {
3561
bdafff1ce443 C-Find SCU at Instance level now sets the 0008,0052 tag to IMAGE per default (was INSTANCE). Source: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/orthanc-users/FYxHXzlaQ0M/rn6d0SowAAAJ
Alain Mazy <alain@mazy.be>
parents: 3530
diff changeset
1620 LOG(WARNING) << "The \"" << manufacturer << "\" manufacturer is now obsolete. "
bdafff1ce443 C-Find SCU at Instance level now sets the 0008,0052 tag to IMAGE per default (was INSTANCE). Source: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/orthanc-users/FYxHXzlaQ0M/rn6d0SowAAAJ
Alain Mazy <alain@mazy.be>
parents: 3530
diff changeset
1621 << "To guarantee compatibility with future Orthanc "
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1622 << "releases, you should replace it by \""
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1623 << EnumerationToString(result)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1624 << "\" in your configuration file.";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1625 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1626
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1627 return result;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1628 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1629
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1630
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1631 DicomVersion StringToDicomVersion(const std::string& version)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1632 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1633 if (version == "2008")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1634 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1635 return DicomVersion_2008;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1636 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1637 else if (version == "2017c")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1638 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1639 return DicomVersion_2017c;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1640 }
4677
521e39b3f2c0 Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4623
diff changeset
1641 else if (version == "2021b")
521e39b3f2c0 Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4623
diff changeset
1642 {
521e39b3f2c0 Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4623
diff changeset
1643 return DicomVersion_2021b;
521e39b3f2c0 Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4623
diff changeset
1644 }
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1645 else
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1646 {
4376
b002f9abe802 review of changeset 4375:208029732d51
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4347
diff changeset
1647 throw OrthancException(ErrorCode_ParameterOutOfRange,
b002f9abe802 review of changeset 4375:208029732d51
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4347
diff changeset
1648 "Unknown specific version of the DICOM standard: " + version);
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1649 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1650 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1651
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1652
2646
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1653 JobState StringToJobState(const std::string& state)
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1654 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1655 if (state == "Pending")
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1656 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1657 return JobState_Pending;
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1658 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1659 else if (state == "Running")
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1660 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1661 return JobState_Running;
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1662 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1663 else if (state == "Success")
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1664 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1665 return JobState_Success;
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1666 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1667 else if (state == "Failure")
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1668 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1669 return JobState_Failure;
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1670 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1671 else if (state == "Paused")
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1672 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1673 return JobState_Paused;
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1674 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1675 else if (state == "Retry")
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1676 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1677 return JobState_Retry;
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1678 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1679 else
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1680 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1681 throw OrthancException(ErrorCode_ParameterOutOfRange);
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1682 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1683 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1684
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1685
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1686 RequestOrigin StringToRequestOrigin(const std::string& origin)
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1687 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1688 if (origin == "Unknown")
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1689 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1690 return RequestOrigin_Unknown;
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1691 }
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1692 else if (origin == "DicomProtocol")
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1693 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1694 return RequestOrigin_DicomProtocol;
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1695 }
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1696 else if (origin == "RestApi")
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1697 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1698 return RequestOrigin_RestApi;
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1699 }
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1700 else if (origin == "Plugins")
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1701 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1702 return RequestOrigin_Plugins;
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1703 }
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1704 else if (origin == "Lua")
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1705 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1706 return RequestOrigin_Lua;
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1707 }
4245
c70df925151e RequestOrigin_WebDav
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4177
diff changeset
1708 else if (origin == "WebDav")
c70df925151e RequestOrigin_WebDav
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4177
diff changeset
1709 {
c70df925151e RequestOrigin_WebDav
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4177
diff changeset
1710 return RequestOrigin_WebDav;
c70df925151e RequestOrigin_WebDav
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4177
diff changeset
1711 }
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1712 else
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1713 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1714 throw OrthancException(ErrorCode_ParameterOutOfRange);
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1715 }
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1716 }
2908
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1717
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1718
4073
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1719 bool LookupMimeType(MimeType& target,
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1720 const std::string& source)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1721 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1722 if (source == MIME_BINARY)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1723 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1724 target = MimeType_Binary;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1725 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1726 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1727 else if (source == MIME_DICOM)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1728 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1729 target = MimeType_Dicom;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1730 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1731 }
5113
a3c3f13368ea clarification that "image/jpg" is not a correct MIME type
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5112
diff changeset
1732 else if (source == MIME_JPEG ||
a3c3f13368ea clarification that "image/jpg" is not a correct MIME type
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5112
diff changeset
1733 source == "image/jpg")
4073
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1734 {
5113
a3c3f13368ea clarification that "image/jpg" is not a correct MIME type
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5112
diff changeset
1735 // Note the tolerance for "image/jpg", which is *not* a standard MIME type
a3c3f13368ea clarification that "image/jpg" is not a correct MIME type
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5112
diff changeset
1736 // https://groups.google.com/g/orthanc-users/c/Y5x37UFKiDg/m/1zI260KTAwAJ
a3c3f13368ea clarification that "image/jpg" is not a correct MIME type
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5112
diff changeset
1737 // https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types
4073
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1738 target = MimeType_Jpeg;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1739 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1740 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1741 else if (source == MIME_JPEG2000)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1742 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1743 target = MimeType_Jpeg2000;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1744 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1745 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1746 else if (source == MIME_JSON)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1747 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1748 target = MimeType_Json;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1749 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1750 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1751 else if (source == MIME_PDF)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1752 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1753 target = MimeType_Pdf;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1754 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1755 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1756 else if (source == MIME_PNG)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1757 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1758 target = MimeType_Png;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1759 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1760 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1761 else if (source == MIME_XML ||
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1762 source == MIME_XML_2)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1763 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1764 target = MimeType_Xml;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1765 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1766 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1767 else if (source == MIME_PLAIN_TEXT)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1768 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1769 target = MimeType_PlainText;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1770 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1771 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1772 else if (source == MIME_PAM)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1773 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1774 target = MimeType_Pam;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1775 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1776 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1777 else if (source == MIME_HTML)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1778 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1779 target = MimeType_Html;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1780 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1781 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1782 else if (source == MIME_GZIP)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1783 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1784 target = MimeType_Gzip;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1785 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1786 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1787 else if (source == MIME_JAVASCRIPT)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1788 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1789 target = MimeType_JavaScript;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1790 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1791 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1792 else if (source == MIME_CSS)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1793 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1794 target = MimeType_Css;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1795 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1796 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1797 else if (source == MIME_WEB_ASSEMBLY)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1798 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1799 target = MimeType_WebAssembly;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1800 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1801 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1802 else if (source == MIME_GIF)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1803 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1804 target = MimeType_Gif;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1805 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1806 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1807 else if (source == MIME_ZIP)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1808 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1809 target = MimeType_Zip;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1810 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1811 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1812 else if (source == MIME_NACL)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1813 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1814 target = MimeType_NaCl;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1815 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1816 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1817 else if (source == MIME_PNACL)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1818 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1819 target = MimeType_PNaCl;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1820 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1821 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1822 else if (source == MIME_SVG)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1823 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1824 target = MimeType_Svg;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1825 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1826 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1827 else if (source == MIME_WOFF)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1828 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1829 target = MimeType_Woff;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1830 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1831 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1832 else if (source == MIME_WOFF2)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1833 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1834 target = MimeType_Woff2;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1835 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1836 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1837 else if (source == MIME_DICOM_WEB_JSON)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1838 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1839 target = MimeType_DicomWebJson;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1840 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1841 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1842 else if (source == MIME_DICOM_WEB_XML)
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1843 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1844 target = MimeType_DicomWebXml;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1845 return true;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1846 }
4887
a29a6bdba9dd mime type for .ico
Alain Mazy <am@osimis.io>
parents: 4870
diff changeset
1847 else if (source == MIME_ICO)
a29a6bdba9dd mime type for .ico
Alain Mazy <am@osimis.io>
parents: 4870
diff changeset
1848 {
a29a6bdba9dd mime type for .ico
Alain Mazy <am@osimis.io>
parents: 4870
diff changeset
1849 target = MimeType_Ico;
a29a6bdba9dd mime type for .ico
Alain Mazy <am@osimis.io>
parents: 4870
diff changeset
1850 return true;
a29a6bdba9dd mime type for .ico
Alain Mazy <am@osimis.io>
parents: 4870
diff changeset
1851 }
4073
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1852 else
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1853 {
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1854 return false;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1855 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1856 }
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1857
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1858
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1859
2908
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1860 MimeType StringToMimeType(const std::string& mime)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1861 {
4073
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1862 MimeType result;
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1863 if (LookupMimeType(result, mime))
2908
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1864 {
4073
e8d30585b909 LookupMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3998
diff changeset
1865 return result;
3203
810772486249 URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3174
diff changeset
1866 }
2908
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1867 else
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1868 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1869 throw OrthancException(ErrorCode_ParameterOutOfRange);
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1870 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1871 }
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1872
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1873
4730
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1874 DicomToJsonFormat StringToDicomToJsonFormat(const std::string& format)
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1875 {
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1876 if (format == "Full")
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1877 {
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1878 return DicomToJsonFormat_Full;
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1879 }
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1880 else if (format == "Short")
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1881 {
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1882 return DicomToJsonFormat_Short;
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1883 }
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1884 else if (format == "Simplify")
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1885 {
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1886 return DicomToJsonFormat_Human;
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1887 }
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1888 else
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1889 {
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1890 throw OrthancException(ErrorCode_ParameterOutOfRange);
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1891 }
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1892 }
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1893
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4677
diff changeset
1894
800
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1895 unsigned int GetBytesPerPixel(PixelFormat format)
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1896 {
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1897 switch (format)
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1898 {
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1899 case PixelFormat_Grayscale8:
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1900 return 1;
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1901
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1902 case PixelFormat_Grayscale16:
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1903 case PixelFormat_SignedGrayscale16:
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1904 return 2;
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1905
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1906 case PixelFormat_RGB24:
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1907 return 3;
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1908
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1909 case PixelFormat_RGBA32:
2089
7a969f235adf PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2007
diff changeset
1910 case PixelFormat_BGRA32:
2415
7e217a1cc63f PixelFormat_Float32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2407
diff changeset
1911 case PixelFormat_Grayscale32:
800
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1912 return 4;
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1913
1993
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
1914 case PixelFormat_Float32:
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
1915 assert(sizeof(float) == 4);
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
1916 return 4;
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
1917
2423
5a7c5c541a1d Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2415
diff changeset
1918 case PixelFormat_RGB48:
5a7c5c541a1d Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2415
diff changeset
1919 return 6;
5a7c5c541a1d Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2415
diff changeset
1920
2645
89b789366596 Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1921 case PixelFormat_Grayscale64:
5054
255b02c68908 Added support for RGBA64 images in tools/create-dicom and /preview (Contribution from James Manners - Pliny)
Alain Mazy <am@osimis.io>
parents: 5037
diff changeset
1922 case PixelFormat_RGBA64:
2645
89b789366596 Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1923 return 8;
89b789366596 Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1924
800
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1925 default:
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1926 throw OrthancException(ErrorCode_ParameterOutOfRange);
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1927 }
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1928 }
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1929
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1930
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1931 bool GetDicomEncoding(Encoding& encoding,
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1932 const char* specificCharacterSet)
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1933 {
2202
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
1934 std::string s = Toolbox::StripSpaces(specificCharacterSet);
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1935 Toolbox::ToUpperCase(s);
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1936
5291
800261398381 Made Orthanc more resilient to common spelling errors in SpecificCharacterSet
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
1937 // handle common spelling mistakes
800261398381 Made Orthanc more resilient to common spelling errors in SpecificCharacterSet
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
1938 boost::replace_all(s, "ISO_IR_", "ISO_IR ");
800261398381 Made Orthanc more resilient to common spelling errors in SpecificCharacterSet
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
1939 boost::replace_all(s, "ISO_2022_IR_", "ISO 2022 IR ");
800261398381 Made Orthanc more resilient to common spelling errors in SpecificCharacterSet
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
1940
800261398381 Made Orthanc more resilient to common spelling errors in SpecificCharacterSet
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
1941
1908
5096681efce6 direct hyperlinks to the DICOM standard
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
1942 // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.12.1.1.2
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1943 // https://github.com/dcm4che/dcm4che/blob/master/dcm4che-core/src/main/java/org/dcm4che3/data/SpecificCharacterSet.java
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1944 if (s == "ISO_IR 6" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1945 s == "ISO 2022 IR 6")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1946 {
2202
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
1947 encoding = Encoding_Ascii;
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
1948 }
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
1949 else if (s == "ISO_IR 192")
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
1950 {
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1951 encoding = Encoding_Utf8;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1952 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1953 else if (s == "ISO_IR 100" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1954 s == "ISO 2022 IR 100")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1955 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1956 encoding = Encoding_Latin1;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1957 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1958 else if (s == "ISO_IR 101" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1959 s == "ISO 2022 IR 101")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1960 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1961 encoding = Encoding_Latin2;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1962 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1963 else if (s == "ISO_IR 109" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1964 s == "ISO 2022 IR 109")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1965 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1966 encoding = Encoding_Latin3;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1967 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1968 else if (s == "ISO_IR 110" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1969 s == "ISO 2022 IR 110")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1970 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1971 encoding = Encoding_Latin4;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1972 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1973 else if (s == "ISO_IR 148" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1974 s == "ISO 2022 IR 148")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1975 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1976 encoding = Encoding_Latin5;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1977 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1978 else if (s == "ISO_IR 144" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1979 s == "ISO 2022 IR 144")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1980 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1981 encoding = Encoding_Cyrillic;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1982 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1983 else if (s == "ISO_IR 127" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1984 s == "ISO 2022 IR 127")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1985 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1986 encoding = Encoding_Arabic;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1987 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1988 else if (s == "ISO_IR 126" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1989 s == "ISO 2022 IR 126")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1990 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1991 encoding = Encoding_Greek;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1992 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1993 else if (s == "ISO_IR 138" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1994 s == "ISO 2022 IR 138")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1995 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1996 encoding = Encoding_Hebrew;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1997 }
3217
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
1998 else if (s == "ISO_IR 166" ||
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
1999 s == "ISO 2022 IR 166")
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2000 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2001 encoding = Encoding_Thai;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2002 }
3217
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
2003 else if (s == "ISO_IR 13" ||
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
2004 s == "ISO 2022 IR 13")
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2005 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2006 encoding = Encoding_Japanese;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2007 }
2401
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
2008 else if (s == "GB18030" || s == "GBK")
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2009 {
2401
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
2010 /**
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
2011 * According to tumashu@163.com, "In China, many dicom file's
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
2012 * 0008,0005 tag is set as "GBK", instead of "GB18030", GBK is a
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
2013 * subset of GB18030, and which is used frequently in China,
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
2014 * suggest support it."
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
2015 * https://groups.google.com/d/msg/orthanc-users/WMM8LMbjpUc/02-1f_yFCgAJ
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
2016 **/
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2017 encoding = Encoding_Chinese;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2018 }
3217
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
2019 else if (s == "ISO 2022 IR 149")
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
2020 {
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
2021 encoding = Encoding_Korean;
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
2022 }
3218
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
2023 else if (s == "ISO 2022 IR 87")
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
2024 {
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
2025 encoding = Encoding_JapaneseKanji;
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
2026 }
3226
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
2027 else if (s == "ISO 2022 IR 58")
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
2028 {
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
2029 encoding = Encoding_SimplifiedChinese;
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
2030 }
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2031 /*
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2032 else if (s == "ISO 2022 IR 159")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2033 {
3218
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
2034 TODO - Supplementary Kanji set
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2035 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2036 */
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2037 else
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2038 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2039 return false;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2040 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2041
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2042 // The encoding was properly detected
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2043 return true;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
2044 }
1146
200fcac0deb4 optimization for access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1090
diff changeset
2045
200fcac0deb4 optimization for access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1090
diff changeset
2046
1555
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2047 ResourceType GetChildResourceType(ResourceType type)
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2048 {
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2049 switch (type)
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2050 {
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2051 case ResourceType_Patient:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2052 return ResourceType_Study;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2053
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2054 case ResourceType_Study:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2055 return ResourceType_Series;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2056
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2057 case ResourceType_Series:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2058 return ResourceType_Instance;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2059
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2060 default:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2061 throw OrthancException(ErrorCode_ParameterOutOfRange);
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2062 }
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2063 }
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2064
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2065
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2066 ResourceType GetParentResourceType(ResourceType type)
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2067 {
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2068 switch (type)
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2069 {
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2070 case ResourceType_Study:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2071 return ResourceType_Patient;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2072
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2073 case ResourceType_Series:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2074 return ResourceType_Study;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2075
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2076 case ResourceType_Instance:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2077 return ResourceType_Series;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2078
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2079 default:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2080 throw OrthancException(ErrorCode_ParameterOutOfRange);
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2081 }
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2082 }
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2083
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2084
3027
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2085 bool IsResourceLevelAboveOrEqual(ResourceType level,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2086 ResourceType reference)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2087 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2088 switch (reference)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2089 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2090 case ResourceType_Patient:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2091 return (level == ResourceType_Patient);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2092
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2093 case ResourceType_Study:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2094 return (level == ResourceType_Patient ||
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2095 level == ResourceType_Study);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2096
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2097 case ResourceType_Series:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2098 return (level == ResourceType_Patient ||
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2099 level == ResourceType_Study ||
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2100 level == ResourceType_Series);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2101
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2102 case ResourceType_Instance:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2103 return (level == ResourceType_Patient ||
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2104 level == ResourceType_Study ||
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2105 level == ResourceType_Series ||
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2106 level == ResourceType_Instance);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2107
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2108 default:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2109 throw OrthancException(ErrorCode_ParameterOutOfRange);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2110 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2111 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2112
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
2113
1555
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2114 DicomModule GetModule(ResourceType type)
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2115 {
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2116 switch (type)
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2117 {
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2118 case ResourceType_Patient:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2119 return DicomModule_Patient;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2120
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2121 case ResourceType_Study:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2122 return DicomModule_Study;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2123
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2124 case ResourceType_Series:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2125 return DicomModule_Series;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2126
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2127 default:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2128 throw OrthancException(ErrorCode_ParameterOutOfRange);
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2129 }
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
2130 }
1565
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2131
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2132
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2133
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2134 const char* GetDicomSpecificCharacterSet(Encoding encoding)
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2135 {
1908
5096681efce6 direct hyperlinks to the DICOM standard
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
2136 // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.12.1.1.2
1565
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2137 switch (encoding)
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2138 {
2202
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
2139 case Encoding_Ascii:
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
2140 return "ISO_IR 6";
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
2141
1565
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2142 case Encoding_Utf8:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2143 return "ISO_IR 192";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2144
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2145 case Encoding_Latin1:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2146 return "ISO_IR 100";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2147
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2148 case Encoding_Latin2:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2149 return "ISO_IR 101";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2150
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2151 case Encoding_Latin3:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2152 return "ISO_IR 109";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2153
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2154 case Encoding_Latin4:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2155 return "ISO_IR 110";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2156
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2157 case Encoding_Latin5:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2158 return "ISO_IR 148";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2159
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2160 case Encoding_Cyrillic:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2161 return "ISO_IR 144";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2162
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2163 case Encoding_Arabic:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2164 return "ISO_IR 127";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2165
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2166 case Encoding_Greek:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2167 return "ISO_IR 126";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2168
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2169 case Encoding_Hebrew:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2170 return "ISO_IR 138";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2171
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2172 case Encoding_Japanese:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2173 return "ISO_IR 13";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2174
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2175 case Encoding_Chinese:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2176 return "GB18030";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2177
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2178 case Encoding_Thai:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2179 return "ISO_IR 166";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2180
3217
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
2181 case Encoding_Korean:
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
2182 return "ISO 2022 IR 149";
cf8cbeb35f33 preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3203
diff changeset
2183
3218
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
2184 case Encoding_JapaneseKanji:
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
2185 return "ISO 2022 IR 87";
9a83d94b2a1e kanji encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3217
diff changeset
2186
3226
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
2187 case Encoding_SimplifiedChinese:
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
2188 return "ISO 2022 IR 58";
45e1631febbb support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3219
diff changeset
2189
1565
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2190 default:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2191 throw OrthancException(ErrorCode_ParameterOutOfRange);
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2192 }
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
2193 }
1576
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2194
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2195
1578
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1577
diff changeset
2196 // This function is autogenerated by the script
4932
b7ce2bb6b881 refactored the list of MainDicomTags to be able to change it dynamicaly. Unit tests and Integration tests ok
Alain Mazy <am@osimis.io>
parents: 4912
diff changeset
2197 // "Resources/CodeGeneration/GenerateErrorCodes.py"
1576
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2198 HttpStatus ConvertErrorCodeToHttpStatus(ErrorCode error)
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2199 {
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2200 switch (error)
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2201 {
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2202 case ErrorCode_Success:
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2203 return HttpStatus_200_Ok;
1577
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2204
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2205 case ErrorCode_ParameterOutOfRange:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2206 return HttpStatus_400_BadRequest;
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2207
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2208 case ErrorCode_BadParameterType:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2209 return HttpStatus_400_BadRequest;
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2210
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2211 case ErrorCode_InexistentItem:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2212 return HttpStatus_404_NotFound;
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2213
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2214 case ErrorCode_BadRequest:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2215 return HttpStatus_400_BadRequest;
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2216
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2217 case ErrorCode_UriSyntax:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2218 return HttpStatus_400_BadRequest;
1576
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2219
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2220 case ErrorCode_InexistentFile:
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2221 return HttpStatus_404_NotFound;
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2222
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2223 case ErrorCode_BadFileFormat:
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2224 return HttpStatus_400_BadRequest;
1577
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2225
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2226 case ErrorCode_UnknownResource:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2227 return HttpStatus_404_NotFound;
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2228
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2229 case ErrorCode_InexistentTag:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2230 return HttpStatus_404_NotFound;
1576
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2231
1596
f2e3d030ea59 BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2232 case ErrorCode_BadJson:
f2e3d030ea59 BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2233 return HttpStatus_400_BadRequest;
f2e3d030ea59 BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2234
1606
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2235 case ErrorCode_Unauthorized:
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2236 return HttpStatus_401_Unauthorized;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2237
1781
5ad4e4d92ecb AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
2238 case ErrorCode_NotAcceptable:
5ad4e4d92ecb AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
2239 return HttpStatus_406_NotAcceptable;
5ad4e4d92ecb AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
2240
2486
ad8f30fc28d1 new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
2241 case ErrorCode_DatabaseUnavailable:
ad8f30fc28d1 new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
2242 return HttpStatus_503_ServiceUnavailable;
ad8f30fc28d1 new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
2243
4442
f77ee6e6cf47 new error code: ErrorCode_BadRange
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
2244 case ErrorCode_BadRange:
f77ee6e6cf47 new error code: ErrorCode_BadRange
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
2245 return HttpStatus_416_RequestedRangeNotSatisfiable;
f77ee6e6cf47 new error code: ErrorCode_BadRange
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
2246
4551
350a22c094f2 testing replay of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
2247 case ErrorCode_DatabaseCannotSerialize:
350a22c094f2 testing replay of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
2248 return HttpStatus_503_ServiceUnavailable;
350a22c094f2 testing replay of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
2249
4608
de5e6b04442d added ErrorCode_Revision
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4551
diff changeset
2250 case ErrorCode_Revision:
de5e6b04442d added ErrorCode_Revision
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4551
diff changeset
2251 return HttpStatus_409_Conflict;
de5e6b04442d added ErrorCode_Revision
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4551
diff changeset
2252
2953
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2253 case ErrorCode_CreateDicomNotString:
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2254 return HttpStatus_400_BadRequest;
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2255
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2256 case ErrorCode_CreateDicomOverrideTag:
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2257 return HttpStatus_400_BadRequest;
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2258
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2259 case ErrorCode_CreateDicomUseContent:
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2260 return HttpStatus_400_BadRequest;
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2261
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2262 case ErrorCode_CreateDicomNoPayload:
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2263 return HttpStatus_400_BadRequest;
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2264
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2265 case ErrorCode_CreateDicomUseDataUriScheme:
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2266 return HttpStatus_400_BadRequest;
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2267
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2268 case ErrorCode_CreateDicomBadParent:
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2269 return HttpStatus_400_BadRequest;
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2270
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2271 case ErrorCode_CreateDicomParentIsInstance:
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2272 return HttpStatus_400_BadRequest;
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2273
3404
e280ced38a4c ErrorCode_UnsupportedMediaType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3376
diff changeset
2274 case ErrorCode_UnsupportedMediaType:
e280ced38a4c ErrorCode_UnsupportedMediaType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3376
diff changeset
2275 return HttpStatus_415_UnsupportedMediaType;
e280ced38a4c ErrorCode_UnsupportedMediaType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3376
diff changeset
2276
1576
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2277 default:
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2278 return HttpStatus_500_InternalServerError;
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2279 }
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2280 }
1773
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
2281
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
2282
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
2283 bool IsUserContentType(FileContentType type)
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
2284 {
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
2285 return (type >= FileContentType_StartUser &&
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
2286 type <= FileContentType_EndUser);
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
2287 }
2007
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2288
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2289
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2290 bool IsBinaryValueRepresentation(ValueRepresentation vr)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2291 {
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2292 // http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2293
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2294 switch (vr)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2295 {
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2296 case ValueRepresentation_ApplicationEntity: // AE
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2297 case ValueRepresentation_AgeString: // AS
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2298 case ValueRepresentation_CodeString: // CS
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2299 case ValueRepresentation_Date: // DA
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2300 case ValueRepresentation_DecimalString: // DS
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2301 case ValueRepresentation_DateTime: // DT
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2302 case ValueRepresentation_IntegerString: // IS
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2303 case ValueRepresentation_LongString: // LO
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2304 case ValueRepresentation_LongText: // LT
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2305 case ValueRepresentation_PersonName: // PN
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2306 case ValueRepresentation_ShortString: // SH
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2307 case ValueRepresentation_ShortText: // ST
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2308 case ValueRepresentation_Time: // TM
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2309 case ValueRepresentation_UnlimitedCharacters: // UC
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2310 case ValueRepresentation_UniqueIdentifier: // UI (UID)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2311 case ValueRepresentation_UniversalResource: // UR (URI or URL)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2312 case ValueRepresentation_UnlimitedText: // UT
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2313 {
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2314 return false;
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2315 }
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2316
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2317 /**
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2318 * Below are all the VR whose character repertoire is tagged as
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2319 * "not applicable"
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2320 **/
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2321 case ValueRepresentation_AttributeTag: // AT (2 x uint16_t)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2322 case ValueRepresentation_FloatingPointSingle: // FL (float)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2323 case ValueRepresentation_FloatingPointDouble: // FD (double)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2324 case ValueRepresentation_OtherByte: // OB
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2325 case ValueRepresentation_OtherDouble: // OD
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2326 case ValueRepresentation_OtherFloat: // OF
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2327 case ValueRepresentation_OtherLong: // OL
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2328 case ValueRepresentation_OtherWord: // OW
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2329 case ValueRepresentation_SignedLong: // SL (int32_t)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2330 case ValueRepresentation_Sequence: // SQ
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2331 case ValueRepresentation_SignedShort: // SS (int16_t)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2332 case ValueRepresentation_UnsignedLong: // UL (uint32_t)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2333 case ValueRepresentation_Unknown: // UN
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2334 case ValueRepresentation_UnsignedShort: // US (uint16_t)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2335 {
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2336 return true;
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2337 }
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2338
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2339 case ValueRepresentation_NotSupported:
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2340 default:
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2341 throw OrthancException(ErrorCode_ParameterOutOfRange);
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2342 }
2381
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2343 }
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2344
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2345
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2346 static boost::mutex defaultEncodingMutex_; // Should not be necessary
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2347 static Encoding defaultEncoding_ = ORTHANC_DEFAULT_DICOM_ENCODING;
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2348
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2349 Encoding GetDefaultDicomEncoding()
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2350 {
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2351 boost::mutex::scoped_lock lock(defaultEncodingMutex_);
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2352 return defaultEncoding_;
2007
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2353 }
2381
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2354
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2355 void SetDefaultDicomEncoding(Encoding encoding)
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2356 {
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2357 std::string name = EnumerationToString(encoding);
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2358
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2359 {
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2360 boost::mutex::scoped_lock lock(defaultEncodingMutex_);
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2361 defaultEncoding_ = encoding;
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2362 }
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2363
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2364 LOG(INFO) << "Default encoding for DICOM was changed to: " << name;
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2365 }
4399
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2366
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2367
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2368 const char* GetResourceTypeText(ResourceType type,
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2369 bool isPlural,
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2370 bool isUpperCase)
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2371 {
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2372 if (isPlural && !isUpperCase)
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2373 {
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2374 switch (type)
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2375 {
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2376 case ResourceType_Patient:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2377 return "patients";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2378
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2379 case ResourceType_Study:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2380 return "studies";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2381
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2382 case ResourceType_Series:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2383 return "series";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2384
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2385 case ResourceType_Instance:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2386 return "instances";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2387
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2388 default:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2389 throw OrthancException(ErrorCode_ParameterOutOfRange);
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2390 }
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2391 }
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2392 else if (isPlural && isUpperCase)
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2393 {
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2394 switch (type)
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2395 {
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2396 case ResourceType_Patient:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2397 return "Patients";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2398
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2399 case ResourceType_Study:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2400 return "Studies";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2401
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2402 case ResourceType_Series:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2403 return "Series";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2404
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2405 case ResourceType_Instance:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2406 return "Instances";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2407
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2408 default:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2409 throw OrthancException(ErrorCode_ParameterOutOfRange);
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2410 }
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2411 }
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2412 else if (!isPlural && !isUpperCase)
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2413 {
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2414 switch (type)
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2415 {
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2416 case ResourceType_Patient:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2417 return "patient";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2418
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2419 case ResourceType_Study:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2420 return "study";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2421
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2422 case ResourceType_Series:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2423 return "series";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2424
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2425 case ResourceType_Instance:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2426 return "instance";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2427
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2428 default:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2429 throw OrthancException(ErrorCode_ParameterOutOfRange);
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2430 }
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2431 }
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2432 else if (!isPlural && isUpperCase)
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2433 {
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2434 switch (type)
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2435 {
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2436 case ResourceType_Patient:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2437 return "Patient";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2438
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2439 case ResourceType_Study:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2440 return "Study";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2441
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2442 case ResourceType_Series:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2443 return "Series";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2444
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2445 case ResourceType_Instance:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2446 return "Instance";
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2447
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2448 default:
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2449 throw OrthancException(ErrorCode_ParameterOutOfRange);
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2450 }
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2451 }
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2452 else
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2453 {
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2454 throw OrthancException(ErrorCode_InternalError);
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2455 }
80fd140b12ba New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4376
diff changeset
2456 }
3730
ae31ba2b09a6 toolbox: LookupTransferSyntax()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3727
diff changeset
2457 }
2381
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2458
3727
090022f1b5e1 auto-generation of primitives to handle transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3643
diff changeset
2459
3730
ae31ba2b09a6 toolbox: LookupTransferSyntax()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3727
diff changeset
2460 #include "./Enumerations_TransferSyntaxes.impl.h"