L_DicomSendCStoreRequest

#include "ltdic.h"

L_LTDIC_API L_INT 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_TCHAR * pszClass;

/* class type */

L_TCHAR * pszInstance;

/* instance */

L_UINT16 nPriority;

/* priority of the message */

L_TCHAR * 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

Platforms

Win32, x64

See Also

Functions:

L_DicomSendCStoreResponse, L_DicomSendCMoveRequest, RECEIVECSTOREREQUESTCALLBACK, RECEIVECSTORERESPONSECALLBACK, RECEIVECMOVEREQUESTCALLBACK, RECEIVECMOVERESPONSECALLBACK

Topics:

Working with DICOM Network Connections

 

Moving Composite Data

Example

#include <memory.h>


L_INT DicomSendCStoreRequestExample(HDICOMNET hNet, HWND hWnd)
{
   L_TCHAR * pszClass=NULL;
   L_TCHAR * pszInstance=NULL;
   L_TCHAR    szMsg[200];
   L_TCHAR    szFilter[100]= TEXT("AllFiles (*.*)\0*.*\0Dicom Files (*.dcm)\0*.dcm\0\0");
   L_UCHAR   nID;
   HDICOMPDU hPDU;
   OPENFILENAME OpenFileName;
   L_TCHAR    szFile[MAX_PATH] = TEXT("\0");
   L_INT nRet;
   HDICOMDS hDS=NULL;
   pDICOMELEMENT pElement=NULL;
   OPENDLGPARAMS DlgParams;

   
   /* send a store request to the server */
   
   hPDU = L_DicomGetAssociate(hNet);
   
   /* pick the data set to send */
   lstrcpy( szFile, TEXT(""));

   memset ( &OpenFileName, 0, sizeof ( OPENFILENAME ) ) ;
   memset ( &DlgParams, 0, sizeof ( OPENDLGPARAMS ) ) ;


   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        = TEXT("Pick a Dicom Data Set");
   OpenFileName.nFileOffset       = 0;
   OpenFileName.nFileExtension    = 0;
   OpenFileName.lpstrDefExt       = NULL;
   OpenFileName.lpfnHook          = NULL;
   OpenFileName.Flags             = 0;

   DlgParams.uStructSize = sizeof ( OPENDLGPARAMS ) ;
   DlgParams.pfnFileLoadCallback = NULL ;

   DlgParams.uDlgFlags = DLG_OPEN_SHOW_PROGRESSIVE     |
                         DLG_OPEN_SHOW_FILEINFO        |
                         DLG_OPEN_SHOW_PREVIEW         |
                         DLG_OPEN_SHOW_DELPAGE         |
                         DLG_OPEN_SHOW_LOADOPTIONS     |
                         DLG_OPEN_LOADBITMAP           ;

   nRet = L_DlgOpen (hWnd, &OpenFileName, &DlgParams);

   if( SUCCESS_DLG_OK == nRet )
   {
      /* load the data set */
      hDS = L_DicomCreateDS(NULL);
      nRet = L_DicomLoadDS(hDS, szFile, 0);
      if(nRet != DICOM_SUCCESS)
      {
         MessageBox(NULL, TEXT("Error Loading Data Set!"), TEXT("Error"), MB_OK);
         L_DicomFreeDS(hDS);
         return nRet;
      }
      
      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, TEXT("Abstract Syntax %s Not Supported by Association!"), pszClass);
         MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
      }
      else
      {
         /* now, use the high-level method to send the command set */
         nRet = L_DicomSendCStoreRequest(hNet, nID, 1, pszClass, pszInstance, COMMAND_PRIORITY_MEDIUM, TEXT(""), 0, hDS);
         if (nRet != DICOM_SUCCESS)
         {
            L_DicomFreeDS(hDS);
            return nRet;
         }
      }
      L_DicomFreeDS(hDS);
   }
   return DICOM_SUCCESS;
}