annotate OrthancServer/Sources/ServerEnumerations.cpp @ 5663:3765085693e5 large-queries

merge default -> large-queries
author Alain Mazy <am@orthanc.team>
date Thu, 04 Jul 2024 07:40:58 +0200
parents 28cc06e4859a f7adfb22e20e
children 963945d780d6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1856
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1288
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1189
diff changeset
4 * Department, University Hospital of Liege, Belgium
5640
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5485
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5485
diff changeset
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
5485
48b8dae6dc77 upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5316
diff changeset
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * This program is free software: you can redistribute it and/or
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * modify it under the terms of the GNU General Public License as
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * published by the Free Software Foundation, either version 3 of the
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * License, or (at your option) any later version.
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 *
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful, but
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * General Public License for more details.
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 *
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
824
a811bdf8b8eb precompiled headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 732
diff changeset
23
831
84513f2ee1f3 pch for unit tests and server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
24 #include "PrecompiledHeadersServer.h"
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include "ServerEnumerations.h"
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
4045
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
27 #include "../../OrthancFramework/Sources/OrthancException.h"
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
28 #include "../../OrthancFramework/Sources/EnumerationDictionary.h"
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
29 #include "../../OrthancFramework/Sources/Logging.h"
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
30 #include "../../OrthancFramework/Sources/Toolbox.h"
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
31
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
32 #include <boost/thread.hpp>
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 namespace Orthanc
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 {
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
36 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
37
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
38 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
39 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
40 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
41 static MimeTypes mimeTypes_;
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
42
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
43 void InitializeServerEnumerations()
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
44 {
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
45 boost::mutex::scoped_lock lock(enumerationsMutex_);
1103
bec1eccf976c Hot restart of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1017
diff changeset
46
bec1eccf976c Hot restart of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1017
diff changeset
47 dictMetadataType_.Clear();
bec1eccf976c Hot restart of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1017
diff changeset
48 dictContentType_.Clear();
436
d51186bf7602 read access to metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 435
diff changeset
49
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
50 dictMetadataType_.Add(MetadataType_Instance_IndexInSeries, "IndexInSeries");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
51 dictMetadataType_.Add(MetadataType_Instance_ReceptionDate, "ReceptionDate");
4460
6831de40acd9 New metadata automatically computed at the series level: "RemoteAET"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
52 dictMetadataType_.Add(MetadataType_RemoteAet, "RemoteAET");
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
53 dictMetadataType_.Add(MetadataType_Series_ExpectedNumberOfInstances, "ExpectedNumberOfInstances");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
54 dictMetadataType_.Add(MetadataType_ModifiedFrom, "ModifiedFrom");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
55 dictMetadataType_.Add(MetadataType_AnonymizedFrom, "AnonymizedFrom");
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
56 dictMetadataType_.Add(MetadataType_LastUpdate, "LastUpdate");
1823
0ef4e6e66b56 "Origin" metadata for the instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
57 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
58 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
59 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
60 dictMetadataType_.Add(MetadataType_Instance_RemoteIp, "RemoteIP");
46061a91c88a new metadata (RemoteIP, CalledAET, HttpUsername), "?expand" metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
61 dictMetadataType_.Add(MetadataType_Instance_CalledAet, "CalledAET");
46061a91c88a new metadata (RemoteIP, CalledAET, HttpUsername), "?expand" metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
62 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
63 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
64 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
65 dictMetadataType_.Add(MetadataType_MainDicomSequences, "MainDicomSequences");
5316
03501a258d9e added instance metadata "PixelDataVR"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5204
diff changeset
66 dictMetadataType_.Add(MetadataType_Instance_PixelDataVR, "PixelDataVR");
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
67
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
68 dictContentType_.Add(FileContentType_Dicom, "dicom");
697
dd1ce9a2844c access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 696
diff changeset
69 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
70 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
71 }
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
72
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
73 void RegisterUserMetadata(int metadata,
656
08eca5d86aad fixes to cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 620
diff changeset
74 const std::string& name)
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
75 {
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
76 boost::mutex::scoped_lock lock(enumerationsMutex_);
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
77
1773
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
78 MetadataType type = static_cast<MetadataType>(metadata);
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
79
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
80 if (metadata < 0 ||
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
81 !IsUserMetadata(type))
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
82 {
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
83 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
84 << 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
85 << 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
86 << 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
87
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
88 throw OrthancException(ErrorCode_ParameterOutOfRange);
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
89 }
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
90
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
91 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
92 {
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
93 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
94 << 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
95 << ", 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
96
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
97 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
98 }
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
99
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
100 dictMetadataType_.Add(type, name);
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
101 }
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
102
437
beca6747945e PUT on metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 436
diff changeset
103 std::string EnumerationToString(MetadataType type)
435
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
104 {
437
beca6747945e PUT on metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 436
diff changeset
105 // This function MUST return a "std::string" and not "const
beca6747945e PUT on metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 436
diff changeset
106 // 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
107 boost::mutex::scoped_lock lock(enumerationsMutex_);
437
beca6747945e PUT on metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 436
diff changeset
108 return dictMetadataType_.Translate(type);
435
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
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
111 MetadataType StringToMetadata(const std::string& str)
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
112 {
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
113 boost::mutex::scoped_lock lock(enumerationsMutex_);
28ba73274919 registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 434
diff changeset
114 return dictMetadataType_.Translate(str);
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
5204
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
117 void GetRegisteredUserMetadata(std::map<std::string, int>& allEntries)
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
118 {
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
119 boost::mutex::scoped_lock lock(enumerationsMutex_);
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
120
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
121 allEntries.clear();
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
122
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
123 std::map<std::string, MetadataType> allEntriesTyped = dictMetadataType_.GetAllEntries();
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
124
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
125 for (std::map<std::string, MetadataType>::const_iterator it = allEntriesTyped.begin(); it != allEntriesTyped.end(); ++it)
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
126 {
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
127 if (it->second >= MetadataType_StartUser)
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
128 {
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
129 allEntries[it->first] = it->second;
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
130 }
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
131 }
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
132 }
08e0c9c0ab39 added UserMetadata in /system
Alain Mazy <am@osimis.io>
parents: 5185
diff changeset
133
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
134 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
135 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
136 const std::string& mime)
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
137 {
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
138 boost::mutex::scoped_lock lock(enumerationsMutex_);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
139
1773
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
140 FileContentType type = static_cast<FileContentType>(contentType);
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
141
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
142 if (contentType < 0 ||
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
143 !IsUserContentType(type))
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
144 {
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
145 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
146 << 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
147 << 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
148 << 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
149
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
150 throw OrthancException(ErrorCode_ParameterOutOfRange);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
151 }
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
152
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
153 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
154 {
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
155 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
156 << 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
157 << ", 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
158
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
159 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
160 }
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
161
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
162 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
163 mimeTypes_[type] = mime;
696
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
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
166 std::string EnumerationToString(FileContentType type)
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
167 {
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
168 // 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
169 // 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
170 boost::mutex::scoped_lock lock(enumerationsMutex_);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
171 return dictContentType_.Translate(type);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
172 }
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
173
1772
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
174 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
175 {
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
176 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
177 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
178 {
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
179 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
180
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
181 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
182 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
183 {
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
184 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
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
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
188 switch (type)
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
189 {
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
190 case FileContentType_Dicom:
2908
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2905
diff changeset
191 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
192
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
193 case FileContentType_DicomAsJson:
2908
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2905
diff changeset
194 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
195
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
196 default:
2908
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2905
diff changeset
197 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
198 }
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
199 }
53e045b5a8ec MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1724
diff changeset
200
696
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
201 FileContentType StringToContentType(const std::string& str)
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
202 {
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
203 boost::mutex::scoped_lock lock(enumerationsMutex_);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
204 return dictContentType_.Translate(str);
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
205 }
4c1860179cc5 dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
206
3677
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 FindStorageAccessMode StringToFindStorageAccessMode(const std::string& value)
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 if (value == "Always")
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 return FindStorageAccessMode_DiskOnLookupAndAnswer;
4182cde57afb refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
213 }
4182cde57afb refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
214 else if (value == "Never")
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 return FindStorageAccessMode_DatabaseOnly;
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 else if (value == "Answers")
4182cde57afb refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
219 {
4182cde57afb refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
220 return FindStorageAccessMode_DiskOnAnswer;
4182cde57afb refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
221 }
4182cde57afb refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
222 else
4182cde57afb refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
223 {
4182cde57afb refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
224 throw OrthancException(ErrorCode_ParameterOutOfRange,
4182cde57afb refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
225 "Configuration option \"StorageAccessOnFind\" "
4182cde57afb refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
226 "should be \"Always\", \"Never\" or \"Answers\": " + value);
4182cde57afb refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
227 }
4182cde57afb refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
228 }
3931
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
229
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
230 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
231 {
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 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
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
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 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
236 {
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 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
238 }
3931
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
239
5061
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
240 MaxStorageMode StringToMaxStorageMode(const std::string& value)
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
241 {
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
242 if (value == "Recycle")
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
243 {
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
244 return MaxStorageMode_Recycle;
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
245 }
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
246 else if (value == "Reject")
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
247 {
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
248 return MaxStorageMode_Reject;
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
249 }
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
250 else
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
251 {
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
252 throw OrthancException(ErrorCode_ParameterOutOfRange,
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
253 "Configuration option \"MaxStorageMode\" "
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
254 "should be \"Recycle\" or \"Reject\": " + value);
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 }
e95fadefeb72 new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents: 5058
diff changeset
257
3931
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
258 BuiltinDecoderTranscoderOrder StringToBuiltinDecoderTranscoderOrder(const std::string& value)
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
259 {
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
260 if (value == "Before")
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
261 {
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
262 return BuiltinDecoderTranscoderOrder_Before;
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
263 }
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
264 else if (value == "After")
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
265 {
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
266 return BuiltinDecoderTranscoderOrder_After;
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
267 }
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
268 else if (value == "Disabled")
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
269 {
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
270 return BuiltinDecoderTranscoderOrder_Disabled;
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
271 }
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
272 else
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
273 {
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
274 throw OrthancException(ErrorCode_ParameterOutOfRange,
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
275 "Configuration option \"BuiltinDecoderTranscoderOrder\" "
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
276 "should be \"After\", \"Before\" or \"Disabled\": " + value);
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
277 }
e6606d3ec892 new configuration option: BuiltinDecoderTranscoderOrder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3677
diff changeset
278 }
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
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
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 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
282 {
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 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
284 {
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 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
286 }
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 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
288 {
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 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
290 }
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 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
292 {
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 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
294 }
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 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
296 {
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 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
298 "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
299 }
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
300 }
3677
4182cde57afb refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
301
4182cde57afb refactoring FindStorageAccessMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
302
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
303 std::string GetBasePath(ResourceType type,
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
304 const std::string& publicId)
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
305 {
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
306 switch (type)
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
307 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
308 case ResourceType_Patient:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
309 return "/patients/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
310
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
311 case ResourceType_Study:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
312 return "/studies/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
313
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
314 case ResourceType_Series:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
315 return "/series/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
316
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
317 case ResourceType_Instance:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
318 return "/instances/" + publicId;
201
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
319
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
320 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
321 throw OrthancException(ErrorCode_ParameterOutOfRange);
201
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 }
bee20e978835 refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
324
434
ccf3a0a43dac EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 407
diff changeset
325 const char* EnumerationToString(SeriesStatus status)
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326 {
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327 switch (status)
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
329 case SeriesStatus_Complete:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
330 return "Complete";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
332 case SeriesStatus_Missing:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
333 return "Missing";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
335 case SeriesStatus_Inconsistent:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
336 return "Inconsistent";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
338 case SeriesStatus_Unknown:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
339 return "Unknown";
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
341 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
342 throw OrthancException(ErrorCode_ParameterOutOfRange);
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 }
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344 }
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
345
434
ccf3a0a43dac EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 407
diff changeset
346 const char* EnumerationToString(StoreStatus status)
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
347 {
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
348 switch (status)
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
349 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
350 case StoreStatus_Success:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
351 return "Success";
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
352
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
353 case StoreStatus_AlreadyStored:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
354 return "AlreadyStored";
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
355
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
356 case StoreStatus_Failure:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
357 return "Failure";
216
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
358
397
941ea46e9e26 lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 348
diff changeset
359 case StoreStatus_FilteredOut:
941ea46e9e26 lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 348
diff changeset
360 return "FilteredOut";
941ea46e9e26 lua filter of new instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 348
diff changeset
361
5117
849000df79b6 fix missing handling of StoreStatus_StorageFull
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5061
diff changeset
362 case StoreStatus_StorageFull:
849000df79b6 fix missing handling of StoreStatus_StorageFull
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5061
diff changeset
363 return "StorageFull";
849000df79b6 fix missing handling of StoreStatus_StorageFull
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5061
diff changeset
364
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
365 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
366 throw OrthancException(ErrorCode_ParameterOutOfRange);
216
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
e5d5d4a9a326 refactored upload of dicom through http
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
370
434
ccf3a0a43dac EnumerationDictionary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 407
diff changeset
371 const char* EnumerationToString(ChangeType type)
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
372 {
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
373 switch (type)
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
374 {
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
375 case ChangeType_CompletedSeries:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
376 return "CompletedSeries";
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
377
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
378 case ChangeType_NewInstance:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
379 return "NewInstance";
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
380
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
381 case ChangeType_NewPatient:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
382 return "NewPatient";
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
383
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
384 case ChangeType_NewSeries:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
385 return "NewSeries";
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
386
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
387 case ChangeType_NewStudy:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
388 return "NewStudy";
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
389
315
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
390 case ChangeType_AnonymizedStudy:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
391 return "AnonymizedStudy";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
392
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
393 case ChangeType_AnonymizedSeries:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
394 return "AnonymizedSeries";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
395
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
396 case ChangeType_ModifiedStudy:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
397 return "ModifiedStudy";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
398
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
399 case ChangeType_ModifiedSeries:
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
400 return "ModifiedSeries";
fc856d175d18 modifications
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 250
diff changeset
401
348
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
402 case ChangeType_AnonymizedPatient:
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
403 return "AnonymizedPatient";
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
404
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
405 case ChangeType_ModifiedPatient:
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
406 return "ModifiedPatient";
1082e8121d10 refactoring anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
407
511
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
408 case ChangeType_StablePatient:
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
409 return "StablePatient";
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
410
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
411 case ChangeType_StableStudy:
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
412 return "StableStudy";
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
413
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
414 case ChangeType_StableSeries:
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
415 return "StableSeries";
3b735fdf320b monitoring of stable patients/studies/series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
416
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1163
diff changeset
417 case ChangeType_Deleted:
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1163
diff changeset
418 return "Deleted";
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1163
diff changeset
419
1189
6b9b02a16e99 NewChildInstance change type
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1177
diff changeset
420 case ChangeType_NewChildInstance:
6b9b02a16e99 NewChildInstance change type
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1177
diff changeset
421 return "NewChildInstance";
6b9b02a16e99 NewChildInstance change type
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1177
diff changeset
422
1773
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
423 case ChangeType_UpdatedAttachment:
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
424 return "UpdatedAttachment";
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
425
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
426 case ChangeType_UpdatedMetadata:
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
427 return "UpdatedMetadata";
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
428
250
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
429 default:
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
430 throw OrthancException(ErrorCode_ParameterOutOfRange);
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
431 }
f23318b11b39 creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 216
diff changeset
432 }
204
7f4acf490179 changes api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
433
5553
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
434 ChangeType StringToChangeType(const std::string& value)
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
435 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
436 if (value == "CompletedSeries")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
437 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
438 return ChangeType_CompletedSeries;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
439 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
440 else if (value == "NewInstance")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
441 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
442 return ChangeType_NewInstance;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
443 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
444 else if (value == "NewPatient")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
445 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
446 return ChangeType_NewPatient;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
447 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
448 else if (value == "NewSeries")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
449 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
450 return ChangeType_NewSeries;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
451 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
452 else if (value == "NewStudy")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
453 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
454 return ChangeType_NewStudy;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
455 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
456 else if (value == "AnonymizedStudy")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
457 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
458 return ChangeType_AnonymizedStudy;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
459 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
460 else if (value == "AnonymizedSeries")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
461 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
462 return ChangeType_AnonymizedSeries;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
463 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
464 else if (value == "ModifiedStudy")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
465 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
466 return ChangeType_ModifiedStudy;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
467 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
468 else if (value == "ModifiedSeries")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
469 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
470 return ChangeType_ModifiedSeries;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
471 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
472 else if (value == "AnonymizedPatient")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
473 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
474 return ChangeType_AnonymizedPatient;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
475 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
476 else if (value == "ModifiedPatient")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
477 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
478 return ChangeType_ModifiedPatient;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
479 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
480 else if (value == "StablePatient")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
481 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
482 return ChangeType_StablePatient;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
483 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
484 else if (value == "StableStudy")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
485 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
486 return ChangeType_StableStudy;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
487 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
488 else if (value == "StableSeries")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
489 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
490 return ChangeType_StableSeries;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
491 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
492 else if (value == "Deleted")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
493 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
494 return ChangeType_Deleted;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
495 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
496 else if (value == "NewChildInstance")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
497 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
498 return ChangeType_NewChildInstance;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
499 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
500 else if (value == "UpdatedAttachment")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
501 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
502 return ChangeType_UpdatedAttachment;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
503 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
504 else if (value == "UpdatedMetadata")
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
505 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
506 return ChangeType_UpdatedMetadata;
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
507 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
508 else
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
509 {
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
510 throw OrthancException(ErrorCode_ParameterOutOfRange, "Invalid value for a change: " + value);
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
511 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
512 }
28cc06e4859a Added ExtendedApiV1: /changes
Alain Mazy <am@orthanc.team>
parents: 5485
diff changeset
513
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
514
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
515 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
516 {
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
517 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
518 {
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
519 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
520 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
521
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
522 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
523 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
524
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
525 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
526 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
527
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
528 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
529 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
530 }
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
531 }
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
532
2309
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
533
1773
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
534 bool IsUserMetadata(MetadataType metadata)
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
535 {
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
536 return (metadata >= MetadataType_StartUser &&
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
537 metadata <= MetadataType_EndUser);
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
538 }
4469
5ffa4e14e4bd move old enum TransferSyntax from OrthancFramework to OrthancServer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4460
diff changeset
539
5ffa4e14e4bd move old enum TransferSyntax from OrthancFramework to OrthancServer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4460
diff changeset
540
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
541 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
542 TransferSyntaxGroup source)
4469
5ffa4e14e4bd move old enum TransferSyntax from OrthancFramework to OrthancServer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4460
diff changeset
543 {
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
544 target.clear();
4472
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
545
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
546 switch (source)
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
547 {
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
548 // Transfer syntaxes supported since Orthanc 0.7.2
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
549 case TransferSyntaxGroup_Deflated:
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
550 target.insert(DicomTransferSyntax_DeflatedLittleEndianExplicit);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
551 break;
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
552
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
553 case TransferSyntaxGroup_Jpeg:
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
554 target.insert(DicomTransferSyntax_JPEGProcess1);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
555 target.insert(DicomTransferSyntax_JPEGProcess2_4);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
556 target.insert(DicomTransferSyntax_JPEGProcess3_5);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
557 target.insert(DicomTransferSyntax_JPEGProcess6_8);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
558 target.insert(DicomTransferSyntax_JPEGProcess7_9);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
559 target.insert(DicomTransferSyntax_JPEGProcess10_12);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
560 target.insert(DicomTransferSyntax_JPEGProcess11_13);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
561 target.insert(DicomTransferSyntax_JPEGProcess14);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
562 target.insert(DicomTransferSyntax_JPEGProcess15);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
563 target.insert(DicomTransferSyntax_JPEGProcess16_18);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
564 target.insert(DicomTransferSyntax_JPEGProcess17_19);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
565 target.insert(DicomTransferSyntax_JPEGProcess20_22);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
566 target.insert(DicomTransferSyntax_JPEGProcess21_23);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
567 target.insert(DicomTransferSyntax_JPEGProcess24_26);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
568 target.insert(DicomTransferSyntax_JPEGProcess25_27);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
569 target.insert(DicomTransferSyntax_JPEGProcess28);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
570 target.insert(DicomTransferSyntax_JPEGProcess29);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
571 target.insert(DicomTransferSyntax_JPEGProcess14SV1);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
572 break;
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
573
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
574 case TransferSyntaxGroup_Jpeg2000:
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
575 target.insert(DicomTransferSyntax_JPEG2000);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
576 target.insert(DicomTransferSyntax_JPEG2000LosslessOnly);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
577 target.insert(DicomTransferSyntax_JPEG2000Multicomponent);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
578 target.insert(DicomTransferSyntax_JPEG2000MulticomponentLosslessOnly);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
579 break;
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
580
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
581 case TransferSyntaxGroup_JpegLossless:
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
582 target.insert(DicomTransferSyntax_JPEGLSLossless);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
583 target.insert(DicomTransferSyntax_JPEGLSLossy);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
584 break;
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
585
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
586 case TransferSyntaxGroup_Jpip:
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
587 target.insert(DicomTransferSyntax_JPIPReferenced);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
588 target.insert(DicomTransferSyntax_JPIPReferencedDeflate);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
589 break;
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
590
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
591 case TransferSyntaxGroup_Mpeg2:
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
592 target.insert(DicomTransferSyntax_MPEG2MainProfileAtMainLevel);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
593 target.insert(DicomTransferSyntax_MPEG2MainProfileAtHighLevel);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
594 break;
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
595
4474
f8c1d94363b6 new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4473
diff changeset
596 case TransferSyntaxGroup_Rle:
f8c1d94363b6 new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4473
diff changeset
597 target.insert(DicomTransferSyntax_RLELossless);
f8c1d94363b6 new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4473
diff changeset
598 break;
f8c1d94363b6 new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4473
diff changeset
599
4472
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
600 case TransferSyntaxGroup_Mpeg4:
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
601 // New in Orthanc 1.6.0
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
602 target.insert(DicomTransferSyntax_MPEG4BDcompatibleHighProfileLevel4_1);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
603 target.insert(DicomTransferSyntax_MPEG4HighProfileLevel4_1);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
604 target.insert(DicomTransferSyntax_MPEG4HighProfileLevel4_2_For2DVideo);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
605 target.insert(DicomTransferSyntax_MPEG4HighProfileLevel4_2_For3DVideo);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
606 target.insert(DicomTransferSyntax_MPEG4StereoHighProfileLevel4_2);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
607 break;
4474
f8c1d94363b6 new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4473
diff changeset
608
f8c1d94363b6 new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4473
diff changeset
609 case TransferSyntaxGroup_H265:
f8c1d94363b6 new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4473
diff changeset
610 // New in Orthanc 1.9.0
f8c1d94363b6 new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4473
diff changeset
611 target.insert(DicomTransferSyntax_HEVCMainProfileLevel5_1);
f8c1d94363b6 new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4473
diff changeset
612 target.insert(DicomTransferSyntax_HEVCMain10ProfileLevel5_1);
f8c1d94363b6 new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4473
diff changeset
613 break;
4472
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
614
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
615 default:
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
616 throw OrthancException(ErrorCode_ParameterOutOfRange);
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
617 }
28a4baadde17 rename TransferSyntax enum as TransferSyntaxGroup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4469
diff changeset
618 }
199
dfa2899d9960 refactoring cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
619 }