L_DicomSendNGetRequest

#include "ltdic.h"

L_LTDIC_API L_INT L_DicomSendNGetRequest(hNet, nPresentationID, nMessageID, pszClass, pszInstance, pnAttribute, nCount)

Sends an N-GET-REQ message to a peer member of a connection.

Parameters

HDICOMNET hNet

A DICOM Network handle to the peer member of the connection.

L_UCHAR nPresentationID

Presentation ID. The presentation ID provides information about both the class type of the data and the transfer syntax to use when transferring the data.

L_UINT16 nMessageID

Message ID. Each message sent by a member of a connection should have a unique ID. Since a member of a connection may send several messages, this ID allows that member to identify when a specific request has been completed.

L_TCHAR * pszClass

Class affected by the request. This will be an SOP Class or an SOP MetaClass.

L_TCHAR * pszInstance

The instance of the class. A server may, for example, have three instances of the Nuclear Medicine Class. This value identifies the data with a specific instance.

L_UINT32 * pnAttribute

An array of the attributes to get. The attributes must be specified using the Data Element Tags. For a list of available Data Element Tags, refer to Data Element Tag Constants.

L_UINT16 nCount

Number of attributes being requested.

Returns

Value Meaning
DICOM_SUCCESS The function was successful.
>0 An error occurred. Refer to Return Codes.

Comments

Calling this function generates a call to RECEIVENGETREQUESTCALLBACK on the SCP. The SCP should respond by calling L_DicomSendNGetResponse which will generate a call to RECEIVENGETRESPONSECALLBACK.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

L_INT DicomSendNGetRequestExample(HDICOMNET hNet, L_TCHAR gszGetFile[L_MAXPATH]) 
{ 
   L_TCHAR szClassUID[200]; 
   L_TCHAR szInstance[200]; 
   L_TCHAR szMsg[200]; 
   HDICOMPDU hPDU; 
   L_UCHAR nID; 
   L_UINT32 Attributes[4]; 
   L_INT nRet; 
    
   /* send an N-GET-REQUEST to the server */ 
    
   /* gszGetFile is a global variable used in the NetReceiveNGetResponse event */ 
   lstrcpy(gszGetFile, MAKE_IMAGE_PATH(TEXT("N_GET_REQ.dcm"))); 
    
   /* this sample uses fixed values */ 
   lstrcpy(szClassUID, UID_SC_IMAGE_STORAGE); 
    
   lstrcpy(szInstance, TEXT("998.998.1.19950214.94000.1.102")); 
    
   /* here, you must create a list of the identifiers */ 
   /* that you wish to get from the server */ 
   Attributes[0] = TAG_PATIENT_NAME; 
   Attributes[1] = TAG_PATIENT_ID; 
   Attributes[2] = TAG_PATIENT_SEX; 
   Attributes[3] = TAG_NUMBER_OF_PATIENT_RELATED_INSTANCES; 
    
   hPDU = L_DicomGetAssociate(hNet); 
    
   /* now, send a request */ 
   nID = L_DicomFindAbstract(hPDU, szClassUID); 
   if(nID == 0) 
   { 
      wsprintf(szMsg, TEXT("Abstract Syntax %s Not Supported by Association!"), szClassUID); 
      MessageBox(NULL, szMsg, TEXT("Error"), MB_OK); 
   } 
   else 
   { 
      nRet = L_DicomSendNGetRequest(hNet, nID, 1, szClassUID, szInstance, Attributes, 4); 
      if (nRet != DICOM_SUCCESS) 
         return nRet; 
   } 
   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