Mercurial > hg > orthanc
annotate OrthancServer/ServerEnumerations.cpp @ 3840:e7003b2203a7
fixing signature of DicomMap::ParseDicomMetaInformation()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 15 Apr 2020 22:17:42 +0200 |
parents | 4182cde57afb |
children | e6606d3ec892 |
rev | line source |
---|---|
199 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
1900 | 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 |
3640
94f4a18a79cc
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
199 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU General Public License as | |
9 * published by the Free Software Foundation, either version 3 of the | |
10 * License, or (at your option) any later version. | |
11 * | |
12 * In addition, as a special exception, the copyright holders of this | |
13 * program give permission to link the code of its release with the | |
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
15 * that use the same license as the "OpenSSL" library), and distribute | |
16 * the linked executables. You must obey the GNU General Public License | |
17 * in all respects for all of the code used other than "OpenSSL". If you | |
18 * modify file(s) with this exception, you may extend this exception to | |
19 * your version of the file(s), but you are not obligated to do so. If | |
20 * you do not wish to do so, delete this exception statement from your | |
21 * version. If you delete this exception statement from all source files | |
22 * in the program, then also delete it here. | |
23 * | |
24 * This program is distributed in the hope that it will be useful, but | |
25 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
27 * General Public License for more details. | |
28 * | |
29 * You should have received a copy of the GNU General Public License | |
30 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
31 **/ | |
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 | 35 #include "ServerEnumerations.h" |
36 | |
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 | 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 | 43 |
44 namespace Orthanc | |
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"); |
2726
46061a91c88a
new metadata (RemoteIP, CalledAET, HttpUsername), "?expand" metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
70 dictMetadataType_.Add(MetadataType_Instance_RemoteIp, "RemoteIP"); |
46061a91c88a
new metadata (RemoteIP, CalledAET, HttpUsername), "?expand" metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
71 dictMetadataType_.Add(MetadataType_Instance_CalledAet, "CalledAET"); |
46061a91c88a
new metadata (RemoteIP, CalledAET, HttpUsername), "?expand" metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
72 dictMetadataType_.Add(MetadataType_Instance_HttpUsername, "HttpUsername"); |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
73 |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
74 dictContentType_.Add(FileContentType_Dicom, "dicom"); |
697
dd1ce9a2844c
access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
696
diff
changeset
|
75 dictContentType_.Add(FileContentType_DicomAsJson, "dicom-as-json"); |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
76 } |
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 void RegisterUserMetadata(int metadata, |
656 | 79 const std::string& name) |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
80 { |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
81 boost::mutex::scoped_lock lock(enumerationsMutex_); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
82 |
1773
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
83 MetadataType type = static_cast<MetadataType>(metadata); |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
84 |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
85 if (metadata < 0 || |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
86 !IsUserMetadata(type)) |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
87 { |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
88 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
|
89 << 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
|
90 << 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
|
91 << 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
|
92 |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
93 throw OrthancException(ErrorCode_ParameterOutOfRange); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
94 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
95 |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
96 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
|
97 { |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
98 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
|
99 << 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
|
100 << ", 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
|
101 |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
102 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
|
103 } |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
104 |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
105 dictMetadataType_.Add(type, name); |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
106 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
107 |
437 | 108 std::string EnumerationToString(MetadataType type) |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
109 { |
437 | 110 // This function MUST return a "std::string" and not "const |
111 // 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
|
112 boost::mutex::scoped_lock lock(enumerationsMutex_); |
437 | 113 return dictMetadataType_.Translate(type); |
435
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 |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
116 MetadataType StringToMetadata(const std::string& 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 boost::mutex::scoped_lock lock(enumerationsMutex_); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
119 return dictMetadataType_.Translate(str); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
120 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
121 |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
122 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
|
123 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
|
124 const std::string& mime) |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
125 { |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
126 boost::mutex::scoped_lock lock(enumerationsMutex_); |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
127 |
1773
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
128 FileContentType type = static_cast<FileContentType>(contentType); |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
129 |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
130 if (contentType < 0 || |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
131 !IsUserContentType(type)) |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
132 { |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
133 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
|
134 << 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
|
135 << 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
|
136 << 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
|
137 |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
138 throw OrthancException(ErrorCode_ParameterOutOfRange); |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
139 } |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
140 |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
141 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
|
142 { |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
143 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
|
144 << 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
|
145 << ", 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
|
146 |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
147 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
|
148 } |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
149 |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
150 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
|
151 mimeTypes_[type] = mime; |
696
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 |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
154 std::string EnumerationToString(FileContentType type) |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
155 { |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
156 // 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
|
157 // 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
|
158 boost::mutex::scoped_lock lock(enumerationsMutex_); |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
159 return dictContentType_.Translate(type); |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
160 } |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
161 |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
162 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
|
163 { |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
164 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
|
165 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
|
166 { |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
167 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
|
168 |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
169 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
|
170 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
|
171 { |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
172 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
|
173 } |
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 |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
176 switch (type) |
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_Dicom: |
2908
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2905
diff
changeset
|
179 return EnumerationToString(MimeType_Dicom); |
1772
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 case FileContentType_DicomAsJson: |
2908
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2905
diff
changeset
|
182 return MIME_JSON_UTF8; |
1772
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 default: |
2908
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2905
diff
changeset
|
185 return EnumerationToString(MimeType_Binary); |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
186 } |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
187 } |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
188 |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
189 FileContentType StringToContentType(const std::string& 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 boost::mutex::scoped_lock lock(enumerationsMutex_); |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
192 return dictContentType_.Translate(str); |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
193 } |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
194 |
3677
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
195 |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
196 FindStorageAccessMode StringToFindStorageAccessMode(const std::string& value) |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
197 { |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
198 if (value == "Always") |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
199 { |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
200 return FindStorageAccessMode_DiskOnLookupAndAnswer; |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
201 } |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
202 else if (value == "Never") |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
203 { |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
204 return FindStorageAccessMode_DatabaseOnly; |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
205 } |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
206 else if (value == "Answers") |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
207 { |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
208 return FindStorageAccessMode_DiskOnAnswer; |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
209 } |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
210 else |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
211 { |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
212 throw OrthancException(ErrorCode_ParameterOutOfRange, |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
213 "Configuration option \"StorageAccessOnFind\" " |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
214 "should be \"Always\", \"Never\" or \"Answers\": " + value); |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
215 } |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
216 } |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
217 |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
218 |
204 | 219 std::string GetBasePath(ResourceType type, |
220 const std::string& publicId) | |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
221 { |
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
222 switch (type) |
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
223 { |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
224 case ResourceType_Patient: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
225 return "/patients/" + publicId; |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
226 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
227 case ResourceType_Study: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
228 return "/studies/" + publicId; |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
229 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
230 case ResourceType_Series: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
231 return "/series/" + publicId; |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
232 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
233 case ResourceType_Instance: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
234 return "/instances/" + publicId; |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
235 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
236 default: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
237 throw OrthancException(ErrorCode_ParameterOutOfRange); |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
238 } |
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
239 } |
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
240 |
434
ccf3a0a43dac
EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
407
diff
changeset
|
241 const char* EnumerationToString(SeriesStatus status) |
199 | 242 { |
243 switch (status) | |
244 { | |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
245 case SeriesStatus_Complete: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
246 return "Complete"; |
199 | 247 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
248 case SeriesStatus_Missing: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
249 return "Missing"; |
199 | 250 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
251 case SeriesStatus_Inconsistent: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
252 return "Inconsistent"; |
199 | 253 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
254 case SeriesStatus_Unknown: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
255 return "Unknown"; |
199 | 256 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
257 default: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
258 throw OrthancException(ErrorCode_ParameterOutOfRange); |
199 | 259 } |
260 } | |
204 | 261 |
434
ccf3a0a43dac
EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
407
diff
changeset
|
262 const char* EnumerationToString(StoreStatus status) |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
263 { |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
264 switch (status) |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
265 { |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
266 case StoreStatus_Success: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
267 return "Success"; |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
268 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
269 case StoreStatus_AlreadyStored: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
270 return "AlreadyStored"; |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
271 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
272 case StoreStatus_Failure: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
273 return "Failure"; |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
274 |
397
941ea46e9e26
lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
348
diff
changeset
|
275 case StoreStatus_FilteredOut: |
941ea46e9e26
lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
348
diff
changeset
|
276 return "FilteredOut"; |
941ea46e9e26
lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
348
diff
changeset
|
277 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
278 default: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
279 throw OrthancException(ErrorCode_ParameterOutOfRange); |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
280 } |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
281 } |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
282 |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
283 |
434
ccf3a0a43dac
EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
407
diff
changeset
|
284 const char* EnumerationToString(ChangeType type) |
204 | 285 { |
286 switch (type) | |
287 { | |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
288 case ChangeType_CompletedSeries: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
289 return "CompletedSeries"; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
290 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
291 case ChangeType_NewInstance: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
292 return "NewInstance"; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
293 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
294 case ChangeType_NewPatient: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
295 return "NewPatient"; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
296 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
297 case ChangeType_NewSeries: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
298 return "NewSeries"; |
204 | 299 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
300 case ChangeType_NewStudy: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
301 return "NewStudy"; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
302 |
315 | 303 case ChangeType_AnonymizedStudy: |
304 return "AnonymizedStudy"; | |
305 | |
306 case ChangeType_AnonymizedSeries: | |
307 return "AnonymizedSeries"; | |
308 | |
309 case ChangeType_ModifiedStudy: | |
310 return "ModifiedStudy"; | |
311 | |
312 case ChangeType_ModifiedSeries: | |
313 return "ModifiedSeries"; | |
314 | |
348
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
315 case ChangeType_AnonymizedPatient: |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
316 return "AnonymizedPatient"; |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
317 |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
318 case ChangeType_ModifiedPatient: |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
319 return "ModifiedPatient"; |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
320 |
511
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
321 case ChangeType_StablePatient: |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
322 return "StablePatient"; |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
323 |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
324 case ChangeType_StableStudy: |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
325 return "StableStudy"; |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
326 |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
327 case ChangeType_StableSeries: |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
328 return "StableSeries"; |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
329 |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
330 case ChangeType_Deleted: |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
331 return "Deleted"; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
332 |
1189
6b9b02a16e99
NewChildInstance change type
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1177
diff
changeset
|
333 case ChangeType_NewChildInstance: |
6b9b02a16e99
NewChildInstance change type
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1177
diff
changeset
|
334 return "NewChildInstance"; |
6b9b02a16e99
NewChildInstance change type
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1177
diff
changeset
|
335 |
1773
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
336 case ChangeType_UpdatedAttachment: |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
337 return "UpdatedAttachment"; |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
338 |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
339 case ChangeType_UpdatedMetadata: |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
340 return "UpdatedMetadata"; |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
341 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
342 default: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
343 throw OrthancException(ErrorCode_ParameterOutOfRange); |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
344 } |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
345 } |
204 | 346 |
2309
4dc313b9a20a
Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
347 |
1773
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
348 bool IsUserMetadata(MetadataType metadata) |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
349 { |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
350 return (metadata >= MetadataType_StartUser && |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
351 metadata <= MetadataType_EndUser); |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
352 } |
199 | 353 } |