Mercurial > hg > orthanc
annotate OrthancServer/Sources/ServerEnumerations.cpp @ 5365:5653527a2b1d
updated API version to 22
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 20 Jul 2023 11:13:19 +0200 |
parents | 03501a258d9e |
children | 48b8dae6dc77 |
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 |
5185
0ea402b4d901
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5117
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
0ea402b4d901
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5117
diff
changeset
|
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
199 | 7 * |
8 * This program is free software: you can redistribute it and/or | |
9 * modify it under the terms of the GNU General Public License as | |
10 * published by the Free Software Foundation, either version 3 of the | |
11 * License, or (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, but | |
14 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 * General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 **/ | |
21 | |
824
a811bdf8b8eb
precompiled headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
732
diff
changeset
|
22 |
831
84513f2ee1f3
pch for unit tests and server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
23 #include "PrecompiledHeadersServer.h" |
199 | 24 #include "ServerEnumerations.h" |
25 | |
4045 | 26 #include "../../OrthancFramework/Sources/OrthancException.h" |
27 #include "../../OrthancFramework/Sources/EnumerationDictionary.h" | |
28 #include "../../OrthancFramework/Sources/Logging.h" | |
29 #include "../../OrthancFramework/Sources/Toolbox.h" | |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
30 |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
31 #include <boost/thread.hpp> |
199 | 32 |
33 namespace Orthanc | |
34 { | |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
35 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
|
36 |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
37 static boost::mutex enumerationsMutex_; |
3991
5d2348b39392
turning toolbox namespaces into classes to control visibility in shared libraries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3931
diff
changeset
|
38 static EnumerationDictionary<MetadataType> dictMetadataType_; |
5d2348b39392
turning toolbox namespaces into classes to control visibility in shared libraries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3931
diff
changeset
|
39 static 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
|
40 static MimeTypes mimeTypes_; |
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 void InitializeServerEnumerations() |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
43 { |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
44 boost::mutex::scoped_lock lock(enumerationsMutex_); |
1103
bec1eccf976c
Hot restart of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1017
diff
changeset
|
45 |
bec1eccf976c
Hot restart of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1017
diff
changeset
|
46 dictMetadataType_.Clear(); |
bec1eccf976c
Hot restart of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1017
diff
changeset
|
47 dictContentType_.Clear(); |
436
d51186bf7602
read access to metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
435
diff
changeset
|
48 |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
49 dictMetadataType_.Add(MetadataType_Instance_IndexInSeries, "IndexInSeries"); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
50 dictMetadataType_.Add(MetadataType_Instance_ReceptionDate, "ReceptionDate"); |
4460
6831de40acd9
New metadata automatically computed at the series level: "RemoteAET"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
51 dictMetadataType_.Add(MetadataType_RemoteAet, "RemoteAET"); |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
52 dictMetadataType_.Add(MetadataType_Series_ExpectedNumberOfInstances, "ExpectedNumberOfInstances"); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
53 dictMetadataType_.Add(MetadataType_ModifiedFrom, "ModifiedFrom"); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
54 dictMetadataType_.Add(MetadataType_AnonymizedFrom, "AnonymizedFrom"); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
55 dictMetadataType_.Add(MetadataType_LastUpdate, "LastUpdate"); |
1823
0ef4e6e66b56
"Origin" metadata for the instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
56 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
|
57 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
|
58 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
|
59 dictMetadataType_.Add(MetadataType_Instance_RemoteIp, "RemoteIP"); |
46061a91c88a
new metadata (RemoteIP, CalledAET, HttpUsername), "?expand" metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
60 dictMetadataType_.Add(MetadataType_Instance_CalledAet, "CalledAET"); |
46061a91c88a
new metadata (RemoteIP, CalledAET, HttpUsername), "?expand" metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
61 dictMetadataType_.Add(MetadataType_Instance_HttpUsername, "HttpUsername"); |
4494
39192eb9b43d
New metadata automatically computed at the instance level: "PixelDataOffset"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4474
diff
changeset
|
62 dictMetadataType_.Add(MetadataType_Instance_PixelDataOffset, "PixelDataOffset"); |
4934
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
63 dictMetadataType_.Add(MetadataType_MainDicomTagsSignature, "MainDicomTagsSignature"); |
5036
877bc3b96476
Handle Dicom sequences in ExtraMainDicomTags and save them in the 'MainDicomSequences' metadata
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
64 dictMetadataType_.Add(MetadataType_MainDicomSequences, "MainDicomSequences"); |
5316
03501a258d9e
added instance metadata "PixelDataVR"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5204
diff
changeset
|
65 dictMetadataType_.Add(MetadataType_Instance_PixelDataVR, "PixelDataVR"); |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
66 |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
67 dictContentType_.Add(FileContentType_Dicom, "dicom"); |
697
dd1ce9a2844c
access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
696
diff
changeset
|
68 dictContentType_.Add(FileContentType_DicomAsJson, "dicom-as-json"); |
4514
5b929e6b3c36
removal of "dicom-as-json" attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4494
diff
changeset
|
69 dictContentType_.Add(FileContentType_DicomUntilPixelData, "dicom-until-pixel-data"); |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
70 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
71 |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
72 void RegisterUserMetadata(int metadata, |
656 | 73 const std::string& name) |
435
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 boost::mutex::scoped_lock lock(enumerationsMutex_); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
76 |
1773
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
77 MetadataType type = static_cast<MetadataType>(metadata); |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
78 |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
79 if (metadata < 0 || |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
80 !IsUserMetadata(type)) |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
81 { |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
82 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
|
83 << 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
|
84 << 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
|
85 << 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
|
86 |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
87 throw OrthancException(ErrorCode_ParameterOutOfRange); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
88 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
89 |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
90 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
|
91 { |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
92 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
|
93 << 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
|
94 << ", 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
|
95 |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
96 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
|
97 } |
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 dictMetadataType_.Add(type, name); |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
100 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
101 |
437 | 102 std::string EnumerationToString(MetadataType type) |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
103 { |
437 | 104 // This function MUST return a "std::string" and not "const |
105 // 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
|
106 boost::mutex::scoped_lock lock(enumerationsMutex_); |
437 | 107 return dictMetadataType_.Translate(type); |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
108 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
109 |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
110 MetadataType StringToMetadata(const std::string& str) |
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 boost::mutex::scoped_lock lock(enumerationsMutex_); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
434
diff
changeset
|
113 return dictMetadataType_.Translate(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 |
5204 | 116 void GetRegisteredUserMetadata(std::map<std::string, int>& allEntries) |
117 { | |
118 boost::mutex::scoped_lock lock(enumerationsMutex_); | |
119 | |
120 allEntries.clear(); | |
121 | |
122 std::map<std::string, MetadataType> allEntriesTyped = dictMetadataType_.GetAllEntries(); | |
123 | |
124 for (std::map<std::string, MetadataType>::const_iterator it = allEntriesTyped.begin(); it != allEntriesTyped.end(); ++it) | |
125 { | |
126 if (it->second >= MetadataType_StartUser) | |
127 { | |
128 allEntries[it->first] = it->second; | |
129 } | |
130 } | |
131 } | |
132 | |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
133 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
|
134 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
|
135 const std::string& mime) |
696
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 boost::mutex::scoped_lock lock(enumerationsMutex_); |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
138 |
1773
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
139 FileContentType type = static_cast<FileContentType>(contentType); |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
140 |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
141 if (contentType < 0 || |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
142 !IsUserContentType(type)) |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
143 { |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
144 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
|
145 << 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
|
146 << 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
|
147 << 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
|
148 |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
149 throw OrthancException(ErrorCode_ParameterOutOfRange); |
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 |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
152 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
|
153 { |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
154 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
|
155 << 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
|
156 << ", 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
|
157 |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
158 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
|
159 } |
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 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
|
162 mimeTypes_[type] = mime; |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
163 } |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
164 |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
165 std::string EnumerationToString(FileContentType type) |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
166 { |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
167 // 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
|
168 // 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
|
169 boost::mutex::scoped_lock lock(enumerationsMutex_); |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
170 return dictContentType_.Translate(type); |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
171 } |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
172 |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
173 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
|
174 { |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
175 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
|
176 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
|
177 { |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
178 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
|
179 |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
180 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
|
181 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
|
182 { |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
183 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
|
184 } |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
185 } |
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 switch (type) |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
188 { |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
189 case FileContentType_Dicom: |
2908
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2905
diff
changeset
|
190 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
|
191 |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
192 case FileContentType_DicomAsJson: |
2908
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2905
diff
changeset
|
193 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
|
194 |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
195 default: |
2908
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2905
diff
changeset
|
196 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
|
197 } |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
198 } |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1724
diff
changeset
|
199 |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
200 FileContentType StringToContentType(const std::string& str) |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
201 { |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
202 boost::mutex::scoped_lock lock(enumerationsMutex_); |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
203 return dictContentType_.Translate(str); |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
204 } |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
205 |
3677
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
206 |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
207 FindStorageAccessMode StringToFindStorageAccessMode(const std::string& value) |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
208 { |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
209 if (value == "Always") |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
210 { |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
211 return FindStorageAccessMode_DiskOnLookupAndAnswer; |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
212 } |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
213 else if (value == "Never") |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
214 { |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
215 return FindStorageAccessMode_DatabaseOnly; |
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 else if (value == "Answers") |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
218 { |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
219 return FindStorageAccessMode_DiskOnAnswer; |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
220 } |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
221 else |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
222 { |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
223 throw OrthancException(ErrorCode_ParameterOutOfRange, |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
224 "Configuration option \"StorageAccessOnFind\" " |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
225 "should be \"Always\", \"Never\" or \"Answers\": " + value); |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
226 } |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
227 } |
3931
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
228 |
5058
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
5036
diff
changeset
|
229 bool IsStorageAccessAllowedForAnswers(FindStorageAccessMode mode) |
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
5036
diff
changeset
|
230 { |
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
5036
diff
changeset
|
231 return mode != FindStorageAccessMode_DatabaseOnly; |
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
5036
diff
changeset
|
232 } |
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
5036
diff
changeset
|
233 |
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
5036
diff
changeset
|
234 bool IsStorageAccessAllowedForLookup(FindStorageAccessMode mode) |
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
5036
diff
changeset
|
235 { |
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
5036
diff
changeset
|
236 return mode == FindStorageAccessMode_DiskOnLookupAndAnswer; |
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
5036
diff
changeset
|
237 } |
3931
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
238 |
5061
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
239 MaxStorageMode StringToMaxStorageMode(const std::string& value) |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
240 { |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
241 if (value == "Recycle") |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
242 { |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
243 return MaxStorageMode_Recycle; |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
244 } |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
245 else if (value == "Reject") |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
246 { |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
247 return MaxStorageMode_Reject; |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
248 } |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
249 else |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
250 { |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
251 throw OrthancException(ErrorCode_ParameterOutOfRange, |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
252 "Configuration option \"MaxStorageMode\" " |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
253 "should be \"Recycle\" or \"Reject\": " + value); |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
254 } |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
255 } |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5058
diff
changeset
|
256 |
3931
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
257 BuiltinDecoderTranscoderOrder StringToBuiltinDecoderTranscoderOrder(const std::string& value) |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
258 { |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
259 if (value == "Before") |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
260 { |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
261 return BuiltinDecoderTranscoderOrder_Before; |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
262 } |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
263 else if (value == "After") |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
264 { |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
265 return BuiltinDecoderTranscoderOrder_After; |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
266 } |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
267 else if (value == "Disabled") |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
268 { |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
269 return BuiltinDecoderTranscoderOrder_Disabled; |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
270 } |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
271 else |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
272 { |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
273 throw OrthancException(ErrorCode_ParameterOutOfRange, |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
274 "Configuration option \"BuiltinDecoderTranscoderOrder\" " |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
275 "should be \"After\", \"Before\" or \"Disabled\": " + value); |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
276 } |
e6606d3ec892
new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3677
diff
changeset
|
277 } |
4273
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
278 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
279 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
280 Verbosity StringToVerbosity(const std::string& str) |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
281 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
282 if (str == "default") |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
283 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
284 return Verbosity_Default; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
285 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
286 else if (str == "verbose") |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
287 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
288 return Verbosity_Verbose; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
289 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
290 else if (str == "trace") |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
291 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
292 return Verbosity_Trace; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
293 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
294 else |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
295 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
296 throw OrthancException(ErrorCode_ParameterOutOfRange, |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
297 "Verbosity can be \"default\", \"verbose\" or \"trace\": " + str); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
298 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
299 } |
3677
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
300 |
4182cde57afb
refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
301 |
204 | 302 std::string GetBasePath(ResourceType type, |
303 const std::string& publicId) | |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
304 { |
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
305 switch (type) |
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
306 { |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
307 case ResourceType_Patient: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
308 return "/patients/" + publicId; |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
309 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
310 case ResourceType_Study: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
311 return "/studies/" + publicId; |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
312 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
313 case ResourceType_Series: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
314 return "/series/" + publicId; |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
315 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
316 case ResourceType_Instance: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
317 return "/instances/" + publicId; |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
318 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
319 default: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
320 throw OrthancException(ErrorCode_ParameterOutOfRange); |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
321 } |
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
322 } |
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
323 |
434
ccf3a0a43dac
EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
407
diff
changeset
|
324 const char* EnumerationToString(SeriesStatus status) |
199 | 325 { |
326 switch (status) | |
327 { | |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
328 case SeriesStatus_Complete: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
329 return "Complete"; |
199 | 330 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
331 case SeriesStatus_Missing: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
332 return "Missing"; |
199 | 333 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
334 case SeriesStatus_Inconsistent: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
335 return "Inconsistent"; |
199 | 336 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
337 case SeriesStatus_Unknown: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
338 return "Unknown"; |
199 | 339 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
340 default: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
341 throw OrthancException(ErrorCode_ParameterOutOfRange); |
199 | 342 } |
343 } | |
204 | 344 |
434
ccf3a0a43dac
EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
407
diff
changeset
|
345 const char* EnumerationToString(StoreStatus status) |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
346 { |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
347 switch (status) |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
348 { |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
349 case StoreStatus_Success: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
350 return "Success"; |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
351 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
352 case StoreStatus_AlreadyStored: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
353 return "AlreadyStored"; |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
354 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
355 case StoreStatus_Failure: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
356 return "Failure"; |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
357 |
397
941ea46e9e26
lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
348
diff
changeset
|
358 case StoreStatus_FilteredOut: |
941ea46e9e26
lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
348
diff
changeset
|
359 return "FilteredOut"; |
941ea46e9e26
lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
348
diff
changeset
|
360 |
5117
849000df79b6
fix missing handling of StoreStatus_StorageFull
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5061
diff
changeset
|
361 case StoreStatus_StorageFull: |
849000df79b6
fix missing handling of StoreStatus_StorageFull
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5061
diff
changeset
|
362 return "StorageFull"; |
849000df79b6
fix missing handling of StoreStatus_StorageFull
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5061
diff
changeset
|
363 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
364 default: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
365 throw OrthancException(ErrorCode_ParameterOutOfRange); |
216
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
366 } |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
367 } |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
368 |
e5d5d4a9a326
refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
204
diff
changeset
|
369 |
434
ccf3a0a43dac
EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
407
diff
changeset
|
370 const char* EnumerationToString(ChangeType type) |
204 | 371 { |
372 switch (type) | |
373 { | |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
374 case ChangeType_CompletedSeries: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
375 return "CompletedSeries"; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
376 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
377 case ChangeType_NewInstance: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
378 return "NewInstance"; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
379 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
380 case ChangeType_NewPatient: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
381 return "NewPatient"; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
382 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
383 case ChangeType_NewSeries: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
384 return "NewSeries"; |
204 | 385 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
386 case ChangeType_NewStudy: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
387 return "NewStudy"; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
388 |
315 | 389 case ChangeType_AnonymizedStudy: |
390 return "AnonymizedStudy"; | |
391 | |
392 case ChangeType_AnonymizedSeries: | |
393 return "AnonymizedSeries"; | |
394 | |
395 case ChangeType_ModifiedStudy: | |
396 return "ModifiedStudy"; | |
397 | |
398 case ChangeType_ModifiedSeries: | |
399 return "ModifiedSeries"; | |
400 | |
348
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
401 case ChangeType_AnonymizedPatient: |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
402 return "AnonymizedPatient"; |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
403 |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
404 case ChangeType_ModifiedPatient: |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
405 return "ModifiedPatient"; |
1082e8121d10
refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
315
diff
changeset
|
406 |
511
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
407 case ChangeType_StablePatient: |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
408 return "StablePatient"; |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
409 |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
410 case ChangeType_StableStudy: |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
411 return "StableStudy"; |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
412 |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
413 case ChangeType_StableSeries: |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
414 return "StableSeries"; |
3b735fdf320b
monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
437
diff
changeset
|
415 |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
416 case ChangeType_Deleted: |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
417 return "Deleted"; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
418 |
1189
6b9b02a16e99
NewChildInstance change type
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1177
diff
changeset
|
419 case ChangeType_NewChildInstance: |
6b9b02a16e99
NewChildInstance change type
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1177
diff
changeset
|
420 return "NewChildInstance"; |
6b9b02a16e99
NewChildInstance change type
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1177
diff
changeset
|
421 |
1773
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
422 case ChangeType_UpdatedAttachment: |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
423 return "UpdatedAttachment"; |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
424 |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
425 case ChangeType_UpdatedMetadata: |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
426 return "UpdatedMetadata"; |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
427 |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
428 default: |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
429 throw OrthancException(ErrorCode_ParameterOutOfRange); |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
430 } |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
216
diff
changeset
|
431 } |
204 | 432 |
4273
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
433 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
434 const char* EnumerationToString(Verbosity verbosity) |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
435 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
436 switch (verbosity) |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
437 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
438 case Verbosity_Default: |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
439 return "default"; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
440 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
441 case Verbosity_Verbose: |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
442 return "verbose"; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
443 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
444 case Verbosity_Trace: |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
445 return "trace"; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
446 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
447 default: |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
448 throw OrthancException(ErrorCode_ParameterOutOfRange); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
449 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
450 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
451 |
2309
4dc313b9a20a
Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
452 |
1773
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
453 bool IsUserMetadata(MetadataType metadata) |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
454 { |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
455 return (metadata >= MetadataType_StartUser && |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
456 metadata <= MetadataType_EndUser); |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
457 } |
4469
5ffa4e14e4bd
move old enum TransferSyntax from OrthancFramework to OrthancServer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4460
diff
changeset
|
458 |
5ffa4e14e4bd
move old enum TransferSyntax from OrthancFramework to OrthancServer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4460
diff
changeset
|
459 |
4473
68f52897c119
new URIs: /tools/accepted-transfer-syntaxes and /tools/unknown-sop-class-accepted to replace Lua callbacks for transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4472
diff
changeset
|
460 void GetTransferSyntaxGroup(std::set<DicomTransferSyntax>& target, |
68f52897c119
new URIs: /tools/accepted-transfer-syntaxes and /tools/unknown-sop-class-accepted to replace Lua callbacks for transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4472
diff
changeset
|
461 TransferSyntaxGroup source) |
4469
5ffa4e14e4bd
move old enum TransferSyntax from OrthancFramework to OrthancServer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4460
diff
changeset
|
462 { |
4473
68f52897c119
new URIs: /tools/accepted-transfer-syntaxes and /tools/unknown-sop-class-accepted to replace Lua callbacks for transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4472
diff
changeset
|
463 target.clear(); |
4472
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
464 |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
465 switch (source) |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
466 { |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
467 // Transfer syntaxes supported since Orthanc 0.7.2 |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
468 case TransferSyntaxGroup_Deflated: |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
469 target.insert(DicomTransferSyntax_DeflatedLittleEndianExplicit); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
470 break; |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
471 |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
472 case TransferSyntaxGroup_Jpeg: |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
473 target.insert(DicomTransferSyntax_JPEGProcess1); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
474 target.insert(DicomTransferSyntax_JPEGProcess2_4); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
475 target.insert(DicomTransferSyntax_JPEGProcess3_5); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
476 target.insert(DicomTransferSyntax_JPEGProcess6_8); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
477 target.insert(DicomTransferSyntax_JPEGProcess7_9); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
478 target.insert(DicomTransferSyntax_JPEGProcess10_12); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
479 target.insert(DicomTransferSyntax_JPEGProcess11_13); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
480 target.insert(DicomTransferSyntax_JPEGProcess14); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
481 target.insert(DicomTransferSyntax_JPEGProcess15); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
482 target.insert(DicomTransferSyntax_JPEGProcess16_18); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
483 target.insert(DicomTransferSyntax_JPEGProcess17_19); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
484 target.insert(DicomTransferSyntax_JPEGProcess20_22); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
485 target.insert(DicomTransferSyntax_JPEGProcess21_23); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
486 target.insert(DicomTransferSyntax_JPEGProcess24_26); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
487 target.insert(DicomTransferSyntax_JPEGProcess25_27); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
488 target.insert(DicomTransferSyntax_JPEGProcess28); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
489 target.insert(DicomTransferSyntax_JPEGProcess29); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
490 target.insert(DicomTransferSyntax_JPEGProcess14SV1); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
491 break; |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
492 |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
493 case TransferSyntaxGroup_Jpeg2000: |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
494 target.insert(DicomTransferSyntax_JPEG2000); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
495 target.insert(DicomTransferSyntax_JPEG2000LosslessOnly); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
496 target.insert(DicomTransferSyntax_JPEG2000Multicomponent); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
497 target.insert(DicomTransferSyntax_JPEG2000MulticomponentLosslessOnly); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
498 break; |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
499 |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
500 case TransferSyntaxGroup_JpegLossless: |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
501 target.insert(DicomTransferSyntax_JPEGLSLossless); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
502 target.insert(DicomTransferSyntax_JPEGLSLossy); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
503 break; |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
504 |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
505 case TransferSyntaxGroup_Jpip: |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
506 target.insert(DicomTransferSyntax_JPIPReferenced); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
507 target.insert(DicomTransferSyntax_JPIPReferencedDeflate); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
508 break; |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
509 |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
510 case TransferSyntaxGroup_Mpeg2: |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
511 target.insert(DicomTransferSyntax_MPEG2MainProfileAtMainLevel); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
512 target.insert(DicomTransferSyntax_MPEG2MainProfileAtHighLevel); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
513 break; |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
514 |
4474
f8c1d94363b6
new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4473
diff
changeset
|
515 case TransferSyntaxGroup_Rle: |
f8c1d94363b6
new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4473
diff
changeset
|
516 target.insert(DicomTransferSyntax_RLELossless); |
f8c1d94363b6
new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4473
diff
changeset
|
517 break; |
f8c1d94363b6
new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4473
diff
changeset
|
518 |
4472
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
519 case TransferSyntaxGroup_Mpeg4: |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
520 // New in Orthanc 1.6.0 |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
521 target.insert(DicomTransferSyntax_MPEG4BDcompatibleHighProfileLevel4_1); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
522 target.insert(DicomTransferSyntax_MPEG4HighProfileLevel4_1); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
523 target.insert(DicomTransferSyntax_MPEG4HighProfileLevel4_2_For2DVideo); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
524 target.insert(DicomTransferSyntax_MPEG4HighProfileLevel4_2_For3DVideo); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
525 target.insert(DicomTransferSyntax_MPEG4StereoHighProfileLevel4_2); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
526 break; |
4474
f8c1d94363b6
new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4473
diff
changeset
|
527 |
f8c1d94363b6
new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4473
diff
changeset
|
528 case TransferSyntaxGroup_H265: |
f8c1d94363b6
new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4473
diff
changeset
|
529 // New in Orthanc 1.9.0 |
f8c1d94363b6
new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4473
diff
changeset
|
530 target.insert(DicomTransferSyntax_HEVCMainProfileLevel5_1); |
f8c1d94363b6
new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4473
diff
changeset
|
531 target.insert(DicomTransferSyntax_HEVCMain10ProfileLevel5_1); |
f8c1d94363b6
new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4473
diff
changeset
|
532 break; |
4472
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
533 |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
534 default: |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
535 throw OrthancException(ErrorCode_ParameterOutOfRange); |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
536 } |
28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
537 } |
199 | 538 } |