Mercurial > hg > orthanc
diff OrthancServer/OrthancRestApi/OrthancRestResources.cpp @ 2209:e3fd5bc429a2
URI to reconstruct the main DICOM tags, the JSON summary and the metadata
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 09 Dec 2016 17:20:21 +0100 |
parents | aa4b8895cd23 |
children | a3a65de1840f |
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestResources.cpp Fri Dec 09 14:48:31 2016 +0100 +++ b/OrthancServer/OrthancRestApi/OrthancRestResources.cpp Fri Dec 09 17:20:21 2016 +0100 @@ -1381,6 +1381,15 @@ } + template <enum ResourceType type> + static void ReconstructResource(RestApiPostCall& call) + { + ServerContext& context = OrthancRestApi::GetContext(call); + ServerToolbox::ReconstructResource(context, call.GetUriComponent("id", "")); + call.GetOutput().AnswerBuffer("", "text/plain"); + } + + void OrthancRestApi::RegisterResources() { Register("/instances", ListResources<ResourceType_Instance>); @@ -1480,5 +1489,10 @@ Register("/instances/{id}/content/*", GetRawContent); Register("/series/{id}/ordered-slices", OrderSlices); + + Register("/patients/{id}/reconstruct", ReconstructResource<ResourceType_Patient>); + Register("/studies/{id}/reconstruct", ReconstructResource<ResourceType_Study>); + Register("/series/{id}/reconstruct", ReconstructResource<ResourceType_Series>); + Register("/instances/{id}/reconstruct", ReconstructResource<ResourceType_Instance>); } }