Function

TfrmODLab.ValidCollTime

Module

fODLab

Last Modified

7/15/2014 3:26:42 PM

Visibility

Protected

Owner

TfrmODLab

Declaration

function  ValidCollTime(UserEntry: string): string;

Calls Hierarchy


TfrmODLab.ValidCollTime
 └StrToFMDateTime

Called-By Hierarchy


                     TfrmODLab.ValidCollTime
                   TfrmODLab.ControlChange┤ 
                   TfrmODLab.SetupDialog┤ │ 
                      TfrmODLab.Validate┤ │ 
            TfrmODLab.cboAvailTestSelect┤ │ 
                 TfrmODLab.SetupDialog┤ │ │ 
            TfrmODLab.cboAvailTestExit┘ │ │ 
             TfrmODLab.cboCollSampChange┤ │ 
                 TfrmODLab.SetupDialog┤ │ │ 
       TfrmODLab.cboAvailTestSelect...┘ │ │ 
              TfrmODLab.cboUrgencyChange┤ │ 
             TfrmODLab.cboSpecimenChange┤ │ 
             TfrmODLab.cboCollTimeChange┤ │ 
            TfrmODLab.cboFrequencyChange┤ │ 
                 TfrmODLab.SetupDialog┤ │ │ 
       TfrmODLab.cboAvailTestSelect...┘ │ │ 
             TfrmODLab.cboCollTypeChange┤ │ 
           TfrmODLab.txtOrderCommentExit┤ │ 
          TfrmODLab.txtAntiCoagulantExit┤ │ 
            TfrmODLab.txtUrineVolumeExit┤ │ 
            TfrmODLab.grpPeakTroughClick┤ │ 
          TfrmODLab.txtAddlCommentExit┘ │ │ 
               TfrmODLab.txtDoseTimeExit┤ │ 
               TfrmODLab.txtDrawTimeExit┤ │ 
           TfrmODLab.cboCollSampKeyPause┤ │ 
         TfrmODLab.cboCollSampMouseClick┤ │ 
               TfrmODLab.cboCollTimeExit┤ │ 
         TfrmODLab.cboSpecimenMouseClick┤ │ 
           TfrmODLab.cboSpecimenKeyPause┘ │ 
                  TfrmODLab.SetupCollTimes┘ 
                    TfrmODLab.FormCreate┤   
                   TfrmODLab.SetupDialog┤   
                  TfrmODLab.LoadCollType┤   
        TfrmODLab.cboCollSampChange...┤ │   
 TfrmODLab.DetermineCollectionDefaults┘ │   
               TfrmODLab.SetupDialog┤   │   
     TfrmODLab.cboAvailTestSelect...┘   │   
             TfrmODLab.cboCollTypeChange┤   
TfrmODLab.DetermineCollectionDefaults...┘   

Calls

Name Declaration Comments
StrToFMDateTime function StrToFMDateTime(const AString: string): TFMDateTime; -

Called-By

Name Declaration Comments
TfrmODLab.ControlChange procedure ControlChange(Sender: TObject); -
TfrmODLab.SetupCollTimes procedure SetupCollTimes(CollType: string); -


Source

1828  function TfrmODLab.ValidCollTime(UserEntry: string): string;
1829  var
1830    i: integer;
1831  const
1832    FMDateResponses: array[0..3] of string = ('TODAY','NOW','NOON','MID');
1833  begin
1834    Result := '';
1835    UserEntry := UpperCase(UserEntry);
1836    if StrToFMDateTime(UserEntry) < 0 then exit;
1837    if (UserEntry = 'T') or
1838       (UserEntry = 'N') or
1839       (Copy(UserEntry,1,2)='T+') or
1840       (Copy(UserEntry,1,2)='T@') or
1841       (Copy(UserEntry,1,2)='T-') or
1842       (Copy(UserEntry,1,2)='N+') then Result := UserEntry
1843    else
1844       for i := 0 to 3 do if Pos(FMDateResponses[i],UserEntry)>0 then Result := UserEntry ;
1845    if Result = '' then Result := FloatToStr(StrToFMDateTime(UserEntry));
1846  end;