annotate OrthancServer/ServerEnumerations.cpp @ 697:dd1ce9a2844c

access to attachments
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Feb 2014 16:46:59 +0100
parents 4c1860179cc5
children b79eda29896d
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
689
2d0a347e8cfc switch to 2014
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
3 * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege,
199
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"
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
35 #include "../Core/EnumerationDictionary.h"
559
e0cfb413c86b find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 519
diff changeset
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
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 namespace Orthanc
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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_;
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
44 static Toolbox::EnumerationDictionary<FileContentType> dictContentType_;
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
45
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
46 void InitializeServerEnumerations()
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
47 {
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
48 boost::mutex::scoped_lock lock(enumerationsMutex_);
436
d51186bf7602 read access to metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 435
diff changeset
49
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
50 dictMetadataType_.Add(MetadataType_Instance_IndexInSeries, "IndexInSeries");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
51 dictMetadataType_.Add(MetadataType_Instance_ReceptionDate, "ReceptionDate");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
52 dictMetadataType_.Add(MetadataType_Instance_RemoteAet, "RemoteAET");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
53 dictMetadataType_.Add(MetadataType_Series_ExpectedNumberOfInstances, "ExpectedNumberOfInstances");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
54 dictMetadataType_.Add(MetadataType_ModifiedFrom, "ModifiedFrom");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
55 dictMetadataType_.Add(MetadataType_AnonymizedFrom, "AnonymizedFrom");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
56 dictMetadataType_.Add(MetadataType_LastUpdate, "LastUpdate");
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
57
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
58 dictContentType_.Add(FileContentType_Dicom, "dicom");
697
dd1ce9a2844c access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 696
diff changeset
59 dictContentType_.Add(FileContentType_DicomAsJson, "dicom-as-json");
435
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
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
62 void RegisterUserMetadata(int metadata,
656
08eca5d86aad fixes to cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 620
diff changeset
63 const std::string& name)
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
64 {
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
65 boost::mutex::scoped_lock lock(enumerationsMutex_);
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
66
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
67 if (metadata < static_cast<int>(MetadataType_StartUser) ||
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
68 metadata > static_cast<int>(MetadataType_EndUser))
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
69 {
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
70 throw OrthancException(ErrorCode_ParameterOutOfRange);
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
71 }
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
72
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
73 dictMetadataType_.Add(static_cast<MetadataType>(metadata), name);
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
74 }
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
75
437
beca6747945e PUT on metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 436
diff changeset
76 std::string EnumerationToString(MetadataType type)
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
77 {
437
beca6747945e PUT on metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 436
diff changeset
78 // This function MUST return a "std::string" and not "const
beca6747945e PUT on metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 436
diff changeset
79 // 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
80 boost::mutex::scoped_lock lock(enumerationsMutex_);
437
beca6747945e PUT on metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 436
diff changeset
81 return dictMetadataType_.Translate(type);
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
82 }
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
83
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
84 MetadataType StringToMetadata(const std::string& str)
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
85 {
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
86 boost::mutex::scoped_lock lock(enumerationsMutex_);
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
87 return dictMetadataType_.Translate(str);
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
88 }
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
89
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
90 void RegisterUserContentType(int contentType,
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
91 const std::string& name)
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
92 {
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
93 boost::mutex::scoped_lock lock(enumerationsMutex_);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
94
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
95 if (contentType < static_cast<int>(FileContentType_StartUser) ||
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
96 contentType > static_cast<int>(FileContentType_EndUser))
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
97 {
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
98 throw OrthancException(ErrorCode_ParameterOutOfRange);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
99 }
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
100
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
101 dictContentType_.Add(static_cast<FileContentType>(contentType), name);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
102 }
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
103
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
104 std::string EnumerationToString(FileContentType type)
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
105 {
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
106 // This function MUST return a "std::string" and not "const
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
107 // char*", as the result is not a static string
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
108 boost::mutex::scoped_lock lock(enumerationsMutex_);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
109 return dictContentType_.Translate(type);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
110 }
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
111
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
112 FileContentType StringToContentType(const std::string& str)
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
113 {
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
114 boost::mutex::scoped_lock lock(enumerationsMutex_);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
115 return dictContentType_.Translate(str);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
116 }
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
117
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
118 std::string GetBasePath(ResourceType type,
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
119 const std::string& publicId)
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
120 {
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
121 switch (type)
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
122 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
123 case ResourceType_Patient:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
124 return "/patients/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
125
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
126 case ResourceType_Study:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
127 return "/studies/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
128
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
129 case ResourceType_Series:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
130 return "/series/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
131
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
132 case ResourceType_Instance:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
133 return "/instances/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
134
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
135 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
136 throw OrthancException(ErrorCode_ParameterOutOfRange);
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
137 }
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
138 }
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
139
434
ccf3a0a43dac EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 407
diff changeset
140 const char* EnumerationToString(SeriesStatus status)
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 {
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 switch (status)
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
144 case SeriesStatus_Complete:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
145 return "Complete";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
147 case SeriesStatus_Missing:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
148 return "Missing";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
150 case SeriesStatus_Inconsistent:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
151 return "Inconsistent";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
153 case SeriesStatus_Unknown:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
154 return "Unknown";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
156 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
157 throw OrthancException(ErrorCode_ParameterOutOfRange);
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 }
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 }
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
160
434
ccf3a0a43dac EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 407
diff changeset
161 const char* EnumerationToString(StoreStatus status)
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
162 {
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
163 switch (status)
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
164 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
165 case StoreStatus_Success:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
166 return "Success";
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
167
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
168 case StoreStatus_AlreadyStored:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
169 return "AlreadyStored";
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
170
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
171 case StoreStatus_Failure:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
172 return "Failure";
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
173
397
941ea46e9e26 lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 348
diff changeset
174 case StoreStatus_FilteredOut:
941ea46e9e26 lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 348
diff changeset
175 return "FilteredOut";
941ea46e9e26 lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 348
diff changeset
176
250
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);
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
179 }
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
180 }
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
181
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
182
434
ccf3a0a43dac EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 407
diff changeset
183 const char* EnumerationToString(ChangeType type)
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
184 {
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
185 switch (type)
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
186 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
187 case ChangeType_CompletedSeries:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
188 return "CompletedSeries";
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
189
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
190 case ChangeType_NewInstance:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
191 return "NewInstance";
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 ChangeType_NewPatient:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
194 return "NewPatient";
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 case ChangeType_NewSeries:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
197 return "NewSeries";
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
198
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
199 case ChangeType_NewStudy:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
200 return "NewStudy";
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
201
315
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
202 case ChangeType_AnonymizedStudy:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
203 return "AnonymizedStudy";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
204
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
205 case ChangeType_AnonymizedSeries:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
206 return "AnonymizedSeries";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
207
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
208 case ChangeType_ModifiedStudy:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
209 return "ModifiedStudy";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
210
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
211 case ChangeType_ModifiedSeries:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
212 return "ModifiedSeries";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
213
348
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
214 case ChangeType_AnonymizedPatient:
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
215 return "AnonymizedPatient";
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
216
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
217 case ChangeType_ModifiedPatient:
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
218 return "ModifiedPatient";
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
219
511
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
220 case ChangeType_StablePatient:
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
221 return "StablePatient";
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
222
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
223 case ChangeType_StableStudy:
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
224 return "StableStudy";
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
225
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
226 case ChangeType_StableSeries:
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
227 return "StableSeries";
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
228
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
229 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
230 throw OrthancException(ErrorCode_ParameterOutOfRange);
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 }
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
233
250
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 ResourceType GetParentResourceType(ResourceType type)
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
236 {
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
237 switch (type)
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
238 {
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
239 case ResourceType_Study:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
240 return ResourceType_Patient;
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
241
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
242 case ResourceType_Series:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
243 return ResourceType_Study;
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
244
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
245 case ResourceType_Instance:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
246 return ResourceType_Series;
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
247
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
248 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
249 throw OrthancException(ErrorCode_ParameterOutOfRange);
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
250 }
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
251 }
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
252
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
253
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
254 ResourceType GetChildResourceType(ResourceType type)
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
255 {
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
256 switch (type)
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
257 {
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
258 case ResourceType_Patient:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
259 return ResourceType_Study;
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
260
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
261 case ResourceType_Study:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
262 return ResourceType_Series;
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
263
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
264 case ResourceType_Series:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
265 return ResourceType_Instance;
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
266
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
267 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
268 throw OrthancException(ErrorCode_ParameterOutOfRange);
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
269 }
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
270 }
519
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
271
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
272
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
273 const char* EnumerationToString(ModalityManufacturer manufacturer)
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
274 {
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
275 switch (manufacturer)
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
276 {
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
277 case ModalityManufacturer_Generic:
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
278 return "Generic";
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
279
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
280 case ModalityManufacturer_ClearCanvas:
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
281 return "ClearCanvas";
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
282
665
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
283 case ModalityManufacturer_MedInria:
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
284 return "MedInria";
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
285
519
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
286 default:
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
287 throw OrthancException(ErrorCode_ParameterOutOfRange);
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
288 }
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
289 }
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
620
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
292 const char* EnumerationToString(DicomRequestType type)
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
293 {
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
294 switch (type)
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
295 {
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
296 case DicomRequestType_Echo:
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
297 return "Echo";
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
298 break;
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
299
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
300 case DicomRequestType_Find:
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
301 return "Find";
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
302 break;
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
303
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
304 case DicomRequestType_Get:
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
305 return "Get";
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
306 break;
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
307
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
308 case DicomRequestType_Move:
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
309 return "Move";
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
310 break;
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
311
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
312 case DicomRequestType_Store:
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
313 return "Store";
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
314 break;
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
315
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
316
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
317 default:
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
318 throw OrthancException(ErrorCode_ParameterOutOfRange);
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
319 }
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
320 }
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
321
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
322
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
323
519
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
324 ModalityManufacturer StringToModalityManufacturer(const std::string& manufacturer)
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
325 {
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
326 if (manufacturer == "Generic")
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
327 {
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
328 return ModalityManufacturer_Generic;
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
329 }
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
330 else if (manufacturer == "ClearCanvas")
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
331 {
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
332 return ModalityManufacturer_ClearCanvas;
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
333 }
665
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
334 else if (manufacturer == "MedInria")
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
335 {
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
336 return ModalityManufacturer_MedInria;
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
337 }
519
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
338 else
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
339 {
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
340 throw OrthancException(ErrorCode_ParameterOutOfRange);
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
341 }
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
342 }
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 }