comparison OrthancFramework/Sources/Enumerations.cpp @ 4399:80fd140b12ba

New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Dec 2020 12:21:03 +0100
parents b002f9abe802
children d9473bd5ed43
comparison
equal deleted inserted replaced
4398:38c22715bb56 4399:80fd140b12ba
2280 defaultEncoding_ = encoding; 2280 defaultEncoding_ = encoding;
2281 } 2281 }
2282 2282
2283 LOG(INFO) << "Default encoding for DICOM was changed to: " << name; 2283 LOG(INFO) << "Default encoding for DICOM was changed to: " << name;
2284 } 2284 }
2285
2286
2287 const char* GetResourceTypeText(ResourceType type,
2288 bool isPlural,
2289 bool isUpperCase)
2290 {
2291 if (isPlural && !isUpperCase)
2292 {
2293 switch (type)
2294 {
2295 case ResourceType_Patient:
2296 return "patients";
2297
2298 case ResourceType_Study:
2299 return "studies";
2300
2301 case ResourceType_Series:
2302 return "series";
2303
2304 case ResourceType_Instance:
2305 return "instances";
2306
2307 default:
2308 throw OrthancException(ErrorCode_ParameterOutOfRange);
2309 }
2310 }
2311 else if (isPlural && isUpperCase)
2312 {
2313 switch (type)
2314 {
2315 case ResourceType_Patient:
2316 return "Patients";
2317
2318 case ResourceType_Study:
2319 return "Studies";
2320
2321 case ResourceType_Series:
2322 return "Series";
2323
2324 case ResourceType_Instance:
2325 return "Instances";
2326
2327 default:
2328 throw OrthancException(ErrorCode_ParameterOutOfRange);
2329 }
2330 }
2331 else if (!isPlural && !isUpperCase)
2332 {
2333 switch (type)
2334 {
2335 case ResourceType_Patient:
2336 return "patient";
2337
2338 case ResourceType_Study:
2339 return "study";
2340
2341 case ResourceType_Series:
2342 return "series";
2343
2344 case ResourceType_Instance:
2345 return "instance";
2346
2347 default:
2348 throw OrthancException(ErrorCode_ParameterOutOfRange);
2349 }
2350 }
2351 else if (!isPlural && isUpperCase)
2352 {
2353 switch (type)
2354 {
2355 case ResourceType_Patient:
2356 return "Patient";
2357
2358 case ResourceType_Study:
2359 return "Study";
2360
2361 case ResourceType_Series:
2362 return "Series";
2363
2364 case ResourceType_Instance:
2365 return "Instance";
2366
2367 default:
2368 throw OrthancException(ErrorCode_ParameterOutOfRange);
2369 }
2370 }
2371 else
2372 {
2373 throw OrthancException(ErrorCode_InternalError);
2374 }
2375 }
2285 } 2376 }
2286 2377
2287 2378
2288 #include "./Enumerations_TransferSyntaxes.impl.h" 2379 #include "./Enumerations_TransferSyntaxes.impl.h"