comparison OrthancFramework/Sources/DicomNetworking/DicomAssociation.cpp @ 4282:65086904ec45

debug logs for storage commitment SCU
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Nov 2020 14:21:13 +0100
parents d2f79a475b51
children 756126cd2219
comparison
equal deleted inserted replaced
4281:d2f79a475b51 4282:65086904ec45
671 throw OrthancException(ErrorCode_NetworkProtocol, "Storage commitment - " 671 throw OrthancException(ErrorCode_NetworkProtocol, "Storage commitment - "
672 "Unable to send N-EVENT-REPORT request to AET: " + 672 "Unable to send N-EVENT-REPORT request to AET: " +
673 parameters.GetRemoteModality().GetApplicationEntityTitle()); 673 parameters.GetRemoteModality().GetApplicationEntityTitle());
674 } 674 }
675 675
676 {
677 OFString str;
678 CLOG(TRACE, DICOM) << "Sending Storage Commitment Report:" << std::endl
679 << DIMSE_dumpMessage(str, message, DIMSE_OUTGOING) << std::endl
680 << DcmObject::PrintHelper(dataset);
681 }
682
676 if (!DIMSE_sendMessageUsingMemoryData( 683 if (!DIMSE_sendMessageUsingMemoryData(
677 &association.GetDcmtkAssociation(), presID, &message, NULL /* status detail */, 684 &association.GetDcmtkAssociation(), presID, &message, NULL /* status detail */,
678 &dataset, NULL /* callback */, NULL /* callback context */, 685 &dataset, NULL /* callback */, NULL /* callback context */,
679 NULL /* commandSet */).good()) 686 NULL /* commandSet */).good())
680 { 687 {
699 throw OrthancException(ErrorCode_NetworkProtocol, "Storage commitment - " 706 throw OrthancException(ErrorCode_NetworkProtocol, "Storage commitment - "
700 "Unable to read N-EVENT-REPORT response from AET: " + 707 "Unable to read N-EVENT-REPORT response from AET: " +
701 parameters.GetRemoteModality().GetApplicationEntityTitle()); 708 parameters.GetRemoteModality().GetApplicationEntityTitle());
702 } 709 }
703 710
711 {
712 OFString str;
713 CLOG(TRACE, DICOM) << "Received Storage Commitment Report Response:" << std::endl
714 << DIMSE_dumpMessage(str, message, DIMSE_INCOMING, NULL, presID);
715 }
716
704 const T_DIMSE_N_EventReportRSP& content = message.msg.NEventReportRSP; 717 const T_DIMSE_N_EventReportRSP& content = message.msg.NEventReportRSP;
705 if (content.MessageIDBeingRespondedTo != messageId || 718 if (content.MessageIDBeingRespondedTo != messageId ||
706 !(content.opts & O_NEVENTREPORT_AFFECTEDSOPCLASSUID) || 719 !(content.opts & O_NEVENTREPORT_AFFECTEDSOPCLASSUID) ||
707 !(content.opts & O_NEVENTREPORT_AFFECTEDSOPINSTANCEUID) || 720 !(content.opts & O_NEVENTREPORT_AFFECTEDSOPINSTANCEUID) ||
708 //(content.opts & O_NEVENTREPORT_EVENTTYPEID) || // Pedantic test - The "content.EventTypeID" is not used by Orthanc 721 //(content.opts & O_NEVENTREPORT_EVENTTYPEID) || // Pedantic test - The "content.EventTypeID" is not used by Orthanc
818 throw OrthancException(ErrorCode_NetworkProtocol, "Storage commitment - " 831 throw OrthancException(ErrorCode_NetworkProtocol, "Storage commitment - "
819 "Unable to send N-ACTION request to AET: " + 832 "Unable to send N-ACTION request to AET: " +
820 parameters.GetRemoteModality().GetApplicationEntityTitle()); 833 parameters.GetRemoteModality().GetApplicationEntityTitle());
821 } 834 }
822 835
836 {
837 OFString str;
838 CLOG(TRACE, DICOM) << "Sending Storage Commitment Request:" << std::endl
839 << DIMSE_dumpMessage(str, message, DIMSE_OUTGOING) << std::endl
840 << DcmObject::PrintHelper(dataset);
841 }
842
823 if (!DIMSE_sendMessageUsingMemoryData( 843 if (!DIMSE_sendMessageUsingMemoryData(
824 &association.GetDcmtkAssociation(), presID, &message, NULL /* status detail */, 844 &association.GetDcmtkAssociation(), presID, &message, NULL /* status detail */,
825 &dataset, NULL /* callback */, NULL /* callback context */, 845 &dataset, NULL /* callback */, NULL /* callback context */,
826 NULL /* commandSet */).good()) 846 NULL /* commandSet */).good())
827 { 847 {
860 throw OrthancException(ErrorCode_NetworkProtocol, "Storage commitment - " 880 throw OrthancException(ErrorCode_NetworkProtocol, "Storage commitment - "
861 "Badly formatted N-ACTION response from AET: " + 881 "Badly formatted N-ACTION response from AET: " +
862 parameters.GetRemoteModality().GetApplicationEntityTitle()); 882 parameters.GetRemoteModality().GetApplicationEntityTitle());
863 } 883 }
864 884
885 {
886 OFString str;
887 CLOG(TRACE, DICOM) << "Received Storage Commitment Request Response:" << std::endl
888 << DIMSE_dumpMessage(str, message, DIMSE_INCOMING, NULL, presID);
889 }
890
865 if (content.DimseStatus != 0 /* success */) 891 if (content.DimseStatus != 0 /* success */)
866 { 892 {
867 throw OrthancException(ErrorCode_NetworkProtocol, "Storage commitment - " 893 throw OrthancException(ErrorCode_NetworkProtocol, "Storage commitment - "
868 "The request cannot be handled by remote AET: " + 894 "The request cannot be handled by remote AET: " +
869 parameters.GetRemoteModality().GetApplicationEntityTitle()); 895 parameters.GetRemoteModality().GetApplicationEntityTitle());