annotate OrthancServer/ServerEnumerations.cpp @ 391:2b189a3d8e94

fix
author jodogne
date Mon, 29 Apr 2013 12:41:47 +0200
parents 1082e8121d10
children 941ea46e9e26 4d5f0857ec9c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012 Medical Physics Department, CHU of Liege,
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Belgium
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 *
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * This program is free software: you can redistribute it and/or
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * modify it under the terms of the GNU General Public License as
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * published by the Free Software Foundation, either version 3 of the
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * License, or (at your option) any later version.
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 *
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * In addition, as a special exception, the copyright holders of this
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * program give permission to link the code of its release with the
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * that use the same license as the "OpenSSL" library), and distribute
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * the linked executables. You must obey the GNU General Public License
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * in all respects for all of the code used other than "OpenSSL". If you
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * modify file(s) with this exception, you may extend this exception to
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * your version of the file(s), but you are not obligated to do so. If
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * you do not wish to do so, delete this exception statement from your
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * version. If you delete this exception statement from all source files
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * in the program, then also delete it here.
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 *
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 * This program is distributed in the hope that it will be useful, but
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * WITHOUT ANY WARRANTY; without even the implied warranty of
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * General Public License for more details.
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 *
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 * You should have received a copy of the GNU General Public License
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * along with this program. If not, see <http://www.gnu.org/licenses/>.
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 **/
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 #include "ServerEnumerations.h"
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #include "../Core/OrthancException.h"
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 namespace Orthanc
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 {
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 const char* ToString(ResourceType type)
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 {
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 switch (type)
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
42 case ResourceType_Patient:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
43 return "Patient";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
45 case ResourceType_Study:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
46 return "Study";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
48 case ResourceType_Series:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
49 return "Series";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
51 case ResourceType_Instance:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
52 return "Instance";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
54 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
55 throw OrthancException(ErrorCode_ParameterOutOfRange);
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 }
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 }
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
59 std::string GetBasePath(ResourceType type,
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
60 const std::string& publicId)
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
61 {
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
62 switch (type)
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
63 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
64 case ResourceType_Patient:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
65 return "/patients/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
66
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
67 case ResourceType_Study:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
68 return "/studies/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
69
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
70 case ResourceType_Series:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
71 return "/series/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
72
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
73 case ResourceType_Instance:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
74 return "/instances/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
75
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
76 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
77 throw OrthancException(ErrorCode_ParameterOutOfRange);
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
78 }
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
79 }
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
80
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 const char* ToString(SeriesStatus status)
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 {
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 switch (status)
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
85 case SeriesStatus_Complete:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
86 return "Complete";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
88 case SeriesStatus_Missing:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
89 return "Missing";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
91 case SeriesStatus_Inconsistent:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
92 return "Inconsistent";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
94 case SeriesStatus_Unknown:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
95 return "Unknown";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
97 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
98 throw OrthancException(ErrorCode_ParameterOutOfRange);
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 }
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 }
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
101
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
102 const char* ToString(StoreStatus status)
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
103 {
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
104 switch (status)
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
105 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
106 case StoreStatus_Success:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
107 return "Success";
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
108
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
109 case StoreStatus_AlreadyStored:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
110 return "AlreadyStored";
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
111
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
112 case StoreStatus_Failure:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
113 return "Failure";
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
114
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
115 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
116 throw OrthancException(ErrorCode_ParameterOutOfRange);
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
117 }
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
118 }
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
119
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
120
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
121 const char* ToString(ChangeType type)
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
122 {
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
123 switch (type)
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
124 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
125 case ChangeType_CompletedSeries:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
126 return "CompletedSeries";
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
127
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
128 case ChangeType_NewInstance:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
129 return "NewInstance";
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
130
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
131 case ChangeType_NewPatient:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
132 return "NewPatient";
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
133
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
134 case ChangeType_NewSeries:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
135 return "NewSeries";
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
136
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
137 case ChangeType_NewStudy:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
138 return "NewStudy";
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
139
315
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
140 case ChangeType_AnonymizedStudy:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
141 return "AnonymizedStudy";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
142
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
143 case ChangeType_AnonymizedSeries:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
144 return "AnonymizedSeries";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
145
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
146 case ChangeType_ModifiedStudy:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
147 return "ModifiedStudy";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
148
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
149 case ChangeType_ModifiedSeries:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
150 return "ModifiedSeries";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
151
348
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
152 case ChangeType_AnonymizedPatient:
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
153 return "AnonymizedPatient";
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
154
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
155 case ChangeType_ModifiedPatient:
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
156 return "ModifiedPatient";
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
157
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
158 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
159 throw OrthancException(ErrorCode_ParameterOutOfRange);
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 }
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
162
250
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 ResourceType GetParentResourceType(ResourceType type)
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
165 {
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
166 switch (type)
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
167 {
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
168 case ResourceType_Study:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
169 return ResourceType_Patient;
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
170
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
171 case ResourceType_Series:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
172 return ResourceType_Study;
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
173
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
174 case ResourceType_Instance:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
175 return ResourceType_Series;
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
176
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
177 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
178 throw OrthancException(ErrorCode_ParameterOutOfRange);
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
179 }
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
180 }
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
181
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
182
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
183 ResourceType GetChildResourceType(ResourceType type)
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
184 {
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
185 switch (type)
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
186 {
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
187 case ResourceType_Patient:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
188 return ResourceType_Study;
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
189
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
190 case ResourceType_Study:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
191 return ResourceType_Series;
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
192
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
193 case ResourceType_Series:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
194 return ResourceType_Instance;
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
195
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
196 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
197 throw OrthancException(ErrorCode_ParameterOutOfRange);
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
198 }
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
199 }
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 }