source: cprs/branches/tmg-cprs/CPRS-Chart/Orders/fODVitals.pas@ 1226

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

Initial upload of TMG-CPRS 1.0.26.69

File size: 5.8 KB
RevLine 
[453]1//kt -- Modified with SourceScanner on 8/8/2007
2unit fODVitals;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 fODBase, ComCtrls, ExtCtrls, StdCtrls, ORCtrls, ORDtTm, DKLang;
9
10type
11 TfrmODVitals = class(TfrmODBase)
12 cboMeasurement: TORComboBox;
13 cboSchedule: TORComboBox;
14 calStart: TORDateBox;
15 calStop: TORDateBox;
16 grpCallHO: TGroupBox;
17 lblMeasurement: TLabel;
18 lblSchedule: TLabel;
19 lblStart: TLabel;
20 lblStop: TLabel;
21 txtBPsys: TCaptionEdit;
22 txtBPDia: TCaptionEdit;
23 txtPulseLT: TCaptionEdit;
24 txtPulGT: TCaptionEdit;
25 txtTemp: TCaptionEdit;
26 lblBPsys: TLabel;
27 lblBPdia: TLabel;
28 lblPulseLT: TLabel;
29 lblPulseGT: TLabel;
30 lblTemp: TLabel;
31 chkCallHO: TCheckBox;
32 txtComment: TCaptionEdit;
33 lblComment: TLabel;
34 spnBPsys: TUpDown;
35 spnBPdia: TUpDown;
36 spnPulseLT: TUpDown;
37 spnPulseGT: TUpDown;
38 spnTemp: TUpDown;
39 procedure FormCreate(Sender: TObject);
40 procedure ControlChange(Sender: TObject);
41 procedure FormClose(Sender: TObject; var Action: TCloseAction);
42 private
43 { Private declarations }
44 protected
45 procedure InitDialog; override;
46 procedure Validate(var AnErrMsg: string); override;
47 public
48 procedure SetupDialog(OrderAction: Integer; const ID: string); override;
49 end;
50
51var
52 frmODVitals: TfrmODVitals;
53
54implementation
55
56{$R *.DFM}
57
58uses uConst, ORFn, rODBase, fFrame;
59
60//const
61//TX_NO_MEASUREMENT = 'A measurement must be selected.'; <-- original line. //kt 8/8/2007
62//TX_BAD_START = 'The start date is not valid.'; <-- original line. //kt 8/8/2007
63//TX_BAD_STOP = 'The stop date is not valid.'; <-- original line. //kt 8/8/2007
64//TX_STOPSTART = 'The stop date must be after the start date.'; <-- original line. //kt 8/8/2007
65
66var
67 TX_NO_MEASUREMENT : string; //kt
68 TX_BAD_START : string; //kt
69 TX_BAD_STOP : string; //kt
70 TX_STOPSTART : string; //kt
71
72procedure SetupVars;
73//kt Added entire function to replace constant declarations 8/8/2007
74begin
75 TX_NO_MEASUREMENT := DKLangConstW('fODVitals_A_measurement_must_be_selectedx');
76 TX_BAD_START := DKLangConstW('fODVitals_The_start_date_is_not_validx');
77 TX_BAD_STOP := DKLangConstW('fODVitals_The_stop_date_is_not_validx');
78 TX_STOPSTART := DKLangConstW('fODVitals_The_stop_date_must_be_after_the_start_datex');
79end;
80
81procedure TfrmODVitals.FormCreate(Sender: TObject);
82begin
83 frmFrame.pnlVisit.Enabled := false;
84 inherited;
85 FillerID := 'OR'; // does 'on Display' order check **KCM**
86//StatusText('Loading Dialog Definition'); <-- original line. //kt 8/8/2007
87 StatusText(DKLangConstW('fODVitals_Loading_Dialog_Definition')); //kt added 8/8/2007
88 Responses.Dialog := 'GMRVOR';
89 //Responses.Dialog := 'ORWD GENERIC VITALS'; // loads formatting info
90//StatusText('Loading Default Values'); // there are no defaults for text only <-- original line. //kt 8/8/2007
91 StatusText(DKLangConstW('fODVitals_Loading_Default_Values')); // there are no defaults for text only //kt added 8/8/2007
92 CtrlInits.LoadDefaults(ODForVitals);
93 InitDialog;
94 StatusText('');
95end;
96
97procedure TfrmODVitals.InitDialog;
98begin
99 inherited;
100 txtComment.Text := '';
101 with CtrlInits do
102 begin
103// SetControl(cboMeasurement, 'Measurements'); <-- original line. //kt 8/8/2007
104 SetControl(cboMeasurement, DKLangConstW('fODVitals_Measurements')); //kt added 8/8/2007
105// SetControl(cboSchedule, 'Schedules'); <-- original line. //kt 8/8/2007
106 SetControl(cboSchedule, DKLangConstW('fODVitals_Schedules')); //kt added 8/8/2007
107 end;
108 ActiveControl := cboMeasurement; //SetFocusedControl(cboMeasurement);
109end;
110
111procedure TfrmODVitals.SetupDialog(OrderAction: Integer; const ID: string);
112begin
113 inherited;
114 if OrderAction in [ORDER_COPY, ORDER_EDIT, ORDER_QUICK] then with Responses do
115 begin
116 Changing := True;
117 SetControl(cboMeasurement, 'ORDERABLE', 1);
118 SetControl(cboSchedule, 'SCHEDULE', 1);
119 SetControl(calStart, 'START', 1);
120 SetControl(calStop, 'STOP', 1);
121 SetControl(txtComment, 'COMMENT', 1);
122 Changing := False;
123 ControlChange(Self);
124 end;
125end;
126
127procedure TfrmODVitals.Validate(var AnErrMsg: string);
128var
129 ErrMsg: string;
130
131 procedure SetError(const x: string);
132 begin
133 if Length(AnErrMsg) > 0 then AnErrMsg := AnErrMsg + CRLF;
134 AnErrMsg := AnErrMsg + x;
135 end;
136
137begin
138 SetupVars; //kt added 8/8/2007 to replace constants with vars.
139 inherited;
140 if cboMeasurement.ItemIEN <= 0 then SetError(TX_NO_MEASUREMENT);
141 calStart.Validate(ErrMsg);
142 if Length(ErrMsg) > 0 then SetError(TX_BAD_START);
143 calStop.Validate(ErrMsg);
144 if Length(ErrMsg) > 0 then SetError(TX_BAD_STOP);
145 if (Length(calStop.Text) > 0) and (calStop.FMDateTime <= calStart.FMDateTime)
146 then SetError(TX_STOPSTART);
147
148end;
149
150procedure TfrmODVitals.ControlChange(Sender: TObject);
151begin
152 inherited;
153 if Changing then Exit;
154 Responses.Clear;
155 with cboMeasurement do if ItemIEN > 0 then Responses.Update('ORDERABLE', 1, ItemID, Text);
156 with cboSchedule do if Length(Text) > 0 then Responses.Update('SCHEDULE' , 1, Text, Text);
157 with calStart do if Length(Text) > 0 then Responses.Update('START', 1, Text, Text);
158 with calStop do if Length(Text) > 0 then Responses.Update('STOP', 1, Text, Text);
159 with txtComment do if Length(Text) > 0 then Responses.Update('COMMENT', 1, Text, Text);
160 memOrder.Text := Responses.OrderText;
161end;
162
163procedure TfrmODVitals.FormClose(Sender: TObject;
164 var Action: TCloseAction);
165begin
166 inherited;
167 frmFrame.pnlVisit.Enabled := true;
168end;
169
170end.
Note: See TracBrowser for help on using the repository browser.