Procedure

TfrmODDiet.SetValuesFromResponsesTF

Module

fODDiet

Last Modified

7/15/2014 3:26:42 PM

Visibility

Private

Owner

TfrmODDiet

Declaration

procedure SetValuesFromResponsesTF;

Calls Hierarchy


TfrmODDiet.SetValuesFromResponsesTF
 ├TfrmODDiet.ResetControlsTF
 │ └TfrmODDiet.TFClearGrid
 ├TResponses.NextInstance
 ├TResponses.FindResponseByName
 ├TfrmODDiet.TFSetAmountForRow
 │ ├TfrmODDiet.TFStrengthCode
 │ └ExpandedQuantity
 ├TfrmODBase.OrderForInpatient
 │ ├OrderEventTypeOnCreate
 │ └IsPassEvt1
 ├TResponses.SetControl
 │ ├TResponses.FindResponseByName
 │ └AssignBPText
 │   ├DisplayGroupToLinkType
 │   │ └DisplayGroupByName
 │   ├TResponses.EValueFor
 │   ├GetServiceIEN
 │   ├TResponses.IValueFor
 │   ├GetProcedureIEN
 │   ├ExpandOrderObjects
 │   │ ├TdmodShared.BoilerplateOK
 │   │ │ ├ErrCount
 │   │ │ ├AddErr
 │   │ │ └TdmodShared.LoadTIUObjects
 │   │ │   └GetObjectList
 │   │ └GetTemplateText
 │   │   └TEncounter.GetVisitStr
 │   │     └TEncounter.GetVisitCategory
 │   ├SetTemplateDialogCanceled
 │   ├CheckBoilerplate4Fields
 │   ├ExecuteTemplateOrBoilerPlate
 │   └WasTemplateDialogCanceled
 └TfrmODDiet.TFChange
   ├TResponses.Clear
   ├TResponses.Update
   │ ├TResponses.FindResponseByName
   │ └TResponses.IENForPrompt
   ├TfrmODDiet.TFStrengthCode
   ├TfrmODBase.OrderForInpatient...
   └TResponses.GetOrderText
     ├TResponses.NextInstance
     ├TResponses.FindResponseByName
     ├TResponses.FormatResponse
     │ └TResponses.FindResponseByIEN
     └TResponses.AppendChildren
       ├TResponses.FindPromptByIEN
       ├TResponses.FindResponseByIEN
       └TResponses.FormatResponse...

Called-By Hierarchy


TfrmODDiet.SetValuesFromResponsesTF
           TfrmODDiet.SetupDialog┤ 
  TfrmODDiet.cboProductMouseClick┘ 
      TfrmODDiet.cboProductExit┘   

Calls

Name Declaration Comments
TResponses.FindResponseByName function FindResponseByName(const APromptID: string; AnInstance: Integer): TResponse; -
TResponses.NextInstance function NextInstance(const APromptID: string; LastInstance: Integer): Integer; -
TfrmODBase.OrderForInpatient function OrderForInpatient: Boolean; -
TfrmODDiet.ResetControlsTF procedure ResetControlsTF; -
TResponses.SetControl procedure SetControl(AControl: TControl; const APromptID: string; AnInstance: Integer); -
TfrmODDiet.TFChange procedure TFChange(Sender: TObject); -
TfrmODDiet.TFSetAmountForRow procedure TFSetAmountForRow(ARow: Integer); -

Called-By

Name Declaration Comments
TfrmODDiet.cboProductMouseClick procedure cboProductMouseClick(Sender: TObject); -
TfrmODDiet.SetupDialog procedure SetupDialog(OrderAction: Integer; const ID: string); override; -


Source

1178  procedure TfrmODDiet.SetValuesFromResponsesTF;
1179  var
1180    AnInstance: Integer;
1181    AResponse: TResponse;
1182    AProduct: TTFProduct;
1183  begin
1184    Changing := True;                                        // Changing set!!
1185    ResetControlsTF;
1186    with Responses do
1187    begin
1188      AnInstance := NextInstance('ORDERABLE', 0);
1189      while AnInstance > 0 do
1190      begin
1191        AResponse := FindResponseByName('ORDERABLE', AnInstance);
1192        if AResponse <> nil then
1193        begin
1194          AProduct := TTFProduct.Create;
1195          AProduct.IEN := StrToIntDef(AResponse.IValue, 0);
1196          AProduct.Name := AResponse.EValue;
1197          with grdSelected do
1198          begin
1199            if Objects[0, RowCount - 1] <> nil then RowCount := RowCount + 1;
1200            Objects[0, RowCount - 1] := AProduct;
1201            Cells[0, RowCount - 1] := AProduct.Name;
1202            AResponse := FindResponseByName('STRENGTH', AnInstance);
1203            if AResponse <> nil then Cells[1, RowCount - 1] := AResponse.EValue;
1204            AResponse := FindResponseByName('INSTR',   AnInstance);
1205            if AResponse <> nil then Cells[2, RowCount - 1] := AResponse.EValue;
1206            TFSetAmountForRow(RowCount - 1);
1207          end;
1208        end;
1209        AnInstance := NextInstance('ORDERABLE', AnInstance);
1210      end; {while AnInstance - ORDERABLE}
1211      AResponse := FindResponseByName('CANCEL', 1);
1212      if AResponse <> nil then chkCancelTrays.Checked := AResponse.IValue = '1';
1213      if not OrderForInpatient then
1214      begin
1215        SetControl(cboOPTFRecurringMeals, 'DATETIME', 1);
1216        SetControl(calOPTFStart, 'DATETIME', 1);
1217      end;
1218      SetControl(txtTFComment, 'COMMENT',  1);
1219    end;
1220    Changing := False;                                       // Changing reset
1221    TFChange(Self);
1222  end;