SendNCreateResponse Example for Delphi
procedure TForm1.LEADDicomNet1NetReceiveNCreateRequest(ASender: TObject;
hNet: Integer; nPresentationID, nMessageID: Smallint; const pszClass,
pszInstance: WideString; hDS: Integer);
var
nRet: Integer;
NewNode: TTreeNode;
strReply: String;
strName: String;
begin
NewNode:= TreeView1.Items.Add(TreeView1.Selected, 'Command Set - ' + 'N-CREATE-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);
//This is a function that would perform the actual creation of the SOP Instance
nRet:= PerformCREATECommand(pszClass, pszInstance, hDS);
if(nRet <> DICOM_SUCCESS)then
nRet:= COMMAND_STATUS_PROCESSING_FAILURE;
//send a response
strReply:= 'Create Response Command Set Sent - ';
//note, we simply send back the passed hDS in this sample
LEADDICOMNet1.SendNCreateResponse(hNet, nPresentationID, nMessageID, pszClass, pszInstance, nRet, hDS);
end;