source: cprs/branches/tmg-cprs/CPRS-Chart/Orders/fODMedFA.pas@ 1620

Last change on this file since 1620 was 453, checked in by Kevin Toppenberg, 16 years ago

Initial upload of TMG-CPRS 1.0.26.69

File size: 3.6 KB
Line 
1//kt -- Modified with SourceScanner on 8/8/2007
2unit fODMedFA;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 fAutoSz, StdCtrls, ORCtrls, ORFn, DKLang;
9
10type
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
29procedure SelectFormularyAlt(AnIEN: Integer; var ADrug, AnOI: Integer;
30 var ADrugName, AnOIName: string; PSType: Char);
31
32implementation
33
34{$R *.DFM}
35
36uses 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
44var
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
50procedure SetupVars;
51//kt Added entire function to replace constant declarations 8/8/2007
52begin
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');
57end;
58
59procedure SelectFormularyAlt(AnIEN: Integer; var ADrug, AnOI: Integer;
60 var ADrugName, AnOIName: string; PSType: Char);
61var
62 frmODMedFA: TfrmODMedFA;
63 FormAltList: TStringList;
64begin
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}
98end;
99
100procedure TfrmODMedFA.FormCreate(Sender: TObject);
101begin
102 inherited;
103 FSelected := '';
104end;
105
106procedure TfrmODMedFA.lstFormAltClick(Sender: TObject);
107begin
108 inherited;
109 if lstFormAlt.ItemIndex > -1 then cmdYes.Enabled := True;
110end;
111
112procedure TfrmODMedFA.cmdYesClick(Sender: TObject);
113begin
114 inherited;
115 with lstFormAlt do if ItemIndex > -1 then FSelected := Items[ItemIndex];
116 Close;
117end;
118
119procedure TfrmODMedFA.cmdNoClick(Sender: TObject);
120begin
121 inherited;
122 Close;
123end;
124
125end.
Note: See TracBrowser for help on using the repository browser.