Procedure

TfrmODDiet.DietChange

Module

fODDiet

Last Modified

7/15/2014 3:26:42 PM

Visibility

Public/Published

Owner

TfrmODDiet

Declaration

procedure DietChange(Sender: TObject);

Calls Hierarchy


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

Called-By Hierarchy


                 TfrmODDiet.DietChange
 TfrmODDiet.SetValuesFromResponsesDO┤ 
            TfrmODDiet.SetupDialog┤ │ 
 TfrmODDiet.cboDietAvailMouseClick┘ │ 
     TfrmODDiet.cboDietAvailExit┘   │ 
TfrmODDiet.cboDietAvailMouseClick...┤ 
           TfrmODDiet.cmdRemoveClick┘ 

Calls

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

Called-By

Name Declaration Comments
TfrmODDiet.cboDietAvailMouseClick procedure cboDietAvailMouseClick(Sender: TObject); -
TfrmODDiet.cmdRemoveClick procedure cmdRemoveClick(Sender: TObject); -
TfrmODDiet.SetValuesFromResponsesDO procedure SetValuesFromResponsesDO; -


Source

1143  procedure TfrmODDiet.DietChange(Sender: TObject);
1144  var
1145    i: Integer;
1146  begin
1147    inherited;
1148    if Changing then Exit;
1149    if Sender <> Self then Responses.Clear;       // Sender=Self when called from SetupDialog
1150    with calDietStart   do {if Length(Text) > 0 then} Responses.Update('START',     1, Text,   Text);
1151    with calDietStop    do {if Length(Text) > 0 then} Responses.Update('STOP',      1, Text,   Text);
1152    with lstDietSelect  do for i := 0 to Items.Count - 1 do
1153      Responses.Update('ORDERABLE', i+1, Piece(Items[i], U, 1), Piece(Items[i], U, 2));
1154    with txtDietComment do {if Length(Text) > 0 then} Responses.Update('COMMENT',   1, Text,   Text);
1155    with cboDelivery    do if Visible            then Responses.Update('DELIVERY',  1, ItemID, Text);
1156    with chkCancelTubefeeding do case State of
1157                                   cbChecked:   Responses.Update('CANCEL', 1, '1', 'YES');
1158                                   cbUnchecked: Responses.Update('CANCEL', 1, '0', 'NO');
1159                                 end;
1160    with lstDietSelect do if (Items.Count = 1) and (GetIEN(0) = uDietParams.NPOIEN) then
1161    begin
1162      if Frac(calDietStart.FMDateTime) > 0.2358 then Responses.VarTrailing := 'at Midnight';
1163    end
1164    else Responses.VarTrailing := 'Diet';
1165    memOrder.Text := Responses.OrderText;
1166  end;