Procedure

TfrmODDiet.ELChange

Module

fODDiet

Last Modified

7/15/2014 3:26:42 PM

Visibility

Public/Published

Owner

TfrmODDiet

Declaration

procedure ELChange(Sender: TObject);

Calls Hierarchy


TfrmODDiet.ELChange
 ├TResponses.Clear
 ├TResponses.Update
 │ ├TResponses.FindResponseByName
 │ └TResponses.IENForPrompt
 ├TfrmODDiet.GetMealTime
 ├TfrmODDiet.IsEarlyTray
 ├TfrmODBase.OrderForInpatient
 │ ├OrderEventTypeOnCreate
 │ └IsPassEvt1
 ├TfrmODDiet.GetDaysOfWeek
 └TResponses.GetOrderText
   ├TResponses.NextInstance
   ├TResponses.FindResponseByName
   ├TResponses.FormatResponse
   │ └TResponses.FindResponseByIEN
   └TResponses.AppendChildren
     ├TResponses.FindPromptByIEN
     ├TResponses.FindResponseByIEN
     └TResponses.FormatResponse...

Called-By Hierarchy


                       TfrmODDiet.ELChange
     TfrmODDiet.SetValuesFromResponsesEL┤ 
                TfrmODDiet.SetupDialog┘ │ 
                 TfrmODDiet.grpMealClick┤ 
TfrmODDiet.SetValuesFromResponsesEL...┘ │ 
             TfrmODDiet.calELStartChange┤ 
              TfrmODDiet.calELStopChange┘ 
TfrmODDiet.SetValuesFromResponsesEL...┘   

Calls

Name Declaration Comments
TResponses.Clear procedure Clear; overload; -
TfrmODDiet.GetDaysOfWeek function GetDaysOfWeek: string; -
TfrmODDiet.GetMealTime function GetMealTime: string; -
TResponses.GetOrderText function GetOrderText: string; -
TfrmODDiet.IsEarlyTray function IsEarlyTray: Boolean; -
TfrmODBase.OrderForInpatient function OrderForInpatient: Boolean; -
TResponses.Update procedure Update(const APromptID: string; AnInstance: Integer; const AnIValue, AnEValue: string); -

Called-By

Name Declaration Comments
TfrmODDiet.calELStartChange procedure calELStartChange(Sender: TObject); -
TfrmODDiet.calELStopChange procedure calELStopChange(Sender: TObject); -
TfrmODDiet.grpMealClick procedure grpMealClick(Sender: TObject); -
TfrmODDiet.SetValuesFromResponsesEL procedure SetValuesFromResponsesEL; -


Source

1748  procedure TfrmODDiet.ELChange(Sender: TObject);
1749  var
1750    x: string;
1751  begin
1752    inherited;
1753    if Changing then Exit;
1754    if Sender <> Self then Responses.Clear;       // Sender=Self when called from SetupDialog
1755    case grpMeal.ItemIndex of
1756    0: Responses.Update('MEAL', 1, 'B', 'BREAKFAST');
1757    1: Responses.Update('MEAL', 1, 'N', 'NOON');
1758    2: Responses.Update('MEAL', 1, 'E', 'EVENING');
1759    end;
1760    x := GetMealTime;
1761    if Length(x) > 0 then
1762    begin
1763      Responses.Update('TIME', 1, x, x);
1764      if IsEarlyTray
1765        then Responses.Update('ORDERABLE', 1, uDietParams.EarlyIEN, 'EARLY TRAY')
1766        else Responses.Update('ORDERABLE', 1, uDietParams.LateIEN,  'LATE TRAY');
1767    end;
1768    if not OrderForInpatient then
1769    begin
1770      calELStart.FMDateTime := StrToFloatDef(cboOPELRecurringMeals.ItemID, 0);
1771      calELStop.FMDateTime := calELStart.FMDateTime;
1772    end;
1773    with calELStart   do if Length(Text) > 0 then Responses.Update('START',     1, Text,   Text);
1774    with calELStop    do if Length(Text) > 0 then Responses.Update('STOP',      1, Text,   Text);
1775    x := GetDaysOfWeek;
1776    if Length(x) > 0 then Responses.Update('SCHEDULE', 1, x, x);
1777    if chkBagged.Checked
1778      then Responses.Update('YN', 1, '1', 'YES')
1779      else Responses.Update('YN', 1, '0', 'NO');
1780    memOrder.Text := Responses.OrderText;
1781  end;