# HG changeset patch # User Sebastien Jodogne # Date 1543520191 -3600 # Node ID d2e548e643afa5db7dcd166a9bb26ad3bcec1de2 # Parent 11f8d72f366fe926accbe24dcff5946d8b41aee6 New options to URI "/queries/.../answers": "?expand" and "?limit" diff -r 11f8d72f366f -r d2e548e643af NEWS --- a/NEWS Thu Nov 29 18:40:51 2018 +0100 +++ b/NEWS Thu Nov 29 20:36:31 2018 +0100 @@ -24,7 +24,8 @@ * New URI: "/studies/.../merge" to merge a study * New URI: "/studies/.../split" to split a study * POST-ing a DICOM file to "/instances" also answers the patient/study/series ID -* GET /modalities/... now returns a JSON object instead of a JSON array +* GET "/modalities/..." now returns a JSON object instead of a JSON array +* New options to URI "/queries/.../answers": "?expand" and "?limit" Maintenance ----------- diff -r 11f8d72f366f -r d2e548e643af OrthancServer/OrthancRestApi/OrthancRestModalities.cpp --- a/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp Thu Nov 29 18:40:51 2018 +0100 +++ b/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp Thu Nov 29 20:36:31 2018 +0100 @@ -498,13 +498,30 @@ static void ListQueryAnswers(RestApiGetCall& call) { + const bool expand = call.HasArgument("expand"); + const bool simplify = call.HasArgument("simplify"); + QueryAccessor query(call); size_t count = query.GetHandler().GetAnswersCount(); Json::Value result = Json::arrayValue; for (size_t i = 0; i < count; i++) { - result.append(boost::lexical_cast(i)); + if (expand) + { + // New in Orthanc 1.4.3 + DicomMap value; + query.GetHandler().GetAnswer(value, i); + + Json::Value json = Json::objectValue; + FromDcmtkBridge::ToJson(json, value, simplify); + + result.append(json); + } + else + { + result.append(boost::lexical_cast(i)); + } } call.GetOutput().AnswerJson(result);