L_DicomSendNActionRequest
#include "ltdic.h"
L_INT EXT_FUNCTION 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_CHAR * pszClass; |
/* class type */ |
L_CHAR * 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 Medical Suite 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. |
Returns
0 |
SUCCESS |
>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
LTDIC For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
See Also
Functions: |
L_DicomSendNActionResponse, RECEIVENACTIONREQUESTCALLBACK, RECEIVENACTIONRESPONSECALLBACK |
Topics: |
Example
HWND hList; /* handle to list box */
HDICOMNET hNet;
L_VOID TestSendNAction(L_VOID)
{
/* this sample shows how to send an N-ACTION-REQUEST */
L_INT nRet;
L_CHAR szClassUID[200];
L_CHAR szInstance[200];
L_CHAR 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, "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);
hPDU = L_DicomGetAssociate(hNet);
/* now, send a request */
nID = L_DicomFindAbstract(hPDU, szClassUID);
if(nID == 0)
{
wsprintf(szMsg, "Abstract Syntax %s Not Supported by Association!", szClassUID);
MessageBox(NULL, szMsg, "Error", MB_OK);
}
else
L_DicomSendNActionRequest(hNet, nID, 1, szClassUID, szInstance, nAction, hDS);
L_DicomFreeDS(hDS);
}
L_INT CreateActionArguments(L_UINT16 nAction, HDICOMDS hDS)
{
/*
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;
}