Class

TfrmODMeds

Module

fODMeds

Last Modified

7/15/2014 3:26:42 PM

Scope

Interfaced

Inherits from

TfrmODBase

Declaration


  TfrmODMeds = class(TfrmODBase)
    txtMed: TEdit;
    pnlMeds: TPanel;
    btnSelect: TButton;
    pnlFields: TPanel;
    lstQuick: TCaptionListView;
    sptSelect: TSplitter;
    lstAll: TCaptionListView;
    dlgStart: TORDateTimeDlg;
    cboXDosage: TORComboBox;
    cboXRoute: TORComboBox;
    pnlXDuration: TPanel;
    timCheckChanges: TTimer;
    popDuration: TPopupMenu;
    popDays: TMenuItem;
    popBlank: TMenuItem;
    hours1: TMenuItem;
    minutes1: TMenuItem;
    months1: TMenuItem;
    weeks1: TMenuItem;
    pnlXSchedule: TPanel;
    cboXSchedule: TORComboBox;
    chkXPRN: TCheckBox;
    txtXDuration: TCaptionEdit;
    spnXDuration: TUpDown;
    pnlXDurationButton: TKeyClickPanel;
    btnXDuration: TSpeedButton;
    pnlTop: TPanel;
    lblRoute: TLabel;
    lblSchedule: TLabel;
    grdDoses: TCaptionStringGrid;
    lblGuideline: TStaticText;
    tabDose: TTabControl;
    cboDosage: TORComboBox;
    cboRoute: TORComboBox;
    cboSchedule: TORComboBox;
    chkPRN: TCheckBox;
    btnXInsert: TButton;
    btnXRemove: TButton;
    pnlBottom: TPanel;
    lblComment: TLabel;
    lblDays: TLabel;
    lblQuantity: TLabel;
    lblRefills: TLabel;
    lblPriority: TLabel;
    chkDoseNow: TCheckBox;
    memComment: TCaptionMemo;
    lblQtyMsg: TStaticText;
    txtSupply: TCaptionEdit;
    spnSupply: TUpDown;
    txtQuantity: TCaptionEdit;
    spnQuantity: TUpDown;
    txtRefills: TCaptionEdit;
    spnRefills: TUpDown;
    grpPickup: TGroupBox;
    radPickWindow: TRadioButton;
    radPickMail: TRadioButton;
    radPickClinic: TRadioButton;
    cboPriority: TORComboBox;
    stcPI: TStaticText;
    chkPtInstruct: TCheckBox;
    memPI: TMemo;
    Image1: TImage;
    memDrugMsg: TMemo;
    txtNSS: TLabel;
    pnlXAdminTime: TPanel;
    cboXSequence: TORComboBox;
    lblAdminSch: TMemo;
    lblAdminTime: TVA508StaticText;
    procedure FormCreate(Sender: TObject);
    procedure btnSelectClick(Sender: TObject);
    procedure tabDoseChange(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure txtMedKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure txtMedKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure txtMedChange(Sender: TObject);
    procedure txtMedExit(Sender: TObject);
    procedure ListViewEditing(Sender: TObject; Item: TListItem;
      var AllowEdit: Boolean);
    procedure ListViewKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure ListViewResize(Sender: TObject);
    procedure lstQuickData(Sender: TObject; Item: TListItem);
    procedure lstQuickDataHint(Sender: TObject; StartIndex,
      EndIndex: Integer);
    procedure lstAllDataHint(Sender: TObject; StartIndex,
      EndIndex: Integer);
    procedure lstAllData(Sender: TObject; Item: TListItem);
    procedure lblGuidelineClick(Sender: TObject);
    procedure ListViewClick(Sender: TObject);
    procedure cboScheduleChange(Sender: TObject);
    procedure cboRouteChange(Sender: TObject);
    procedure ControlChange(Sender: TObject);
    procedure cboDosageClick(Sender: TObject);
    procedure cboDosageChange(Sender: TObject);
    procedure cboScheduleClick(Sender: TObject);
    procedure txtSupplyChange(Sender: TObject);
    procedure txtQuantityChange(Sender: TObject);
    procedure cboRouteExit(Sender: TObject);
    procedure grdDosesMouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure grdDosesKeyPress(Sender: TObject; var Key: Char);
    procedure grdDosesMouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure grdDosesDrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    procedure cboXDosageClick(Sender: TObject);
    procedure cboXDosageExit(Sender: TObject);
    procedure cboXRouteClick(Sender: TObject);
    procedure cboXRouteExit(Sender: TObject);
    procedure cboXScheduleClick(Sender: TObject);
    procedure pnlXDurationEnter(Sender: TObject);
    procedure pnlXDurationExit(Sender: TObject);
    procedure txtXDurationChange(Sender: TObject);
    procedure cboXDosageEnter(Sender: TObject);
    procedure cboXDosageChange(Sender: TObject);
    procedure cboXRouteChange(Sender: TObject);
    procedure cboXScheduleChange(Sender: TObject);
    procedure grdDosesExit(Sender: TObject);
    procedure ListViewEnter(Sender: TObject);
    procedure timCheckChangesTimer(Sender: TObject);
    procedure popDurationClick(Sender: TObject);
    procedure cmdAcceptClick(Sender: TObject);
    procedure btnXInsertClick(Sender: TObject);
    procedure btnXRemoveClick(Sender: TObject);
    procedure pnlXScheduleEnter(Sender: TObject);
    procedure pnlXScheduleExit(Sender: TObject);
    procedure chkPtInstructClick(Sender: TObject);
    procedure pnlFieldsResize(Sender: TObject);
    procedure chkDoseNowClick(Sender: TObject);
    procedure cboDosageExit(Sender: TObject);
    procedure chkXPRNClick(Sender: TObject);
    procedure memCommentClick(Sender: TObject);
    procedure btnXDurationClick(Sender: TObject);
    procedure chkPRNClick(Sender: TObject);
    procedure grdDosesKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure grdDosesEnter(Sender: TObject);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure cboXRouteEnter(Sender: TObject);
    procedure pnlMessageEnter(Sender: TObject);
    procedure pnlMessageExit(Sender: TObject);
    procedure memMessageKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure memPIClick(Sender: TObject);
    procedure FormResize(Sender: TObject);
    procedure memPIKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure lstChange(Sender: TObject; Item: TListItem;
      Change: TItemChange);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure txtNSSClick(Sender: TObject);
    procedure cboScheduleEnter(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure cboScheduleExit(Sender: TObject);
    procedure cboXScheduleExit(Sender: TObject);
    procedure cboDosageKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure cboXDosageKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure txtSupplyClick(Sender: TObject);
    procedure txtQuantityClick(Sender: TObject);
    procedure txtRefillsClick(Sender: TObject);
    procedure WMClose(var Msg : TWMClose); message WM_CLOSE;
    procedure cboXScheduleEnter(Sender: TObject);
    procedure pnlXAdminTimeClick(Sender: TObject);
    procedure cboXSequenceChange(Sender: TObject);
    procedure cboXSequence1Exit(Sender: TObject);
    procedure cboXSequenceExit(Sender: TObject);
    procedure cboXSequenceEnter(Sender: TObject);
    procedure txtRefillsChange(Sender: TObject);
    procedure QuantityMessageCheck(Tag: integer)  ;
    procedure pnlXDurationButtonEnter(Sender: TObject);
    procedure cboRouteKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure cboScheduleKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure cboXScheduleKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure cboXSequenceKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure cboPriorityKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    //procedure btnNSSClick(Sender: TObject);
  private
    FCloseCalled : Boolean;
    FScheduleChanged : Boolean;
    {selection}
    FMedCache:   TObjectList;
    FCacheIEN:   Integer;
    FQuickList:  Integer;
    FQuickItems: TStringList;
    FChangePending: Boolean;
    FKeyTimerActive: Boolean;
    FActiveMedList: TListView;
    FRowHeight: Integer;
    FFromSelf: Boolean;
    {edit}
    FAllDoses:  TStringList;
    FAllDrugs:  TStringList;
    FGuideline: TStringList;
    FLastUnits:    string;
    FLastSchedule: string;
    FLastDuration: string;
    FLastInstruct: string;
    FLastDispDrug: string;
    FLastQuantity: Double;
    FLastSupply:   Integer;
    FLastPickup:   string;
    FSIGVerb: string;
    FSIGPrep: string;
    FDropColumn: Integer;
    FDrugID: string;
    FInptDlg: Boolean;
    FUpdated: Boolean;
    FSuppressMsg: Boolean;
    FPtInstruct: string;
    FAltChecked: Boolean;
    FOutptIV: Boolean;
    FQOQuantity: Double;
    FQODosage: string;
    FNoZERO: boolean;
    FIsQuickOrder: boolean;
    FDisabledDefaultButton: TButton;
    FDisabledCancelButton: TButton;
    FShrinked: boolean;
    FShrinkDrugMsg: boolean;
    FResizedAlready: boolean;
    FQOInitial: boolean;
    FOrigiMsgDisp: boolean;
    FNSSOther: boolean;
    {selection}
    FShowPnlXScheduleOk : boolean;
    FRemoveText : Boolean;
    FSmplPRNChkd: Boolean;
    {Admin Time}
    FAdminTimeLbl: string;
    FMedName: String;
    FNSSAdminTime: string;
    FNSSScheduleType: string;
    FAdminTimeText: string;
    //FOriginalAdminTime: string;
    //FOriginalScheduleIndex: integer;
    FOrderAction: integer;
    JAWSON: boolean;
    procedure ChangeDelayed;
    function FindQuickOrder(const x: string): Integer;
    function isUniqueQuickOrder(iText: string): Boolean;
    function GetCacheChunkIndex(idx: integer): integer;
    procedure LoadMedCache(First, Last: Integer);
    procedure ScrollToVisible(AListView: TListView);
    procedure StartKeyTimer;
    procedure StopKeyTimer;
    procedure WMTimer(var Message: TWMTimer); message WM_TIMER;
    {edit}
    procedure ResetOnMedChange;
    procedure ResetOnTabChange;
    procedure SetControlsInpatient;
    procedure SetControlsOutpatient;
    procedure SetOnMedSelect;
    procedure SetOnQuickOrder;
    procedure SetVisibleCommentRows( Rows: integer );
    procedure ShowMedSelect;
    procedure ShowMedFields;
    procedure ShowControlsSimple;
    procedure ShowControlsComplex;
    procedure SetDosage(const x: string);
    procedure SetPickup(const x: string);
    procedure SetSchedule(const x: string);
    procedure CheckFormAltDose(DispDrug: Integer);
    function DurationToDays: Integer;
    function ConstructedDoseFields(const ADose: string; PrependName: Boolean = FALSE): string;
    function FieldsForDose(ARow: Integer): string;
    function FieldsForDrug(const DrugID: string): string;
    function FindCommonDrug(DoseList: TStringList): string;
    function FindDoseFields(const Drug, ADose: string): string;
    function InpatientSig: string;
    function OutpatientSig: string;
    procedure UpdateRelated(DelayUpdate: Boolean = TRUE);
    procedure UpdateRefills(const CurDispDrug: string; CurSupply: Integer);
    procedure UpdateStartExpires(const CurSchedule: string);
    procedure UpdateDefaultSupply(const CurUnits, CurSchedule, CurDuration, CurDispDrug: string;
      var CurSupply: Integer; var CurQuantity: double; var SkipQtyCheck: Boolean);
    procedure UpdateSupplyQuantity(const CurUnits, CurSchedule, CurDuration, CurDispDrug, CurInstruct: string;
      var CurSupply: Integer; var CurQuantity: double);
    procedure UpdateDurationControls( FreeText: boolean);
    function DisableDefaultButton(Control: TWinControl): boolean;
    function DisableCancelButton(Control: TWinControl): boolean;
    procedure RestoreDefaultButton;
    procedure RestoreCancelButton;
    function ValueOf(FieldID: Integer; ARow: Integer = -1): string;
    function ValueOfResponse(FieldID: Integer; AnInstance: Integer = 1): string;
    function ValFor(FieldID, ARow: Integer): string;
    function TextDosage(ADosage: string): string;
    //NSS
    function CreateOtherScheduel: string;
    function CreateOtherScheduelComplex: string;
    procedure ShowEditor(ACol, ARow: Integer; AChar: Char);
    procedure DropLastSequence(ASign: integer = 0);
    procedure DispOrderMessage(const AMessage: string);
    procedure UMDelayClick(var Message: TMessage); message UM_DELAYCLICK;
    procedure UMDelayEvent(var Message: TMessage); message UM_DELAYEVENT;
    procedure UMShowNSSBuilder(var Message: TMessage); message UM_NSSOTHER;
    function  IfIsIMODialog: boolean;
    procedure ValidateInpatientSchedule(ScheduleCombo: TORComboBox);
//    function ValidateRoute(RouteCombo: TORComboBox) : Boolean; Removed based on Site feeback. See CQ: 7518
    function IsSupplyAndOutPatient : boolean;
    function GetSchedListIndex(SchedCombo: TORComboBox; pSchedule: String):integer;
    procedure DisplayDoseNow(Status: boolean);
    function lblAdminSchGetText: string;
    procedure lblAdminSchSetText(str: string);
  protected
    procedure Loaded; override;
    procedure InitDialog; override;
    procedure Validate(var AnErrMsg: string); override;
    procedure updateSig; override;
  public
    ARow1: integer;
    procedure SetupDialog(OrderAction: Integer; const ID: string); override;
    procedure CheckDecimal(var AStr: string);
    property MedName: string read FMedName write FMedName;
    property NSSAdminTime: string read FNSSAdminTime write FNSSAdminTime;
    property NSSScheduleType: string read FNSSScheduleType write FNSSScheduleType;
  end;

DFM Objects


frmODMeds : TfrmODMeds
 ├pnlMeds : TPanel
 │ ├sptSelect : TSplitter
 │ ├lstQuick : TCaptionListView
 │ └lstAll : TCaptionListView
 ├memOrder : TCaptionMemo
 ├txtMed : TEdit
 ├btnSelect : TButton
 ├pnlFields : TPanel
 │ ├pnlTop : TPanel
 │ │ ├lblRoute : TLabel
 │ │ ├lblSchedule : TLabel
 │ │ ├txtNSS : TLabel
 │ │ ├grdDoses : TCaptionStringGrid
 │ │ ├lblGuideline : TStaticText
 │ │ ├tabDose : TTabControl
 │ │ ├cboDosage : TORComboBox
 │ │ ├cboRoute : TORComboBox
 │ │ ├cboSchedule : TORComboBox
 │ │ ├chkPRN : TCheckBox
 │ │ ├btnXInsert : TButton
 │ │ ├btnXRemove : TButton
 │ │ └pnlXAdminTime : TPanel
 │ ├cboXDosage : TORComboBox
 │ ├cboXRoute : TORComboBox
 │ ├pnlXDuration : TPanel
 │ │ ├pnlXDurationButton : TKeyClickPanel
 │ │ │ └btnXDuration : TSpeedButton
 │ │ ├txtXDuration : TCaptionEdit
 │ │ └spnXDuration : TUpDown
 │ ├pnlXSchedule : TPanel
 │ │ ├cboXSchedule : TORComboBox
 │ │ └chkXPRN : TCheckBox
 │ ├pnlBottom : TPanel
 │ │ ├lblComment : TLabel
 │ │ ├lblDays : TLabel
 │ │ ├lblQuantity : TLabel
 │ │ ├lblRefills : TLabel
 │ │ ├lblPriority : TLabel
 │ │ ├Image1 : TImage
 │ │ ├chkDoseNow : TCheckBox
 │ │ ├memComment : TCaptionMemo
 │ │ ├lblQtyMsg : TStaticText
 │ │ ├txtSupply : TCaptionEdit
 │ │ ├spnSupply : TUpDown
 │ │ ├txtQuantity : TCaptionEdit
 │ │ ├spnQuantity : TUpDown
 │ │ ├txtRefills : TCaptionEdit
 │ │ ├spnRefills : TUpDown
 │ │ ├grpPickup : TGroupBox
 │ │ │ ├radPickWindow : TRadioButton
 │ │ │ ├radPickMail : TRadioButton
 │ │ │ └radPickClinic : TRadioButton
 │ │ ├cboPriority : TORComboBox
 │ │ ├stcPI : TStaticText
 │ │ ├chkPtInstruct : TCheckBox
 │ │ ├memPI : TMemo
 │ │ ├memDrugMsg : TMemo
 │ │ ├lblAdminSch : TMemo
 │ │ └lblAdminTime : TVA508StaticText
 │ └cboXSequence : TORComboBox
 ├cmdAccept : TButton
 ├cmdQuit : TButton
 ├pnlMessage : TPanel
 │ ├imgMessage : TImage
 │ └memMessage : TRichEdit
 ├amgrMain : TVA508AccessibilityManager
 ├dlgStart : TORDateTimeDlg
 ├timCheckChanges : TTimer
 └popDuration : TPopupMenu
   ├popBlank : TMenuItem
   ├months1 : TMenuItem
   ├weeks1 : TMenuItem
   ├popDays : TMenuItem
   ├hours1 : TMenuItem
   └minutes1 : TMenuItem

Class Hierarchy


Class Fields

Name Type Scope Comments
ARow1 Integer Public -
btnSelect TButton Public/Published -
btnXDuration TSpeedButton Public/Published -
btnXInsert TButton Public/Published -
btnXRemove TButton Public/Published -
cboDosage TORComboBox Public/Published -
cboPriority TORComboBox Public/Published -
cboRoute TORComboBox Public/Published -
cboSchedule TORComboBox Public/Published -
cboXDosage TORComboBox Public/Published -
cboXRoute TORComboBox Public/Published -
cboXSchedule TORComboBox Public/Published -
cboXSequence TORComboBox Public/Published -
chkDoseNow TCheckBox Public/Published -
chkPRN TCheckBox Public/Published -
chkPtInstruct TCheckBox Public/Published -
chkXPRN TCheckBox Public/Published -
dlgStart TORDateTimeDlg Public/Published -
FActiveMedList TListView Private -
FAdminTimeLbl UnicodeString Private Admin Time
FAdminTimeText UnicodeString Private -
FAllDoses TStringList Private Edit
FAllDrugs TStringList Private -
FAltChecked Boolean Private -
FCacheIEN Integer Private -
FChangePending Boolean Private -
FCloseCalled Boolean Private -
FDisabledCancelButton TButton Private -
FDisabledDefaultButton TButton Private -
FDropColumn Integer Private -
FDrugID UnicodeString Private -
FFromSelf Boolean Private -
FGuideline TStringList Private -
FInptDlg Boolean Private -
FIsQuickOrder Boolean Private -
FKeyTimerActive Boolean Private -
FLastDispDrug UnicodeString Private -
FLastDuration UnicodeString Private -
FLastInstruct UnicodeString Private -
FLastPickup UnicodeString Private -
FLastQuantity Double Private -
FLastSchedule UnicodeString Private -
FLastSupply Integer Private -
FLastUnits UnicodeString Private -
FMedCache Simple (unknown) Private Selection
FMedName UnicodeString Private -
FNoZERO Boolean Private -
FNSSAdminTime UnicodeString Private -
FNSSOther Boolean Private -
FNSSScheduleType UnicodeString Private -
FOrderAction Integer Private
FOriginalAdminTime: string;
FOriginalScheduleIndex: integer;
FOrigiMsgDisp Boolean Private -
FOutptIV Boolean Private -
FPtInstruct UnicodeString Private -
FQODosage UnicodeString Private -
FQOInitial Boolean Private -
FQOQuantity Double Private -
FQuickItems TStringList Private -
FQuickList Integer Private -
FRemoveText Boolean Private -
FResizedAlready Boolean Private -
FRowHeight Integer Private -
FScheduleChanged Boolean Private -
FShowPnlXScheduleOk Boolean Private Selection
FShrinkDrugMsg Boolean Private -
FShrinked Boolean Private -
FSIGPrep UnicodeString Private -
FSIGVerb UnicodeString Private -
FSmplPRNChkd Boolean Private -
FSuppressMsg Boolean Private -
FUpdated Boolean Private -
grdDoses TCaptionStringGrid Public/Published -
grpPickup TGroupBox Public/Published -
hours1 TMenuItem Public/Published -
Image1 TImage Public/Published -
JAWSON Boolean Private -
lblAdminSch TMemo Public/Published -
lblAdminTime TVA508StaticText Public/Published -
lblComment TLabel Public/Published -
lblDays TLabel Public/Published -
lblGuideline TStaticText Public/Published -
lblPriority TLabel Public/Published -
lblQtyMsg TStaticText Public/Published -
lblQuantity TLabel Public/Published -
lblRefills TLabel Public/Published -
lblRoute TLabel Public/Published -
lblSchedule TLabel Public/Published -
lstAll TCaptionListView Public/Published -
lstQuick TCaptionListView Public/Published -
memComment TCaptionMemo Public/Published -
memDrugMsg TMemo Public/Published -
memPI TMemo Public/Published -
minutes1 TMenuItem Public/Published -
months1 TMenuItem Public/Published -
pnlBottom TPanel Public/Published -
pnlFields TPanel Public/Published -
pnlMeds TPanel Public/Published -
pnlTop TPanel Public/Published -
pnlXAdminTime TPanel Public/Published -
pnlXDuration TPanel Public/Published -
pnlXDurationButton TKeyClickPanel Public/Published -
pnlXSchedule TPanel Public/Published -
popBlank TMenuItem Public/Published -
popDays TMenuItem Public/Published -
popDuration TPopupMenu Public/Published -
radPickClinic TRadioButton Public/Published -
radPickMail TRadioButton Public/Published -
radPickWindow TRadioButton Public/Published -
spnQuantity TUpDown Public/Published -
spnRefills TUpDown Public/Published -
spnSupply TUpDown Public/Published -
spnXDuration TUpDown Public/Published -
sptSelect TSplitter Public/Published -
stcPI TStaticText Public/Published -
tabDose Simple (unknown) Public/Published -
timCheckChanges TTimer Public/Published -
txtMed TEdit Public/Published -
txtNSS TLabel Public/Published -
txtQuantity TCaptionEdit Public/Published -
txtRefills TCaptionEdit Public/Published -
txtSupply TCaptionEdit Public/Published -
txtXDuration TCaptionEdit Public/Published -
weeks1 TMenuItem Public/Published -

Properties

Name Type Scope Comments
MedName UnicodeString Public -
NSSAdminTime UnicodeString Public -
NSSScheduleType UnicodeString Public -

Methods

Name Declaration Scope Comments
btnSelectClick procedure btnSelectClick(Sender: TObject); Public/Published
Medication is now selected ---------------------------------------------------------------- 

MedName: string;
btnXDurationClick procedure btnXDurationClick(Sender: TObject); Public/Published -
btnXInsertClick procedure btnXInsertClick(Sender: TObject); Public/Published -
btnXRemoveClick procedure btnXRemoveClick(Sender: TObject); Public/Published -
cboDosageChange procedure cboDosageChange(Sender: TObject); Public/Published -
cboDosageClick procedure cboDosageClick(Sender: TObject); Public/Published -
cboDosageExit procedure cboDosageExit(Sender: TObject); Public/Published -
cboDosageKeyUp procedure cboDosageKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
cboPriorityKeyUp procedure cboPriorityKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
cboRouteChange procedure cboRouteChange(Sender: TObject); Public/Published CboRoute --------------------------------------
cboRouteExit procedure cboRouteExit(Sender: TObject); Public/Published -
cboRouteKeyUp procedure cboRouteKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
cboScheduleChange procedure cboScheduleChange(Sender: TObject); Public/Published -
cboScheduleClick procedure cboScheduleClick(Sender: TObject); Public/Published CboSchedule -----------------------------------
cboScheduleEnter procedure cboScheduleEnter(Sender: TObject); Public/Published -
cboScheduleExit procedure cboScheduleExit(Sender: TObject); Public/Published -
cboScheduleKeyUp procedure cboScheduleKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
cboXDosageChange procedure cboXDosageChange(Sender: TObject); Public/Published -
cboXDosageClick procedure cboXDosageClick(Sender: TObject); Public/Published -
cboXDosageEnter procedure cboXDosageEnter(Sender: TObject); Public/Published -
cboXDosageExit procedure cboXDosageExit(Sender: TObject); Public/Published TempTag: integer;
cboXDosageKeyUp procedure cboXDosageKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
cboXRouteChange procedure cboXRouteChange(Sender: TObject); Public/Published -
cboXRouteClick procedure cboXRouteClick(Sender: TObject); Public/Published -
cboXRouteEnter procedure cboXRouteEnter(Sender: TObject); Public/Published -
cboXRouteExit procedure cboXRouteExit(Sender: TObject); Public/Published -
cboXScheduleChange procedure cboXScheduleChange(Sender: TObject); Public/Published -
cboXScheduleClick procedure cboXScheduleClick(Sender: TObject); Public/Published -
cboXScheduleEnter procedure cboXScheduleEnter(Sender: TObject); Public/Published -
cboXScheduleExit procedure cboXScheduleExit(Sender: TObject); Public/Published -
cboXScheduleKeyUp procedure cboXScheduleKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
cboXSequence1Exit procedure cboXSequence1Exit(Sender: TObject); Public/Published -
cboXSequenceChange procedure cboXSequenceChange(Sender: TObject); Public/Published -
cboXSequenceEnter procedure cboXSequenceEnter(Sender: TObject); Public/Published -
cboXSequenceExit procedure cboXSequenceExit(Sender: TObject); Public/Published -
cboXSequenceKeyUp procedure cboXSequenceKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
ChangeDelayed procedure ChangeDelayed; Private -
CheckDecimal procedure CheckDecimal(var AStr: string); Public -
CheckFormAltDose procedure CheckFormAltDose(DispDrug: Integer); Private CboDosage -------------------------------------
chkDoseNowClick procedure chkDoseNowClick(Sender: TObject); Public/Published -
chkPRNClick procedure chkPRNClick(Sender: TObject); Public/Published -
chkPtInstructClick procedure chkPtInstructClick(Sender: TObject); Public/Published -
chkXPRNClick procedure chkXPRNClick(Sender: TObject); Public/Published -
cmdAcceptClick procedure cmdAcceptClick(Sender: TObject); Public/Published -
ConstructedDoseFields function ConstructedDoseFields(const ADose: string; PrependName: Boolean = FALSE): string; Private -
ControlChange procedure ControlChange(Sender: TObject); Public/Published -
CreateOtherScheduel function CreateOtherScheduel: string; Private
NSS
NSS
CreateOtherScheduelComplex function CreateOtherScheduelComplex: string; Private -
DisableCancelButton function DisableCancelButton(Control: TWinControl): boolean; Private -
DisableDefaultButton function DisableDefaultButton(Control: TWinControl): boolean; Private -
DisplayDoseNow procedure DisplayDoseNow(Status: boolean); Private -
DispOrderMessage procedure DispOrderMessage(const AMessage: string); Private -
DropLastSequence procedure DropLastSequence(ASign: integer = 0); Private -
DurationToDays function DurationToDays: Integer; Private
Procedure TfrmODMeds.DurationToDays;
var
  i, DoseHours, TotalHours: Integer;
  AllRows: Boolean;
  Days: Extended;
  x: string;
begin
  Exit;  // don't try to figure out days supply from duration for now
  if txtSupply.Tag = 1 then Exit;
  AllRows := True;
  with grdDoses do for i := 1 to Pred(RowCount) do
    if (Length(ValFor(COL_DOSAGE, i)) > 0) and (Length(ValFor(VAL_DURATION, i)) = 0)
      then AllRows := False;
  if not AllRows then Exit;
  Changing := True;
  TotalHours := 0;
  with grdDoses do for i := 1 to Pred(RowCount) do
    if Length(ValFor(COL_DOSAGE, i)) > 0 then
    begin
      x := ValFor(VAL_DURATION, i);
      if Piece(x, U, 2) = 'D'
        then DoseHours := ExtractInteger(x) * 24
        else DoseHours := ExtractInteger(x);
      TotalHours := TotalHours + DoseHours;
    end;
  Days := TotalHours / 24;
  if Days > Int(Days) then Days := Days + 1;
  txtSupply.Text := IntToStr(Trunc(Days));
  //timDayQty.Tag := TIMER_FROM_DAYS;
  //timDayQtyTimer(Self);
  Changing := False;
end;
FieldsForDose function FieldsForDose(ARow: Integer): string; Private -
FieldsForDrug function FieldsForDrug(const DrugID: string): string; Private -
FindCommonDrug function FindCommonDrug(DoseList: TStringList): string; Private DoseList[n] = DoseText ^ Dispense Drug Pointer
FindDoseFields function FindDoseFields(const Drug, ADose: string): string; Private -
FindQuickOrder function FindQuickOrder(const x: string): Integer; Private -
FormClose procedure FormClose(Sender: TObject; var Action: TCloseAction); Public/Published -
FormCreate procedure FormCreate(Sender: TObject); Public/Published Procedures inherited from fODBase ---------------------------------------------------------
FormDestroy procedure FormDestroy(Sender: TObject); Public/Published -
FormKeyDown procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
FormKeyPress procedure FormKeyPress(Sender: TObject; var Key: Char); Public/Published -
FormResize procedure FormResize(Sender: TObject); Public/Published -
FormShow procedure FormShow(Sender: TObject); Public/Published -
GetCacheChunkIndex function GetCacheChunkIndex(idx: integer): integer; Private CQ: 7397 - Inpatient med orders with PRN cancel due to invalid schedule.
GetSchedListIndex function GetSchedListIndex(SchedCombo: TORComboBox; pSchedule: String):integer; Private -
grdDosesDrawCell procedure grdDosesDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); Public/Published -
grdDosesEnter procedure grdDosesEnter(Sender: TObject); Public/Published -
grdDosesExit procedure grdDosesExit(Sender: TObject); Public/Published -
grdDosesKeyDown procedure grdDosesKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
grdDosesKeyPress procedure grdDosesKeyPress(Sender: TObject; var Key: Char); Public/Published -
grdDosesMouseDown procedure grdDosesMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); Public/Published -
grdDosesMouseUp procedure grdDosesMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); Public/Published -
IfIsIMODialog function IfIsIMODialog: boolean; Private -
InitDialog procedure InitDialog; override; Protected Executed each time dialog is reset after pressing accept. Clears controls & responses
InpatientSig function InpatientSig: string; Private -
IsSupplyAndOutPatient function IsSupplyAndOutPatient : boolean; Private Function ValidateRoute(RouteCombo: TORComboBox) : Boolean; Removed based on Site feeback. See CQ: 7518
isUniqueQuickOrder function isUniqueQuickOrder(iText: string): Boolean; Private
Removed based on Site feeback. See CQ: 7518
function TfrmODMeds.ValidateRoute(RouteCombo: TORComboBox) : Boolean;
begin
{CQ: 7331 - Medications - Route - Can not enter any route not listed in Route field in window}
  Result := True;
  if (Length(RouteCombo.Text) > 0) and (RouteCombo.ItemIndex < 0) and (Not IsSupplyAndOutPatient) then
  begin
    Application.MessageBox('Please select a correct route from the list.',
                           'Incorrect Route.');
    if RouteCombo.CanFocus then
      RouteCombo.SetFocus;
    RouteCombo.SelStart := Length(RouteCombo.Text);
    Result := False;
  end;
end;
lblAdminSchGetText function lblAdminSchGetText: string; Private -
lblAdminSchSetText procedure lblAdminSchSetText(str: string); Private -
lblGuidelineClick procedure lblGuidelineClick(Sender: TObject); Public/Published -
ListViewClick procedure ListViewClick(Sender: TObject); Public/Published -
ListViewEditing procedure ListViewEditing(Sender: TObject; Item: TListItem; var AllowEdit: Boolean); Public/Published -
ListViewEnter procedure ListViewEnter(Sender: TObject); Public/Published LstAll & lstQuick methods
ListViewKeyUp procedure ListViewKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
ListViewResize procedure ListViewResize(Sender: TObject); Public/Published -
Loaded procedure Loaded; override; Protected LstAll Methods (lstAll is TListView)
LoadMedCache procedure LoadMedCache(First, Last: Integer); Private Cache is a list of 100 string lists, starting at idx 0
lstAllData procedure lstAllData(Sender: TObject; Item: TListItem); Public/Published -
lstAllDataHint procedure lstAllDataHint(Sender: TObject; StartIndex, EndIndex: Integer); Public/Published -
lstChange procedure lstChange(Sender: TObject; Item: TListItem; Change: TItemChange); Public/Published -
lstQuickData procedure lstQuickData(Sender: TObject; Item: TListItem); Public/Published LstQuick methods (lstQuick is TListView)
lstQuickDataHint procedure lstQuickDataHint(Sender: TObject; StartIndex, EndIndex: Integer); Public/Published -
memCommentClick procedure memCommentClick(Sender: TObject); Public/Published -
memMessageKeyDown procedure memMessageKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
memPIClick procedure memPIClick(Sender: TObject); Public/Published -
memPIKeyDown procedure memPIKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
OutpatientSig function OutpatientSig: string; Private Values changing
pnlFieldsResize procedure pnlFieldsResize(Sender: TObject); Public/Published -
pnlMessageEnter procedure pnlMessageEnter(Sender: TObject); Public/Published -
pnlMessageExit procedure pnlMessageExit(Sender: TObject); Public/Published -
pnlXAdminTimeClick procedure pnlXAdminTimeClick(Sender: TObject); Public/Published -
pnlXDurationButtonEnter procedure pnlXDurationButtonEnter(Sender: TObject); Public/Published -
pnlXDurationEnter procedure pnlXDurationEnter(Sender: TObject); Public/Published -
pnlXDurationExit procedure pnlXDurationExit(Sender: TObject); Public/Published -
pnlXScheduleEnter procedure pnlXScheduleEnter(Sender: TObject); Public/Published -
pnlXScheduleExit procedure pnlXScheduleExit(Sender: TObject); Public/Published -
popDurationClick procedure popDurationClick(Sender: TObject); Public/Published -
QuantityMessageCheck procedure QuantityMessageCheck(Tag: integer) ; Public/Published -
ResetOnMedChange procedure ResetOnMedChange; Private Edit
ResetOnTabChange procedure ResetOnTabChange; Private -
RestoreCancelButton procedure RestoreCancelButton; Private -
RestoreDefaultButton procedure RestoreDefaultButton; Private -
ScrollToVisible procedure ScrollToVisible(AListView: TListView); Private -
SetControlsInpatient procedure SetControlsInpatient; Private -
SetControlsOutpatient procedure SetControlsOutpatient; Private -
SetDosage procedure SetDosage(const x: string); Private -
SetOnMedSelect procedure SetOnMedSelect; Private -
SetOnQuickOrder procedure SetOnQuickOrder; Private -
SetPickup procedure SetPickup(const x: string); Private -
SetSchedule procedure SetSchedule(const x: string); Private -
SetupDialog procedure SetupDialog(OrderAction: Integer; const ID: string); override; Public -
SetVisibleCommentRows procedure SetVisibleCommentRows( Rows: integer ); Private -
ShowControlsComplex procedure ShowControlsComplex; Private -
ShowControlsSimple procedure ShowControlsSimple; Private
Var
dosagetxt: string;
ShowEditor procedure ShowEditor(ACol, ARow: Integer; AChar: Char); Private -
ShowMedFields procedure ShowMedFields; Private -
ShowMedSelect procedure ShowMedSelect; Private -
StartKeyTimer procedure StartKeyTimer; Private Start (or restart) a timer (done on keyup to delay before calling OnKeyPause)
StopKeyTimer procedure StopKeyTimer; Private Stop the timer (done whenever a key is pressed or the combobox no longer has focus)
tabDoseChange procedure tabDoseChange(Sender: TObject); Public/Published
Medication edit --------------------------------------------------------------------------- 

text,x, tmpsch: string;
TextDosage function TextDosage(ADosage: string): string; Private -
timCheckChangesTimer procedure timCheckChangesTimer(Sender: TObject); Public/Published -
txtMedChange procedure txtMedChange(Sender: TObject); Public/Published -
txtMedExit procedure txtMedExit(Sender: TObject); Public/Published -
txtMedKeyDown procedure txtMedKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
txtMedKeyUp procedure txtMedKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
txtNSSClick procedure txtNSSClick(Sender: TObject); Public/Published -
txtQuantityChange procedure txtQuantityChange(Sender: TObject); Public/Published -
txtQuantityClick procedure txtQuantityClick(Sender: TObject); Public/Published -
txtRefillsChange procedure txtRefillsChange(Sender: TObject); Public/Published -
txtRefillsClick procedure txtRefillsClick(Sender: TObject); Public/Published -
txtSupplyChange procedure txtSupplyChange(Sender: TObject); Public/Published TxtSupply, txtQuantity --------------------------
txtSupplyClick procedure txtSupplyClick(Sender: TObject); Public/Published -
txtXDurationChange procedure txtXDurationChange(Sender: TObject); Public/Published -
UMDelayClick procedure UMDelayClick(var Message: TMessage); message UM_DELAYCLICK; Private -
UMDelayEvent procedure UMDelayEvent(var Message: TMessage); message UM_DELAYEVENT; Private After focusing events are completed for a combobox, set the key the user typed
UMShowNSSBuilder procedure UMShowNSSBuilder(var Message: TMessage); message UM_NSSOTHER; Private -
UpdateDefaultSupply procedure UpdateDefaultSupply(const CurUnits, CurSchedule, CurDuration, CurDispDrug: string; var CurSupply: Integer; var CurQuantity: double; var SkipQtyCheck: Boolean); Private -
UpdateDurationControls procedure UpdateDurationControls( FreeText: boolean); Private Duration -----------------------------
UpdateRefills procedure UpdateRefills(const CurDispDrug: string; CurSupply: Integer); Private -
UpdateRelated procedure UpdateRelated(DelayUpdate: Boolean = TRUE); Private -
updateSig procedure updateSig; override; Protected -
UpdateStartExpires procedure UpdateStartExpires(const CurSchedule: string); Private -
UpdateSupplyQuantity procedure UpdateSupplyQuantity(const CurUnits, CurSchedule, CurDuration, CurDispDrug, CurInstruct: string; var CurSupply: Integer; var CurQuantity: double); Private
Add CURInstrcut to this procedure. This address a problem with an user starting with a free-text dosage and changing
to another free-text dose and the quantity value not updating.
ValFor function ValFor(FieldID, ARow: Integer): string; Private
General Functions - get & set cell values

 Contents of grid cells  (Only the first tab piece for each cell is drawn)
    Dosage    <TAB> DosageFields
    RouteText <TAB> IEN^RouteName^Abbreviation
    Schedule  <TAB> (nothing)
    Duration  <TAB> Duration^Units
Validate procedure Validate(var AnErrMsg: string); override; Protected -
ValidateInpatientSchedule procedure ValidateInpatientSchedule(ScheduleCombo: TORComboBox); Private -
ValueOf function ValueOf(FieldID: Integer; ARow: Integer = -1): string; Private
Contents of cboDosage
    DrugName^Strength^NF^TDose&Units&U/D&Noun&LDose&Drug^DoseText^CostText^MaxRefills
  Contents of grid cells  (Only the first tab piece for each cell is drawn)
    Dosage    <TAB> DosageFields
    RouteText <TAB> IEN^RouteName^Abbreviation
    Schedule  <TAB> (nothing)
    Duration  <TAB> Duration^Units 






 the following functions were created to get rid of a compile warning saying the
 return value may be undefined - too much branching logic in the case statements
 for the compiler to handle
ValueOfResponse function ValueOfResponse(FieldID: Integer; AnInstance: Integer = 1): string; Private -
WMClose procedure WMClose(var Msg : TWMClose); message WM_CLOSE; Public/Published -
WMTimer procedure WMTimer(var Message: TWMTimer); message WM_TIMER; Private TxtMed methods (including timers)

Referenced By (2)

Module (line) Referrer Type
fODMeds (345) frmODMeds Read
uOrders (206) - Read