# HG changeset patch # User Sebastien Jodogne # Date 1611158530 -3600 # Node ID da460bef88f86ffc0084ff2f6e614fba3687ff65 # Parent 22abc6851191f9a24fb73ef47855debba2663a8e "/modalities/{...}/query": New string argument "LocalAet" diff -r 22abc6851191 -r da460bef88f8 NEWS --- a/NEWS Wed Jan 20 14:51:48 2021 +0100 +++ b/NEWS Wed Jan 20 17:02:10 2021 +0100 @@ -20,6 +20,11 @@ * The DICOM meta-header and the transfer syntax are displayed at the "Instance" level +REST API +-------- + +* "/modalities/{...}/query": New string argument "LocalAet" + Plugins ------- diff -r 22abc6851191 -r da460bef88f8 OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp --- a/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp Wed Jan 20 14:51:48 2021 +0100 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp Wed Jan 20 17:02:10 2021 +0100 @@ -670,6 +670,8 @@ .SetRequestField(KEY_NORMALIZE, RestApiCallDocumentation::Type_Boolean, "Whether to normalize the query, i.e. whether to wipe out from the query, the DICOM tags " "that are not applicable for the query-retrieve level of interest", false) + .SetRequestField(KEY_LOCAL_AET, RestApiCallDocumentation::Type_String, + "Local AET that is used for this commands, defaults to `DicomAet` configuration option", false) .SetAnswerField("ID", RestApiCallDocumentation::Type_JsonObject, "Identifier of the query, to be used with `/queries/{id}`") .SetAnswerField("Path", RestApiCallDocumentation::Type_JsonObject, @@ -703,6 +705,12 @@ throw OrthancException(ErrorCode_BadFileFormat, "The field " + std::string(KEY_QUERY) + " must contain a JSON object"); } + else if (request.isMember(KEY_LOCAL_AET) && + request[KEY_LOCAL_AET].type() != Json::stringValue) + { + throw OrthancException(ErrorCode_BadFileFormat, + "The field " + std::string(KEY_LOCAL_AET) + " must contain a string"); + } else { std::unique_ptr handler(new QueryRetrieveHandler(context)); @@ -727,6 +735,11 @@ handler->SetFindNormalized(request[KEY_NORMALIZE].asBool()); } + if (request.isMember(KEY_LOCAL_AET)) + { + handler->SetLocalAet(request[KEY_LOCAL_AET].asString()); + } + AnswerQueryHandler(call, handler); } } diff -r 22abc6851191 -r da460bef88f8 OrthancServer/Sources/QueryRetrieveHandler.cpp --- a/OrthancServer/Sources/QueryRetrieveHandler.cpp Wed Jan 20 14:51:48 2021 +0100 +++ b/OrthancServer/Sources/QueryRetrieveHandler.cpp Wed Jan 20 17:02:10 2021 +0100 @@ -115,6 +115,13 @@ } + void QueryRetrieveHandler::SetLocalAet(const std::string& localAet) + { + Invalidate(); + localAet_ = localAet; + } + + void QueryRetrieveHandler::SetLevel(ResourceType level) { Invalidate(); diff -r 22abc6851191 -r da460bef88f8 OrthancServer/Sources/QueryRetrieveHandler.h --- a/OrthancServer/Sources/QueryRetrieveHandler.h Wed Jan 20 14:51:48 2021 +0100 +++ b/OrthancServer/Sources/QueryRetrieveHandler.h Wed Jan 20 17:02:10 2021 +0100 @@ -65,6 +65,8 @@ return modality_; } + void SetLocalAet(const std::string& localAet); + const std::string& GetLocalAet() const { return localAet_;