source: cprs/branches/foia-cprs/CPRS-Chart/Orders/fODMedFA.pas@ 1154

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

Adding foia-cprs branch

File size: 2.7 KB
Line 
1unit fODMedFA;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 fAutoSz, StdCtrls, ORCtrls, ORFn;
8
9type
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
27procedure SelectFormularyAlt(AnIEN: Integer; var ADrug, AnOI: Integer;
28 var ADrugName, AnOIName: string; PSType: Char);
29
30implementation
31
32{$R *.DFM}
33
34uses rODBase;
35
36const
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
42procedure SelectFormularyAlt(AnIEN: Integer; var ADrug, AnOI: Integer;
43 var ADrugName, AnOIName: string; PSType: Char);
44var
45 frmODMedFA: TfrmODMedFA;
46 FormAltList: TStringList;
47begin
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
62 lstFormAlt.Items.Assign(FormAltList);
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}
80end;
81
82procedure TfrmODMedFA.FormCreate(Sender: TObject);
83begin
84 inherited;
85 FSelected := '';
86end;
87
88procedure TfrmODMedFA.lstFormAltClick(Sender: TObject);
89begin
90 inherited;
91 if lstFormAlt.ItemIndex > -1 then cmdYes.Enabled := True;
92end;
93
94procedure TfrmODMedFA.cmdYesClick(Sender: TObject);
95begin
96 inherited;
97 with lstFormAlt do if ItemIndex > -1 then FSelected := Items[ItemIndex];
98 Close;
99end;
100
101procedure TfrmODMedFA.cmdNoClick(Sender: TObject);
102begin
103 inherited;
104 Close;
105end;
106
107end.
Note: See TracBrowser for help on using the repository browser.