Procedure

TfrmODDiet.OPChange

Module

fODDiet

Last Modified

7/15/2014 3:26:42 PM

Comments

I: integer;

Visibility

Public/Published

Owner

TfrmODDiet

Declaration

procedure OPChange(Sender: TObject);

Calls Hierarchy


TfrmODDiet.OPChange
 ├TResponses.Clear
 ├TResponses.Update
 │ ├TResponses.FindResponseByName
 │ └TResponses.IENForPrompt
 ├TfrmODDiet.GetOPDaysOfWeek
 └TResponses.GetOrderText
   ├TResponses.NextInstance
   ├TResponses.FindResponseByName
   ├TResponses.FormatResponse
   │ └TResponses.FindResponseByIEN
   └TResponses.AppendChildren
     ├TResponses.FindPromptByIEN
     ├TResponses.FindResponseByIEN
     └TResponses.FormatResponse...

Called-By Hierarchy


                       TfrmODDiet.OPChange
     TfrmODDiet.cboOPDietAvailMouseClick┤ 
              TfrmODDiet.nbkDietChange┤ │ 
               TfrmODDiet.InitDialog┤ │ │ 
              TfrmODDiet.SetupDialog┤ │ │ 
                           ..(rec)..┘ │ │ 
         TfrmODDiet.cboOPDietAvailExit┤ │ 
      TfrmODDiet.cboOPDietAvailKeyDown┘ │ 
     TfrmODDiet.SetValuesFromResponsesOP┤ 
                TfrmODDiet.SetupDialog┤ │ 
TfrmODDiet.cboOPDietAvailMouseClick...┘ │ 
             TfrmODDiet.calOPStartChange┤ 
              TfrmODDiet.calOPStopChange┤ 
TfrmODDiet.SetValuesFromResponsesOP...┘ │ 
               TfrmODDiet.grpOPMealClick┤ 
             TfrmODDiet.cmdOPRemoveClick┘ 

Calls

Name Declaration Comments
TResponses.Clear procedure Clear; overload; -
TfrmODDiet.GetOPDaysOfWeek function GetOPDaysOfWeek: string; -
TResponses.GetOrderText function GetOrderText: string; -
TResponses.Update procedure Update(const APromptID: string; AnInstance: Integer; const AnIValue, AnEValue: string); -

Called-By

Name Declaration Comments
TfrmODDiet.calOPStartChange procedure calOPStartChange(Sender: TObject); -
TfrmODDiet.calOPStopChange procedure calOPStopChange(Sender: TObject); -
TfrmODDiet.cboOPDietAvailMouseClick procedure cboOPDietAvailMouseClick(Sender: TObject); -
TfrmODDiet.cmdOPRemoveClick procedure cmdOPRemoveClick(Sender: TObject); -
TfrmODDiet.grpOPMealClick procedure grpOPMealClick(Sender: TObject); -
TfrmODDiet.SetValuesFromResponsesOP procedure SetValuesFromResponsesOP; -


Source

2078  procedure TfrmODDiet.OPChange(Sender: TObject);
2079  var
2080    x: string;
2081    //i: integer;
2082  begin
2083    inherited;
2084    if Changing then Exit;
2085    if Sender <> Self then Responses.Clear;       // Sender=Self when called from SetupDialog
2086    // Per NFS, only one selection allowed from any of 10-15 available OP diets
2087    with lstOPDietSelect do if Items.Count > 0 then
2088      Responses.Update('ORDERABLE', 1, Piece(Items[0], U, 1), Piece(Items[0], U, 2));
2089    case grpOPMeal.ItemIndex of
2090      0: Responses.Update('MEAL', 1, 'B', 'BREAKFAST');
2091      1: Responses.Update('MEAL', 1, 'N', 'NOON');
2092      2: Responses.Update('MEAL', 1, 'E', 'EVENING');
2093    end;
2094    with calOPStart   do (*if Length(Text) > 0 then*) Responses.Update('START',     1, Text,   Text);
2095    with calOPStop    do (*if Length(Text) > 0 then*) Responses.Update('STOP',      1, Text,   Text);
2096    if uDialogName = 'FHW OP MEAL' then
2097      begin
2098        x := GetOPDaysOfWeek;
2099        if Length(x) = 0 then x := 'ONCE';
2100        Responses.Update('SCHEDULE', 1, x, x);
2101      end;
2102    with txtOPDietComment do {if Length(Text) > 0 then} Responses.Update('COMMENT',   1, Text,   Text);
2103    with cboOPDelivery    do if Visible            then Responses.Update('DELIVERY',  1, ItemID, Text);
2104  { TODO -oRich V. -cOutpatient Meals : Need to DC Tubefeeding order for OP meals? }
2105  (*  with chkOPCancelTubefeeding do case State of
2106                                   cbChecked:   Responses.Update('CANCEL', 1, '1', 'YES');
2107                                   cbUnchecked: Responses.Update('CANCEL', 1, '0', 'NO');
2108                                 end;*)
2109    Responses.VarTrailing := 'Meal';
2110    memOrder.Text := Responses.OrderText;
2111  end;