comparison OrthancFramework/Sources/DicomNetworking/Internals/FindScp.cpp @ 4284:756126cd2219

moving all logs from DicomNetworking folder into the "dicom" category
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Nov 2020 15:01:47 +0100
parents 4d42408da117
children 544120b34c09
comparison
equal deleted inserted replaced
4283:6b58ceed959e 4284:756126cd2219
19 * <http://www.gnu.org/licenses/>. 19 * <http://www.gnu.org/licenses/>.
20 **/ 20 **/
21 21
22 22
23 23
24
24 /*========================================================================= 25 /*=========================================================================
25 26
26 This file is based on portions of the following project: 27 This file is based on portions of the following project:
27 28
28 Program: DCMTK 3.6.0 29 Program: DCMTK 3.6.0
29 Module: http://dicom.offis.de/dcmtk.php.en 30 Module: http://dicom.offis.de/dcmtk.php.en
30 31
31 Copyright (C) 1994-2011, OFFIS e.V. 32 Copyright (C) 1994-2011, OFFIS e.V.
32 All rights reserved. 33 All rights reserved.
33 34
34 This software and supporting documentation were developed by 35 This software and supporting documentation were developed by
35 36
36 OFFIS e.V. 37 OFFIS e.V.
37 R&D Division Health 38 R&D Division Health
38 Escherweg 2 39 Escherweg 2
39 26121 Oldenburg, Germany 40 26121 Oldenburg, Germany
40 41
41 Redistribution and use in source and binary forms, with or without 42 Redistribution and use in source and binary forms, with or without
42 modification, are permitted provided that the following conditions 43 modification, are permitted provided that the following conditions
43 are met: 44 are met:
44 45
45 - Redistributions of source code must retain the above copyright 46 - Redistributions of source code must retain the above copyright
46 notice, this list of conditions and the following disclaimer. 47 notice, this list of conditions and the following disclaimer.
47 48
48 - Redistributions in binary form must reproduce the above copyright 49 - Redistributions in binary form must reproduce the above copyright
49 notice, this list of conditions and the following disclaimer in the 50 notice, this list of conditions and the following disclaimer in the
50 documentation and/or other materials provided with the distribution. 51 documentation and/or other materials provided with the distribution.
51 52
52 - Neither the name of OFFIS nor the names of its contributors may be 53 - Neither the name of OFFIS nor the names of its contributors may be
53 used to endorse or promote products derived from this software 54 used to endorse or promote products derived from this software
54 without specific prior written permission. 55 without specific prior written permission.
55 56
56 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 57 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
57 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 58 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
58 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 59 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
59 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 60 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
60 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 61 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
61 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 62 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
62 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 63 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
63 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 64 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
64 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 65 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
65 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 66 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
66 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 67 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67 68
68 =========================================================================*/ 69 =========================================================================*/
69 70
70 71
71 72
72 #include "../../PrecompiledHeaders.h" 73 #include "../../PrecompiledHeaders.h"
73 #include "FindScp.h" 74 #include "FindScp.h"
240 *data.calledAet_, modality.GetManufacturer()); 241 *data.calledAet_, modality.GetManufacturer());
241 ok = true; 242 ok = true;
242 } 243 }
243 else 244 else
244 { 245 {
245 LOG(ERROR) << "No worklist handler is installed, cannot handle this C-FIND request"; 246 CLOG(ERROR, DICOM) << "No worklist handler is installed, cannot handle this C-FIND request";
246 } 247 }
247 } 248 }
248 else 249 else
249 { 250 {
250 data.answers_.SetWorklist(false); 251 data.answers_.SetWorklist(false);
261 const DicomTag tag(FromDcmtkBridge::Convert(element->getTag())); 262 const DicomTag tag(FromDcmtkBridge::Convert(element->getTag()));
262 263
263 DcmSequenceOfItems& sequence = dynamic_cast<DcmSequenceOfItems&>(*element); 264 DcmSequenceOfItems& sequence = dynamic_cast<DcmSequenceOfItems&>(*element);
264 if (sequence.card() != 0) 265 if (sequence.card() != 0)
265 { 266 {
266 LOG(WARNING) << "Orthanc only supports sequence matching on worklists, " 267 CLOG(WARNING, DICOM) << "Orthanc only supports sequence matching on worklists, "
267 << "ignoring C-FIND SCU constraint on tag (" << tag.Format() 268 << "ignoring C-FIND SCU constraint on tag (" << tag.Format()
268 << ") " << FromDcmtkBridge::GetTagName(*element); 269 << ") " << FromDcmtkBridge::GetTagName(*element);
269 } 270 }
270 271
271 sequencesToReturn.push_back(tag); 272 sequencesToReturn.push_back(tag);
272 } 273 }
273 } 274 }
284 *data.calledAet_, modality.GetManufacturer()); 285 *data.calledAet_, modality.GetManufacturer());
285 ok = true; 286 ok = true;
286 } 287 }
287 else 288 else
288 { 289 {
289 LOG(ERROR) << "No C-Find handler is installed, cannot handle this request"; 290 CLOG(ERROR, DICOM) << "No C-Find handler is installed, cannot handle this request";
290 } 291 }
291 } 292 }
292 } 293 }
293 catch (OrthancException& e) 294 catch (OrthancException& e)
294 { 295 {
295 // Internal error! 296 // Internal error!
296 LOG(ERROR) << "C-FIND request handler has failed: " << e.What(); 297 CLOG(ERROR, DICOM) << "C-FIND request handler has failed: " << e.What();
297 } 298 }
298 299
299 if (!ok) 300 if (!ok)
300 { 301 {
301 response->DimseStatus = STATUS_FIND_Failed_UnableToProcess; 302 response->DimseStatus = STATUS_FIND_Failed_UnableToProcess;
326 *responseIdentifiers = NULL; 327 *responseIdentifiers = NULL;
327 } 328 }
328 else 329 else
329 { 330 {
330 // Success, but the results were too numerous and had to be cropped 331 // Success, but the results were too numerous and had to be cropped
331 LOG(WARNING) << "Too many results for an incoming C-FIND query"; 332 CLOG(WARNING, DICOM) << "Too many results for an incoming C-FIND query";
332 response->DimseStatus = STATUS_FIND_Cancel_MatchingTerminatedDueToCancelRequest; 333 response->DimseStatus = STATUS_FIND_Cancel_MatchingTerminatedDueToCancelRequest;
333 *responseIdentifiers = NULL; 334 *responseIdentifiers = NULL;
334 } 335 }
335 } 336 }
336 } 337 }
363 364
364 // if some error occured, dump corresponding information and remove the outfile if necessary 365 // if some error occured, dump corresponding information and remove the outfile if necessary
365 if (cond.bad()) 366 if (cond.bad())
366 { 367 {
367 OFString temp_str; 368 OFString temp_str;
368 LOG(ERROR) << "Find SCP Failed: " << cond.text(); 369 CLOG(ERROR, DICOM) << "Find SCP Failed: " << cond.text();
369 } 370 }
370 371
371 return cond; 372 return cond;
372 } 373 }
373 } 374 }