InsertUID Example for Delphi
var
nRet: Integer;
sOutput: String;
begin
LEADDicom1.EnableMethodErrors := false;
nRet := LEADDicom1.FindUID('1.2.840.10008.1.3');
If nRet = SUCCESS Then
begin
ShowMessage('Already Exists!');
Exit;
End;
nRet := LEADDicom1.InsertUID('1.2.840.10008.1.3', 'My Test UID');
If nRet <> SUCCESS Then
begin
ShowMessage('Error Number: ' + IntToStr(LEADDicom1.Error));
Exit;
End;
LEADDicom1.EnableMethodErrors := true;
try
{ add item to the ListView control }
sOutput := 'UID Inserted:'#13;
sOutput := sOutput + 'Code: ' + LEADDicom1.CurrentUID.Code + #13;
sOutput := sOutput + 'Name: ' + LEADDicom1.CurrentUID.Name;
ShowMessage(sOutput);
except
ShowMessage('Error Number: ' + IntToStr(LEADDicom1.Error));
end;
End;