SendNActionRequest Example for Delphi
//this sample shows how to send an N-ACTION-REQUEST
var
nRet: Integer;
strClassUID: String;
strInstance: String;
hPDU: LongInt;
nID: Integer;
nAction: Integer;
begin
//send an N-ACTION-REQUEST to the server
nAction:= StrToInt(InputBox('What Action(1..10)?', 'Action Request', '1'));
strClassUID:= InputBox('What class?', 'Action Request', UID_BASIC_FILM_BOX_CLASS);
if(Length(strClassUID) < 1)then
Exit;
strInstance:= InputBox('What instance?', 'Action Request', '1.1.1.1');
if(Length(strInstance) < 1)then
Exit;
//here you would create a data set that encodes the Action Arguments
//for this example, we just load a dataset
//...
nRet:= LEADDicomDS1.LoadDS ('e:\images\dicom16.dic', 0);
hPDU:= LEADDICOMNet1.GetAssociate (LEADDICOMNet1.hNet);
//now, send a request
nID:= LEADDICOMNet1.FindPresentationAbstract (hPDU, strClassUID);
if(nID = 0)then
begin
nRet:= LEADDicomDS1.FindUID (strClassUID);
if(nRet = 0)then
ShowMessage('Abstract Syntax, ' + LEADDicomDS1.DefaultInterface.Get_CurrentUID().Name + ', Not Supported by Association!')
Else
ShowMessage('Abstract Syntax, ' + strClassUID + ', Not Supported by Association!');
Exit;
end;
LEADDICOMNet1.SendNActionRequest(LEADDICOMNet1.hNet, nID, 1, strClassUID, strInstance, nAction, LEADDicomDS1.hDicomDS);
end;