Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS DICOM C DLL Help

L_DicomIsRoleSelect

Show in webframe

#include "ltdic.h"

L_LTDIC_API L_BOOL 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

Platforms

Win32, x64, Linux.

See Also

Functions:

L_DicomGetUserRole, L_DicomGetProviderRole, L_DicomSetRoleSelect

Topics:

Working with DICOM Associate Connections

Example

L_INT DicomIsRoleSelectExample(HDICOMPDU hPDU)
{
   L_INT x;
   L_UCHAR nID;
   L_TCHAR szOut[20000];
   L_TCHAR szTemp[2000];
   L_UCHAR nUser;
   L_UCHAR nProvider;
   L_INT nRet;
   
   /* 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);
      nRet = L_DicomSetRoleSelect(hPDU, nID, TRUE, PDU_ROLE_SUPPORT, PDU_ROLE_NON_SUPPORT);
      if (nRet != DICOM_SUCCESS)
         return nRet;
      
   }
   
   /* now, display the information */
   lstrcpy(szOut, TEXT("Role Select Info\n"));
   for(x = 0; x < L_DicomGetPresentationCount(hPDU); x ++)
   {
      nID = L_DicomGetPresentation(hPDU, x);
      wsprintf(szTemp, TEXT("ID: %d"), nID);
      lstrcat(szOut, szTemp);
      if(L_DicomIsRoleSelect(hPDU, nID))
      {
         nUser = L_DicomGetUserRole(hPDU, nID);
         nProvider = L_DicomGetProviderRole(hPDU, nID);
         wsprintf(szTemp, TEXT("  User: %d"), nUser);
         lstrcat(szOut, szTemp);
         wsprintf(szTemp, TEXT("  Provider: %d\n"), nProvider);
         lstrcat(szOut, szTemp);
      }
      else
         lstrcat(szOut, TEXT("  No Role Select\n"));
   }
   MessageBox(NULL, szOut, TEXT("Test"), MB_OK);

   return DICOM_SUCCESS;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.