annotate OrthancServer/ServerEnumerations.cpp @ 2292:ccd44d546b47

Fix XSS inside DICOM in Orthanc Explorer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 27 Jun 2017 17:54:45 +0200
parents a3a65de1840f
children 4dc313b9a20a
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
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1856
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1288
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1189
diff changeset
4 * Department, University Hospital of Liege, Belgium
2244
a3a65de1840f shared copyright with osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2208
diff changeset
5 * Copyright (C) 2017 Osimis, Belgium
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * License, or (at your option) any later version.
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * In addition, as a special exception, the copyright holders of this
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * program give permission to link the code of its release with the
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * that use the same license as the "OpenSSL" library), and distribute
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * the linked executables. You must obey the GNU General Public License
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * 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
18 * modify file(s) with this exception, you may extend this exception to
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * 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
20 * 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
21 * version. If you delete this exception statement from all source files
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * in the program, then also delete it here.
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 *
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * 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
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * General Public License for more details.
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 *
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * You should have received a copy of the GNU General Public License
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
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
824
a811bdf8b8eb precompiled headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 732
diff changeset
33
831
84513f2ee1f3 pch for unit tests and server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
34 #include "PrecompiledHeadersServer.h"
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include "ServerEnumerations.h"
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 #include "../Core/OrthancException.h"
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
38 #include "../Core/EnumerationDictionary.h"
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
39 #include "../Core/Logging.h"
559
e0cfb413c86b find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 519
diff changeset
40 #include "../Core/Toolbox.h"
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
41
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
42 #include <boost/thread.hpp>
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 namespace Orthanc
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 {
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
46 typedef std::map<FileContentType, std::string> MimeTypes;
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
47
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
48 static boost::mutex enumerationsMutex_;
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
49 static Toolbox::EnumerationDictionary<MetadataType> dictMetadataType_;
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
50 static Toolbox::EnumerationDictionary<FileContentType> dictContentType_;
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
51 static MimeTypes mimeTypes_;
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
52
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
53 void InitializeServerEnumerations()
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
54 {
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
55 boost::mutex::scoped_lock lock(enumerationsMutex_);
1103
bec1eccf976c Hot restart of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1017
diff changeset
56
bec1eccf976c Hot restart of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1017
diff changeset
57 dictMetadataType_.Clear();
bec1eccf976c Hot restart of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1017
diff changeset
58 dictContentType_.Clear();
436
d51186bf7602 read access to metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 435
diff changeset
59
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
60 dictMetadataType_.Add(MetadataType_Instance_IndexInSeries, "IndexInSeries");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
61 dictMetadataType_.Add(MetadataType_Instance_ReceptionDate, "ReceptionDate");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
62 dictMetadataType_.Add(MetadataType_Instance_RemoteAet, "RemoteAET");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
63 dictMetadataType_.Add(MetadataType_Series_ExpectedNumberOfInstances, "ExpectedNumberOfInstances");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
64 dictMetadataType_.Add(MetadataType_ModifiedFrom, "ModifiedFrom");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
65 dictMetadataType_.Add(MetadataType_AnonymizedFrom, "AnonymizedFrom");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
66 dictMetadataType_.Add(MetadataType_LastUpdate, "LastUpdate");
1823
0ef4e6e66b56 "Origin" metadata for the instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
67 dictMetadataType_.Add(MetadataType_Instance_Origin, "Origin");
2189
c4b3259c8bce New metadata automatically computed at the instance level: "TransferSyntax"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
68 dictMetadataType_.Add(MetadataType_Instance_TransferSyntax, "TransferSyntax");
2208
90ea60bee5ff New metadata automatically computed at the instance level: "SopClassUid"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2189
diff changeset
69 dictMetadataType_.Add(MetadataType_Instance_SopClassUid, "SopClassUid");
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
70
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
71 dictContentType_.Add(FileContentType_Dicom, "dicom");
697
dd1ce9a2844c access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 696
diff changeset
72 dictContentType_.Add(FileContentType_DicomAsJson, "dicom-as-json");
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
73 }
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 void RegisterUserMetadata(int metadata,
656
08eca5d86aad fixes to cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 620
diff changeset
76 const std::string& name)
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
77 {
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
78 boost::mutex::scoped_lock lock(enumerationsMutex_);
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
79
1773
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
80 MetadataType type = static_cast<MetadataType>(metadata);
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
81
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
82 if (metadata < 0 ||
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
83 !IsUserMetadata(type))
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
84 {
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
85 LOG(ERROR) << "A user content type must have index between "
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
86 << static_cast<int>(MetadataType_StartUser) << " and "
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
87 << static_cast<int>(MetadataType_EndUser) << ", but \""
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
88 << name << "\" has index " << metadata;
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
89
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
90 throw OrthancException(ErrorCode_ParameterOutOfRange);
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
91 }
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
92
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
93 if (dictMetadataType_.Contains(type))
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
94 {
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
95 LOG(ERROR) << "Cannot associate user content type \""
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
96 << name << "\" with index " << metadata
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
97 << ", as this index is already used";
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
98
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
99 throw OrthancException(ErrorCode_ParameterOutOfRange);
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
100 }
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
101
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
102 dictMetadataType_.Add(type, name);
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
103 }
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
104
437
beca6747945e PUT on metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 436
diff changeset
105 std::string EnumerationToString(MetadataType type)
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
106 {
437
beca6747945e PUT on metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 436
diff changeset
107 // This function MUST return a "std::string" and not "const
beca6747945e PUT on metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 436
diff changeset
108 // 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
109 boost::mutex::scoped_lock lock(enumerationsMutex_);
437
beca6747945e PUT on metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 436
diff changeset
110 return dictMetadataType_.Translate(type);
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
111 }
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
112
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
113 MetadataType StringToMetadata(const std::string& str)
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
114 {
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
115 boost::mutex::scoped_lock lock(enumerationsMutex_);
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
116 return dictMetadataType_.Translate(str);
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
117 }
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
118
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
119 void RegisterUserContentType(int contentType,
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
120 const std::string& name,
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
121 const std::string& mime)
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
122 {
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
123 boost::mutex::scoped_lock lock(enumerationsMutex_);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
124
1773
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
125 FileContentType type = static_cast<FileContentType>(contentType);
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
126
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
127 if (contentType < 0 ||
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
128 !IsUserContentType(type))
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
129 {
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
130 LOG(ERROR) << "A user content type must have index between "
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
131 << static_cast<int>(FileContentType_StartUser) << " and "
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
132 << static_cast<int>(FileContentType_EndUser) << ", but \""
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
133 << name << "\" has index " << contentType;
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
134
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
135 throw OrthancException(ErrorCode_ParameterOutOfRange);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
136 }
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
137
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
138 if (dictContentType_.Contains(type))
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
139 {
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
140 LOG(ERROR) << "Cannot associate user content type \""
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
141 << name << "\" with index " << contentType
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
142 << ", as this index is already used";
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
143
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
144 throw OrthancException(ErrorCode_ParameterOutOfRange);
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
145 }
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
146
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
147 dictContentType_.Add(type, name);
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
148 mimeTypes_[type] = mime;
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
149 }
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
150
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
151 std::string EnumerationToString(FileContentType type)
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
152 {
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
153 // 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
154 // 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
155 boost::mutex::scoped_lock lock(enumerationsMutex_);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
156 return dictContentType_.Translate(type);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
157 }
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
158
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
159 std::string GetFileContentMime(FileContentType type)
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
160 {
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
161 if (type >= FileContentType_StartUser &&
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
162 type <= FileContentType_EndUser)
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
163 {
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
164 boost::mutex::scoped_lock lock(enumerationsMutex_);
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
165
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
166 MimeTypes::const_iterator it = mimeTypes_.find(type);
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
167 if (it != mimeTypes_.end())
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
168 {
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
169 return it->second;
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
170 }
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
171 }
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
172
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
173 switch (type)
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
174 {
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
175 case FileContentType_Dicom:
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
176 return "application/dicom";
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
177
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
178 case FileContentType_DicomAsJson:
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
179 return "application/json";
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
180
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
181 default:
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
182 return "application/octet-stream";
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
183 }
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
184 }
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
185
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
186 FileContentType StringToContentType(const std::string& str)
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
187 {
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
188 boost::mutex::scoped_lock lock(enumerationsMutex_);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
189 return dictContentType_.Translate(str);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
190 }
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
191
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
192 std::string GetBasePath(ResourceType type,
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
193 const std::string& publicId)
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
194 {
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
195 switch (type)
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
196 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
197 case ResourceType_Patient:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
198 return "/patients/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
199
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
200 case ResourceType_Study:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
201 return "/studies/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
202
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
203 case ResourceType_Series:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
204 return "/series/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
205
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
206 case ResourceType_Instance:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
207 return "/instances/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
208
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
209 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
210 throw OrthancException(ErrorCode_ParameterOutOfRange);
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
211 }
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
212 }
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
213
434
ccf3a0a43dac EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 407
diff changeset
214 const char* EnumerationToString(SeriesStatus status)
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 {
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 switch (status)
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
218 case SeriesStatus_Complete:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
219 return "Complete";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
221 case SeriesStatus_Missing:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
222 return "Missing";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
224 case SeriesStatus_Inconsistent:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
225 return "Inconsistent";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
227 case SeriesStatus_Unknown:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
228 return "Unknown";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
230 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
231 throw OrthancException(ErrorCode_ParameterOutOfRange);
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 }
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 }
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
234
434
ccf3a0a43dac EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 407
diff changeset
235 const char* EnumerationToString(StoreStatus status)
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
236 {
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
237 switch (status)
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
238 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
239 case StoreStatus_Success:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
240 return "Success";
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
241
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
242 case StoreStatus_AlreadyStored:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
243 return "AlreadyStored";
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
244
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
245 case StoreStatus_Failure:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
246 return "Failure";
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
247
397
941ea46e9e26 lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 348
diff changeset
248 case StoreStatus_FilteredOut:
941ea46e9e26 lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 348
diff changeset
249 return "FilteredOut";
941ea46e9e26 lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 348
diff changeset
250
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
251 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
252 throw OrthancException(ErrorCode_ParameterOutOfRange);
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
253 }
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
254 }
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
255
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
256
434
ccf3a0a43dac EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 407
diff changeset
257 const char* EnumerationToString(ChangeType type)
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
258 {
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
259 switch (type)
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 ChangeType_CompletedSeries:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
262 return "CompletedSeries";
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 ChangeType_NewInstance:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
265 return "NewInstance";
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 case ChangeType_NewPatient:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
268 return "NewPatient";
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
269
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
270 case ChangeType_NewSeries:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
271 return "NewSeries";
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
272
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
273 case ChangeType_NewStudy:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
274 return "NewStudy";
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
275
315
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
276 case ChangeType_AnonymizedStudy:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
277 return "AnonymizedStudy";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
278
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
279 case ChangeType_AnonymizedSeries:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
280 return "AnonymizedSeries";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
281
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
282 case ChangeType_ModifiedStudy:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
283 return "ModifiedStudy";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
284
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
285 case ChangeType_ModifiedSeries:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
286 return "ModifiedSeries";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
287
348
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
288 case ChangeType_AnonymizedPatient:
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
289 return "AnonymizedPatient";
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
290
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
291 case ChangeType_ModifiedPatient:
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
292 return "ModifiedPatient";
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
293
511
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
294 case ChangeType_StablePatient:
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
295 return "StablePatient";
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
296
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
297 case ChangeType_StableStudy:
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
298 return "StableStudy";
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
299
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
300 case ChangeType_StableSeries:
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
301 return "StableSeries";
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
302
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1163
diff changeset
303 case ChangeType_Deleted:
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1163
diff changeset
304 return "Deleted";
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1163
diff changeset
305
1189
6b9b02a16e99 NewChildInstance change type
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1177
diff changeset
306 case ChangeType_NewChildInstance:
6b9b02a16e99 NewChildInstance change type
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1177
diff changeset
307 return "NewChildInstance";
6b9b02a16e99 NewChildInstance change type
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1177
diff changeset
308
1773
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
309 case ChangeType_UpdatedAttachment:
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
310 return "UpdatedAttachment";
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
311
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
312 case ChangeType_UpdatedMetadata:
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
313 return "UpdatedMetadata";
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
314
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
315 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
316 throw OrthancException(ErrorCode_ParameterOutOfRange);
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
317 }
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
318 }
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
319
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
320
519
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
321 const char* EnumerationToString(ModalityManufacturer manufacturer)
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
322 {
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
323 switch (manufacturer)
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
324 {
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
325 case ModalityManufacturer_Generic:
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
326 return "Generic";
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
327
1017
9d0c7301596e storescp modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 831
diff changeset
328 case ModalityManufacturer_StoreScp:
9d0c7301596e storescp modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 831
diff changeset
329 return "StoreScp";
9d0c7301596e storescp modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 831
diff changeset
330
519
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
331 case ModalityManufacturer_ClearCanvas:
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
332 return "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 case ModalityManufacturer_MedInria:
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
335 return "MedInria";
732
b79eda29896d dcm4chee manufacturer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
336
b79eda29896d dcm4chee manufacturer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
337 case ModalityManufacturer_Dcm4Chee:
b79eda29896d dcm4chee manufacturer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
338 return "Dcm4Chee";
665
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
339
1429
7366a0bdda6a attempt of fix for Syngo.Via
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
340 case ModalityManufacturer_SyngoVia:
7366a0bdda6a attempt of fix for Syngo.Via
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
341 return "SyngoVia";
7366a0bdda6a attempt of fix for Syngo.Via
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
342
1846
3dcf5c0734c9 New "AgfaImpax" modality manufacturer for AGFA Impax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1823
diff changeset
343 case ModalityManufacturer_AgfaImpax:
3dcf5c0734c9 New "AgfaImpax" modality manufacturer for AGFA Impax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1823
diff changeset
344 return "AgfaImpax";
3dcf5c0734c9 New "AgfaImpax" modality manufacturer for AGFA Impax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1823
diff changeset
345
1856
36ab170733d6 Made eFilm version explicit
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1852
diff changeset
346 case ModalityManufacturer_EFilm2:
36ab170733d6 Made eFilm version explicit
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1852
diff changeset
347 return "EFilm2";
1852
efbc3afd6cd3 Efilm and Vitrea manufacturers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
348
efbc3afd6cd3 Efilm and Vitrea manufacturers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
349 case ModalityManufacturer_Vitrea:
efbc3afd6cd3 Efilm and Vitrea manufacturers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
350 return "Vitrea";
efbc3afd6cd3 Efilm and Vitrea manufacturers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
351
519
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
352 default:
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
353 throw OrthancException(ErrorCode_ParameterOutOfRange);
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
354 }
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
355 }
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
356
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
357
620
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
358 const char* EnumerationToString(DicomRequestType type)
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
359 {
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
360 switch (type)
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
361 {
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
362 case DicomRequestType_Echo:
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
363 return "Echo";
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
364 break;
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
365
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
366 case DicomRequestType_Find:
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
367 return "Find";
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
368 break;
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
369
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
370 case DicomRequestType_Get:
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
371 return "Get";
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
372 break;
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
373
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
374 case DicomRequestType_Move:
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
375 return "Move";
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
376 break;
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
377
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
378 case DicomRequestType_Store:
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
379 return "Store";
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
380 break;
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
381
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
382 default:
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
383 throw OrthancException(ErrorCode_ParameterOutOfRange);
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
384 }
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
385 }
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
386
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
387
4aa6f0d79947 security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 562
diff changeset
388
519
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
389 ModalityManufacturer StringToModalityManufacturer(const std::string& manufacturer)
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
390 {
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
391 if (manufacturer == "Generic")
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
392 {
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
393 return ModalityManufacturer_Generic;
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
394 }
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
395 else if (manufacturer == "ClearCanvas")
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
396 {
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
397 return ModalityManufacturer_ClearCanvas;
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
398 }
1017
9d0c7301596e storescp modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 831
diff changeset
399 else if (manufacturer == "StoreScp")
9d0c7301596e storescp modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 831
diff changeset
400 {
9d0c7301596e storescp modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 831
diff changeset
401 return ModalityManufacturer_StoreScp;
9d0c7301596e storescp modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 831
diff changeset
402 }
665
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
403 else if (manufacturer == "MedInria")
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
404 {
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
405 return ModalityManufacturer_MedInria;
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
406 }
732
b79eda29896d dcm4chee manufacturer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
407 else if (manufacturer == "Dcm4Chee")
b79eda29896d dcm4chee manufacturer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
408 {
b79eda29896d dcm4chee manufacturer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
409 return ModalityManufacturer_Dcm4Chee;
b79eda29896d dcm4chee manufacturer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
410 }
1429
7366a0bdda6a attempt of fix for Syngo.Via
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
411 else if (manufacturer == "SyngoVia")
7366a0bdda6a attempt of fix for Syngo.Via
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
412 {
7366a0bdda6a attempt of fix for Syngo.Via
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
413 return ModalityManufacturer_SyngoVia;
7366a0bdda6a attempt of fix for Syngo.Via
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
414 }
1846
3dcf5c0734c9 New "AgfaImpax" modality manufacturer for AGFA Impax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1823
diff changeset
415 else if (manufacturer == "AgfaImpax")
3dcf5c0734c9 New "AgfaImpax" modality manufacturer for AGFA Impax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1823
diff changeset
416 {
3dcf5c0734c9 New "AgfaImpax" modality manufacturer for AGFA Impax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1823
diff changeset
417 return ModalityManufacturer_AgfaImpax;
3dcf5c0734c9 New "AgfaImpax" modality manufacturer for AGFA Impax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1823
diff changeset
418 }
1852
efbc3afd6cd3 Efilm and Vitrea manufacturers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
419 else if (manufacturer == "Vitrea")
efbc3afd6cd3 Efilm and Vitrea manufacturers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
420 {
efbc3afd6cd3 Efilm and Vitrea manufacturers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
421 return ModalityManufacturer_Vitrea;
efbc3afd6cd3 Efilm and Vitrea manufacturers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
422 }
1856
36ab170733d6 Made eFilm version explicit
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1852
diff changeset
423 else if (manufacturer == "EFilm2")
1852
efbc3afd6cd3 Efilm and Vitrea manufacturers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
424 {
1856
36ab170733d6 Made eFilm version explicit
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1852
diff changeset
425 return ModalityManufacturer_EFilm2;
1852
efbc3afd6cd3 Efilm and Vitrea manufacturers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
426 }
519
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
427 else
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
428 {
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
429 throw OrthancException(ErrorCode_ParameterOutOfRange);
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
430 }
1b2cdc855bd3 Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 511
diff changeset
431 }
1163
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
432
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
433
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
434 const char* EnumerationToString(TransferSyntax syntax)
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
435 {
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
436 switch (syntax)
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
437 {
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
438 case TransferSyntax_Deflated:
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
439 return "Deflated";
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
440
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
441 case TransferSyntax_Jpeg:
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
442 return "JPEG";
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
443
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
444 case TransferSyntax_Jpeg2000:
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
445 return "JPEG2000";
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
446
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
447 case TransferSyntax_JpegLossless:
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
448 return "JPEG Lossless";
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
449
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
450 case TransferSyntax_Jpip:
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
451 return "JPIP";
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
452
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
453 case TransferSyntax_Mpeg2:
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
454 return "MPEG2";
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
455
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
456 case TransferSyntax_Rle:
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
457 return "RLE";
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
458
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
459 default:
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
460 throw OrthancException(ErrorCode_ParameterOutOfRange);
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
461 }
3db41779d8f9 abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1103
diff changeset
462 }
1773
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
463
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
464
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
465 bool IsUserMetadata(MetadataType metadata)
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
466 {
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
467 return (metadata >= MetadataType_StartUser &&
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
468 metadata <= MetadataType_EndUser);
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
469 }
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470 }