source: cprs/trunk/CPRS-Chart/fPtCWAD.pas@ 730

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

Initial Upload of Official WV CPRS 1.0.26.76

File size: 2.6 KB
Line 
1unit fPtCWAD;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 fAutoSz, ORCtrls, StdCtrls, ORFn, ExtCtrls;
8
9type
10 TfrmPtCWAD = class(TfrmAutoSz)
11 lstAllergies: TORListBox;
12 lstNotes: TORListBox;
13 lblNotes: TOROffsetLabel;
14 pnlBottom: TPanel;
15 btnClose: TButton;
16 lblAllergies: TOROffsetLabel;
17 procedure FormCreate(Sender: TObject);
18 procedure lstAllergiesClick(Sender: TObject);
19 procedure lstNotesClick(Sender: TObject);
20 procedure FormKeyUp(Sender: TObject; var Key: Word;
21 Shift: TShiftState);
22 procedure btnCloseClick(Sender: TObject);
23 private
24 { Private declarations }
25 public
26 { Public declarations }
27 end;
28
29procedure ShowCWAD;
30
31implementation
32
33{$R *.DFM}
34
35uses rCover, fRptBox, uCore, uConst, fAllgyBox, rODAllergy;
36
37const
38 TX_LST_ALLG = 'Searching for allergies...';
39 TX_LST_POST = 'Searching for postings...';
40
41procedure ShowCWAD;
42{ displays CWAD notices (future - allow updates of allergy info from here? }
43var
44 frmPtCWAD: TfrmPtCWAD;
45begin
46 frmPtCWAD := TfrmPtCWAD.Create(Application);
47 try
48 ResizeFormToFont(TForm(frmPtCWAD));
49 frmPtCWAD.ShowModal;
50 finally
51 frmPtCWAD.Release;
52 end;
53end;
54
55
56procedure TfrmPtCWAD.FormCreate(Sender: TObject);
57var
58 i: Integer;
59begin
60 inherited;
61 StatusText(TX_LST_ALLG);
62 ListAllergies(lstAllergies.Items);
63 StatusText(TX_LST_POST);
64 ListPostings(lstNotes.Items);
65 with lstNotes do for i := Items.Count - 1 downto 0 do
66 if Items[i]='^Allergies^' then Items.Delete(i);
67 StatusText('');
68end;
69
70procedure TfrmPtCWAD.lstAllergiesClick(Sender: TObject);
71begin
72 inherited;
73 with lstAllergies do
74 if ItemIEN > 0 then
75 begin
76{ TODO -oRich V. -cART/Allergy : Allergy Box to update CWAD allergies list? }
77(* if ARTPatchInstalled then
78 AllergyBox(DetailAllergy(ItemIEN), DisplayText[ItemIndex], True, ItemIEN)
79 else*)
80 ReportBox(DetailAllergy(ItemIEN), DisplayText[ItemIndex], True);
81 end;
82end;
83
84procedure TfrmPtCWAD.lstNotesClick(Sender: TObject);
85begin
86 inherited;
87 with lstNotes do
88 if ItemID <> '' then
89 begin
90 NotifyOtherApps(NAE_REPORT, 'TIU^' + lstNotes.ItemID);
91 ReportBox(DetailPosting(ItemID), DisplayText[ItemIndex], True);
92 end;
93end;
94
95procedure TfrmPtCWAD.FormKeyUp(Sender: TObject; var Key: Word;
96 Shift: TShiftState);
97begin
98 inherited;
99 if Key = VK_ESCAPE then
100 begin
101 Key := 0;
102 Close;
103 end;
104end;
105
106procedure TfrmPtCWAD.btnCloseClick(Sender: TObject);
107begin
108 inherited;
109 Close;
110end;
111
112end.
Note: See TracBrowser for help on using the repository browser.