Mercurial > hg > orthanc
comparison OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp @ 4416:0b27841950d5
openapi about creation of zip/media archives
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 28 Dec 2020 16:49:17 +0100 |
parents | b50410d0e98c |
children | 9d6fa3da8f00 |
comparison
equal
deleted
inserted
replaced
4415:b50410d0e98c | 4416:0b27841950d5 |
---|---|
247 { | 247 { |
248 const std::string resource = GetResourceTypeText(resourceType, false /* plural */, false /* lower case */); | 248 const std::string resource = GetResourceTypeText(resourceType, false /* plural */, false /* lower case */); |
249 call.GetDocumentation() | 249 call.GetDocumentation() |
250 .SetTag(GetResourceTypeText(resourceType, true /* plural */, true /* upper case */)) | 250 .SetTag(GetResourceTypeText(resourceType, true /* plural */, true /* upper case */)) |
251 .SetSummary("Get information about some " + resource) | 251 .SetSummary("Get information about some " + resource) |
252 .SetDescription("Get detailed information about the DICOM " + resource + " of interest whose Orthanc identifier is provided in the URL") | 252 .SetDescription("Get detailed information about the DICOM " + resource + " whose Orthanc identifier is provided in the URL") |
253 .SetUriArgument("id", "Orthanc identifier of the " + resource + " of interest") | 253 .SetUriArgument("id", "Orthanc identifier of the " + resource + " of interest") |
254 .AddAnswerType(MimeType_Json, "Information about the DICOM " + resource) | 254 .AddAnswerType(MimeType_Json, "Information about the DICOM " + resource) |
255 .SetHttpGetSample(GetDocumentationSampleResource(resourceType), true); | 255 .SetHttpGetSample(GetDocumentationSampleResource(resourceType), true); |
256 return; | 256 return; |
257 } | 257 } |
270 { | 270 { |
271 const std::string resource = GetResourceTypeText(resourceType, false /* plural */, false /* lower case */); | 271 const std::string resource = GetResourceTypeText(resourceType, false /* plural */, false /* lower case */); |
272 call.GetDocumentation() | 272 call.GetDocumentation() |
273 .SetTag(GetResourceTypeText(resourceType, true /* plural */, true /* upper case */)) | 273 .SetTag(GetResourceTypeText(resourceType, true /* plural */, true /* upper case */)) |
274 .SetSummary("Delete some " + resource) | 274 .SetSummary("Delete some " + resource) |
275 .SetDescription("Delete the DICOM " + resource + " of interest whose Orthanc identifier is provided in the URL") | 275 .SetDescription("Delete the DICOM " + resource + " whose Orthanc identifier is provided in the URL") |
276 .SetUriArgument("id", "Orthanc identifier of the " + resource + " of interest"); | 276 .SetUriArgument("id", "Orthanc identifier of the " + resource + " of interest"); |
277 return; | 277 return; |
278 } | 278 } |
279 | 279 |
280 Json::Value result; | 280 Json::Value result; |
433 call.GetDocumentation() | 433 call.GetDocumentation() |
434 .SetTag("Instances") | 434 .SetTag("Instances") |
435 .SetSummary("Get human-readable tags") | 435 .SetSummary("Get human-readable tags") |
436 .SetDescription("Get the DICOM tags in human-readable format") | 436 .SetDescription("Get the DICOM tags in human-readable format") |
437 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest") | 437 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest") |
438 .SetHttpGetArgument("ignore-length", RestApiCallDocumentation::Type_JsonListOfStrings, | |
439 "Also include the DICOM tags that are provided in this list, even if their associated value is long", false) | |
438 .AddAnswerType(MimeType_Json, "JSON object containing the DICOM tags and their associated value") | 440 .AddAnswerType(MimeType_Json, "JSON object containing the DICOM tags and their associated value") |
439 .SetTruncatedJsonHttpGetSample("https://demo.orthanc-server.com/instances/7c92ce8e-bbf67ed2-ffa3b8c1-a3b35d94-7ff3ae26/simplified-tags", 10); | 441 .SetTruncatedJsonHttpGetSample("https://demo.orthanc-server.com/instances/7c92ce8e-bbf67ed2-ffa3b8c1-a3b35d94-7ff3ae26/simplified-tags", 10); |
440 return; | 442 return; |
441 } | 443 } |
442 else | 444 else |
2075 } | 2077 } |
2076 | 2078 |
2077 | 2079 |
2078 static void GetSharedTags(RestApiGetCall& call) | 2080 static void GetSharedTags(RestApiGetCall& call) |
2079 { | 2081 { |
2082 if (call.IsDocumentation()) | |
2083 { | |
2084 ResourceType t = StringToResourceType(call.GetFullUri()[0].c_str()); | |
2085 std::string r = GetResourceTypeText(t, false /* plural */, false /* upper case */); | |
2086 call.GetDocumentation() | |
2087 .SetTag(GetResourceTypeText(t, true /* plural */, true /* upper case */)) | |
2088 .SetSummary("Get shared tags") | |
2089 .SetDescription("Extract the DICOM tags whose value is constant across all the child instances of " | |
2090 "the DICOM " + r + " whose Orthanc identifier is provided in the URL") | |
2091 .SetUriArgument("id", "Orthanc identifier of the " + r + " of interest") | |
2092 .AddAnswerType(MimeType_Json, "JSON object containing the values of the DICOM tags") | |
2093 .SetTruncatedJsonHttpGetSample(GetDocumentationSampleResource(t) + "/shared-tags", 5); | |
2094 return; | |
2095 } | |
2096 | |
2080 ServerContext& context = OrthancRestApi::GetContext(call); | 2097 ServerContext& context = OrthancRestApi::GetContext(call); |
2081 std::string publicId = call.GetUriComponent("id", ""); | 2098 std::string publicId = call.GetUriComponent("id", ""); |
2082 | 2099 |
2083 Json::Value sharedTags; | 2100 Json::Value sharedTags; |
2084 if (ExtractSharedTags(sharedTags, context, publicId)) | 2101 if (ExtractSharedTags(sharedTags, context, publicId)) |
2383 const std::string resource = GetResourceTypeText(start, false /* plural */, false /* lower case */); | 2400 const std::string resource = GetResourceTypeText(start, false /* plural */, false /* lower case */); |
2384 call.GetDocumentation() | 2401 call.GetDocumentation() |
2385 .SetTag(GetResourceTypeText(start, true /* plural */, true /* upper case */)) | 2402 .SetTag(GetResourceTypeText(start, true /* plural */, true /* upper case */)) |
2386 .SetSummary("Get child " + children) | 2403 .SetSummary("Get child " + children) |
2387 .SetDescription("Get detailed information about the child " + children + " of the DICOM " + | 2404 .SetDescription("Get detailed information about the child " + children + " of the DICOM " + |
2388 resource + " of interest whose Orthanc identifier is provided in the URL") | 2405 resource + " whose Orthanc identifier is provided in the URL") |
2389 .SetUriArgument("id", "Orthanc identifier of the " + resource + " of interest") | 2406 .SetUriArgument("id", "Orthanc identifier of the " + resource + " of interest") |
2390 .AddAnswerType(MimeType_Json, "JSON array containing information about the child DICOM " + children) | 2407 .AddAnswerType(MimeType_Json, "JSON array containing information about the child DICOM " + children) |
2391 .SetTruncatedJsonHttpGetSample(GetDocumentationSampleResource(start) + "/" + children, 5); | 2408 .SetTruncatedJsonHttpGetSample(GetDocumentationSampleResource(start) + "/" + children, 5); |
2392 return; | 2409 return; |
2393 } | 2410 } |
2432 } | 2449 } |
2433 | 2450 |
2434 | 2451 |
2435 static void GetChildInstancesTags(RestApiGetCall& call) | 2452 static void GetChildInstancesTags(RestApiGetCall& call) |
2436 { | 2453 { |
2454 if (call.IsDocumentation()) | |
2455 { | |
2456 ResourceType t = StringToResourceType(call.GetFullUri()[0].c_str()); | |
2457 std::string r = GetResourceTypeText(t, false /* plural */, false /* upper case */); | |
2458 call.GetDocumentation() | |
2459 .SetTag(GetResourceTypeText(t, true /* plural */, true /* upper case */)) | |
2460 .SetSummary("Get tags of instances") | |
2461 .SetDescription("Get the tags of all the child instances of the DICOM " + r + | |
2462 " whose Orthanc identifier is provided in the URL") | |
2463 .SetUriArgument("id", "Orthanc identifier of the " + r + " of interest") | |
2464 .SetHttpGetArgument("ignore-length", RestApiCallDocumentation::Type_JsonListOfStrings, | |
2465 "Also include the DICOM tags that are provided in this list, even if their associated value is long", false) | |
2466 .AddAnswerType(MimeType_Json, "JSON object associating the Orthanc identifiers of the instances, with the values of their DICOM tags") | |
2467 .SetTruncatedJsonHttpGetSample(GetDocumentationSampleResource(t) + "/instances-tags", 5); | |
2468 return; | |
2469 } | |
2470 | |
2437 ServerContext& context = OrthancRestApi::GetContext(call); | 2471 ServerContext& context = OrthancRestApi::GetContext(call); |
2438 std::string publicId = call.GetUriComponent("id", ""); | 2472 std::string publicId = call.GetUriComponent("id", ""); |
2439 DicomToJsonFormat format = GetDicomFormat(call); | 2473 DicomToJsonFormat format = GetDicomFormat(call); |
2440 | 2474 |
2441 std::set<DicomTag> ignoreTagLength; | 2475 std::set<DicomTag> ignoreTagLength; |
2484 const std::string resource = GetResourceTypeText(start, false /* plural */, false /* lower case */); | 2518 const std::string resource = GetResourceTypeText(start, false /* plural */, false /* lower case */); |
2485 call.GetDocumentation() | 2519 call.GetDocumentation() |
2486 .SetTag(GetResourceTypeText(start, true /* plural */, true /* upper case */)) | 2520 .SetTag(GetResourceTypeText(start, true /* plural */, true /* upper case */)) |
2487 .SetSummary("Get parent " + parent) | 2521 .SetSummary("Get parent " + parent) |
2488 .SetDescription("Get detailed information about the parent " + parent + " of the DICOM " + | 2522 .SetDescription("Get detailed information about the parent " + parent + " of the DICOM " + |
2489 resource + " of interest whose Orthanc identifier is provided in the URL") | 2523 resource + " whose Orthanc identifier is provided in the URL") |
2490 .SetUriArgument("id", "Orthanc identifier of the " + resource + " of interest") | 2524 .SetUriArgument("id", "Orthanc identifier of the " + resource + " of interest") |
2491 .AddAnswerType(MimeType_Json, "Information about the parent DICOM " + parent) | 2525 .AddAnswerType(MimeType_Json, "Information about the parent DICOM " + parent) |
2492 .SetTruncatedJsonHttpGetSample(GetDocumentationSampleResource(start) + "/" + parent, 10); | 2526 .SetTruncatedJsonHttpGetSample(GetDocumentationSampleResource(start) + "/" + parent, 10); |
2493 return; | 2527 return; |
2494 } | 2528 } |