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