annotate Framework/Plugins/MessagesToolbox.cpp @ 571:7453fc5bef1a attach-custom-data

fix
author Alain Mazy <am@orthanc.team>
date Thu, 26 Sep 2024 08:55:00 +0200
parents 1a74fc1bea2d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
550
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * This program is free software: you can redistribute it and/or
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * modify it under the terms of the GNU Affero General Public License
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * as published by the Free Software Foundation, either version 3 of
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * the License, or (at your option) any later version.
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 *
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful, but
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * Affero General Public License for more details.
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 *
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * You should have received a copy of the GNU Affero General Public License
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "MessagesToolbox.h"
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 namespace OrthancDatabases
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 {
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 namespace MessagesToolbox
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 {
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 Orthanc::ResourceType Convert(Orthanc::DatabasePluginMessages::ResourceType resourceType)
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 switch (resourceType)
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 case Orthanc::DatabasePluginMessages::RESOURCE_PATIENT:
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 return Orthanc::ResourceType_Patient;
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 case Orthanc::DatabasePluginMessages::RESOURCE_STUDY:
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 return Orthanc::ResourceType_Study;
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 case Orthanc::DatabasePluginMessages::RESOURCE_SERIES:
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 return Orthanc::ResourceType_Series;
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 case Orthanc::DatabasePluginMessages::RESOURCE_INSTANCE:
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 return Orthanc::ResourceType_Instance;
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 default:
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 }
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 }
554
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
51
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
52
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
53 OrthancPluginResourceType ConvertToPlainC(Orthanc::ResourceType type)
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
54 {
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
55 switch (type)
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
56 {
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
57 case Orthanc::ResourceType_Patient:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
58 return OrthancPluginResourceType_Patient;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
59
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
60 case Orthanc::ResourceType_Study:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
61 return OrthancPluginResourceType_Study;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
62
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
63 case Orthanc::ResourceType_Series:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
64 return OrthancPluginResourceType_Series;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
65
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
66 case Orthanc::ResourceType_Instance:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
67 return OrthancPluginResourceType_Instance;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
68
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
69 default:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
70 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
71 }
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
72 }
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
73
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
74
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
75 Orthanc::ResourceType Convert(OrthancPluginResourceType type)
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
76 {
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
77 switch (type)
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
78 {
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
79 case OrthancPluginResourceType_Patient:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
80 return Orthanc::ResourceType_Patient;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
81
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
82 case OrthancPluginResourceType_Study:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
83 return Orthanc::ResourceType_Study;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
84
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
85 case OrthancPluginResourceType_Series:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
86 return Orthanc::ResourceType_Series;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
87
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
88 case OrthancPluginResourceType_Instance:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
89 return Orthanc::ResourceType_Instance;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
90
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
91 default:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
92 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
93 }
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
94 }
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
95
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
96
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
97 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
98 OrthancPluginConstraintType ConvertToPlainC(ConstraintType constraint)
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
99 {
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
100 switch (constraint)
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
101 {
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
102 case ConstraintType_Equal:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
103 return OrthancPluginConstraintType_Equal;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
104
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
105 case ConstraintType_GreaterOrEqual:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
106 return OrthancPluginConstraintType_GreaterOrEqual;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
107
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
108 case ConstraintType_SmallerOrEqual:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
109 return OrthancPluginConstraintType_SmallerOrEqual;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
110
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
111 case ConstraintType_Wildcard:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
112 return OrthancPluginConstraintType_Wildcard;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
113
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
114 case ConstraintType_List:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
115 return OrthancPluginConstraintType_List;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
116
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
117 default:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
118 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
119 }
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
120 }
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
121 #endif
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
122
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
123
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
124 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
125 ConstraintType Convert(OrthancPluginConstraintType constraint)
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
126 {
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
127 switch (constraint)
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
128 {
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
129 case OrthancPluginConstraintType_Equal:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
130 return ConstraintType_Equal;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
131
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
132 case OrthancPluginConstraintType_GreaterOrEqual:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
133 return ConstraintType_GreaterOrEqual;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
134
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
135 case OrthancPluginConstraintType_SmallerOrEqual:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
136 return ConstraintType_SmallerOrEqual;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
137
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
138 case OrthancPluginConstraintType_Wildcard:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
139 return ConstraintType_Wildcard;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
140
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
141 case OrthancPluginConstraintType_List:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
142 return ConstraintType_List;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
143
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
144 default:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
145 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
146 }
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
147 }
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
148 #endif
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
149
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
150
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
151 Orthanc::DatabasePluginMessages::ResourceType ConvertToProtobuf(OrthancPluginResourceType resourceType)
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
152 {
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
153 switch (resourceType)
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
154 {
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
155 case OrthancPluginResourceType_Patient:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
156 return Orthanc::DatabasePluginMessages::RESOURCE_PATIENT;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
157
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
158 case OrthancPluginResourceType_Study:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
159 return Orthanc::DatabasePluginMessages::RESOURCE_STUDY;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
160
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
161 case OrthancPluginResourceType_Series:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
162 return Orthanc::DatabasePluginMessages::RESOURCE_SERIES;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
163
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
164 case OrthancPluginResourceType_Instance:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
165 return Orthanc::DatabasePluginMessages::RESOURCE_INSTANCE;
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
166
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
167 default:
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
168 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
169 }
1a74fc1bea2d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 550
diff changeset
170 }
550
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 }
9ed9a91bde33 un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 }