Procedure

TfrmODMedNVA.UpdateStartExpires

Module

fODMedNVA

Last Modified

7/15/2014 3:26:42 PM

Visibility

Private

Owner

TfrmODMedNVA

Declaration

procedure UpdateStartExpires(const CurSchedule: string);

Calls Hierarchy


TfrmODMedNVA.UpdateStartExpires
 ├LoadAdminInfo
 └FMToday
   └FMNow

Called-By Hierarchy


     TfrmODMedNVA.UpdateStartExpires
      TfrmODMedNVA.SetOnQuickOrder┤ 
        TfrmODMedNVA.SetupDialog┤ │ 
     TfrmODMedNVA.btnSelectClick┘ │ 
     TfrmODMedNVA.UMDelayClick┘   │ 
 TfrmODMedNVA.timCheckChangesTimer┤ 
      TfrmODMedNVA.UpdateRelated┘ │ 
      TfrmODMedNVA.SetupDialog┤   │ 
TfrmODMedNVA.btnSelectClick...┤   │ 
   TfrmODMedNVA.cboDosageClick┤   │ 
  TfrmODMedNVA.cboDosageExit┘ │   │ 
  TfrmODMedNVA.cboDosageChange┤   │ 
 TfrmODMedNVA.cboScheduleClick┤   │ 
TfrmODMedNVA.cboScheduleChange┤   │ 
     TfrmODMedNVA.grdDosesExit┘   │ 
          TfrmODMedNVA.chkPRNClick┘ 

Calls

Name Declaration Comments
FMToday function FMToday: TFMDateTime; -
LoadAdminInfo procedure LoadAdminInfo(const Schedule: string; OrdItem: Integer; var StartText: string; var AdminTime: TFMDateTime; var Duration: string; Admin: string = ''); -

Called-By

Name Declaration Comments
TfrmODMedNVA.chkPRNClick procedure chkPRNClick(Sender: TObject); -
TfrmODMedNVA.SetOnQuickOrder procedure SetOnQuickOrder; -
TfrmODMedNVA.timCheckChangesTimer procedure timCheckChangesTimer(Sender: TObject); -


Source

1888  procedure TfrmODMedNVA.UpdateStartExpires(const CurSchedule: string);
1889  var
1890    ShowText, Duration, ASchedule: string;
1891    AdminTime:    TFMDateTime;
1892    Interval, PrnPos: Integer;
1893  begin
1894    if Length(CurSchedule)=0 then Exit;
1895    ASchedule := Trim(CurSchedule);
1896    {if (Pos('^',ASchedule)=0) then  //GE  CQ7506
1897    begin
1898      PrnPos := Pos('PRN',ASchedule);
1899      if (PrnPos > 1) and (CharAt(ASchedule,PrnPos-1) <> ';') then
1900        Delete(ASchedule, PrnPos, Length(ASchedule));
1901    end  }
1902    if (Pos('^',ASchedule)>0) then
1903    begin
1904      PrnPos := Pos('PRN',ASchedule);
1905      if (PrnPos > 1) and (CharAt(ASchedule,PrnPos-1)=' ') then
1906        Delete(ASchedule, PrnPos-1, 4);
1907    end;
1908    ASchedule := Trim(ASchedule);
1909    if Length(ASchedule)>0 then
1910        LoadAdminInfo(ASchedule, txtMed.Tag, ShowText, AdminTime, Duration)
1911    else Exit;
1912    if AdminTime > 0 then
1913    begin
1914      ShowText := 'Expected First Dose: ';
1915      Interval := Trunc(FMDateTimeToDateTime(AdminTime) - FMDateTimeToDateTime(FMToday));
1916      case Interval of
1917      0: ShowText := ShowText + 'TODAY ' + FormatFMDateTime('(mmm dd, yy) at hh:nn', AdminTime);
1918      1: ShowText := ShowText + 'TOMORROW ' + FormatFMDateTime('(mmm dd, yy) at hh:nn', AdminTime);
1919      else ShowText := ShowText + FormatFMDateTime('mmm dd, yy at hh:nn', AdminTime);
1920      end;
1921    lblAdminTime.Caption := ShowText;
1922    FAdminTimeLbl := lblAdminTime.Caption;
1923    end
1924    else lblAdminTime.Caption := '';
1925  end;