GetDateValue Example for Delphi
Procedure TForm1.TestProc();
var
nCount: Integer;
nRet: Integer;
begin
LEADDicomDS1.EnableMethodErrors:= False;
//move to the root element
LEADDicomDS1.MoveFirstElement (False);
LEADDicomDS1.MoveRootElement ();
//insert a new element for the Date Value
LEADDicomDS1.InsertElement (False, TAG_PATIENT_BIRTH_DATE, VR_DA, False, 0);
//insert an Date value into the element
LEADDicomDS1.DateValueCount:= 1;
LEADDicomDS1.DateValues [0].Year:= 1971;
LEADDicomDS1.DateValues [0].Month:= 12;
LEADDicomDS1.DateValues [0].Day:= 12;
//set the date
nRet:= LEADDicomDS1.SetDateValue (1);
if(nRet <> 0)then
begin
ShowMessage('Error');
Exit;
end;
LEADDicomDS1.DateValueCount:= 0; //free the value
Edit1.Visible:= True;
Edit1.Text:= '';
//get the value count
nCount:= LEADDicomDS1.GetValueCount ();
ShowMessage('There are ' + IntToStr(nCount) + ' values!');
//get the value
nRet:= LEADDicomDS1.GetDateValue (0, nCount);
//display the value
Edit1.Text:= 'Year: ' + IntToStr(LEADDicomDS1.DateValues [0].Year) + ' Month: ' + IntToStr(LEADDicomDS1.DateValues [0].Month) + ' Day: ' + IntToStr(LEADDicomDS1.DateValues [0].Day);
LEADDicomDS1.EnableMethodErrors:= True;
ShowMessage('wait');
end;