L_DicomGetResult

#include "ltdic.h"

L_LTDIC_API L_UCHAR L_DicomGetResult(hPDU, nID)

HDICOMPDU hPDU;

/* a DICOM Associate handle */

L_UCHAR nID;

/* Presentation ID */

Returns the result of the specified Presentation Context of the specified DICOM Associate.

Parameter

Description

hPDU

A DICOM Associate handle.

nID

Presentation ID of the Presentation Context from which to get the result. The presentation ID provides information about both the class type of the data and the transfer syntax to use when transferring the data. It also identifies a specific Presentation Context within an Associate.

Returns

The result of the specified Presentation Context of the specified DICOM Associate. Possible values are:

Value

Meaning

PDU_ACCEPT_RESULT_SUCCESS

[0] Success

PDU_ACCEPT_RESULT_USER_REJECT

[1] User rejection

PDU_ACCEPT_RESULT_PROVIDER_REJECT

[2] No reason (provider rejection)

PDU_ACCEPT_RESULT_ABSTRACT_SYNTAX

[3] Abstract Syntax not supported. (provider rejection)

PDU_ACCEPT_RESULT_TRANSFER_SYNTAX

[4] Transfer Syntax not supported. (provider rejection)

Comments

This function is only valid for DICOM Associates of type Associate Accept.

Required DLLs and Libraries

LTDIC

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

L_DicomSetResult

Topics:

Working with DICOM Associate Connections

Example

L_INT DicomGetResultExample(HDICOMPDU hPDU)
{
   L_UCHAR i;
   L_UCHAR nID;
   L_TCHAR szMsg[800];
   L_TCHAR szTemp[800];
   L_UCHAR uResult;

   /* get current results for each Presentation Context */
   lstrcpy(szMsg, TEXT("Current Results"));
   for(i = 0; i < L_DicomGetPresentationCount(hPDU); i++)
   {
      nID = L_DicomGetPresentation(hPDU, i);
      uResult = L_DicomGetResult(hPDU, nID);
      wsprintf(szTemp, TEXT("\n[%d]"), uResult);
      lstrcat(szMsg, szTemp);
   }
   MessageBox(NULL, szMsg, TEXT("Test"), MB_OK);

   /* change all results to 1 */
   for(i = 0; i < L_DicomGetPresentationCount(hPDU); i++)
   {
      nID = L_DicomGetPresentation(hPDU, i);
      L_DicomSetResult(hPDU, nID, 1);
   }

   /* Display new results for each Presentation Context */
   lstrcpy(szMsg, TEXT("New Results"));
   for(i = 0; i < L_DicomGetPresentationCount(hPDU); i++)
   {
      nID = L_DicomGetPresentation(hPDU, i);
      uResult = L_DicomGetResult(hPDU, nID);
      wsprintf(szTemp, TEXT("\n[%d]"), uResult);
      lstrcat(szMsg, szTemp);
   }
   MessageBox(NULL, szMsg, TEXT("Test"), MB_OK);
   return DICOM_SUCCESS;
}