L_DicomIsRoleSelect

#include "ltdic.h"

L_BOOL EXT_FUNCTION L_DicomIsRoleSelect(hPDU, nID)

HDICOMPDU hPDU;

/* a DICOM Associate handle */

L_UCHAR nID;

/* presentation ID */

Determines whether Role Selection is enabled for the specified Presentation Context of the specified DICOM Associate.

Parameter

Description

hPDU

A DICOM Associate handle.

nID

Presentation ID of the Presentation Context for which you wish to check Role Selection. 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

TRUE

Role Selection is enabled for the specified Presentation Context of the specified DICOM Associate.

FALSE

Role Selection is disabled for the specified Presentation Context of the specified DICOM Associate.

Comments

If Role Selection is enabled, the role of the specified Presentation Context can be retrieved using L_DicomGetUserRole and L_DicomGetProviderRole. To set the role of the specified Presentation Context, use L_DicomSetRoleSelect.

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_DicomGetUserRole, L_DicomGetProviderRole, L_DicomSetRoleSelect

Topics:

Working with DICOM Associate Connections

Example

L_VOID TestRoleSelect(HDICOMPDU hPDU)
{
   L_INT x;
   L_UCHAR nID;
   L_CHAR szOut[2000];
   L_CHAR szTemp[200];
   L_UCHAR nUser;
   L_UCHAR nProvider;
   
   /* indicate that we wish to serve as user for each SOP associated */
   for(x = 0; x < L_DicomGetPresentationCount(hPDU); x ++)
   {
      nID = L_DicomGetPresentation(hPDU, x);
      L_DicomSetRoleSelect(hPDU, nID, TRUE, PDU_ROLE_SUPPORT, PDU_ROLE_NON_SUPPORT);
   }
   
   /* now, display the information */
   lstrcpy(szOut, "Role Select Info\n");
   for(x = 0; x < L_DicomGetPresentationCount(hPDU); x ++)
   {
      nID = L_DicomGetPresentation(hPDU, x);
      wsprintf(szTemp, "ID: %d", nID);
      lstrcat(szOut, szTemp);
      if(L_DicomIsRoleSelect(hPDU, nID))
      {
         nUser = L_DicomGetUserRole(hPDU, nID);
         nProvider = L_DicomGetProviderRole(hPDU, nID);
         wsprintf(szTemp, "  User: %d", nUser);
         lstrcat(szOut, szTemp);
         wsprintf(szTemp, "  Provider: %d\n", nProvider);
         lstrcat(szOut, szTemp);
      }
      else
         lstrcat(szOut, "  No Role Select\n");
   }
   MessageBox(NULL, szOut, "Test", MB_OK);
}