source: cprs/trunk/CPRS-Chart/Encounter/fPatientEd.pas@ 819

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

Initial Upload of Official WV CPRS 1.0.26.76

File size: 2.9 KB
Line 
1unit fPatientEd;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 fPCEBase, StdCtrls, ORCtrls, CheckLst, ExtCtrls, Buttons, uPCE, rPCE, ORFn,
8 fPCELex, fPCEOther, ComCtrls, fPCEBaseMain;
9
10type
11 TfrmPatientEd = class(TfrmPCEBaseMain)
12 lblUnderstanding: TLabel;
13 cboPatUnderstanding: TORComboBox;
14 procedure cboPatUnderstandingChange(Sender: TObject);
15 procedure FormCreate(Sender: TObject);
16 private
17 protected
18 procedure UpdateNewItemStr(var x: string); override;
19 procedure UpdateControls; override;
20 public
21 end;
22
23var
24 frmPatientEd: TfrmPatientEd;
25
26implementation
27
28{$R *.DFM}
29
30uses
31 fEncounterFrame;
32
33{///////////////////////////////////////////////////////////////////////////////
34//Name:procedure tfrmPatientEd.cboPatUnderstandingChange(Sender: TObject);
35//Created: Jan 1999
36//By: Robert Bott
37//Location: ISL
38//Description:Change the level of understanding assigned to the education item.
39///////////////////////////////////////////////////////////////////////////////}
40procedure tfrmPatientEd.cboPatUnderstandingChange(Sender: TObject);
41var
42 i: integer;
43
44begin
45 if(NotUpdating) and (cboPatUnderstanding.Text <> '') then
46 begin
47 for i := 0 to lbGrid.Items.Count-1 do
48 if(lbGrid.Selected[i]) then
49 TPCEPat(lbGrid.Items.Objects[i]).Level := cboPatUnderstanding.ItemID;
50 GridChanged;
51 end;
52end;
53
54procedure TfrmPatientEd.FormCreate(Sender: TObject);
55begin
56 inherited;
57 FTabName := CT_PedNm;
58 FPCEListCodesProc := ListPatientCodes;
59 FPCEItemClass := TPCEPat;
60 FPCECode := 'PED';
61 PCELoadORCombo(cboPatUnderstanding);
62end;
63
64procedure TfrmPatientEd.UpdateNewItemStr(var x: string);
65begin
66 SetPiece(x, U, pnumPEDLevel, NoPCEValue);
67end;
68
69procedure TfrmPatientEd.UpdateControls;
70var
71 ok, First: boolean;
72 SameLOU: boolean;
73 i: integer;
74 LOU: string;
75 Obj: TPCEPat;
76
77begin
78 inherited;
79 if(NotUpdating) then
80 begin
81 BeginUpdate;
82 try
83 ok := (lbGrid.SelCount > 0);
84 lblUnderstanding.Enabled := ok;
85 cboPatUnderstanding.Enabled := ok;
86 if(ok) then
87 begin
88 First := TRUE;
89 SameLOU := TRUE;
90 LOU := NoPCEValue;
91 for i := 0 to lbGrid.Items.Count-1 do
92 begin
93 if lbGrid.Selected[i] then
94 begin
95 Obj := TPCEPat(lbGrid.Items.Objects[i]);
96 if(First) then
97 begin
98 First := FALSE;
99 LOU := Obj.Level;
100 end
101 else
102 begin
103 if(SameLOU) then
104 SameLOU := (LOU = Obj.Level);
105 end;
106 end;
107 end;
108 if(SameLOU) then
109 cboPatUnderstanding.SelectByID(LOU)
110 else
111 cboPatUnderstanding.Text := '';
112 end
113 else
114 begin
115 cboPatUnderstanding.Text := '';
116 end;
117 finally
118 EndUpdate;
119 end;
120 end;
121end;
122
123end.
Note: See TracBrowser for help on using the repository browser.