comparison Core/DicomNetworking/Internals/GetScp.cpp @ 3954:67b457283499 c-get

coding style
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 20 May 2020 09:52:20 +0200
parents 620e87e9e816
children 66879215cbf3
comparison
equal deleted inserted replaced
3953:620e87e9e816 3954:67b457283499
92 #include "../../Logging.h" 92 #include "../../Logging.h"
93 #include "../../OrthancException.h" 93 #include "../../OrthancException.h"
94 94
95 #include <boost/lexical_cast.hpp> 95 #include <boost/lexical_cast.hpp>
96 96
97 /**
98 * Macro specifying whether to apply the patch suggested in issue 66:
99 * "Orthanc responses C-GET with zero Get Originator Message ID"
100 * https://bitbucket.org/sjodogne/orthanc/issues/66/
101 **/
102 97
103 namespace Orthanc 98 namespace Orthanc
104 { 99 {
105 namespace 100 namespace
106 { 101 {
190 LOG(ERROR) << "IGetRequestHandler Failed: Internal error lastRequestIdentifier"; 185 LOG(ERROR) << "IGetRequestHandler Failed: Internal error lastRequestIdentifier";
191 response->DimseStatus = STATUS_GET_Failed_UnableToProcess; 186 response->DimseStatus = STATUS_GET_Failed_UnableToProcess;
192 return; 187 return;
193 } 188 }
194 189
195 if (data.handler_->nRemaining() == 0) 190 if (data.handler_->GetRemainingCount() == 0)
196 { 191 {
197 response->DimseStatus = STATUS_Success; 192 response->DimseStatus = STATUS_Success;
198 } 193 }
199 else 194 else
200 { 195 {
212 return; 207 return;
213 } 208 }
214 209
215 if (status == STATUS_Success) 210 if (status == STATUS_Success)
216 { 211 {
217 if (responseCount < static_cast<int>(data.handler_->nRemaining())) 212 if (responseCount < static_cast<int>(data.handler_->GetRemainingCount()))
218 { 213 {
219 response->DimseStatus = STATUS_Pending; 214 response->DimseStatus = STATUS_Pending;
220 } 215 }
221 else 216 else
222 { 217 {
225 } 220 }
226 else 221 else
227 { 222 {
228 response->DimseStatus = STATUS_GET_Failed_UnableToProcess; 223 response->DimseStatus = STATUS_GET_Failed_UnableToProcess;
229 224
230 if (data.handler_->nFailed() > 0 || 225 if (data.handler_->GetFailedCount() > 0 ||
231 data.handler_->warningCount() > 0) 226 data.handler_->GetWarningCount() > 0)
232 { 227 {
233 response->DimseStatus = STATUS_GET_Warning_SubOperationsCompleteOneOrMoreFailures; 228 response->DimseStatus = STATUS_GET_Warning_SubOperationsCompleteOneOrMoreFailures;
234 } 229 }
230
235 /* 231 /*
236 * if all the sub-operations failed then we need to generate 232 * if all the sub-operations failed then we need to generate
237 * a failed or refused status. cf. DICOM part 4, C.4.3.3.1 233 * a failed or refused status. cf. DICOM part 4, C.4.3.3.1
238 * we choose to generate a "Refused - Out of Resources - 234 * we choose to generate a "Refused - Out of Resources -
239 * Unable to perform suboperations" status. 235 * Unable to perform suboperations" status.
240 */ 236 */
241 if ((data.handler_->nFailed() > 0) && 237 if ((data.handler_->GetFailedCount() > 0) &&
242 ((data.handler_->nCompleted() + data.handler_->warningCount()) == 0)) 238 ((data.handler_->GetCompletedCount() +
239 data.handler_->GetWarningCount()) == 0))
243 { 240 {
244 response->DimseStatus = STATUS_GET_Refused_OutOfResourcesSubOperations; 241 response->DimseStatus = STATUS_GET_Refused_OutOfResourcesSubOperations;
245 } 242 }
246 243
247 *responseIdentifiers = BuildFailedInstanceList(data.handler_->failedUids()); 244 *responseIdentifiers = BuildFailedInstanceList(data.handler_->GetFailedUids());
248 } 245 }
249 } 246 }
250 247
251 response->NumberOfRemainingSubOperations = data.handler_->nRemaining(); 248 response->NumberOfRemainingSubOperations = data.handler_->GetRemainingCount();
252 response->NumberOfCompletedSubOperations = data.handler_->nCompleted(); 249 response->NumberOfCompletedSubOperations = data.handler_->GetCompletedCount();
253 response->NumberOfFailedSubOperations = data.handler_->nFailed(); 250 response->NumberOfFailedSubOperations = data.handler_->GetFailedCount();
254 response->NumberOfWarningSubOperations = data.handler_->warningCount(); 251 response->NumberOfWarningSubOperations = data.handler_->GetWarningCount();
255 } 252 }
256 } 253 }
257 254
258 OFCondition Internals::getScp(T_ASC_Association * assoc, 255 OFCondition Internals::getScp(T_ASC_Association * assoc,
259 T_DIMSE_Message * msg, 256 T_DIMSE_Message * msg,