[453] | 1 | //kt -- Modified with SourceScanner on 8/8/2007
|
---|
| 2 | unit fODMedOIFA;
|
---|
| 3 |
|
---|
| 4 | interface
|
---|
| 5 |
|
---|
| 6 | uses
|
---|
| 7 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
| 8 | StdCtrls, ORCtrls, ExtCtrls, fAutoSz, DKLang;
|
---|
| 9 |
|
---|
| 10 | type
|
---|
| 11 | TfrmODMedOIFA = class(TForm)
|
---|
| 12 | Label1: TLabel;
|
---|
| 13 | lstFormAlt: TORListBox;
|
---|
| 14 | Label2: TStaticText;
|
---|
| 15 | btnPanel: TPanel;
|
---|
| 16 | cmdYes: TButton;
|
---|
| 17 | cmdNo: TButton;
|
---|
| 18 | DKLanguageController1: TDKLanguageController;
|
---|
| 19 | procedure FormCreate(Sender: TObject);
|
---|
| 20 | procedure cmdYesClick(Sender: TObject);
|
---|
| 21 | procedure cmdNoClick(Sender: TObject);
|
---|
| 22 | procedure lstFormAltClick(Sender: TObject);
|
---|
| 23 | procedure FormShow(Sender: TObject);
|
---|
| 24 | procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
---|
| 25 | private
|
---|
| 26 | FSelected: string;
|
---|
| 27 | end;
|
---|
| 28 |
|
---|
| 29 | procedure CheckFormularyOI(var AnIEN: Integer; var AName: string; ForInpatient: Boolean);
|
---|
| 30 | procedure CheckFormularyDose(DispDrug: Integer; var OI: Integer; var OIName: string;
|
---|
| 31 | ForInpatient: Boolean);
|
---|
| 32 |
|
---|
| 33 | implementation
|
---|
| 34 |
|
---|
| 35 | {$R *.DFM}
|
---|
| 36 |
|
---|
| 37 | uses ORFn, rODMeds, rMisc;
|
---|
| 38 |
|
---|
| 39 | procedure CheckFormularyOI(var AnIEN: Integer; var AName: string; ForInpatient: Boolean);
|
---|
| 40 |
|
---|
| 41 | //const
|
---|
| 42 | //TX_NO_FORM_ALT = 'This drug is not in the formulary!' + CRLF + <-- original line. //kt 8/8/2007
|
---|
| 43 | // 'There are no formulary alternatives entered for this item.' + CRLF + <-- original line. //kt 8/8/2007
|
---|
| 44 | // 'Please consult with your pharmacy before ordering this item.'; <-- original line. //kt 8/8/2007
|
---|
| 45 | //TC_NO_FORM_ALT = 'No Formulary Alternatives'; <-- original line. //kt 8/8/2007
|
---|
| 46 |
|
---|
| 47 | var
|
---|
| 48 | frmODMedOIFA: TfrmODMedOIFA;
|
---|
| 49 | FormAltList: TStringList;
|
---|
| 50 | TX_NO_FORM_ALT : string; //kt
|
---|
| 51 | TC_NO_FORM_ALT : string; //kt
|
---|
| 52 |
|
---|
| 53 | begin
|
---|
| 54 | TX_NO_FORM_ALT := DKLangConstW('fODMedOIFA_This_drug_is_not_in_the_formularyx') + CRLF +
|
---|
| 55 | DKLangConstW('fODMedOIFA_There_are_no_formulary_alternatives_entered_for_this_itemx') + CRLF +
|
---|
| 56 | DKLangConstW('fODMedOIFA_Please_consult_with_your_pharmacy_before_ordering_this_itemx'); //kt
|
---|
| 57 | TC_NO_FORM_ALT := DKLangConstW('fODMedOIFA_No_Formulary_Alternatives'); //kt
|
---|
| 58 | FormAltList := TStringList.Create;
|
---|
| 59 | try
|
---|
| 60 | LoadFormularyAltOI(FormAltList, AnIEN, ForInpatient);
|
---|
| 61 | if FormAltList.Count > 0 then
|
---|
| 62 | begin
|
---|
| 63 | frmODMedOIFA := TfrmODMedOIFA.Create(Application);
|
---|
| 64 | try
|
---|
| 65 | ResizeFormToFont(TForm(frmODMedOIFA));
|
---|
| 66 | with frmODMedOIFA do
|
---|
| 67 | begin
|
---|
| 68 | lstFormAlt.Items.Assign(FormAltList);
|
---|
| 69 | ShowModal;
|
---|
| 70 | if Length(FSelected) > 0 then
|
---|
| 71 | begin
|
---|
| 72 | AnIEN := StrToIntDef(Piece(FSelected, U, 1), 0);
|
---|
| 73 | AName := Piece(FSelected, U, 2);
|
---|
| 74 | end;
|
---|
| 75 | end; {with frmODMedOIFA}
|
---|
| 76 | finally
|
---|
| 77 | frmODMedOIFA.Release;
|
---|
| 78 | end; {frmODMedOIFA}
|
---|
| 79 | end
|
---|
| 80 | else messageDlg(TX_NO_FORM_ALT,mtWarning, [mbOK],0);
|
---|
| 81 | finally
|
---|
| 82 | FormAltList.Free;
|
---|
| 83 | end; {FormAltList}
|
---|
| 84 | end;
|
---|
| 85 |
|
---|
| 86 | procedure CheckFormularyDose(DispDrug: Integer; var OI: Integer; var OIName: string;
|
---|
| 87 | ForInpatient: Boolean);
|
---|
| 88 | var
|
---|
| 89 | frmODMedOIFA: TfrmODMedOIFA;
|
---|
| 90 | FormAltList: TStringList;
|
---|
| 91 | begin
|
---|
| 92 | FormAltList := TStringList.Create;
|
---|
| 93 | try
|
---|
| 94 | LoadFormularyAltDose(FormAltList, DispDrug, OI, ForInpatient);
|
---|
| 95 | if FormAltList.Count > 0 then
|
---|
| 96 | begin
|
---|
| 97 | frmODMedOIFA := TfrmODMedOIFA.Create(Application);
|
---|
| 98 | try
|
---|
| 99 | ResizeFormToFont(TForm(frmODMedOIFA));
|
---|
| 100 | with frmODMedOIFA do
|
---|
| 101 | begin
|
---|
| 102 | lstFormAlt.Items.Assign(FormAltList);
|
---|
| 103 | ShowModal;
|
---|
| 104 | if Length(FSelected) > 0 then
|
---|
| 105 | begin
|
---|
| 106 | OI := StrToIntDef(Piece(FSelected, U, 1), 0);
|
---|
| 107 | OIName := Piece(FSelected, U, 2);
|
---|
| 108 | end;
|
---|
| 109 | end; {with frmODMedOIFA}
|
---|
| 110 | finally
|
---|
| 111 | frmODMedOIFA.Release;
|
---|
| 112 | end; {frmODMedOIFA}
|
---|
| 113 | end; {if FormAltList}
|
---|
| 114 | finally
|
---|
| 115 | FormAltList.Free;
|
---|
| 116 | end; {FormAltList}
|
---|
| 117 | end;
|
---|
| 118 |
|
---|
| 119 | procedure TfrmODMedOIFA.FormCreate(Sender: TObject);
|
---|
| 120 | begin
|
---|
| 121 | inherited;
|
---|
| 122 | FSelected := '';
|
---|
| 123 | end;
|
---|
| 124 |
|
---|
| 125 | procedure TfrmODMedOIFA.lstFormAltClick(Sender: TObject);
|
---|
| 126 | begin
|
---|
| 127 | inherited;
|
---|
| 128 | if lstFormAlt.ItemIndex > -1 then cmdYes.Enabled := True;
|
---|
| 129 | end;
|
---|
| 130 |
|
---|
| 131 | procedure TfrmODMedOIFA.cmdYesClick(Sender: TObject);
|
---|
| 132 | begin
|
---|
| 133 | inherited;
|
---|
| 134 | with lstFormAlt do if ItemIndex > -1 then FSelected := Items[ItemIndex];
|
---|
| 135 | Close;
|
---|
| 136 | end;
|
---|
| 137 |
|
---|
| 138 | procedure TfrmODMedOIFA.cmdNoClick(Sender: TObject);
|
---|
| 139 | begin
|
---|
| 140 | inherited;
|
---|
| 141 | Close;
|
---|
| 142 | end;
|
---|
| 143 |
|
---|
| 144 | procedure TfrmODMedOIFA.FormShow(Sender: TObject);
|
---|
| 145 | begin
|
---|
| 146 | inherited;
|
---|
| 147 | SetFormPosition(Self);
|
---|
| 148 | end;
|
---|
| 149 |
|
---|
| 150 | procedure TfrmODMedOIFA.FormClose(Sender: TObject;
|
---|
| 151 | var Action: TCloseAction);
|
---|
| 152 | begin
|
---|
| 153 | inherited;
|
---|
| 154 | SaveUserBounds(Self);
|
---|
| 155 | end;
|
---|
| 156 |
|
---|
| 157 | end.
|
---|