L_DicomIsRoleSelect

#include "ltdic.h"

L_LTDIC_API L_BOOL L_DicomIsRoleSelect(hPDU, nID)

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

Parameters

HDICOMPDU hPDU

A DICOM Associate handle.

L_UCHAR 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

Value Meaning
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

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

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; 
} 
Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C API Help