comparison OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp @ 4405:5466f336b09f

gathering statistics about progress of api documentation
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 24 Dec 2020 09:37:30 +0100
parents f34634916d8c
children 4cb9f66a1c7c
comparison
equal deleted inserted replaced
4404:f34634916d8c 4405:5466f336b09f
334 334
335 // Get information about a single instance ---------------------------------- 335 // Get information about a single instance ----------------------------------
336 336
337 static void GetInstanceFile(RestApiGetCall& call) 337 static void GetInstanceFile(RestApiGetCall& call)
338 { 338 {
339 if (call.IsDocumentation())
340 {
341 call.GetDocumentation()
342 .SetTag("Instances")
343 .SetSummary("Download DICOM")
344 .SetDescription("Download one DICOM instance")
345 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest")
346 .SetHttpHeader("Accept", "This HTTP header can be set to retrieve the DICOM instance in DICOMweb format")
347 .AddAnswerType(MimeType_Dicom, "The DICOM instance")
348 .AddAnswerType(MimeType_DicomWebJson, "The DICOM instance, in DICOMweb JSON format")
349 .AddAnswerType(MimeType_DicomWebXml, "The DICOM instance, in DICOMweb XML format");
350 return;
351 }
352
339 ServerContext& context = OrthancRestApi::GetContext(call); 353 ServerContext& context = OrthancRestApi::GetContext(call);
340 354
341 std::string publicId = call.GetUriComponent("id", ""); 355 std::string publicId = call.GetUriComponent("id", "");
342 356
343 HttpToolbox::Arguments::const_iterator accept = call.GetHttpHeaders().find("accept"); 357 HttpToolbox::Arguments::const_iterator accept = call.GetHttpHeaders().find("accept");
1568 1582
1569 // Raw access to the DICOM tags of an instance ------------------------------ 1583 // Raw access to the DICOM tags of an instance ------------------------------
1570 1584
1571 static void GetRawContent(RestApiGetCall& call) 1585 static void GetRawContent(RestApiGetCall& call)
1572 { 1586 {
1587 if (call.IsDocumentation())
1588 {
1589 call.GetDocumentation()
1590 .SetTag("Instances")
1591 .SetSummary("Get raw tag")
1592 .SetDescription("Get the raw content of one DICOM tag in the hierarchy of DICOM dataset")
1593 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest")
1594 .SetUriArgument("...", "Path to the DICOM tag. This is the interleaving of one DICOM tag, possibly followed "
1595 "by an index for sequences. Sequences are accessible as, for instance, `/0008-1140/1/0008-1150`")
1596 .AddAnswerType(MimeType_Binary, "The raw value of the tag of intereset "
1597 "(binary data, whose memory layout depends on the underlying transfer syntax), "
1598 "or JSON array containing the list of available tags if accessing a dataset");
1599 return;
1600 }
1601
1573 std::string id = call.GetUriComponent("id", ""); 1602 std::string id = call.GetUriComponent("id", "");
1574 1603
1575 ServerContext::DicomCacheLocker locker(OrthancRestApi::GetContext(call), id); 1604 ServerContext::DicomCacheLocker locker(OrthancRestApi::GetContext(call), id);
1576 1605
1577 locker.GetDicom().SendPathValue(call.GetOutput(), call.GetTrailingUri()); 1606 locker.GetDicom().SendPathValue(call.GetOutput(), call.GetTrailingUri());