DcmSCP:how to reply C-Get Request

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Posts: 32
Joined: Wed, 2012-06-06, 07:38

DcmSCP:how to reply C-Get Request

#1 Post by qimo601 » Thu, 2012-11-15, 04:05


As it said in chapter4 :

The C-GET operation allows an application entity to instruct another application entity to transfer stored SOP Instances to the initiating applicationentity using the C-STORE operation. Support for the C-GET service shall be agreed upon at Association establishment time by both the SCU and SCP of the C-GET in order for a C-GET operation to occur over the Association. The C-STORE Sub-operations shall be accomplished on the same Association as the C-GET operation. Hence, the SCP of the Query/Retrieve Service Class serves as the SCU of the Storage Service Class.

My question:
how to use the same association accomplish the C-Store Sub-operations??????
how to start a new C-STORE Sub-operation with the same association??????

My code:

Code: Select all

OFCondition DcmSCP::handleGetRequest(T_DIMSE_C_GetRQ &reqMessage,
									  const T_ASC_PresentationContextID presID)
	OFString tempStr;
	// Dump debug information
	if (DCM_dcmnetLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL))
		DCMNET_INFO("Received C-Get Request");
		DCMNET_DEBUG(DIMSE_dumpMessage(tempStr, reqMessage, DIMSE_INCOMING, NULL, presID));
		DCMNET_INFO("Sending C-Get Response");
	} else {
		DCMNET_INFO("Received C-Get Request (MsgID " << reqMessage.MessageID << ")");
		DCMNET_INFO("Sending C-Get Response (" << DU_cechoStatusString(STATUS_Success) << ")");

	//// intialize some variables
	//GetCallbackData callbackData;
	//callbackData.assoc = m_assoc;
	//callbackData.imageFileName = "aaaa.DCM";
	//DcmFileFormat dcmff;
	//callbackData.dcmff = &dcmff;
	//callbackData.presID = presID;
	void * callbackData = NULL;
	OFCondition cond = DIMSE_getProvider(m_assoc,presID,&reqMessage,getProviderCallback, callbackData, DIMSE_BLOCKING,5);
	return cond;

void DcmSCP::getProviderCallback(
	/* in */
	void *callbackData,
	OFBool cancelled, T_DIMSE_C_GetRQ *request,
	DcmDataset *requestIdentifiers, int responseCount,
	/* out */
	T_DIMSE_C_GetRSP *response,
	DcmDataset **responseIdentifiers,
	DcmDataset **statusDetail)

	OFString queryRetrieveLevel;
	OFString patientId;
	OFString studyInstanceUID;
	OFString seriesInstanceUID;
	OFString sopInstanceUID;

	OFCondition result = requestIdentifiers->findAndGetOFStringArray(DCM_QueryRetrieveLevel,queryRetrieveLevel);
	result = requestIdentifiers->findAndGetOFStringArray(DCM_StudyInstanceUID,studyInstanceUID);
	result = requestIdentifiers->findAndGetOFStringArray(DCM_SeriesInstanceUID,seriesInstanceUID);
	result = requestIdentifiers->findAndGetOFStringArray(DCM_SOPInstanceUID,sopInstanceUID);

	//OFList<OFString> ts;
	//OFCondition m1 = storeSCU.addPresentationContext(UID_DICOS_CTImageStorage, ts);

	T_ASC_PresentationContextID presID = findPresentationContextID(UID_DICOS_CTImageStorage,UID_LittleEndianExplicitTransferSyntax);
	OFString dcmFileName = "aaaa.DCM";
	DcmDataset dataset;
	Uint16 rspStatusCode;
	sendSTORERequest(presID, dcmFileName, &dataset, rspStatusCode);
Thanks for your help.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest