Class

TfrmODMedNVA

Module

fODMedNVA

Last Modified

7/15/2014 3:26:42 PM

Scope

Interfaced

Inherits from

TfrmODBase

Declaration


TfrmODMedNVA = class(TfrmODBase)
  txtMed: TEdit;
  pnlMeds: TPanel;
  lstQuick: TCaptionListView;
  sptSelect: TSplitter;
  lstAll: TCaptionListView;
  dlgStart: TORDateTimeDlg;
  timCheckChanges: TTimer;
  pnlFields: TPanel;
  pnlTop: TPanel;
  lblRoute: TLabel;
  lblSchedule: TLabel;
  lblGuideline: TStaticText;
  tabDose: TTabControl;
  cboDosage: TORComboBox;
  cboRoute: TORComboBox;
  cboSchedule: TORComboBox;
  chkPRN: TCheckBox;
  pnlBottom: TPanel;
  lblComment: TLabel;
  memComment: TCaptionMemo;
  lblAdminTime: TStaticText;
  calStart: TORDateBox;
  Label1: TLabel;
  lbStatements: TORListBox;
  Label2: TLabel;
  btnSelect: TButton;
  Image1: TImage;
  memDrugMsg: TMemo;
  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 ListViewResize(Sender: TObject);
  procedure lstQuickData(Sender: TObject; Item: TListItem);
  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 DispOrderMessage(const AMessage: string);


  procedure grdDosesExit(Sender: TObject);
  procedure ListViewEnter(Sender: TObject);
  procedure timCheckChangesTimer(Sender: TObject);
  procedure cmdAcceptClick(Sender: TObject);
  procedure cboDosageExit(Sender: TObject);
  procedure chkPRNClick(Sender: TObject);
  procedure grdDosesKeyDown(Sender: TObject; var Key: Word;
    Shift: TShiftState);
  procedure grdDosesEnter(Sender: TObject);
  procedure pnlMessageEnter(Sender: TObject);
  procedure pnlMessageExit(Sender: TObject);
  procedure memMessageKeyDown(Sender: TObject; var Key: Word;
    Shift: TShiftState);
  procedure FormResize(Sender: TObject);
  procedure lbStatementsClickCheck(Sender: TObject; Index: Integer);
  procedure lstChange(Sender: TObject; Item: TListItem;
    Change: TItemChange);
  procedure FormKeyPress(Sender: TObject; var Key: Char);
  procedure cboDosageKeyUp(Sender: TObject; var Key: Word;
    Shift: TShiftState);
  procedure cboRouteKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
  procedure cboScheduleKeyUp(Sender: TObject; var Key: Word;
    Shift: TShiftState);

private
  {selection}
  FNVAMedCache:   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;
  FLastDispDrug: string;
  FLastQuantity: Integer;
  FLastSupply:   Integer;
  FLastPickup:   string;
  FSIGVerb: string;
  FSIGPrep: string;
  FDrugID: string;
  fInptDlg: Boolean;
  FNonVADlg: Boolean;
  FUpdated: Boolean;
  FSuppressMsg: Boolean;
  FPtInstruct: string;
  FAltChecked: Boolean;
  FShrinkDrugMsg: boolean;
  FQOQuantity: Double;
  FQODosage: string;
  FNoZERO: boolean;
  FIsQuickOrder: boolean;
  FAdminTimeLbl: string;
  FDisabledDefaultButton: TButton;
  FDisabledCancelButton: TButton;
  FShrinked: boolean;
  FQOInitial: boolean;
  FRemoveText : Boolean;
  FMedName: string;
  {selection}
  procedure ChangeDelayed;
  procedure LoadNonVAMedCache(First, Last: Integer);
  function FindQuickOrder(const x: string): Integer;
  function isUniqueQuickOrder(iText: string): Boolean;
  function GetCacheChunkIndex(idx: integer): integer;
  procedure ScrollToVisible(AListView: TListView);
  procedure StartKeyTimer;
  procedure StopKeyTimer;
  procedure WMTimer(var Message: TWMTimer); message WM_TIMER;
  // NON VA MEDS
  procedure LoadOTCStatements(Dest: TStrings);

  {edit}
  procedure ResetOnMedChange;
  procedure SetOnMedSelect;
  procedure SetOnQuickOrder;
  procedure ShowMedSelect;
  procedure ShowMedFields;
  procedure ShowControlsSimple;
  procedure SetDosage(const x: string);
  procedure SetStatements(x: string);
  procedure SetStartDate(const x: string);
  procedure SetSchedule(const x: string);
  procedure CheckFormAltDose(DispDrug: Integer);
  function ConstructedDoseFields(const ADose: string; PrependName: Boolean = FALSE): string;
  function FindCommonDrug(DoseList: TStringList): string;
  function FindDoseFields(const Drug, ADose: string): string;
  function OutpatientSig: string;
  function  SearchStatements(StatementList:TStringList;Statement: string): Boolean;
  procedure UpdateRelated(DelayUpdate: Boolean = TRUE);
  procedure UpdateStartExpires(const CurSchedule: string);
  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;
  procedure UMDelayClick(var Message: TMessage); message UM_DELAYCLICK;

protected
  procedure InitDialog; override;
  procedure Validate(var AnErrMsg: string); override;
public
  procedure SetupDialog(OrderAction: Integer; const ID: string); override;
  procedure CheckDecimal(var AStr: string);
  property MedName: string read FMedName write FMedName;
end;

DFM Objects


frmODMedNVA : TfrmODMedNVA
 ├memOrder : TCaptionMemo
 ├pnlMeds : TPanel
 │ ├sptSelect : TSplitter
 │ ├lstQuick : TCaptionListView
 │ └lstAll : TCaptionListView
 ├txtMed : TEdit
 ├pnlFields : TPanel
 │ ├pnlTop : TPanel
 │ │ ├lblRoute : TLabel
 │ │ ├lblSchedule : TLabel
 │ │ ├lblGuideline : TStaticText
 │ │ ├tabDose : TTabControl
 │ │ ├cboDosage : TORComboBox
 │ │ ├cboRoute : TORComboBox
 │ │ ├cboSchedule : TORComboBox
 │ │ └chkPRN : TCheckBox
 │ └pnlBottom : TPanel
 │   ├lblComment : TLabel
 │   ├Label1 : TLabel
 │   ├Label2 : TLabel
 │   ├Image1 : TImage
 │   ├memComment : TCaptionMemo
 │   ├lblAdminTime : TStaticText
 │   ├calStart : TORDateBox
 │   ├lbStatements : TORListBox
 │   └memDrugMsg : TMemo
 ├btnSelect : TButton
 ├cmdAccept : TButton
 ├cmdQuit : TButton
 ├pnlMessage : TPanel
 ├amgrMain : TVA508AccessibilityManager
 ├dlgStart : TORDateTimeDlg
 └timCheckChanges : TTimer

Class Hierarchy


Class Fields

Name Type Scope Comments
btnSelect TButton Public/Published -
calStart TORDateBox Public/Published -
cboDosage TORComboBox Public/Published -
cboRoute TORComboBox Public/Published -
cboSchedule TORComboBox Public/Published -
chkPRN TCheckBox Public/Published -
dlgStart TORDateTimeDlg Public/Published -
FActiveMedList TListView Private -
FAdminTimeLbl UnicodeString Private -
FAllDoses TStringList Private Edit
FAllDrugs TStringList Private -
FAltChecked Boolean Private -
FCacheIEN Integer Private -
FChangePending Boolean Private -
FDisabledCancelButton TButton Private -
FDisabledDefaultButton TButton Private -
FDrugID UnicodeString Private -
FFromSelf Boolean Private -
FGuideline TStringList Private -
fInptDlg Boolean Private -
FIsQuickOrder Boolean Private -
FKeyTimerActive Boolean Private -
FLastDispDrug UnicodeString Private -
FLastPickup UnicodeString Private -
FLastQuantity Integer Private -
FLastSchedule UnicodeString Private -
FLastSupply Integer Private -
FLastUnits UnicodeString Private -
FMedName UnicodeString Private -
FNonVADlg Boolean Private -
FNoZERO Boolean Private -
FNVAMedCache Simple (unknown) Private Selection
FPtInstruct UnicodeString Private -
FQODosage UnicodeString Private -
FQOInitial Boolean Private -
FQOQuantity Double Private -
FQuickItems TStringList Private -
FQuickList Integer Private -
FRemoveText Boolean Private -
FRowHeight Integer Private -
FShrinkDrugMsg Boolean Private -
FShrinked Boolean Private -
FSIGPrep UnicodeString Private -
FSIGVerb UnicodeString Private -
FSuppressMsg Boolean Private -
FUpdated Boolean Private -
Image1 TImage Public/Published -
Label1 TLabel Public/Published -
Label2 TLabel Public/Published -
lblAdminTime TStaticText Public/Published -
lblComment TLabel Public/Published -
lblGuideline TStaticText Public/Published -
lblRoute TLabel Public/Published -
lblSchedule TLabel Public/Published -
lbStatements TORListBox Public/Published -
lstAll TCaptionListView Public/Published -
lstQuick TCaptionListView Public/Published -
memComment TCaptionMemo Public/Published -
memDrugMsg TMemo Public/Published -
pnlBottom TPanel Public/Published -
pnlFields TPanel Public/Published -
pnlMeds TPanel Public/Published -
pnlTop TPanel Public/Published -
sptSelect TSplitter Public/Published -
tabDose TTabControl Public/Published -
timCheckChanges TTimer Public/Published -
txtMed TEdit Public/Published -

Properties

Name Type Scope Comments
MedName UnicodeString Public -

Methods

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

MedName: string;
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 -
cboRouteChange procedure cboRouteChange(Sender: TObject); Public/Published CboRoute --------------------------------------
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 -----------------------------------
cboScheduleKeyUp procedure cboScheduleKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
ChangeDelayed procedure ChangeDelayed; Private Selection
CheckDecimal procedure CheckDecimal(var AStr: string); Public -
CheckFormAltDose procedure CheckFormAltDose(DispDrug: Integer); Private CboDosage -------------------------------------
chkPRNClick procedure chkPRNClick(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 -
DisableCancelButton function DisableCancelButton(Control: TWinControl): boolean; Private -
DisableDefaultButton function DisableDefaultButton(Control: TWinControl): boolean; Private -
DispOrderMessage procedure DispOrderMessage(const AMessage: string); Public/Published -
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 -
FormCreate procedure FormCreate(Sender: TObject); Public/Published Procedures inherited from fODBase ---------------------------------------------------------
FormDestroy procedure FormDestroy(Sender: TObject); Public/Published -
FormKeyPress procedure FormKeyPress(Sender: TObject; var Key: Char); Public/Published -
FormResize procedure FormResize(Sender: TObject); Public/Published -
GetCacheChunkIndex function GetCacheChunkIndex(idx: integer): integer; Private -
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 -
InitDialog procedure InitDialog; override; Protected Executed each time dialog is reset after pressing accept. Clears controls & responses
isUniqueQuickOrder function isUniqueQuickOrder(iText: string): Boolean; Private -
lblGuidelineClick procedure lblGuidelineClick(Sender: TObject); Public/Published -
lbStatementsClickCheck procedure lbStatementsClickCheck(Sender: TObject; Index: Integer); 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
ListViewResize procedure ListViewResize(Sender: TObject); Public/Published -
LoadNonVAMedCache procedure LoadNonVAMedCache(First, Last: Integer); Private Cache is a list of 100 string lists, starting at idx 0
LoadOTCStatements procedure LoadOTCStatements(Dest: TStrings); Private NON VA MEDS
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 -
memMessageKeyDown procedure memMessageKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
OutpatientSig function OutpatientSig: string; Private Values changing
pnlMessageEnter procedure pnlMessageEnter(Sender: TObject); Public/Published -
pnlMessageExit procedure pnlMessageExit(Sender: TObject); Public/Published -
ResetOnMedChange procedure ResetOnMedChange; Private Edit
RestoreCancelButton procedure RestoreCancelButton; Private -
RestoreDefaultButton procedure RestoreDefaultButton; Private -
ScrollToVisible procedure ScrollToVisible(AListView: TListView); Private -
SearchStatements function SearchStatements(StatementList:TStringList;Statement: string): Boolean; Private -
SetDosage procedure SetDosage(const x: string); Private -
SetOnMedSelect procedure SetOnMedSelect; Private -
SetOnQuickOrder procedure SetOnQuickOrder; Private -
SetSchedule procedure SetSchedule(const x: string); Private -
SetStartDate procedure SetStartDate(const x: string); Private -
SetStatements procedure SetStatements(x: string); Private -
SetupDialog procedure SetupDialog(OrderAction: Integer; const ID: string); override; Public AnInstr: string;
ShowControlsSimple procedure ShowControlsSimple; 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 ---------------------------------------------------------------------------
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 -
UMDelayClick procedure UMDelayClick(var Message: TMessage); message UM_DELAYCLICK; Private -
UpdateRelated procedure UpdateRelated(DelayUpdate: Boolean = TRUE); Private -
UpdateStartExpires procedure UpdateStartExpires(const CurSchedule: string); Private -
Validate procedure Validate(var AnErrMsg: string); override; Protected -
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 -
WMTimer procedure WMTimer(var Message: TWMTimer); message WM_TIMER; Private TxtMed methods (including timers)

Referenced By (2)

Module (line) Referrer Type
fODMedNVA (190) frmODMedNVA Read
uOrders (208) - Read