GetTimeValue 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 Time Value
LEADDicomDS1.InsertElement (False, TAG_PATIENT_BIRTH_TIME, VR_TM, False, 0);
//insert an Time value into the element
LEADDicomDS1.TimeValueCount:= 1;
LEADDicomDS1.TimeValues [0].Hours:= 12;
LEADDicomDS1.TimeValues [0].Minutes:= 25;
LEADDicomDS1.TimeValues [0].Seconds:= 33;
LEADDicomDS1.TimeValues [0].Fractions:= 50;
//set the time
nRet:= LEADDicomDS1.SetTimeValue (1);
if(nRet <> 0)then
begin
ShowMessage('Error');
Exit;
end;
LEADDicomDS1.TimeValueCount:= 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.GetTimeValue (0, nCount);
//display the value
Edit1.Text:= 'Hours: ' + IntToStr(LEADDicomDS1.TimeValues [0].Hours) + ' Minutes: ' + IntToStr(LEADDicomDS1.TimeValues [0].Minutes) + ' Seconds: ' + IntToStr(LEADDicomDS1.TimeValues [0].Seconds) + ' Fractions: ' + IntToStr(LEADDicomDS1.TimeValues [0].Fractions);
LEADDicomDS1.EnableMethodErrors:= True;
ShowMessage('wait');
end;