Procedure

TfrmODDiet.SetValuesFromResponsesOP

Module

fODDiet

Last Modified

7/15/2014 3:26:42 PM

Visibility

Private

Owner

TfrmODDiet

Declaration

procedure SetValuesFromResponsesOP;

Calls Hierarchy


TfrmODDiet.SetValuesFromResponsesOP
 ├TfrmODDiet.ResetControlsOP
 ├TResponses.FindResponseByName
 ├DietAttributes
 ├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.calOPStopChange
 │ ├TfrmODDiet.SetEnableOPDOW
 │ ├TfrmODDiet.FMDOW
 │ ├TfrmODDiet.FMDays
 │ └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...
 ├TfrmODDiet.OPDietCheckForNPO
 ├TfrmODDiet.OPDietCheckForTF
 │ └TextForOrder
 └TfrmODDiet.OPChange...

Called-By Hierarchy


    TfrmODDiet.SetValuesFromResponsesOP
               TfrmODDiet.SetupDialog┤ 
  TfrmODDiet.cboOPDietAvailMouseClick┘ 
           TfrmODDiet.nbkDietChange┤   
            TfrmODDiet.InitDialog┤ │   
           TfrmODDiet.SetupDialog┤ │   
                        ..(rec)..┘ │   
      TfrmODDiet.cboOPDietAvailExit┤   
   TfrmODDiet.cboOPDietAvailKeyDown┘   

Calls

Name Declaration Comments
TfrmODDiet.calOPStopChange procedure calOPStopChange(Sender: TObject); -
DietAttributes function DietAttributes(OI: Integer): string; -
TResponses.FindResponseByName function FindResponseByName(const APromptID: string; AnInstance: Integer): TResponse; -
TfrmODDiet.OPChange procedure OPChange(Sender: TObject); -
TfrmODDiet.OPDietCheckForNPO procedure OPDietCheckForNPO; -
TfrmODDiet.OPDietCheckForTF procedure OPDietCheckForTF; -
TfrmODDiet.ResetControlsOP procedure ResetControlsOP; -
TResponses.SetControl procedure SetControl(AControl: TControl; const APromptID: string; AnInstance: Integer); -

Called-By

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


Source

1943  procedure TfrmODDiet.SetValuesFromResponsesOP;
1944  var
1945    AResponse: TResponse;
1946    ADiet: string;
1947  begin
1948    Changing := True;
1949    ResetControlsOP;
1950    with Responses do
1951    begin
1952      AResponse := FindResponseByName('ORDERABLE', 1);
1953      if AResponse <> nil then
1954      begin
1955        ADiet := DietAttributes(StrToIntDef(AResponse.IValue,0));
1956        if Piece(ADiet,'^',1)='0' then
1957        begin
1958          InfoBox(Piece(ADiet,'^',2), TC_OP_DIET_ERR, MB_OK);
1959          cboOPDietAvail.ItemIndex := -1;
1960          Changing := False;
1961          Exit;
1962        end;
1963        SetControl(cboOPDietAvail,    'ORDERABLE', 1);
1964        lstOPDietSelect.Items.Add(ADiet);
1965      end;
1966      SetControl(cboOPDelivery,    'DELIVERY', 1);
1967      AResponse := FindResponseByName('MEAL', 1);
1968      if AResponse <> nil then
1969      begin
1970        if AResponse.IValue = 'B' then grpOPMeal.ItemIndex := 0;
1971        if AResponse.IValue = 'N' then grpOPMeal.ItemIndex := 1;
1972        if AResponse.IValue = 'E' then grpOPMeal.ItemIndex := 2;
1973      end;
1974      SetControl(calOPStart, 'START', 1);
1975      SetControl(calOPStop,  'STOP',  1);
1976      calOPStopChange(Self);
1977      AResponse := FindResponseByName('SCHEDULE', 1);
1978      if AResponse <> nil then
1979      begin
1980        chkOPMonday.Checked    := Pos('M', AResponse.IValue) > 0;
1981        chkOPTuesday.Checked   := Pos('T', AResponse.IValue) > 0;
1982        chkOPWednesday.Checked := Pos('W', AResponse.IValue) > 0;
1983        chkOPThursday.Checked  := Pos('R', AResponse.IValue) > 0;
1984        chkOPFriday.Checked    := Pos('F', AResponse.IValue) > 0;
1985        chkOPSaturday.Checked  := Pos('S', AResponse.IValue) > 0;
1986        chkOPSunday.Checked    := Pos('X', AResponse.IValue) > 0;
1987      end;
1988      SetControl(txtOPDietComment, 'COMMENT',  1);
1989    end; {with Responses}
1990    OPDietCheckForNPO;
1991    OPDietCheckForTF;
1992    Changing := False;
1993    OPChange(Self);
1994  end;