L_DicomSendCStoreRequest
#include "ltdic.h"
L_INT EXT_FUNCTION L_DicomSendCStoreRequest(hNet, nPresentationID, nMessageID, pszClass, pszInstance, nPriority, pszMoveAE, nMoveMessageID, 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 nPriority; |
/* priority of the message */ |
L_CHAR * pszMoveAE; |
/* name of the application entity */ |
L_UINT16 nMoveMessageID; |
/* message ID */ |
HDICOMDS hDS; |
/* data set to be stored */ |
Sends a C-STORE-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. |
|
nPriority |
The priority level of the message. The Service Class Provider may or may not support priority. Therefore, setting this parameter may or may not have any effect. Possible values are: |
|
|
Value |
Meaning |
|
COMMAND_PRIORITY_LOW |
[0x0002] Low priority message. |
|
COMMAND_PRIORITY_MEDIUM |
[0x0000] Medium priority message. |
|
COMMAND_PRIORTY_HIGH |
[0x0001] High priority message. |
pszMoveAE |
Character string that contains the name of the application entity that originally requested the move. For a simple storage request from a client to a server, this should be "". When the request is a sub-operation of a C-MOVE, this will contain the name of the AE that requested the move. |
|
nMoveMessageID |
The ID of the original move request message. For a simple storage request from a client to a server, this should be 0. When the request is a sub-operation of a C-MOVE, this will contain the original message ID of the C-MOVE request. |
|
hDS |
Pointer to the data set to be stored. |
Returns
0 |
SUCCESS |
>0 |
An error occurred. Refer to Return Codes. |
Comments
When an SCU requests a Move (C-MOVE-REQ), the SCP may have to call this function to request one or more C-STORE-REQ sub-operations to complete the storage. The series of calls and information transfer in a C-MOVE-REQ is complicated. For more information, refer to Moving Composite Data.
Calling this function generates a call to RECEIVECSTOREREQUESTCALLBACK on the SCP. The SCP should respond by calling L_DicomSendCStoreResponse which will generate a call to RECEIVECSTORERESPONSECALLBACK.
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_DicomSendCStoreResponse, L_DicomSendCMoveRequest, RECEIVECSTOREREQUESTCALLBACK, RECEIVECSTORERESPONSECALLBACK, RECEIVECMOVEREQUESTCALLBACK, RECEIVECMOVERESPONSECALLBACK |
Topics: |
|
|
Example
#include <memory.h>
.
.
.
HWND hList; /* handle to list box */
HDICOMNET hNet;
HWND hWnd;
L_VOID TestSendCStore(L_VOID)
{
L_CHAR L_FAR* pszClass=NULL;
L_CHAR L_FAR* pszInstance=NULL;
L_CHAR szMsg[200];
L_CHAR szFilter[100]= "AllFiles (*.*)\0*.*\0Dicom Files (*.dic)\0*.dic\0\0";
L_UCHAR nID;
HDICOMPDU hPDU;
OPENFILENAME OpenFileName;
L_CHAR szFile[MAX_PATH] = "\0";
FILEOPENPARM foParm;
L_INT nRet;
L_UINT32 uFlags;
HDICOMDS hDS=NULL;
pDICOMELEMENT pElement=NULL;
/* send a store request to the server */
hPDU = L_DicomGetAssociate(hNet);
/* pick the data set to send */
memset(&foParm, 0, sizeof(FILEOPENPARM));
lstrcpy( szFile, "");
OpenFileName.lStructSize = sizeof(OPENFILENAME);
OpenFileName.hwndOwner = hWnd;
OpenFileName.lpstrFilter = szFilter;
OpenFileName.lpstrCustomFilter = NULL;
OpenFileName.nMaxCustFilter = 0;
OpenFileName.nFilterIndex = 0;
OpenFileName.lpstrFile = szFile;
OpenFileName.nMaxFile = sizeof(szFile);
OpenFileName.lpstrFileTitle = NULL;
OpenFileName.nMaxFileTitle = 0;
OpenFileName.lpstrInitialDir = NULL;
OpenFileName.lpstrTitle = "Pick a Dicom Data Set";
OpenFileName.nFileOffset = 0;
OpenFileName.nFileExtension = 0;
OpenFileName.lpstrDefExt = NULL;
OpenFileName.lpfnHook = NULL;
OpenFileName.Flags = 0;
uFlags = DLG_FO_FILEINFO;
nRet = L_DlgFileOpen (hWnd, &OpenFileName, &foParm, uFlags, NULL, NULL);
if(nRet = SUCCESS)
{
/* load the data set */
hDS = L_DicomCreateDS(NULL);
nRet = L_DicomLoadDS(hDS, szFile, 0);
if(nRet != DICOM_SUCCESS)
{
MessageBox(NULL, "Error Loading Data Set!", "Error", MB_OK);
return;
}
pElement = L_DicomFindFirstElement(hDS, NULL, TAG_SOP_INSTANCE_UID, FALSE);
pszInstance = L_DicomGetStringValue(hDS, pElement, 0, 1);
pElement = L_DicomFindFirstElement(hDS, NULL, TAG_SOP_CLASS_UID, FALSE);
pszClass = L_DicomGetStringValue(hDS, pElement, 0, 1);
/* send the command set */
nID = L_DicomFindAbstract(hPDU, pszClass);
if(nID == 0)
{
wsprintf(szMsg, "Abstract Syntax %s Not Supported by Association!", pszClass);
MessageBox(NULL, szMsg, "Error", MB_OK);
}
else
{
/* now, use the high-level method to send the command set */
L_DicomSendCStoreRequest(hNet, nID, 1, pszClass, pszInstance, COMMAND_PRIORITY_MEDIUM, "", 0, hDS);
}
L_DicomFreeDS(hDS);
}
}