L_DicomSendNActionRequest

Summary

Sends an N-ACTION-REQ message to a peer member of a connection. This function is available in the PACS Imaging Toolkit.

Syntax

#include "ltdic.h"

L_LTDIC_API L_INT L_DicomSendNActionRequest(hNet, nPresentationID, nMessageID, pszClass, pszInstance, nAction, hDS)

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_UINT16 nAction

An application specific action to be performed on the specified data set.

HDICOMDS hDS

The data set on which the specified action is to be performed.

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 RECEIVENACTIONREQUESTCALLBACK on the SCP. The SCP should respond by calling L_DicomSendNActionResponse which will generate a call to RECEIVENACTIONRESPONSECALLBACK.

The action specified may be the addition of a new patient, the deletion of a patient, the addition of a new study, a print job, etc. The nAction value, which designates the action to perform is determined by the server. To find out the values used, you must contact the organization that created the server. When creating a server, the values and their corresponding meanings are determined by those creating the server.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

L_INT CreateActionArguments(L_UINT16 nAction, HDICOMDS hDS) 
{ 
   UNREFERENCED_PARAMETER(nAction); 
   /* 
       this function should create a data set for the required 
       arguments for nAction 
       in this sample, it simply creates a dummy data set 
   */ 
   L_DicomInitDS(hDS, CLASS_CR_IMAGE_STORAGE, 0); 
   return DICOM_SUCCESS; 
} 
 
L_INT DicomSendNActionRequestExample(HDICOMNET hNet) 
{ 
   /* this sample shows how to send an N-ACTION-REQUEST */ 
   L_INT nRet; 
   L_TCHAR szClassUID[200]; 
   L_TCHAR szInstance[200]; 
   L_TCHAR szMsg[200]; 
   HDICOMPDU hPDU; 
   L_UCHAR nID; 
   L_UINT16 nAction; 
   HDICOMDS hDS=NULL; 
    
   /* send an N-ACTION-REQUEST to the server */ 
    
   /* this sample uses fixed values */ 
   nAction = 1; /* application specific */ 
    
   lstrcpy(szClassUID, UID_BASIC_FILM_BOX_CLASS); 
    
   lstrcpy(szInstance, TEXT("1.1.1.1")); 
    
   /*  
       now, you must create a data set that encodes the 
       Action Arguments. 
       This function should create the Data Set based on 
       the value of nAction. 
   */ 
   hDS=L_DicomCreateDS(NULL); 
   nRet = CreateActionArguments(nAction, hDS); 
   if (nRet != DICOM_SUCCESS) 
   { 
      L_DicomFreeDS(hDS); 
      return nRet; 
   } 
    
   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_DicomSendNActionRequest(hNet, nID, 1, szClassUID, szInstance, nAction, hDS); 
      if (nRet != DICOM_SUCCESS) 
      { 
         L_DicomFreeDS(hDS); 
         return nRet; 
      } 
   } 
   L_DicomFreeDS(hDS); 
   return DICOM_SUCCESS; 
} 
Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.