Mercurial > hg > orthanc
comparison OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp @ 4420:f95ad769e671
cont openapi
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 29 Dec 2020 12:21:51 +0100 |
parents | cd96c807ca3d |
children | a7d72378e1cb |
comparison
equal
deleted
inserted
replaced
4419:cd96c807ca3d | 4420:f95ad769e671 |
---|---|
2717 } | 2717 } |
2718 | 2718 |
2719 | 2719 |
2720 static void InvalidateTags(RestApiPostCall& call) | 2720 static void InvalidateTags(RestApiPostCall& call) |
2721 { | 2721 { |
2722 if (call.IsDocumentation()) | |
2723 { | |
2724 call.GetDocumentation() | |
2725 .SetTag("System") | |
2726 .SetSummary("Invalidate DICOM-as-JSON summaries") | |
2727 .SetDescription("Remove all the attachments of the type \"DICOM-as-JSON\" that are associated will all the " | |
2728 "DICOM instances stored in Orthanc. These summaries will be automatically re-created on the next access. " | |
2729 "This is notably useful after changes to the `Dictionary` configuration option. " | |
2730 "https://book.orthanc-server.com/faq/orthanc-storage.html#storage-area"); | |
2731 return; | |
2732 } | |
2733 | |
2722 ServerIndex& index = OrthancRestApi::GetIndex(call); | 2734 ServerIndex& index = OrthancRestApi::GetIndex(call); |
2723 | 2735 |
2724 // Loop over the instances, grouping them by parent studies so as | 2736 // Loop over the instances, grouping them by parent studies so as |
2725 // to avoid large memory consumption | 2737 // to avoid large memory consumption |
2726 std::list<std::string> studies; | 2738 std::list<std::string> studies; |
2744 | 2756 |
2745 | 2757 |
2746 template <enum ResourceType type> | 2758 template <enum ResourceType type> |
2747 static void ReconstructResource(RestApiPostCall& call) | 2759 static void ReconstructResource(RestApiPostCall& call) |
2748 { | 2760 { |
2761 if (call.IsDocumentation()) | |
2762 { | |
2763 const std::string resource = GetResourceTypeText(type, false /* plural */, false /* lower case */); | |
2764 call.GetDocumentation() | |
2765 .SetTag(GetResourceTypeText(type, true /* plural */, true /* upper case */)) | |
2766 .SetSummary("Reconstruct tags of " + resource) | |
2767 .SetDescription("Reconstruct the main DICOM tags of the " + resource + " whose Orthanc identifier is provided " | |
2768 "in the URL. This is useful if child studies/series/instances have inconsistent values for " | |
2769 "higher-level tags, in order to force Orthanc to use the value from the resource of interest. " | |
2770 "Beware that this is a time-consuming operation, as all the children DICOM instances will be " | |
2771 "parsed again, and the Orthanc index will be updated accordingly.") | |
2772 .SetUriArgument("id", "Orthanc identifier of the " + resource + " of interest"); | |
2773 return; | |
2774 } | |
2775 | |
2749 ServerContext& context = OrthancRestApi::GetContext(call); | 2776 ServerContext& context = OrthancRestApi::GetContext(call); |
2750 ServerToolbox::ReconstructResource(context, call.GetUriComponent("id", "")); | 2777 ServerToolbox::ReconstructResource(context, call.GetUriComponent("id", "")); |
2751 call.GetOutput().AnswerBuffer("", MimeType_PlainText); | 2778 call.GetOutput().AnswerBuffer("", MimeType_PlainText); |
2752 } | 2779 } |
2753 | 2780 |
2754 | 2781 |
2755 static void ReconstructAllResources(RestApiPostCall& call) | 2782 static void ReconstructAllResources(RestApiPostCall& call) |
2756 { | 2783 { |
2784 if (call.IsDocumentation()) | |
2785 { | |
2786 call.GetDocumentation() | |
2787 .SetTag("System") | |
2788 .SetSummary("Reconstruct all the index") | |
2789 .SetDescription("Reconstruct the index of all the tags of all the DICOM instances that are stored in Orthanc. " | |
2790 "This is notably useful after the deletion of resources whose children resources have inconsistent " | |
2791 "values with their sibling resources. Beware that this is a highly time-consuming operation, " | |
2792 "as all the DICOM instances will be parsed again, and as all the Orthanc index will be regenerated."); | |
2793 return; | |
2794 } | |
2795 | |
2757 ServerContext& context = OrthancRestApi::GetContext(call); | 2796 ServerContext& context = OrthancRestApi::GetContext(call); |
2758 | 2797 |
2759 std::list<std::string> studies; | 2798 std::list<std::string> studies; |
2760 context.GetIndex().GetAllUuids(studies, ResourceType_Study); | 2799 context.GetIndex().GetAllUuids(studies, ResourceType_Study); |
2761 | 2800 |