L_DicomSendCMoveRequest

#include "ltdic.h"

L_INT EXT_FUNCTION L_DicomSendCMoveRequest(hNet, nPresentationID, nMessageID, pszClass, nPriority, pszMoveAE, hDS)

HDICOMNET hNet;

/* a DICOM Network handle */

L_UCHAR nPresentationID;

/* presentation ID */

L_UINT16 nMessageID;

/* message ID */

L_CHAR * pszClass;

/* class type */

L_UINT16 nPriority;

/* priority of the message */

L_CHAR * pszMoveAE;

/* name of the application entity */

HDICOMDS hDS;

/* data set to be moved */

Sends a C-MOVE-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.

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 to which to move the data.

hDS

Pointer to the data set to be moved.

Returns

0

SUCCESS

>0

An error occurred. Refer to Return Codes.

Comments

Calling this function generates a call to RECEIVECMOVEREQUESTCALLBACK on the SCP. The SCP should respond by calling L_DicomSendCMoveResponse which will generate a call to RECEIVECMOVERESPONSECALLBACK.

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_DicomSendCMoveResponse, L_DicomSendCStoreRequest, RECEIVECMOVEREQUESTCALLBACK, RECEIVECMOVERESPONSECALLBACK, RECEIVECSTOREREQUESTCALLBACK, RECEIVECSTORERESPONSECALLBACK

Topics:

Working with DICOM Network Connections

Example

HWND hList;      /* handle to list box */
HDICOMNET hNet;
L_CHAR gszGetFile[L_MAXPATH];

L_VOID TestSendCMove(L_VOID)
{
   L_CHAR szClassUID[200];
   L_CHAR szAE[200];
   L_CHAR szMsg[200];
   HDICOMPDU hPDU;
   L_UCHAR nID;
   HDICOMDS hDS=NULL;
   pDICOMTAG pTag=NULL;
   pDICOMELEMENT pElement=NULL;

   
   /* send a Move Request to the server */
   
   /* 
       gszGetFile is a global variable that will be used when we get
       the C-STORE-RQ event to store the file
   */
   lstrcpy(gszGetFile, "d:\\temp\\move_request.dic");
   
   /* this demo uses fixed values */
   lstrcpy(szClassUID, UID_NM_IMAGE_STORAGE);
   
   /* create the data set that encodes the identifier to be matched */
   hDS = L_DicomCreateDS(NULL);
   L_DicomInitDS(hDS, CLASS_UNKNOWN, 0);
   
   /* add the required elements */
   pTag = L_DicomFindTag(TAG_QUERY_RETRIEVE_LEVEL);
   pElement = L_DicomInsertElement(hDS, NULL, FALSE, TAG_QUERY_RETRIEVE_LEVEL, pTag->nVR, FALSE, 0);
   L_DicomSetStringValue(hDS, pElement, "PATIENT", 1);
   
   pTag = L_DicomFindTag(TAG_PATIENT_NAME);
   pElement = L_DicomInsertElement(hDS, NULL, FALSE, TAG_PATIENT_NAME, pTag->nVR, FALSE, 0);

   pTag = L_DicomFindTag(TAG_PATIENT_ID);
   pElement = L_DicomInsertElement(hDS, NULL, FALSE, TAG_PATIENT_ID, pTag->nVR, FALSE, 0);

   pTag = L_DicomFindTag(TAG_PATIENT_BIRTH_DATE);
   pElement = L_DicomInsertElement(hDS, NULL, FALSE, TAG_PATIENT_BIRTH_DATE, pTag->nVR, FALSE, 0);

   pTag = L_DicomFindTag(TAG_PATIENT_SEX);
   pElement = L_DicomInsertElement(hDS, NULL, FALSE, TAG_PATIENT_SEX, pTag->nVR, FALSE, 0);
   pTag = L_DicomFindTag(TAG_NUMBER_OF_PATIENT_RELATED_INSTANCES);
   pElement = L_DicomInsertElement(hDS, NULL, FALSE, TAG_NUMBER_OF_PATIENT_RELATED_IMAGES, pTag->nVR, FALSE, 0);
   
   hPDU = L_DicomGetAssociate(hNet);
   lstrcpy(szAE, L_DicomGetCalling(hPDU));
   
   /* 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
   {
      /* we are asking the Called AE to move the SOP Instance to ourselves */
      L_DicomSendCMoveRequest(hNet, nID, 1, szClassUID, COMMAND_PRIORITY_MEDIUM, szAE, hDS);
   }
   /* we now must wait for the response and for the C-STORE sub-operations */
   L_DicomFreeDS(hDS);
}