SendCStoreRequest Example for Delphi
var
nRet: Integer;
hPDU: LongInt;
nID: Integer;
strClassUID: String;
strInstanceUID: String;
begin
//send a store request to the server
hPDU:= LEADDICOMNet1.GetAssociate (LEADDICOMNet1.hNet);
//pick the data set to send
nRet:= LEADDicomDS1.LoadDS ('e:\images\dicom16.dic', 0);
if(nRet <> 0)then
begin
Application.MessageBox('Error Loading Data Set!', 'Error', MB_OK);
Screen.Cursor:= crDefault;
Exit;
end;
LEADDicomDS1.FindFirstElement (TAG_SOP_INSTANCE_UID, False);
LEADDicomDS1.GetStringValue (0, 1);
strInstanceUID:= LEADDicomDS1.StringValues [0];
LEADDicomDS1.MoveFirstElement (False);
LEADDicomDS1.FindFirstElement (TAG_SOP_CLASS_UID, False);
LEADDicomDS1.GetStringValue (0, 1);
strClassUID:= LEADDicomDS1.StringValues [0];
//send the command set
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!');
Screen.Cursor:= crDefault;
Exit;
end;
LEADDICOMNet1.SendCStoreRequest(LEADDICOMNet1.hNet, nID, 999, strClassUID, strInstanceUID, COMMAND_PRIORITY_MEDIUM, '', 0, LEADDicomDS1.hDicomDS);
Screen.Cursor:= crDefault;
end;