NetReceiveNActionRequest Example for Delphi
procedure TForm1.LEADDicomNet1NetReceiveNActionRequest(ASender: TObject;
hNet: Integer; nPresentationID, nMessageID: Smallint; const pszClass,
pszInstance: WideString; nAction: Smallint; hDS: Integer);
var
nRet: Integer;
NewNode: TTreeNode;
strName: String;
begin
NewNode:= TreeView1.Items.Add(TreeView1.Selected, 'Command Set - ' + 'N-ACTION-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, 'Requested SOP Class: ' + strName + ' - ' + pszClass);
end
else
TreeView1.Items.Add(NewNode, 'Requested SOP Class: ' + pszClass);
TreeView1.Items.Add(NewNode, 'Requested SOP Instance: ' + pszInstance);
TreeView1.Items.Add(NewNode, 'Action: ' + IntToStr(nAction));
//this function should perform the action command
nRet:= PerformACTIONCommand(pszClass, pszInstance, hDS);
if(nRet <> DICOM_SUCCESS)then
nRet:= COMMAND_STATUS_PROCESSING_FAILURE;
//send a response
LEADDICOMNet1.SendNActionResponse(hNet, nPresentationID, nMessageID, pszClass, pszInstance, nRet, nAction, hDS);
end;