Class

TfrmODDiet

Module

fODDiet

Last Modified

7/15/2014 3:26:42 PM

Scope

Interfaced

Inherits from

TfrmODBase

Declaration


TfrmODDiet = class(TfrmODBase)
  nbkDiet: TPageControl;
  pgeDiet: TTabSheet;
  lblDietAvail: TLabel;
  lblDietSelect: TLabel;
  lblComment: TLabel;
  lblStart: TLabel;
  lblStop: TLabel;
  lblDelivery: TLabel;
  cboDietAvail: TORComboBox;
  lstDietSelect: TORListBox;
  cmdRemove: TButton;
  txtDietComment: TCaptionEdit;
  calDietStart: TORDateBox;
  calDietStop: TORDateBox;
  cboDelivery: TORComboBox;
  pgeTubefeeding: TTabSheet;                                                        
  lblTFProductList: TLabel;
  lblTFComment: TLabel;                                                             
  lblTFStrength: TLabel;
  lblTFQuantity: TLabel;
  lblTFProduct: TLabel;
  cboProduct: TORComboBox;
  txtTFComment: TCaptionEdit;
  grdSelected: TCaptionStringGrid;
  cmdTFRemove: TButton;
  pgeEarlyLate: TTabSheet;
  pgeIsolations: TTabSheet;
  pgeAdditional: TTabSheet;
  chkCancelTubefeeding: TCheckBox;
  chkCancelTrays: TCheckBox;
  txtQuantity: TCaptionEdit;
  cboStrength: TCaptionComboBox;
  lblTFAmount: TLabel;
  grpMeal: TKeyClickRadioGroup;
  grpMealTime: TGroupBox;
  lblELStart: TLabel;
  calELStart: TORDateBox;
  lblELStop: TLabel;
  calELStop: TORDateBox;
  grpDoW: TGroupBox;
  chkMonday: TCheckBox;
  chkTuesday: TCheckBox;
  chkWednesday: TCheckBox;
  chkThursday: TCheckBox;
  chkFriday: TCheckBox;
  chkSaturday: TCheckBox;
  chkSunday: TCheckBox;
  chkBagged: TCheckBox;
  radET1: TRadioButton;
  radET2: TRadioButton;
  radET3: TRadioButton;
  radLT1: TRadioButton;
  radLT2: TRadioButton;
  radLT3: TRadioButton;
  lblNoTimes: TLabel;
  txtAOComment: TCaptionEdit;
  lblAddlOrder: TLabel;
  lstIsolation: TORListBox;
  lblIsolation: TLabel;
  lblIPComment: TLabel;
  txtIPComment: TCaptionEdit;
  lblIPCurrent: TLabel;
  txtIPCurrent: TCaptionEdit;
  pgeOutPt: TTabSheet;
  grpOPMeal: TKeyClickRadioGroup;
  grpOPDoW: TGroupBox;
  chkOPMonday: TCheckBox;
  chkOPTuesday: TCheckBox;
  chkOPWednesday: TCheckBox;
  chkOPThursday: TCheckBox;
  chkOPFriday: TCheckBox;
  chkOPSaturday: TCheckBox;
  chkOPSunday: TCheckBox;
  lblOPStart: TLabel;
  calOPStart: TORDateBox;
  lblOPStop: TLabel;
  calOPStop: TORDateBox;
  lblOPDietAvail: TLabel;
  cboOPDietAvail: TORComboBox;
  lblOPComment: TLabel;
  txtOPDietComment: TCaptionEdit;
  lblOPDelivery: TLabel;
  cboOPDelivery: TORComboBox;
  lblOPSelect: TLabel;
  lstOPDietSelect: TORListBox;
  cmdOPRemove: TButton;
  chkOPCancelTubefeeding: TCheckBox;
  calOPTFStart: TORDateBox;
  lblOPTFStart: TLabel;
  lblOPAOStart: TLabel;
  calOPAOStart: TORDateBox;
  cboOPAORecurringMeals: TORComboBox;
  cboOPTFRecurringMeals: TORComboBox;
  cboOPELRecurringMeals: TORComboBox;
  procedure nbkDietChanging(Sender: TObject;
    var AllowChange: Boolean);
  procedure nbkDietChange(Sender: TObject);
  procedure FormCreate(Sender: TObject);
  procedure cboDietAvailNeedData(Sender: TObject;
    const StartFrom: String; Direction, InsertAt: Integer);
  procedure cboDietAvailMouseClick(Sender: TObject);
  procedure cboDietAvailExit(Sender: TObject);
  procedure cmdRemoveClick(Sender: TObject);
  procedure DietChange(Sender: TObject);
  procedure cmdAcceptClick(Sender: TObject);
  procedure cboProductMouseClick(Sender: TObject);
  procedure cboProductExit(Sender: TObject);
  procedure FormDestroy(Sender: TObject);
  procedure FormResize(Sender: TObject);
  procedure grdSelectedSelectCell(Sender: TObject; Col, Row: Integer;
    var CanSelect: Boolean);
  procedure txtQuantityChange(Sender: TObject);
  procedure txtQuantityExit(Sender: TObject);
  procedure cboStrengthChange(Sender: TObject);
  procedure cboStrengthExit(Sender: TObject);
  procedure TFChange(Sender: TObject);
  procedure cmdTFRemoveClick(Sender: TObject);
  procedure grdSelectedDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect;
    State: TGridDrawState);
  procedure cboStrengthKeyDown(Sender: TObject; var Key: Word;
    Shift: TShiftState);
  procedure cboStrengthEnter(Sender: TObject);
  procedure txtQuantityKeyDown(Sender: TObject; var Key: Word;
    Shift: TShiftState);
  procedure txtQuantityEnter(Sender: TObject);
  procedure grpMealClick(Sender: TObject);
  procedure calELStartExit(Sender: TObject);
  procedure calELStopChange(Sender: TObject);
  procedure ELChange(Sender: TObject);
  procedure calELStartEnter(Sender: TObject);
  procedure calELStartChange(Sender: TObject);
  procedure IPChange(Sender: TObject);
  procedure AOChange(Sender: TObject);
  procedure FormKeyDown(Sender: TObject; var Key: Word;
    Shift: TShiftState);
  procedure cboOPDietAvailMouseClick(Sender: TObject);
  procedure cboOPDietAvailExit(Sender: TObject);
  procedure calOPStartExit(Sender: TObject);
  procedure calOPStopChange(Sender: TObject);
  procedure calOPStartEnter(Sender: TObject);
  procedure calOPStartChange(Sender: TObject);
  procedure OPChange(Sender: TObject);
  procedure grpOPMealClick(Sender: TObject);
  procedure cmdOPRemoveClick(Sender: TObject);
  procedure cboOPDietAvailKeyDown(Sender: TObject; var Key: Word;
    Shift: TShiftState);
private
  FNextCol: Integer;
  FNextRow: Integer;
  FChangeStop: Boolean;
  FIsolationID: string;
  FTabChanging: Boolean;
  FGiveMultiTabMessage: boolean;
  procedure DietCheckForNPO;
  procedure DietCheckForTF;
  function GetMealTime: string;
  function GetDaysOfWeek: string;
  function IsEarlyTray: Boolean;
  procedure ResetControlsDO;
  procedure ResetControlsTF;
  procedure ResetControlsEL;
  procedure ResetControlsIP;
  procedure ResetControlsAO;
  procedure SetEnableDOW(AllowUse: Boolean);
  procedure SetNextCell(ACol, ARow: Integer);
  procedure SetValuesFromResponsesDO;
  procedure SetValuesFromResponsesTF;
  procedure SetValuesFromResponsesEL;
  procedure SetValuesFromResponsesIP;
  procedure SetValuesFromResponsesAO;
  procedure TFMoveToNextCell;
  procedure TFClearGrid;
  procedure TFSetAmountForRow(ARow: Integer);
  function TFStrengthCode(const x: string): Integer;
 //  Outpatient meal additions
  function  FMDOW(AnFMDate: TFMDateTime): integer;
  function  FMDays(AStart, AEnd: TFMDateTime): string;
  function  GetOPDaysOfWeek: string;
  procedure SetEnableOPDOW(AllowUse: Boolean; OneTimeDay: integer; DaysToCheck: string = '');
  procedure ResetControlsOP;
  procedure SetValuesFromResponsesOP;
  function  GetOPMealWindow: string;
  procedure OPDietCheckForNPO;
  procedure OPDietCheckForTF;
  function  PatientHasRecurringMeals(var MealList: TStringList; MealType: string = ''): boolean;
  //procedure CheckForAutoDCOrders(EvtID: integer; CurrentText: string; var CancelText: string; Sender: TObject);
protected
  procedure InitDialog; override;
  procedure Validate(var AnErrMsg: string); override;
public
  procedure SetupDialog(OrderAction: Integer; const ID: string); override;
end;

DFM Objects


frmODDiet : TfrmODDiet
 ├nbkDiet : TPageControl
 │ ├pgeDiet : TTabSheet
 │ │ ├lblDietAvail : TLabel
 │ │ ├lblDietSelect : TLabel
 │ │ ├lblComment : TLabel
 │ │ ├lblStart : TLabel
 │ │ ├lblStop : TLabel
 │ │ ├lblDelivery : TLabel
 │ │ ├cboDietAvail : TORComboBox
 │ │ ├lstDietSelect : TORListBox
 │ │ ├cmdRemove : TButton
 │ │ ├txtDietComment : TCaptionEdit
 │ │ ├calDietStart : TORDateBox
 │ │ ├calDietStop : TORDateBox
 │ │ ├cboDelivery : TORComboBox
 │ │ └chkCancelTubefeeding : TCheckBox
 │ ├pgeOutPt : TTabSheet
 │ │ ├lblOPStart : TLabel
 │ │ ├lblOPStop : TLabel
 │ │ ├lblOPDietAvail : TLabel
 │ │ ├lblOPComment : TLabel
 │ │ ├lblOPDelivery : TLabel
 │ │ ├lblOPSelect : TLabel
 │ │ ├grpOPMeal : TKeyClickRadioGroup
 │ │ ├grpOPDoW : TGroupBox
 │ │ │ ├chkOPMonday : TCheckBox
 │ │ │ ├chkOPTuesday : TCheckBox
 │ │ │ ├chkOPWednesday : TCheckBox
 │ │ │ ├chkOPThursday : TCheckBox
 │ │ │ ├chkOPFriday : TCheckBox
 │ │ │ ├chkOPSaturday : TCheckBox
 │ │ │ └chkOPSunday : TCheckBox
 │ │ ├calOPStart : TORDateBox
 │ │ ├calOPStop : TORDateBox
 │ │ ├cboOPDietAvail : TORComboBox
 │ │ ├txtOPDietComment : TCaptionEdit
 │ │ ├cboOPDelivery : TORComboBox
 │ │ ├lstOPDietSelect : TORListBox
 │ │ ├cmdOPRemove : TButton
 │ │ └chkOPCancelTubefeeding : TCheckBox
 │ ├pgeTubefeeding : TTabSheet
 │ │ ├lblTFProductList : TLabel
 │ │ ├lblTFComment : TLabel
 │ │ ├lblTFStrength : TLabel
 │ │ ├lblTFQuantity : TLabel
 │ │ ├lblTFProduct : TLabel
 │ │ ├lblTFAmount : TLabel
 │ │ ├lblOPTFStart : TLabel
 │ │ ├cboProduct : TORComboBox
 │ │ ├txtTFComment : TCaptionEdit
 │ │ ├grdSelected : TCaptionStringGrid
 │ │ ├cmdTFRemove : TButton
 │ │ ├chkCancelTrays : TCheckBox
 │ │ ├txtQuantity : TCaptionEdit
 │ │ ├cboStrength : TCaptionComboBox
 │ │ ├calOPTFStart : TORDateBox
 │ │ └cboOPTFRecurringMeals : TORComboBox
 │ ├pgeEarlyLate : TTabSheet
 │ │ ├lblELStart : TLabel
 │ │ ├lblELStop : TLabel
 │ │ ├grpMeal : TKeyClickRadioGroup
 │ │ ├grpMealTime : TGroupBox
 │ │ │ ├lblNoTimes : TLabel
 │ │ │ ├radET1 : TRadioButton
 │ │ │ ├radET2 : TRadioButton
 │ │ │ ├radET3 : TRadioButton
 │ │ │ ├radLT1 : TRadioButton
 │ │ │ ├radLT2 : TRadioButton
 │ │ │ └radLT3 : TRadioButton
 │ │ ├calELStart : TORDateBox
 │ │ ├calELStop : TORDateBox
 │ │ ├grpDoW : TGroupBox
 │ │ │ ├chkMonday : TCheckBox
 │ │ │ ├chkTuesday : TCheckBox
 │ │ │ ├chkWednesday : TCheckBox
 │ │ │ ├chkThursday : TCheckBox
 │ │ │ ├chkFriday : TCheckBox
 │ │ │ ├chkSaturday : TCheckBox
 │ │ │ └chkSunday : TCheckBox
 │ │ ├chkBagged : TCheckBox
 │ │ └cboOPELRecurringMeals : TORComboBox
 │ ├pgeIsolations : TTabSheet
 │ │ ├lblIsolation : TLabel
 │ │ ├lblIPComment : TLabel
 │ │ ├lblIPCurrent : TLabel
 │ │ ├lstIsolation : TORListBox
 │ │ ├txtIPComment : TCaptionEdit
 │ │ └txtIPCurrent : TCaptionEdit
 │ └pgeAdditional : TTabSheet
 │   ├lblAddlOrder : TLabel
 │   ├lblOPAOStart : TLabel
 │   ├txtAOComment : TCaptionEdit
 │   ├calOPAOStart : TORDateBox
 │   └cboOPAORecurringMeals : TORComboBox
 ├memOrder : TCaptionMemo
 ├cmdAccept : TButton
 ├cmdQuit : TButton
 ├pnlMessage : TPanel
 │ ├imgMessage : TImage
 │ └memMessage : TRichEdit
 └amgrMain : TVA508AccessibilityManager

Class Hierarchy


Class Fields

Name Type Scope Comments
calDietStart TORDateBox Public/Published -
calDietStop TORDateBox Public/Published -
calELStart TORDateBox Public/Published -
calELStop TORDateBox Public/Published -
calOPAOStart TORDateBox Public/Published -
calOPStart TORDateBox Public/Published -
calOPStop TORDateBox Public/Published -
calOPTFStart TORDateBox Public/Published -
cboDelivery TORComboBox Public/Published -
cboDietAvail TORComboBox Public/Published -
cboOPAORecurringMeals TORComboBox Public/Published -
cboOPDelivery TORComboBox Public/Published -
cboOPDietAvail TORComboBox Public/Published -
cboOPELRecurringMeals TORComboBox Public/Published -
cboOPTFRecurringMeals TORComboBox Public/Published -
cboProduct TORComboBox Public/Published -
cboStrength Simple (unknown) Public/Published -
chkBagged TCheckBox Public/Published -
chkCancelTrays TCheckBox Public/Published -
chkCancelTubefeeding TCheckBox Public/Published -
chkFriday TCheckBox Public/Published -
chkMonday TCheckBox Public/Published -
chkOPCancelTubefeeding TCheckBox Public/Published -
chkOPFriday TCheckBox Public/Published -
chkOPMonday TCheckBox Public/Published -
chkOPSaturday TCheckBox Public/Published -
chkOPSunday TCheckBox Public/Published -
chkOPThursday TCheckBox Public/Published -
chkOPTuesday TCheckBox Public/Published -
chkOPWednesday TCheckBox Public/Published -
chkSaturday TCheckBox Public/Published -
chkSunday TCheckBox Public/Published -
chkThursday TCheckBox Public/Published -
chkTuesday TCheckBox Public/Published -
chkWednesday TCheckBox Public/Published -
cmdOPRemove TButton Public/Published -
cmdRemove TButton Public/Published -
cmdTFRemove TButton Public/Published -
FChangeStop Boolean Private -
FGiveMultiTabMessage Boolean Private -
FIsolationID UnicodeString Private -
FNextCol Integer Private -
FNextRow Integer Private -
FTabChanging Boolean Private -
grdSelected TCaptionStringGrid Public/Published -
grpDoW TGroupBox Public/Published -
grpMeal TKeyClickRadioGroup Public/Published -
grpMealTime TGroupBox Public/Published -
grpOPDoW TGroupBox Public/Published -
grpOPMeal TKeyClickRadioGroup Public/Published -
lblAddlOrder TLabel Public/Published -
lblComment TLabel Public/Published -
lblDelivery TLabel Public/Published -
lblDietAvail TLabel Public/Published -
lblDietSelect TLabel Public/Published -
lblELStart TLabel Public/Published -
lblELStop TLabel Public/Published -
lblIPComment TLabel Public/Published -
lblIPCurrent TLabel Public/Published -
lblIsolation TLabel Public/Published -
lblNoTimes TLabel Public/Published -
lblOPAOStart TLabel Public/Published -
lblOPComment TLabel Public/Published -
lblOPDelivery TLabel Public/Published -
lblOPDietAvail TLabel Public/Published -
lblOPSelect TLabel Public/Published -
lblOPStart TLabel Public/Published -
lblOPStop TLabel Public/Published -
lblOPTFStart TLabel Public/Published -
lblStart TLabel Public/Published -
lblStop TLabel Public/Published -
lblTFAmount TLabel Public/Published -
lblTFComment TLabel Public/Published -
lblTFProduct TLabel Public/Published -
lblTFProductList TLabel Public/Published -
lblTFQuantity TLabel Public/Published -
lblTFStrength TLabel Public/Published -
lstDietSelect TORListBox Public/Published -
lstIsolation TORListBox Public/Published -
lstOPDietSelect TORListBox Public/Published -
nbkDiet Simple (unknown) Public/Published -
pgeAdditional Simple (unknown) Public/Published -
pgeDiet Simple (unknown) Public/Published -
pgeEarlyLate Simple (unknown) Public/Published -
pgeIsolations Simple (unknown) Public/Published -
pgeOutPt Simple (unknown) Public/Published -
pgeTubefeeding Simple (unknown) Public/Published -
radET1 TRadioButton Public/Published -
radET2 TRadioButton Public/Published -
radET3 TRadioButton Public/Published -
radLT1 TRadioButton Public/Published -
radLT2 TRadioButton Public/Published -
radLT3 TRadioButton Public/Published -
txtAOComment TCaptionEdit Public/Published -
txtDietComment TCaptionEdit Public/Published -
txtIPComment TCaptionEdit Public/Published -
txtIPCurrent TCaptionEdit Public/Published -
txtOPDietComment TCaptionEdit Public/Published -
txtQuantity TCaptionEdit Public/Published -
txtTFComment TCaptionEdit Public/Published -

Methods

Name Declaration Scope Comments
AOChange procedure AOChange(Sender: TObject); Public/Published -
calELStartChange procedure calELStartChange(Sender: TObject); Public/Published -
calELStartEnter procedure calELStartEnter(Sender: TObject); Public/Published -
calELStartExit procedure calELStartExit(Sender: TObject); Public/Published -
calELStopChange procedure calELStopChange(Sender: TObject); Public/Published -
calOPStartChange procedure calOPStartChange(Sender: TObject); Public/Published -
calOPStartEnter procedure calOPStartEnter(Sender: TObject); Public/Published -
calOPStartExit procedure calOPStartExit(Sender: TObject); Public/Published -
calOPStopChange procedure calOPStopChange(Sender: TObject); Public/Published -
cboDietAvailExit procedure cboDietAvailExit(Sender: TObject); Public/Published -
cboDietAvailMouseClick procedure cboDietAvailMouseClick(Sender: TObject); Public/Published -
cboDietAvailNeedData procedure cboDietAvailNeedData(Sender: TObject; const StartFrom: String; Direction, InsertAt: Integer); Public/Published -
cboOPDietAvailExit procedure cboOPDietAvailExit(Sender: TObject); Public/Published -
cboOPDietAvailKeyDown procedure cboOPDietAvailKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
cboOPDietAvailMouseClick procedure cboOPDietAvailMouseClick(Sender: TObject); Public/Published Outpatient Meals Order tab -----------------------------------------------------------------
cboProductExit procedure cboProductExit(Sender: TObject); Public/Published -
cboProductMouseClick procedure cboProductMouseClick(Sender: TObject); Public/Published -
cboStrengthChange procedure cboStrengthChange(Sender: TObject); Public/Published -
cboStrengthEnter procedure cboStrengthEnter(Sender: TObject); Public/Published -
cboStrengthExit procedure cboStrengthExit(Sender: TObject); Public/Published -
cboStrengthKeyDown procedure cboStrengthKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
cmdAcceptClick procedure cmdAcceptClick(Sender: TObject); Public/Published
Common Buttons ---------------------------------------------------------------------------- 

CxMsg: string;
cmdOPRemoveClick procedure cmdOPRemoveClick(Sender: TObject); Public/Published -
cmdRemoveClick procedure cmdRemoveClick(Sender: TObject); Public/Published -
cmdTFRemoveClick procedure cmdTFRemoveClick(Sender: TObject); Public/Published -
DietChange procedure DietChange(Sender: TObject); Public/Published -
DietCheckForNPO procedure DietCheckForNPO; Private Diet Order tab ----------------------------------------------------------------------------
DietCheckForTF procedure DietCheckForTF; Private -
ELChange procedure ELChange(Sender: TObject); Public/Published -
FMDays function FMDays(AStart, AEnd: TFMDateTime): string; Private -
FMDOW function FMDOW(AnFMDate: TFMDateTime): integer; Private Outpatient meal additions
FormCreate procedure FormCreate(Sender: TObject); Public/Published -
FormDestroy procedure FormDestroy(Sender: TObject); Public/Published -
FormKeyDown procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
FormResize procedure FormResize(Sender: TObject); Public/Published -
GetDaysOfWeek function GetDaysOfWeek: string; Private -
GetMealTime function GetMealTime: string; Private -
GetOPDaysOfWeek function GetOPDaysOfWeek: string; Private -
GetOPMealWindow function GetOPMealWindow: string; Private -
grdSelectedDrawCell procedure grdSelectedDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); Public/Published -
grdSelectedSelectCell procedure grdSelectedSelectCell(Sender: TObject; Col, Row: Integer; var CanSelect: Boolean); Public/Published -
grpMealClick procedure grpMealClick(Sender: TObject); Public/Published -
grpOPMealClick procedure grpOPMealClick(Sender: TObject); Public/Published -
InitDialog procedure InitDialog; override; Protected -
IPChange procedure IPChange(Sender: TObject); Public/Published -
IsEarlyTray function IsEarlyTray: Boolean; Private -
nbkDietChange procedure nbkDietChange(Sender: TObject); Public/Published
Procedure TfrmODDiet.CheckForAutoDCOrders(EvtID: integer; CurrentText: string; var CancelText: string; Sender: TObject);
const
  TX_CX_CUR = 'A new diet order will CANCEL and REPLACE this current diet now unless' + CRLF +
              'you specify a start date for when the new diet should replace the current' + CRLF +
              'diet:' + CRLF + CRLF;
  TX_CX_FUT = 'A new diet order with no expiration date will CANCEL and REPLACE these diets:' + CRLF + CRLF;
  TX_CX_DELAYED1 =  'There are other delayed diet orders for this release event:';
  TX_CX_DELAYED2 =  'This new diet order may cancel and replace those other diets' + CRLF +
                    'IMMEDIATELY ON RELEASE, unless you either:' + CRLF + CRLF +

                    '1. Specify an expiration date/time for this order that will' + CRLF +
                    '   be prior to the start date/time of those other orders; or' + CRLF + CRLF +

                    '2. Specify a later start date/time for this order for when you' + CRLF +
                    '   would like it to cancel and replace those other orders.';

var
  i: integer;
  AStringList: TStringList;
  AList: TList;
  x, PtEvtIFN, PtEvtName: string;
  //AResponse: TResponse;
begin
  if Self.EvtID = 0 then   // check current and future released diets
  begin
    x := CurrentText;
    if Piece(x, #13, 1) <> 'Current Diet:  ' then
    begin
      AStringList := TStringList.Create;
      try
        AStringList.Text := x;
        CancelText := TX_CX_CUR + #9 + Piece(AStringList[0], ':', 1) + ':' + CRLF + CRLF
                 + #9 + Copy(AStringList[0], 16, 99) + CRLF;
        if AStringList.Count > 1 then
        begin
          CancelText := CancelText + CRLF + CRLF +
                   TX_CX_FUT + #9 + Piece(AStringList[1], ':', 1) + ':' + CRLF + CRLF
                   + #9 + Copy(AStringList[1], 22, 99) + CRLF;
          if AStringList.Count > 2 then
          for i := 2 to AStringList.Count - 1 do
            CancelText := CancelText + #9 + TrimLeft(AStringList[i]) + CRLF;
        end;
      finally
        AStringList.Free;
      end;
    end;
  end 
  else if Sender is TButton then     // delayed orders code here - on accept only
  begin
    //AResponse := Responses.FindResponseByName('STOP', 1);
    //if (AResponse <> nil) and (AResponse.EValue <> '') then exit;
    AList := TList.Create;
    try
      PtEvtIFN := IntToStr(frmOrders.TheCurrentView.EventDelay.PtEventIFN);
      PtEvtName := frmOrders.TheCurrentView.EventDelay.EventName;
      LoadOrdersAbbr(AList, frmOrders.TheCurrentView, PtEvtIFN);
      for i := AList.Count - 1 downto 0 do
      begin
        if TOrder(Alist.Items[i]).DGroup <> Self.DisplayGroup then
        begin
          TOrder(AList.Items[i]).Free;
          AList.Delete(i);
        end;
      end;
      if AList.Count > 0 then
      begin
        x := '';
        RetrieveOrderFields(AList, 0, 0);
        CancelText := TX_CX_DELAYED1 + CRLF + CRLF + 'Release event: ' + PtEvtName; 
        for i := 0 to AList.Count - 1 do
          with TOrder(AList.Items[i]) do
          begin
            x := x + #9 + Text + CRLF;
(*            if StartTime <> '' then
              x := #9 + x + 'Start:   ' + StartTime + CRLF
            else
              x := #9 + x + 'Ordered: ' + FormatFMDateTime('mmm dd,yyyy@hh:nn', OrderTime) + CRLF;
          end;
        CancelText := CancelText + CRLF + CRLF + x;
        CancelText := CancelText + CRLF + CRLF + TX_CX_DELAYED2;
      end;
    finally
      with AList do for i := 0 to Count - 1 do TOrder(Items[i]).Free;
      AList.Free;
    end;
  end;
end;
nbkDietChanging procedure nbkDietChanging(Sender: TObject; var AllowChange: Boolean); Public/Published Notebook tabs - general -------------------------------------------------------------------
OPChange procedure OPChange(Sender: TObject); Public/Published I: integer;
OPDietCheckForNPO procedure OPDietCheckForNPO; Private -
OPDietCheckForTF procedure OPDietCheckForTF; Private TODO -oRich V. -cOutpatient Meals : Need to DC Tubefeeding order for OP meals?
PatientHasRecurringMeals function PatientHasRecurringMeals(var MealList: TStringList; MealType: string = ''): boolean; Private -
ResetControlsAO procedure ResetControlsAO; Private Additional Diet Order tab -----------------------------------------------------------------
ResetControlsDO procedure ResetControlsDO; Private -
ResetControlsEL procedure ResetControlsEL; Private Early/Late Tray tab -----------------------------------------------------------------------
ResetControlsIP procedure ResetControlsIP; Private Isolation Precautions tab -----------------------------------------------------------------
ResetControlsOP procedure ResetControlsOP; Private -
ResetControlsTF procedure ResetControlsTF; Private Tubefeeding tab ---------------------------------------------------------------------------
SetEnableDOW procedure SetEnableDOW(AllowUse: Boolean); Private -
SetEnableOPDOW procedure SetEnableOPDOW(AllowUse: Boolean; OneTimeDay: integer; DaysToCheck: string = ''); Private -
SetNextCell procedure SetNextCell(ACol, ARow: Integer); Private -
SetupDialog procedure SetupDialog(OrderAction: Integer; const ID: string); override; Public -
SetValuesFromResponsesAO procedure SetValuesFromResponsesAO; Private -
SetValuesFromResponsesDO procedure SetValuesFromResponsesDO; Private -
SetValuesFromResponsesEL procedure SetValuesFromResponsesEL; Private -
SetValuesFromResponsesIP procedure SetValuesFromResponsesIP; Private -
SetValuesFromResponsesOP procedure SetValuesFromResponsesOP; Private -
SetValuesFromResponsesTF procedure SetValuesFromResponsesTF; Private -
TFChange procedure TFChange(Sender: TObject); Public/Published -
TFClearGrid procedure TFClearGrid; Private -
TFMoveToNextCell procedure TFMoveToNextCell; Private -
TFSetAmountForRow procedure TFSetAmountForRow(ARow: Integer); Private -
TFStrengthCode function TFStrengthCode(const x: string): Integer; Private -
txtQuantityChange procedure txtQuantityChange(Sender: TObject); Public/Published -
txtQuantityEnter procedure txtQuantityEnter(Sender: TObject); Public/Published -
txtQuantityExit procedure txtQuantityExit(Sender: TObject); Public/Published -
txtQuantityKeyDown procedure txtQuantityKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
Validate procedure Validate(var AnErrMsg: string); override; Protected -

Referenced By (2)

Module (line) Referrer Type
fODDiet (206) frmODDiet Read
uOrders (217) - Read