Mercurial > hg > orthanc
comparison OrthancServer/Sources/ServerEnumerations.h @ 4044:d25f4c0fa160 framework
splitting code into OrthancFramework and OrthancServer
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 10 Jun 2020 20:30:34 +0200 |
parents | OrthancServer/ServerEnumerations.h@e6606d3ec892 |
children | 05b8fd21089c |
comparison
equal
deleted
inserted
replaced
4043:6c6239aec462 | 4044:d25f4c0fa160 |
---|---|
1 /** | |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium | |
6 * | |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU General Public License as | |
9 * published by the Free Software Foundation, either version 3 of the | |
10 * License, or (at your option) any later version. | |
11 * | |
12 * In addition, as a special exception, the copyright holders of this | |
13 * program give permission to link the code of its release with the | |
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
15 * that use the same license as the "OpenSSL" library), and distribute | |
16 * the linked executables. You must obey the GNU General Public License | |
17 * in all respects for all of the code used other than "OpenSSL". If you | |
18 * modify file(s) with this exception, you may extend this exception to | |
19 * your version of the file(s), but you are not obligated to do so. If | |
20 * you do not wish to do so, delete this exception statement from your | |
21 * version. If you delete this exception statement from all source files | |
22 * in the program, then also delete it here. | |
23 * | |
24 * This program is distributed in the hope that it will be useful, but | |
25 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
27 * General Public License for more details. | |
28 * | |
29 * You should have received a copy of the GNU General Public License | |
30 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
31 **/ | |
32 | |
33 #pragma once | |
34 | |
35 #include <string> | |
36 #include <map> | |
37 | |
38 #include "../Core/Enumerations.h" | |
39 #include "../Core/DicomFormat/DicomTag.h" | |
40 | |
41 namespace Orthanc | |
42 { | |
43 enum SeriesStatus | |
44 { | |
45 SeriesStatus_Complete, | |
46 SeriesStatus_Missing, | |
47 SeriesStatus_Inconsistent, | |
48 SeriesStatus_Unknown | |
49 }; | |
50 | |
51 enum StoreStatus | |
52 { | |
53 StoreStatus_Success, | |
54 StoreStatus_AlreadyStored, | |
55 StoreStatus_Failure, | |
56 StoreStatus_FilteredOut // Removed by NewInstanceFilter | |
57 }; | |
58 | |
59 enum DicomTagType | |
60 { | |
61 DicomTagType_Identifier, // Tag that whose value is stored and indexed in the DB | |
62 DicomTagType_Main, // Tag that is stored in the DB (but not indexed) | |
63 DicomTagType_Generic // Tag that is only stored in the JSON files | |
64 }; | |
65 | |
66 enum ConstraintType | |
67 { | |
68 ConstraintType_Equal, | |
69 ConstraintType_SmallerOrEqual, | |
70 ConstraintType_GreaterOrEqual, | |
71 ConstraintType_Wildcard, | |
72 ConstraintType_List | |
73 }; | |
74 | |
75 namespace Compatibility | |
76 { | |
77 enum IdentifierConstraintType | |
78 { | |
79 IdentifierConstraintType_Equal, | |
80 IdentifierConstraintType_SmallerOrEqual, | |
81 IdentifierConstraintType_GreaterOrEqual, | |
82 IdentifierConstraintType_Wildcard /* Case sensitive, "*" or "?" are the only allowed wildcards */ | |
83 }; | |
84 } | |
85 | |
86 enum FindStorageAccessMode | |
87 { | |
88 FindStorageAccessMode_DatabaseOnly, | |
89 FindStorageAccessMode_DiskOnAnswer, | |
90 FindStorageAccessMode_DiskOnLookupAndAnswer | |
91 }; | |
92 | |
93 enum StoreInstanceMode | |
94 { | |
95 StoreInstanceMode_Default, | |
96 StoreInstanceMode_OverwriteDuplicate, | |
97 StoreInstanceMode_IgnoreDuplicate | |
98 }; | |
99 | |
100 | |
101 /** | |
102 * WARNING: Do not change the explicit values in the enumerations | |
103 * below this point. This would result in incompatible databases | |
104 * between versions of Orthanc! | |
105 **/ | |
106 | |
107 enum GlobalProperty | |
108 { | |
109 GlobalProperty_DatabaseSchemaVersion = 1, // Unused in the Orthanc core as of Orthanc 0.9.5 | |
110 GlobalProperty_FlushSleep = 2, | |
111 GlobalProperty_AnonymizationSequence = 3, | |
112 GlobalProperty_JobsRegistry = 5, | |
113 GlobalProperty_GetTotalSizeIsFast = 6, // New in Orthanc 1.5.2 | |
114 GlobalProperty_Modalities = 20, // New in Orthanc 1.5.0 | |
115 GlobalProperty_Peers = 21, // New in Orthanc 1.5.0 | |
116 | |
117 // Reserved values for internal use by the database plugins | |
118 GlobalProperty_DatabasePatchLevel = 4, | |
119 GlobalProperty_DatabaseInternal0 = 10, | |
120 GlobalProperty_DatabaseInternal1 = 11, | |
121 GlobalProperty_DatabaseInternal2 = 12, | |
122 GlobalProperty_DatabaseInternal3 = 13, | |
123 GlobalProperty_DatabaseInternal4 = 14, | |
124 GlobalProperty_DatabaseInternal5 = 15, | |
125 GlobalProperty_DatabaseInternal6 = 16, | |
126 GlobalProperty_DatabaseInternal7 = 17, | |
127 GlobalProperty_DatabaseInternal8 = 18, | |
128 GlobalProperty_DatabaseInternal9 = 19 | |
129 }; | |
130 | |
131 enum MetadataType | |
132 { | |
133 MetadataType_Instance_IndexInSeries = 1, | |
134 MetadataType_Instance_ReceptionDate = 2, | |
135 MetadataType_Instance_RemoteAet = 3, | |
136 MetadataType_Series_ExpectedNumberOfInstances = 4, | |
137 MetadataType_ModifiedFrom = 5, | |
138 MetadataType_AnonymizedFrom = 6, | |
139 MetadataType_LastUpdate = 7, | |
140 MetadataType_Instance_Origin = 8, // New in Orthanc 0.9.5 | |
141 MetadataType_Instance_TransferSyntax = 9, // New in Orthanc 1.2.0 | |
142 MetadataType_Instance_SopClassUid = 10, // New in Orthanc 1.2.0 | |
143 MetadataType_Instance_RemoteIp = 11, // New in Orthanc 1.4.0 | |
144 MetadataType_Instance_CalledAet = 12, // New in Orthanc 1.4.0 | |
145 MetadataType_Instance_HttpUsername = 13, // New in Orthanc 1.4.0 | |
146 | |
147 // Make sure that the value "65535" can be stored into this enumeration | |
148 MetadataType_StartUser = 1024, | |
149 MetadataType_EndUser = 65535 | |
150 }; | |
151 | |
152 enum ChangeType | |
153 { | |
154 ChangeType_CompletedSeries = 1, | |
155 ChangeType_NewInstance = 2, | |
156 ChangeType_NewPatient = 3, | |
157 ChangeType_NewSeries = 4, | |
158 ChangeType_NewStudy = 5, | |
159 ChangeType_AnonymizedStudy = 6, | |
160 ChangeType_AnonymizedSeries = 7, | |
161 ChangeType_ModifiedStudy = 8, | |
162 ChangeType_ModifiedSeries = 9, | |
163 ChangeType_AnonymizedPatient = 10, | |
164 ChangeType_ModifiedPatient = 11, | |
165 ChangeType_StablePatient = 12, | |
166 ChangeType_StableStudy = 13, | |
167 ChangeType_StableSeries = 14, | |
168 ChangeType_UpdatedAttachment = 15, | |
169 ChangeType_UpdatedMetadata = 16, | |
170 | |
171 ChangeType_INTERNAL_LastLogged = 4095, | |
172 | |
173 // The changes below this point are not logged into the database | |
174 ChangeType_Deleted = 4096, | |
175 ChangeType_NewChildInstance = 4097 | |
176 }; | |
177 | |
178 enum BuiltinDecoderTranscoderOrder | |
179 { | |
180 BuiltinDecoderTranscoderOrder_Before, | |
181 BuiltinDecoderTranscoderOrder_After, | |
182 BuiltinDecoderTranscoderOrder_Disabled | |
183 }; | |
184 | |
185 | |
186 | |
187 void InitializeServerEnumerations(); | |
188 | |
189 void RegisterUserMetadata(int metadata, | |
190 const std::string& name); | |
191 | |
192 MetadataType StringToMetadata(const std::string& str); | |
193 | |
194 std::string EnumerationToString(MetadataType type); | |
195 | |
196 void RegisterUserContentType(int contentType, | |
197 const std::string& name, | |
198 const std::string& mime); | |
199 | |
200 FileContentType StringToContentType(const std::string& str); | |
201 | |
202 FindStorageAccessMode StringToFindStorageAccessMode(const std::string& str); | |
203 | |
204 BuiltinDecoderTranscoderOrder StringToBuiltinDecoderTranscoderOrder(const std::string& str); | |
205 | |
206 std::string EnumerationToString(FileContentType type); | |
207 | |
208 std::string GetFileContentMime(FileContentType type); | |
209 | |
210 std::string GetBasePath(ResourceType type, | |
211 const std::string& publicId); | |
212 | |
213 const char* EnumerationToString(SeriesStatus status); | |
214 | |
215 const char* EnumerationToString(StoreStatus status); | |
216 | |
217 const char* EnumerationToString(ChangeType type); | |
218 | |
219 bool IsUserMetadata(MetadataType type); | |
220 } |