Procedure

TfrmODDiet.cboOPDietAvailMouseClick

Module

fODDiet

Last Modified

7/15/2014 3:26:42 PM

Comments

Outpatient Meals Order tab -----------------------------------------------------------------

Visibility

Public/Published

Owner

TfrmODDiet

Declaration

procedure cboOPDietAvailMouseClick(Sender: TObject);

Calls Hierarchy


TfrmODDiet.cboOPDietAvailMouseClick
 ├TResponses.SetQuickOrder
 │ ├TResponses.Clear
 │ └LoadResponses
 │   └ExtractToResponses
 │     └ExpandOrderObjects
 │       ├TdmodShared.BoilerplateOK
 │       │ ├ErrCount
 │       │ ├AddErr
 │       │ └TdmodShared.LoadTIUObjects
 │       │   └GetObjectList
 │       └GetTemplateText
 │         └TEncounter.GetVisitStr
 │           └TEncounter.GetVisitCategory
 ├TfrmODDiet.SetValuesFromResponsesOP
 │ ├TfrmODDiet.ResetControlsOP
 │ ├TResponses.FindResponseByName
 │ ├DietAttributes
 │ ├TResponses.SetControl
 │ │ ├TResponses.FindResponseByName
 │ │ └AssignBPText
 │ │   ├DisplayGroupToLinkType
 │ │   │ └DisplayGroupByName
 │ │   ├TResponses.EValueFor
 │ │   ├GetServiceIEN
 │ │   ├TResponses.IValueFor
 │ │   ├GetProcedureIEN
 │ │   ├ExpandOrderObjects...
 │ │   ├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...
 ├DietAttributes
 ├TfrmODDiet.OPDietCheckForNPO
 ├TfrmODDiet.OPDietCheckForTF...
 ├TfrmODBase.OrderMessage
 │ └TfrmODBase.ShowOrderMessage
 ├OIMessage
 └TfrmODDiet.OPChange...

Called-By Hierarchy


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

Calls

Name Declaration Comments
DietAttributes function DietAttributes(OI: Integer): string; -
OIMessage function OIMessage(IEN: Integer): string; -
TfrmODDiet.OPChange procedure OPChange(Sender: TObject); -
TfrmODDiet.OPDietCheckForNPO procedure OPDietCheckForNPO; -
TfrmODDiet.OPDietCheckForTF procedure OPDietCheckForTF; -
TfrmODBase.OrderMessage procedure OrderMessage(const AMessage: string); -
TResponses.SetQuickOrder procedure SetQuickOrder(AnIEN: Integer); -
TfrmODDiet.SetValuesFromResponsesOP procedure SetValuesFromResponsesOP; -

Called-By

Name Declaration Comments
TfrmODDiet.cboOPDietAvailExit procedure cboOPDietAvailExit(Sender: TObject); -
TfrmODDiet.cboOPDietAvailKeyDown procedure cboOPDietAvailKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); -
TfrmODDiet.nbkDietChange procedure nbkDietChange(Sender: TObject); -


Source

1850  procedure TfrmODDiet.cboOPDietAvailMouseClick(Sender: TObject);
1851  var
1852    NewDiet,ErrMsg: string;
1853  
1854    procedure SetError(const AnError: string);
1855    begin
1856      if Length(ErrMsg) > 0 then Exit;
1857      ErrMsg := AnError;
1858    end;
1859  
1860  begin
1861    inherited;
1862    if cboOPDietAvail.Items.Count = 0 then
1863      begin
1864        InfoBox(TX_NO_MEALS_DEFINED, TC_NO_MEALS_DEFINED, MB_OK or MB_ICONINFORMATION);
1865        AbortOrder := True;
1866        exit;
1867      end  ;
1868    if CharAt(cboOPDietAvail.ItemID, 1) = 'Q' then              // setup quick order
1869    begin
1870      Responses.QuickOrder := ExtractInteger(cboOPDietAvail.ItemID);
1871      SetValuesFromResponsesOP;
1872      cboOPDietAvail.ItemIndex := -1;
1873      Exit;
1874    end;
1875    if cboOPDietAvail.ItemIEN > 0 then with lstOPDietSelect do
1876    begin
1877      ErrMsg := '';
1878      NewDiet := DietAttributes(cboOPDietAvail.ItemIEN);
1879      if Piece(NewDiet,'^',1)='0' then
1880      begin
1881        InfoBox(Piece(NewDiet,'^',2),TC_OP_DIET_ERR, MB_OK);     
1882        cboOPDietAvail.ItemIndex := -1;
1883        Exit;
1884      end;
1885      lstOPDietSelect.Items.Clear;
1886      lstOPDietSelect.Items.Add(NewDiet);
1887  { TODO -oRich V. -cOutpatient Meals : Will these be selectable for an outpatient meal? }
1888      OPDietCheckForNPO;
1889  { TODO -oRich V. -cOutpatient Meals : Need to DC Tubefeeding order for OP meals? }
1890      OPDietCheckForTF;
1891      OrderMessage(OIMessage(StrToIntDef(Piece(NewDiet, U, 1), 0)));
1892      OPChange(Sender);
1893    end; {if cboOPDietAvail}
1894    OPChange(Sender);
1895    cboOPDietAvail.ItemIndex := -1;
1896  end;