Mercurial > hg > orthanc
diff OrthancServer/DicomInstanceToStore.cpp @ 2640:c691fcf66071 jobs
ResourceModificationJob
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 28 May 2018 16:30:17 +0200 |
parents | 878b59270859 |
children | a27b0e9a3fd9 |
line wrap: on
line diff
--- a/OrthancServer/DicomInstanceToStore.cpp Mon May 28 14:39:22 2018 +0200 +++ b/OrthancServer/DicomInstanceToStore.cpp Mon May 28 16:30:17 2018 +0200 @@ -181,101 +181,6 @@ } - - void DicomInstanceToStore::GetOriginInformation(Json::Value& result) const - { - result = Json::objectValue; - result["RequestOrigin"] = EnumerationToString(origin_); - - switch (origin_) - { - case RequestOrigin_Unknown: - { - // None of the methods "SetDicomProtocolOrigin()", "SetHttpOrigin()", - // "SetLuaOrigin()" or "SetPluginsOrigin()" was called! - throw OrthancException(ErrorCode_BadSequenceOfCalls); - } - - case RequestOrigin_DicomProtocol: - { - result["RemoteIp"] = remoteIp_; - result["RemoteAet"] = dicomRemoteAet_; - result["CalledAet"] = dicomCalledAet_; - break; - } - - case RequestOrigin_RestApi: - { - result["RemoteIp"] = remoteIp_; - result["Username"] = httpUsername_; - break; - } - - case RequestOrigin_Lua: - case RequestOrigin_Plugins: - { - // No additional information available for these kinds of requests - break; - } - - default: - throw OrthancException(ErrorCode_InternalError); - } - } - - - void DicomInstanceToStore::SetDicomProtocolOrigin(const char* remoteIp, - const char* remoteAet, - const char* calledAet) - { - origin_ = RequestOrigin_DicomProtocol; - remoteIp_ = remoteIp; - dicomRemoteAet_ = remoteAet; - dicomCalledAet_ = calledAet; - } - - void DicomInstanceToStore::SetRestOrigin(const RestApiCall& call) - { - origin_ = call.GetRequestOrigin(); - - if (origin_ == RequestOrigin_RestApi) - { - remoteIp_ = call.GetRemoteIp(); - httpUsername_ = call.GetUsername(); - } - } - - void DicomInstanceToStore::SetHttpOrigin(const char* remoteIp, - const char* username) - { - origin_ = RequestOrigin_RestApi; - remoteIp_ = remoteIp; - httpUsername_ = username; - } - - void DicomInstanceToStore::SetLuaOrigin() - { - origin_ = RequestOrigin_Lua; - } - - void DicomInstanceToStore::SetPluginsOrigin() - { - origin_ = RequestOrigin_Plugins; - } - - const char* DicomInstanceToStore::GetRemoteAet() const - { - if (origin_ == RequestOrigin_DicomProtocol) - { - return dicomRemoteAet_.c_str(); - } - else - { - return ""; - } - } - - bool DicomInstanceToStore::LookupTransferSyntax(std::string& result) { ComputeMissingInformation();