SendCStoreResponse Example for Delphi
procedure TForm1.LEADDicomNet1NetReceiveCStoreRequest(ASender: TObject;
hNet: Integer; nPresentationID, nMessageID: Smallint; const pszClass,
pszInstance: WideString; nPriority: Smallint;
const pszMoveAE: WideString; nMoveMessageID: Smallint; hDS: Integer);
var
nRet: Integer;
NewNode: TTreeNode;
strName: String;
strReply: String;
begin
NewNode:= TreeView1.Items.Add(TreeView1.Selected, 'Command Set - ' + 'C-STORE-REQUEST');
NewNode.MakeVisible();
TreeView1.Items.Add(NewNode, 'Presentation ID: ' + IntToStr(nPresentationID));
TreeView1.Items.Add(NewNode, 'Message ID: ' + IntToStr(nMessageID));
nRet:= LEADDicomDS1.FindUID (pszClass);
if(nRet = 0)then
begin
strName:= LEADDicomDS1.DefaultInterface.Get_CurrentUID().Name;
TreeView1.Items.Add(NewNode, 'Affected SOP Class: ' + strName + ' - ' + pszClass);
end
else
TreeView1.Items.Add(NewNode, 'Affected SOP Class: ' + pszClass);
TreeView1.Items.Add(NewNode, 'Affected SOP Instance: ' + pszInstance);
TreeView1.Items.Add(NewNode, 'Priority: ' + IntToStr(nPriority));
TreeView1.Items.Add(NewNode, 'Move AE Title: ' + pszMoveAE);
TreeView1.Items.Add(NewNode, 'Move Message ID: ' + IntToStr(nMoveMessageID));
//perform the store - this is a function that you have to write
nRet:= PerformSTORECommand(hDS);
//send a response
strReply:= 'Store Response Command Set Sent - ';
//use high-level method to send a response
LEADDICOMNet1.SendCStoreResponse(hNet, nPresentationID, nMessageID, pszClass, pszInstance, nRet);
ShowMessage(strReply + LEADDICOMNet1.GetPeerAddress (hNet));
end;