comparison OrthancServer/DicomInstanceOrigin.cpp @ 2726:46061a91c88a jobs

new metadata (RemoteIP, CalledAET, HttpUsername), "?expand" metadata
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 12 Jul 2018 18:01:16 +0200
parents a21b244efb37
children 4e43e67f8ecf
comparison
equal deleted inserted replaced
2725:7caf01aa4d7b 2726:46061a91c88a
125 { 125 {
126 return ""; 126 return "";
127 } 127 }
128 } 128 }
129 129
130 const std::string& DicomInstanceOrigin::GetRemoteIp() const 130 bool DicomInstanceOrigin::LookupRemoteAet(std::string& result) const
131 {
132 if (origin_ == RequestOrigin_DicomProtocol)
133 {
134 result = dicomRemoteAet_.c_str();
135 return true;
136 }
137 else
138 {
139 return false;
140 }
141 }
142
143 bool DicomInstanceOrigin::LookupRemoteIp(std::string& result) const
131 { 144 {
132 if (origin_ == RequestOrigin_DicomProtocol || 145 if (origin_ == RequestOrigin_DicomProtocol ||
133 origin_ == RequestOrigin_RestApi) 146 origin_ == RequestOrigin_RestApi)
134 { 147 {
135 return remoteIp_; 148 result = remoteIp_;
136 } 149 return true;
137 else 150 }
138 { 151 else
139 throw OrthancException(ErrorCode_ParameterOutOfRange); 152 {
140 } 153 return false;
141 } 154 }
142 155 }
143 const std::string& DicomInstanceOrigin::GetCalledAet() const 156
157 bool DicomInstanceOrigin::LookupCalledAet(std::string& result) const
144 { 158 {
145 if (origin_ == RequestOrigin_DicomProtocol) 159 if (origin_ == RequestOrigin_DicomProtocol)
146 { 160 {
147 return dicomCalledAet_; 161 result = dicomCalledAet_;
148 } 162 return true;
149 else 163 }
150 { 164 else
151 throw OrthancException(ErrorCode_ParameterOutOfRange); 165 {
152 } 166 return false;
153 } 167 }
154 168 }
155 const std::string& DicomInstanceOrigin::GetHttpUsername() const 169
170 bool DicomInstanceOrigin::LookupHttpUsername(std::string& result) const
156 { 171 {
157 if (origin_ == RequestOrigin_RestApi) 172 if (origin_ == RequestOrigin_RestApi)
158 { 173 {
159 return httpUsername_; 174 result = httpUsername_;
160 } 175 return true;
161 else 176 }
162 { 177 else
163 throw OrthancException(ErrorCode_ParameterOutOfRange); 178 {
179 return false;
164 } 180 }
165 } 181 }
166 182
167 183
168 184