comparison OrthancFramework/Sources/DicomNetworking/DicomStoreUserConnection.cpp @ 4281:d2f79a475b51

debug log for DCMTK SCU
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Nov 2020 13:48:42 +0100
parents bf7b9edf6b81
children 756126cd2219
comparison
equal deleted inserted replaced
4280:58e757ded69e 4281:d2f79a475b51
32 #include <dcmtk/dcmdata/dcdeftag.h> 32 #include <dcmtk/dcmdata/dcdeftag.h>
33 33
34 34
35 namespace Orthanc 35 namespace Orthanc
36 { 36 {
37 static void ProgressCallback(void * /*callbackData*/,
38 T_DIMSE_StoreProgress *progress,
39 T_DIMSE_C_StoreRQ * req)
40 {
41 if (req != NULL &&
42 progress->state == DIMSE_StoreBegin)
43 {
44 OFString str;
45 CLOG(TRACE, DICOM) << "Sending Store Request:" << std::endl
46 << DIMSE_dumpMessage(str, *req, DIMSE_OUTGOING);
47 }
48 }
49
50
37 bool DicomStoreUserConnection::ProposeStorageClass(const std::string& sopClassUid, 51 bool DicomStoreUserConnection::ProposeStorageClass(const std::string& sopClassUid,
38 const std::set<DicomTransferSyntax>& syntaxes) 52 const std::set<DicomTransferSyntax>& syntaxes)
39 { 53 {
40 // Default transfer syntax for DICOM 54 // Default transfer syntax for DICOM
41 const bool addLittleEndianImplicit = ( 55 const bool addLittleEndianImplicit = (
355 // Finally conduct transmission of data 369 // Finally conduct transmission of data
356 T_DIMSE_C_StoreRSP response; 370 T_DIMSE_C_StoreRSP response;
357 DcmDataset* statusDetail = NULL; 371 DcmDataset* statusDetail = NULL;
358 DicomAssociation::CheckCondition( 372 DicomAssociation::CheckCondition(
359 DIMSE_storeUser(&association_->GetDcmtkAssociation(), presID, &request, 373 DIMSE_storeUser(&association_->GetDcmtkAssociation(), presID, &request,
360 NULL, dicom.getDataset(), /*progressCallback*/ NULL, NULL, 374 NULL, dicom.getDataset(), ProgressCallback, NULL,
361 /*opt_blockMode*/ (GetParameters().HasTimeout() ? DIMSE_NONBLOCKING : DIMSE_BLOCKING), 375 /*opt_blockMode*/ (GetParameters().HasTimeout() ? DIMSE_NONBLOCKING : DIMSE_BLOCKING),
362 /*opt_dimse_timeout*/ GetParameters().GetTimeout(), 376 /*opt_dimse_timeout*/ GetParameters().GetTimeout(),
363 &response, &statusDetail, NULL), 377 &response, &statusDetail, NULL),
364 GetParameters(), "C-STORE"); 378 GetParameters(), "C-STORE");
365 379
366 if (statusDetail != NULL) 380 if (statusDetail != NULL)
367 { 381 {
368 delete statusDetail; 382 delete statusDetail;
383 }
384
385 {
386 OFString str;
387 CLOG(TRACE, DICOM) << "Received Store Response:" << std::endl
388 << DIMSE_dumpMessage(str, response, DIMSE_INCOMING, NULL, presID);
369 } 389 }
370 390
371 /** 391 /**
372 * New in Orthanc 1.6.0: Deal with failures during C-STORE. 392 * New in Orthanc 1.6.0: Deal with failures during C-STORE.
373 * http://dicom.nema.org/medical/dicom/current/output/chtml/part04/sect_B.2.3.html#table_B.2-1 393 * http://dicom.nema.org/medical/dicom/current/output/chtml/part04/sect_B.2.3.html#table_B.2-1