Procedure

TfrmODDiet.TFChange

Module

fODDiet

Last Modified

7/15/2014 3:26:42 PM

Visibility

Public/Published

Owner

TfrmODDiet

Declaration

procedure TFChange(Sender: TObject);

Calls Hierarchy


TfrmODDiet.TFChange
 ├TResponses.Clear
 ├TResponses.Update
 │ ├TResponses.FindResponseByName
 │ └TResponses.IENForPrompt
 ├TfrmODDiet.TFStrengthCode
 ├TfrmODBase.OrderForInpatient
 │ ├OrderEventTypeOnCreate
 │ └IsPassEvt1
 └TResponses.GetOrderText
   ├TResponses.NextInstance
   ├TResponses.FindResponseByName
   ├TResponses.FormatResponse
   │ └TResponses.FindResponseByIEN
   └TResponses.AppendChildren
     ├TResponses.FindPromptByIEN
     ├TResponses.FindResponseByIEN
     └TResponses.FormatResponse...

Called-By Hierarchy


                  TfrmODDiet.TFChange
TfrmODDiet.SetValuesFromResponsesTF┤ 
           TfrmODDiet.SetupDialog┤ │ 
  TfrmODDiet.cboProductMouseClick┘ │ 
      TfrmODDiet.cboProductExit┘   │ 
 TfrmODDiet.cboProductMouseClick...┤ 
       TfrmODDiet.cboStrengthChange┤ 
         TfrmODDiet.cboStrengthExit┤ 
       TfrmODDiet.txtQuantityChange┤ 
         TfrmODDiet.txtQuantityExit┤ 
        TfrmODDiet.cmdTFRemoveClick┘ 

Calls

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

Called-By

Name Declaration Comments
TfrmODDiet.cboProductMouseClick procedure cboProductMouseClick(Sender: TObject); -
TfrmODDiet.cboStrengthChange procedure cboStrengthChange(Sender: TObject); -
TfrmODDiet.cboStrengthExit procedure cboStrengthExit(Sender: TObject); -
TfrmODDiet.cmdTFRemoveClick procedure cmdTFRemoveClick(Sender: TObject); -
TfrmODDiet.SetValuesFromResponsesTF procedure SetValuesFromResponsesTF; -
TfrmODDiet.txtQuantityChange procedure txtQuantityChange(Sender: TObject); -
TfrmODDiet.txtQuantityExit procedure txtQuantityExit(Sender: TObject); -


Source

1488  procedure TfrmODDiet.TFChange(Sender: TObject);
1489  var
1490    i: Integer;
1491    AProduct: TTFProduct;
1492  
1493  begin
1494    inherited;
1495    if Changing then Exit;
1496    if Sender <> Self then Responses.Clear;       // Sender=Self when called from SetupDialog
1497    with grdSelected do for i := 0 to RowCount - 1 do
1498    begin
1499      AProduct := TTFProduct(Objects[0, i]);
1500      if AProduct = nil then Continue;
1501      with AProduct do if IEN > 0
1502        then Responses.Update('ORDERABLE', i+1, IntToStr(IEN), Name);
1503      if TFStrengthCode(Cells[1,i]) > 0
1504        then Responses.Update('STRENGTH',  i+1, IntToStr(TFStrengthCode(Cells[1,i])), Cells[1,i]);
1505      if Length(Cells[2,i]) > 0
1506        then Responses.Update('INSTR',     i+1, Cells[2,i], Cells[2,i]);
1507    end; {with grdSelected}
1508    with txtTFComment do if Text <> ''
1509      then Responses.Update('COMMENT', 1, Text, Text);
1510    with chkCancelTrays do if Checked
1511      then Responses.Update('CANCEL', 1, '1', 'Yes')
1512      else Responses.Update('CANCEL', 1, '0', 'No');
1513    if not OrderForInpatient then
1514    begin
1515      calOPTFStart.FMDateTime := StrToFloatDef(cboOPTFRecurringMeals.ItemID, 0);
1516      Responses.Update('DATETIME', 1, FloatToStr(calOPTFStart.FMDateTime), calOPTFStart.Text);
1517    end;
1518    memOrder.Text := Responses.OrderText;
1519  end;