#include "ltdic.h"
L_LTDIC_API L_INT L_DicomSendNActionRequest(hNet, nPresentationID, nMessageID, pszClass, pszInstance, nAction, hDS)
HDICOMNET hNet; |
a DICOM Network handle |
L_UCHAR nPresentationID; |
presentation ID |
L_UINT16 nMessageID; |
message ID |
L_TCHAR * pszClass; |
class type |
L_TCHAR * pszInstance; |
instance |
L_UINT16 nAction; |
the action to perform |
HDICOMDS hDS; |
data set |
Sends an N-ACTION-REQ message to a peer member of a connection. This function is available in the PACS Imaging Toolkit.
Parameter |
Description |
hNet |
A DICOM Network handle to the peer member of the connection. |
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. |
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. |
pszClass |
Class affected by the request. This will be an SOP Class or an SOP MetaClass. |
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. |
nAction |
An application specific action to be performed on the specified data set. |
hDS |
The data set on which the specified action is to be performed. |
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.
Required DLLs and Libraries
For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
Win32, x64, Linux.
Functions: |
L_DicomSendNActionResponse, RECEIVENACTIONREQUESTCALLBACK, RECEIVENACTIONRESPONSECALLBACK |
Topics: |
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;
}