comparison OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp @ 4419:cd96c807ca3d

cont openapi
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 29 Dec 2020 11:53:42 +0100
parents 9d6fa3da8f00
children f95ad769e671
comparison
equal deleted inserted replaced
4418:9d6fa3da8f00 4419:cd96c807ca3d
2219 2219
2220 template <enum ResourceType resourceType, 2220 template <enum ResourceType resourceType,
2221 enum DicomModule module> 2221 enum DicomModule module>
2222 static void GetModule(RestApiGetCall& call) 2222 static void GetModule(RestApiGetCall& call)
2223 { 2223 {
2224 if (call.IsDocumentation())
2225 {
2226 const std::string resource = GetResourceTypeText(resourceType, false /* plural */, false /* lower case */);
2227 std::string m;
2228 switch (module)
2229 {
2230 case DicomModule_Patient:
2231 m = "patient";
2232 break;
2233 case DicomModule_Study:
2234 m = "study";
2235 break;
2236 case DicomModule_Series:
2237 m = "series";
2238 break;
2239 case DicomModule_Instance:
2240 m = "instance";
2241 break;
2242 default:
2243 throw OrthancException(ErrorCode_ParameterOutOfRange);
2244 }
2245 call.GetDocumentation()
2246 .SetTag(GetResourceTypeText(resourceType, true /* plural */, true /* upper case */))
2247 .SetSummary("Get " + m + " module" + std::string(resource == m ? "" : " of " + resource))
2248 .SetDescription("Get the " + m + " module of the DICOM " + resource + " whose Orthanc identifier is provided in the URL")
2249 .SetUriArgument("id", "Orthanc identifier of the " + resource + " of interest")
2250 .SetHttpGetArgument("ignore-length", RestApiCallDocumentation::Type_JsonListOfStrings,
2251 "Also include the DICOM tags that are provided in this list, even if their associated value is long", false)
2252 .AddAnswerType(MimeType_Json, "Information about the DICOM " + resource)
2253 .SetHttpGetSample(GetDocumentationSampleResource(resourceType) + "/" + (*call.GetFullUri().rbegin()), true);
2254 return;
2255 }
2256
2224 GetModuleInternal(call, resourceType, module); 2257 GetModuleInternal(call, resourceType, module);
2225 } 2258 }
2226 2259
2227 2260
2228 namespace 2261 namespace