comparison Plugins/Engine/PluginsEnumerations.cpp @ 3140:977158ab0623

making db-changes the new mainline
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 17 Jan 2019 18:32:42 +0100
parents aae1d6d31fef
children 94f4a18a79cc
comparison
equal deleted inserted replaced
3138:ab46e537f92e 3140:977158ab0623
41 41
42 #include "../../Core/OrthancException.h" 42 #include "../../Core/OrthancException.h"
43 43
44 namespace Orthanc 44 namespace Orthanc
45 { 45 {
46 namespace Compatibility
47 {
48 OrthancPluginIdentifierConstraint Convert(IdentifierConstraintType constraint)
49 {
50 switch (constraint)
51 {
52 case Compatibility::IdentifierConstraintType_Equal:
53 return OrthancPluginIdentifierConstraint_Equal;
54
55 case Compatibility::IdentifierConstraintType_GreaterOrEqual:
56 return OrthancPluginIdentifierConstraint_GreaterOrEqual;
57
58 case Compatibility::IdentifierConstraintType_SmallerOrEqual:
59 return OrthancPluginIdentifierConstraint_SmallerOrEqual;
60
61 case Compatibility::IdentifierConstraintType_Wildcard:
62 return OrthancPluginIdentifierConstraint_Wildcard;
63
64 default:
65 throw OrthancException(ErrorCode_ParameterOutOfRange);
66 }
67 }
68
69
70 IdentifierConstraintType Convert(OrthancPluginIdentifierConstraint constraint)
71 {
72 switch (constraint)
73 {
74 case OrthancPluginIdentifierConstraint_Equal:
75 return Compatibility::IdentifierConstraintType_Equal;
76
77 case OrthancPluginIdentifierConstraint_GreaterOrEqual:
78 return Compatibility::IdentifierConstraintType_GreaterOrEqual;
79
80 case OrthancPluginIdentifierConstraint_SmallerOrEqual:
81 return Compatibility::IdentifierConstraintType_SmallerOrEqual;
82
83 case OrthancPluginIdentifierConstraint_Wildcard:
84 return Compatibility::IdentifierConstraintType_Wildcard;
85
86 default:
87 throw OrthancException(ErrorCode_ParameterOutOfRange);
88 }
89 }
90 }
91
92
46 namespace Plugins 93 namespace Plugins
47 { 94 {
48 OrthancPluginResourceType Convert(ResourceType type)
49 {
50 switch (type)
51 {
52 case ResourceType_Patient:
53 return OrthancPluginResourceType_Patient;
54
55 case ResourceType_Study:
56 return OrthancPluginResourceType_Study;
57
58 case ResourceType_Series:
59 return OrthancPluginResourceType_Series;
60
61 case ResourceType_Instance:
62 return OrthancPluginResourceType_Instance;
63
64 default:
65 throw OrthancException(ErrorCode_ParameterOutOfRange);
66 }
67 }
68
69
70 ResourceType Convert(OrthancPluginResourceType type)
71 {
72 switch (type)
73 {
74 case OrthancPluginResourceType_Patient:
75 return ResourceType_Patient;
76
77 case OrthancPluginResourceType_Study:
78 return ResourceType_Study;
79
80 case OrthancPluginResourceType_Series:
81 return ResourceType_Series;
82
83 case OrthancPluginResourceType_Instance:
84 return ResourceType_Instance;
85
86 default:
87 throw OrthancException(ErrorCode_ParameterOutOfRange);
88 }
89 }
90
91
92 OrthancPluginChangeType Convert(ChangeType type) 95 OrthancPluginChangeType Convert(ChangeType type)
93 { 96 {
94 switch (type) 97 switch (type)
95 { 98 {
96 case ChangeType_CompletedSeries: 99 case ChangeType_CompletedSeries:
257 case OrthancPluginDicomToJsonFormat_Short: 260 case OrthancPluginDicomToJsonFormat_Short:
258 return DicomToJsonFormat_Short; 261 return DicomToJsonFormat_Short;
259 262
260 case OrthancPluginDicomToJsonFormat_Human: 263 case OrthancPluginDicomToJsonFormat_Human:
261 return DicomToJsonFormat_Human; 264 return DicomToJsonFormat_Human;
262
263 default:
264 throw OrthancException(ErrorCode_ParameterOutOfRange);
265 }
266 }
267
268
269 OrthancPluginIdentifierConstraint Convert(IdentifierConstraintType constraint)
270 {
271 switch (constraint)
272 {
273 case IdentifierConstraintType_Equal:
274 return OrthancPluginIdentifierConstraint_Equal;
275
276 case IdentifierConstraintType_GreaterOrEqual:
277 return OrthancPluginIdentifierConstraint_GreaterOrEqual;
278
279 case IdentifierConstraintType_SmallerOrEqual:
280 return OrthancPluginIdentifierConstraint_SmallerOrEqual;
281
282 case IdentifierConstraintType_Wildcard:
283 return OrthancPluginIdentifierConstraint_Wildcard;
284
285 default:
286 throw OrthancException(ErrorCode_ParameterOutOfRange);
287 }
288 }
289
290
291 IdentifierConstraintType Convert(OrthancPluginIdentifierConstraint constraint)
292 {
293 switch (constraint)
294 {
295 case OrthancPluginIdentifierConstraint_Equal:
296 return IdentifierConstraintType_Equal;
297
298 case OrthancPluginIdentifierConstraint_GreaterOrEqual:
299 return IdentifierConstraintType_GreaterOrEqual;
300
301 case OrthancPluginIdentifierConstraint_SmallerOrEqual:
302 return IdentifierConstraintType_SmallerOrEqual;
303
304 case OrthancPluginIdentifierConstraint_Wildcard:
305 return IdentifierConstraintType_Wildcard;
306 265
307 default: 266 default:
308 throw OrthancException(ErrorCode_ParameterOutOfRange); 267 throw OrthancException(ErrorCode_ParameterOutOfRange);
309 } 268 }
310 } 269 }