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