[456] | 1 | unit fODMedFA;
|
---|
| 2 |
|
---|
| 3 | interface
|
---|
| 4 |
|
---|
| 5 | uses
|
---|
| 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
[829] | 7 | fAutoSz, StdCtrls, ORCtrls, ORFn, VA508AccessibilityManager;
|
---|
[456] | 8 |
|
---|
| 9 | type
|
---|
| 10 | TfrmODMedFA = class(TfrmAutoSz)
|
---|
| 11 | Label1: TLabel;
|
---|
| 12 | lstFormAlt: TORListBox;
|
---|
| 13 | Label2: TStaticText;
|
---|
| 14 | cmdYes: TButton;
|
---|
| 15 | cmdNo: TButton;
|
---|
| 16 | procedure lstFormAltClick(Sender: TObject);
|
---|
| 17 | procedure cmdYesClick(Sender: TObject);
|
---|
| 18 | procedure FormCreate(Sender: TObject);
|
---|
| 19 | procedure cmdNoClick(Sender: TObject);
|
---|
| 20 | private
|
---|
| 21 | { Private declarations }
|
---|
| 22 | FSelected: string;
|
---|
| 23 | public
|
---|
| 24 | { Public declarations }
|
---|
| 25 | end;
|
---|
| 26 |
|
---|
| 27 | procedure SelectFormularyAlt(AnIEN: Integer; var ADrug, AnOI: Integer;
|
---|
| 28 | var ADrugName, AnOIName: string; PSType: Char);
|
---|
| 29 |
|
---|
| 30 | implementation
|
---|
| 31 |
|
---|
| 32 | {$R *.DFM}
|
---|
| 33 |
|
---|
| 34 | uses rODBase;
|
---|
| 35 |
|
---|
| 36 | const
|
---|
| 37 | TX_NO_FORM_ALT = 'This drug is not in the formulary!' + CRLF +
|
---|
| 38 | 'There are no formulary alternatives entered for this item.' + CRLF +
|
---|
| 39 | 'Please consult with your pharmacy before ordering this item.';
|
---|
| 40 | TC_NO_FORM_ALT = 'No Formulary Alternatives';
|
---|
| 41 |
|
---|
| 42 | procedure SelectFormularyAlt(AnIEN: Integer; var ADrug, AnOI: Integer;
|
---|
| 43 | var ADrugName, AnOIName: string; PSType: Char);
|
---|
| 44 | var
|
---|
| 45 | frmODMedFA: TfrmODMedFA;
|
---|
| 46 | FormAltList: TStringList;
|
---|
| 47 | begin
|
---|
| 48 | ADrug := 0;
|
---|
| 49 | AnOI := 0;
|
---|
| 50 | ADrugName := '';
|
---|
| 51 | AnOIName := '';
|
---|
| 52 | FormAltList := TStringList.Create;
|
---|
| 53 | try
|
---|
| 54 | LoadFormularyAlt(FormAltList, AnIEN, PSType);
|
---|
| 55 | if FormAltList.Count > 0 then
|
---|
| 56 | begin
|
---|
| 57 | frmODMedFA := TfrmODMedFA.Create(Application);
|
---|
| 58 | try
|
---|
| 59 | ResizeFormToFont(TForm(frmODMedFA));
|
---|
| 60 | with frmODMedFA do
|
---|
| 61 | begin
|
---|
[829] | 62 | FastAssign(FormAltList, lstFormAlt.Items);
|
---|
[456] | 63 | ShowModal;
|
---|
| 64 | if Length(FSelected) > 0 then
|
---|
| 65 | begin
|
---|
| 66 | ADrug := StrToIntDef(Piece(FSelected, U, 1), 0);
|
---|
| 67 | AnOI := StrToIntDef(Piece(FSelected, U, 4), 0);
|
---|
| 68 | ADrugName := Piece(FSelected, U, 2);
|
---|
| 69 | AnOIName := Piece(FSelected, U, 5);
|
---|
| 70 | end;
|
---|
| 71 | end;
|
---|
| 72 | finally
|
---|
| 73 | frmODMedFA.Release;
|
---|
| 74 | end; {frmODMedFA}
|
---|
| 75 | end
|
---|
| 76 | else InfoBox(TX_NO_FORM_ALT, TC_NO_FORM_ALT, MB_OK);
|
---|
| 77 | finally
|
---|
| 78 | FormAltList.Free;
|
---|
| 79 | end; {FormAltList}
|
---|
| 80 | end;
|
---|
| 81 |
|
---|
| 82 | procedure TfrmODMedFA.FormCreate(Sender: TObject);
|
---|
| 83 | begin
|
---|
| 84 | inherited;
|
---|
| 85 | FSelected := '';
|
---|
| 86 | end;
|
---|
| 87 |
|
---|
| 88 | procedure TfrmODMedFA.lstFormAltClick(Sender: TObject);
|
---|
| 89 | begin
|
---|
| 90 | inherited;
|
---|
| 91 | if lstFormAlt.ItemIndex > -1 then cmdYes.Enabled := True;
|
---|
| 92 | end;
|
---|
| 93 |
|
---|
| 94 | procedure TfrmODMedFA.cmdYesClick(Sender: TObject);
|
---|
| 95 | begin
|
---|
| 96 | inherited;
|
---|
| 97 | with lstFormAlt do if ItemIndex > -1 then FSelected := Items[ItemIndex];
|
---|
| 98 | Close;
|
---|
| 99 | end;
|
---|
| 100 |
|
---|
| 101 | procedure TfrmODMedFA.cmdNoClick(Sender: TObject);
|
---|
| 102 | begin
|
---|
| 103 | inherited;
|
---|
| 104 | Close;
|
---|
| 105 | end;
|
---|
| 106 |
|
---|
| 107 | end.
|
---|