source: cprs/branches/tmg-cprs/CPRS-Chart/Orders/fODMedOIFA.pas@ 1686

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

Initial upload of TMG-CPRS 1.0.26.69

File size: 4.5 KB
Line 
1//kt -- Modified with SourceScanner on 8/8/2007
2unit fODMedOIFA;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 StdCtrls, ORCtrls, ExtCtrls, fAutoSz, DKLang;
9
10type
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
29procedure CheckFormularyOI(var AnIEN: Integer; var AName: string; ForInpatient: Boolean);
30procedure CheckFormularyDose(DispDrug: Integer; var OI: Integer; var OIName: string;
31 ForInpatient: Boolean);
32
33implementation
34
35{$R *.DFM}
36
37uses ORFn, rODMeds, rMisc;
38
39procedure 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
47var
48 frmODMedOIFA: TfrmODMedOIFA;
49 FormAltList: TStringList;
50 TX_NO_FORM_ALT : string; //kt
51 TC_NO_FORM_ALT : string; //kt
52
53begin
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}
84end;
85
86procedure CheckFormularyDose(DispDrug: Integer; var OI: Integer; var OIName: string;
87 ForInpatient: Boolean);
88var
89 frmODMedOIFA: TfrmODMedOIFA;
90 FormAltList: TStringList;
91begin
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}
117end;
118
119procedure TfrmODMedOIFA.FormCreate(Sender: TObject);
120begin
121 inherited;
122 FSelected := '';
123end;
124
125procedure TfrmODMedOIFA.lstFormAltClick(Sender: TObject);
126begin
127 inherited;
128 if lstFormAlt.ItemIndex > -1 then cmdYes.Enabled := True;
129end;
130
131procedure TfrmODMedOIFA.cmdYesClick(Sender: TObject);
132begin
133 inherited;
134 with lstFormAlt do if ItemIndex > -1 then FSelected := Items[ItemIndex];
135 Close;
136end;
137
138procedure TfrmODMedOIFA.cmdNoClick(Sender: TObject);
139begin
140 inherited;
141 Close;
142end;
143
144procedure TfrmODMedOIFA.FormShow(Sender: TObject);
145begin
146 inherited;
147 SetFormPosition(Self);
148end;
149
150procedure TfrmODMedOIFA.FormClose(Sender: TObject;
151 var Action: TCloseAction);
152begin
153 inherited;
154 SaveUserBounds(Self);
155end;
156
157end.
Note: See TracBrowser for help on using the repository browser.