Sends an N-ACTION-REQ message to a peer member of a connection. This function is available in the PACS Imaging Toolkit.
#include "ltdic.h"
L_LTDIC_API L_INT L_DicomSendNActionRequest(hNet, nPresentationID, nMessageID, pszClass, pszInstance, nAction, hDS)
A DICOM Network handle to the peer member of the connection.
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.
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.
Class affected by the request. This will be an SOP Class or an SOP MetaClass.
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.
An application specific action to be performed on the specified data set.
The data set on which the specified action is to be performed.
Value | Meaning |
---|---|
DICOM_SUCCESS | The function was successful. |
>0 | An error occurred. Refer to Return Codes. |
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.
Win32, x64, Linux.
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 Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document