Mercurial > hg > orthanc
annotate OrthancServer/ServerEnumerations.cpp @ 646:fb49bf72ac2d
fix issue #7
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 30 Oct 2013 08:58:45 +0100 |
parents | 4aa6f0d79947 |
children | 08eca5d86aad |
rev | line source |
---|---|
199 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
399 | 3 * Copyright (C) 2012-2013 Medical Physics Department, CHU of Liege, |
199 | 4 * Belgium |
5 * | |
6 * This program is free software: you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation, either version 3 of the | |
9 * License, or (at your option) any later version. | |
10 * | |
11 * In addition, as a special exception, the copyright holders of this | |
12 * program give permission to link the code of its release with the | |
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
14 * that use the same license as the "OpenSSL" library), and distribute | |
15 * the linked executables. You must obey the GNU General Public License | |
16 * in all respects for all of the code used other than "OpenSSL". If you | |
17 * modify file(s) with this exception, you may extend this exception to | |
18 * your version of the file(s), but you are not obligated to do so. If | |
19 * you do not wish to do so, delete this exception statement from your | |
20 * version. If you delete this exception statement from all source files | |
21 * in the program, then also delete it here. | |
22 * | |
23 * This program is distributed in the hope that it will be useful, but | |
24 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
26 * General Public License for more details. | |
27 * | |
28 * You should have received a copy of the GNU General Public License | |
29 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
30 **/ | |
31 | |
32 #include "ServerEnumerations.h" | |
33 | |
34 #include "../Core/OrthancException.h" | |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
35 #include "../Core/EnumerationDictionary.h" |
559 | 36 #include "../Core/Toolbox.h" |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
37 |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
38 #include <boost/thread.hpp> |
199 | 39 |
40 namespace Orthanc | |
41 { | |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
42 static boost::mutex enumerationsMutex_; |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
43 static Toolbox::EnumerationDictionary<MetadataType> dictMetadataType_; |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
44 |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
45 void InitializeServerEnumerations() |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
46 { |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
47 boost::mutex::scoped_lock lock(enumerationsMutex_); |
436
d51186bf7602
read access to metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
435
diff
changeset
|
48 |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
49 dictMetadataType_.Add(MetadataType_Instance_IndexInSeries, "IndexInSeries"); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
50 dictMetadataType_.Add(MetadataType_Instance_ReceptionDate, "ReceptionDate"); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
51 dictMetadataType_.Add(MetadataType_Instance_RemoteAet, "RemoteAET"); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
52 dictMetadataType_.Add(MetadataType_Series_ExpectedNumberOfInstances, "ExpectedNumberOfInstances"); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
53 dictMetadataType_.Add(MetadataType_ModifiedFrom, "ModifiedFrom"); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
54 dictMetadataType_.Add(MetadataType_AnonymizedFrom, "AnonymizedFrom"); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
55 dictMetadataType_.Add(MetadataType_LastUpdate, "LastUpdate"); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
56 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
57 |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
58 void RegisterUserMetadata(int metadata, |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
59 const std::string name) |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
60 { |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
61 boost::mutex::scoped_lock lock(enumerationsMutex_); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
62 |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
63 if (metadata < static_cast<int>(MetadataType_StartUser) || |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
64 metadata > static_cast<int>(MetadataType_EndUser)) |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
65 { |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
66 throw OrthancException(ErrorCode_ParameterOutOfRange); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
67 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
68 |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
69 dictMetadataType_.Add(static_cast<MetadataType>(metadata), name); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
70 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
71 |
437 | 72 std::string EnumerationToString(MetadataType type) |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
73 { |
437 | 74 // This function MUST return a "std::string" and not "const |
75 // char*", as the result is not a static string | |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
76 boost::mutex::scoped_lock lock(enumerationsMutex_); |
437 | 77 return dictMetadataType_.Translate(type); |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
78 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
79 |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
80 MetadataType StringToMetadata(const std::string& str) |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
81 { |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
82 boost::mutex::scoped_lock lock(enumerationsMutex_); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
83 return dictMetadataType_.Translate(str); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
84 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
85 |
204 | 86 std::string GetBasePath(ResourceType type, |
87 const std::string& publicId) | |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
88 { |
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
89 switch (type) |
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
90 { |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
91 case ResourceType_Patient: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
92 return "/patients/" + publicId; |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
93 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
94 case ResourceType_Study: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
95 return "/studies/" + publicId; |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
96 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
97 case ResourceType_Series: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
98 return "/series/" + publicId; |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
99 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
100 case ResourceType_Instance: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
101 return "/instances/" + publicId; |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
102 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
103 default: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
104 throw OrthancException(ErrorCode_ParameterOutOfRange); |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
105 } |
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
106 } |
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
107 |
434
ccf3a0a43dac
EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
407
diff
changeset
|
108 const char* EnumerationToString(SeriesStatus status) |
199 | 109 { |
110 switch (status) | |
111 { | |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
112 case SeriesStatus_Complete: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
113 return "Complete"; |
199 | 114 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
115 case SeriesStatus_Missing: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
116 return "Missing"; |
199 | 117 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
118 case SeriesStatus_Inconsistent: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
119 return "Inconsistent"; |
199 | 120 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
121 case SeriesStatus_Unknown: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
122 return "Unknown"; |
199 | 123 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
124 default: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
125 throw OrthancException(ErrorCode_ParameterOutOfRange); |
199 | 126 } |
127 } | |
204 | 128 |
434
ccf3a0a43dac
EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
407
diff
changeset
|
129 const char* EnumerationToString(StoreStatus status) |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
130 { |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
131 switch (status) |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
132 { |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
133 case StoreStatus_Success: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
134 return "Success"; |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
135 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
136 case StoreStatus_AlreadyStored: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
137 return "AlreadyStored"; |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
138 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
139 case StoreStatus_Failure: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
140 return "Failure"; |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
141 |
397
941ea46e9e26
lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
348
diff
changeset
|
142 case StoreStatus_FilteredOut: |
941ea46e9e26
lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
348
diff
changeset
|
143 return "FilteredOut"; |
941ea46e9e26
lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
348
diff
changeset
|
144 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
145 default: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
146 throw OrthancException(ErrorCode_ParameterOutOfRange); |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
147 } |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
148 } |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
149 |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
150 |
434
ccf3a0a43dac
EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
407
diff
changeset
|
151 const char* EnumerationToString(ChangeType type) |
204 | 152 { |
153 switch (type) | |
154 { | |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
155 case ChangeType_CompletedSeries: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
156 return "CompletedSeries"; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
157 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
158 case ChangeType_NewInstance: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
159 return "NewInstance"; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
160 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
161 case ChangeType_NewPatient: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
162 return "NewPatient"; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
163 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
164 case ChangeType_NewSeries: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
165 return "NewSeries"; |
204 | 166 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
167 case ChangeType_NewStudy: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
168 return "NewStudy"; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
169 |
315 | 170 case ChangeType_AnonymizedStudy: |
171 return "AnonymizedStudy"; | |
172 | |
173 case ChangeType_AnonymizedSeries: | |
174 return "AnonymizedSeries"; | |
175 | |
176 case ChangeType_ModifiedStudy: | |
177 return "ModifiedStudy"; | |
178 | |
179 case ChangeType_ModifiedSeries: | |
180 return "ModifiedSeries"; | |
181 | |
348
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
182 case ChangeType_AnonymizedPatient: |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
183 return "AnonymizedPatient"; |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
184 |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
185 case ChangeType_ModifiedPatient: |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
186 return "ModifiedPatient"; |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
187 |
511
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
188 case ChangeType_StablePatient: |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
189 return "StablePatient"; |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
190 |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
191 case ChangeType_StableStudy: |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
192 return "StableStudy"; |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
193 |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
194 case ChangeType_StableSeries: |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
195 return "StableSeries"; |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
196 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
197 default: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
198 throw OrthancException(ErrorCode_ParameterOutOfRange); |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
199 } |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
200 } |
204 | 201 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
202 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
203 ResourceType GetParentResourceType(ResourceType type) |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
204 { |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
205 switch (type) |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
206 { |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
207 case ResourceType_Study: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
208 return ResourceType_Patient; |
204 | 209 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
210 case ResourceType_Series: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
211 return ResourceType_Study; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
212 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
213 case ResourceType_Instance: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
214 return ResourceType_Series; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
215 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
216 default: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
217 throw OrthancException(ErrorCode_ParameterOutOfRange); |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
218 } |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
219 } |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
220 |
204 | 221 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
222 ResourceType GetChildResourceType(ResourceType type) |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
223 { |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
224 switch (type) |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
225 { |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
226 case ResourceType_Patient: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
227 return ResourceType_Study; |
204 | 228 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
229 case ResourceType_Study: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
230 return ResourceType_Series; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
231 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
232 case ResourceType_Series: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
233 return ResourceType_Instance; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
234 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
235 default: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
236 throw OrthancException(ErrorCode_ParameterOutOfRange); |
204 | 237 } |
238 } | |
519
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
239 |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
240 |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
241 const char* EnumerationToString(ModalityManufacturer manufacturer) |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
242 { |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
243 switch (manufacturer) |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
244 { |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
245 case ModalityManufacturer_Generic: |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
246 return "Generic"; |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
247 |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
248 case ModalityManufacturer_ClearCanvas: |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
249 return "ClearCanvas"; |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
250 |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
251 default: |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
252 throw OrthancException(ErrorCode_ParameterOutOfRange); |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
253 } |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
254 } |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
255 |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
256 |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
257 const char* EnumerationToString(DicomRequestType type) |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
258 { |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
259 switch (type) |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
260 { |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
261 case DicomRequestType_Echo: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
262 return "Echo"; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
263 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
264 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
265 case DicomRequestType_Find: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
266 return "Find"; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
267 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
268 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
269 case DicomRequestType_Get: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
270 return "Get"; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
271 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
272 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
273 case DicomRequestType_Move: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
274 return "Move"; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
275 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
276 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
277 case DicomRequestType_Store: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
278 return "Store"; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
279 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
280 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
281 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
282 default: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
283 throw OrthancException(ErrorCode_ParameterOutOfRange); |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
284 } |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
285 } |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
286 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
287 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
562
diff
changeset
|
288 |
519
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
289 ModalityManufacturer StringToModalityManufacturer(const std::string& manufacturer) |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
290 { |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
291 if (manufacturer == "Generic") |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
292 { |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
293 return ModalityManufacturer_Generic; |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
294 } |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
295 else if (manufacturer == "ClearCanvas") |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
296 { |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
297 return ModalityManufacturer_ClearCanvas; |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
298 } |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
299 else |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
300 { |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
301 throw OrthancException(ErrorCode_ParameterOutOfRange); |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
302 } |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
303 } |
199 | 304 } |