source: Scheduling/trunk/cs/bsdx0200GUISourceCode/DAppointPage.cs@ 1675

Last change on this file since 1675 was 1117, checked in by Sam Habiel, 14 years ago

CGAVDocument: Don't Update Grid. Leave that to CGAVView.
CGAVView: When updating grid, make a copy of appointments, and use the copy, so there won't be clashes when updating appointments in the background.
CGDocument: Minor Changes in AppointmentNoShow; New method AppointmentUndoCheckIn
CGDocumentManager: Resequenced load order b/c UserPreferences now talks to DB.
DAL: New Methods to save autoprint preferences; new delegate to enable some async stuff
DCheckIn & DAppointPage: _myCodeIsFiringIstheCheckBoxChangedEvent added to protect against firing event when setting checkbox in the code.
DPatientLetter: No changes.
UserPreferences: Now gets and saves user preferences from DB.

File size: 36.8 KB
Line 
1using System;
2using System.Drawing;
3using System.Collections;
4using System.ComponentModel;
5using System.Windows.Forms;
6using System.Data;
7//using System.Data.OleDb;
8using System.Diagnostics;
9using IndianHealthService.BMXNet;
10
11namespace IndianHealthService.ClinicalScheduling
12{
13 /// <summary>
14 /// Appointment Info Dialog
15 /// </summary>
16 public class DAppointPage : System.Windows.Forms.Form
17 {
18 private System.Windows.Forms.TabControl tabControl1;
19 private System.Windows.Forms.TabPage tabPatientInfo;
20 private System.Windows.Forms.TabPage tabAppointment;
21 private System.Windows.Forms.Panel panel1;
22 private System.Windows.Forms.Button cmdOK;
23 private System.Windows.Forms.Button cmdCancel;
24 private System.Windows.Forms.GroupBox groupBox2;
25 private System.Windows.Forms.TextBox txtCity;
26 private System.Windows.Forms.Label label8;
27 private System.Windows.Forms.Label label9;
28 private System.Windows.Forms.TextBox txtZip;
29 private System.Windows.Forms.Label label10;
30 private System.Windows.Forms.TextBox txtState;
31 private System.Windows.Forms.Label label11;
32 private System.Windows.Forms.TextBox txtStreet;
33 private System.Windows.Forms.Label label12;
34 private System.Windows.Forms.TextBox txtPhoneOffice;
35 private System.Windows.Forms.Label label13;
36 private System.Windows.Forms.TextBox txtPhoneHome;
37 private System.Windows.Forms.GroupBox groupBox1;
38 private System.Windows.Forms.Label label6;
39 private System.Windows.Forms.TextBox txtPID;
40 private System.Windows.Forms.Label label5;
41 private System.Windows.Forms.TextBox txtDOB;
42 private System.Windows.Forms.Label label2;
43 private System.Windows.Forms.TextBox txtPatientName;
44 private System.Windows.Forms.GroupBox groupBox3;
45 private System.Windows.Forms.Label lblClinic;
46 private System.Windows.Forms.Label label15;
47 private System.Windows.Forms.TextBox txtNote;
48 private System.Windows.Forms.Label label1;
49 private System.Windows.Forms.Label lblDuration;
50 private System.Windows.Forms.Label lblStartTime;
51 private System.Windows.Forms.Label label4;
52 private System.Windows.Forms.Label label3;
53 private System.Windows.Forms.Label label14;
54 private System.Windows.Forms.TextBox txtHRN;
55 private GroupBox groupBox4;
56 private BindingSource dsPatientApptDisplay2BindingSource;
57 private dsPatientApptDisplay2 dsPatientApptDisplay2;
58 private BindingSource patientApptsBindingSource;
59 private Label label17;
60 private TextBox txtEmail;
61 private Label label16;
62 private TextBox txtPhoneCell;
63 private Label label7;
64 private TextBox txtCountry;
65 private CheckBox chkPrint;
66 private Label label18;
67 private TextBox txtSex;
68 private IContainer components;
69
70 public DAppointPage()
71 {
72 InitializeComponent();
73 }
74
75 #region Windows Form Designer generated code
76 /// <summary>
77 /// Required method for Designer support - do not modify
78 /// the contents of this method with the code editor.
79 /// </summary>
80 private void InitializeComponent()
81 {
82 this.components = new System.ComponentModel.Container();
83 this.tabControl1 = new System.Windows.Forms.TabControl();
84 this.tabAppointment = new System.Windows.Forms.TabPage();
85 this.groupBox4 = new System.Windows.Forms.GroupBox();
86 this.groupBox3 = new System.Windows.Forms.GroupBox();
87 this.lblClinic = new System.Windows.Forms.Label();
88 this.label15 = new System.Windows.Forms.Label();
89 this.txtNote = new System.Windows.Forms.TextBox();
90 this.label1 = new System.Windows.Forms.Label();
91 this.lblDuration = new System.Windows.Forms.Label();
92 this.lblStartTime = new System.Windows.Forms.Label();
93 this.label4 = new System.Windows.Forms.Label();
94 this.label3 = new System.Windows.Forms.Label();
95 this.groupBox1 = new System.Windows.Forms.GroupBox();
96 this.txtSex = new System.Windows.Forms.TextBox();
97 this.label18 = new System.Windows.Forms.Label();
98 this.label14 = new System.Windows.Forms.Label();
99 this.txtHRN = new System.Windows.Forms.TextBox();
100 this.label6 = new System.Windows.Forms.Label();
101 this.txtPID = new System.Windows.Forms.TextBox();
102 this.label5 = new System.Windows.Forms.Label();
103 this.txtDOB = new System.Windows.Forms.TextBox();
104 this.label2 = new System.Windows.Forms.Label();
105 this.txtPatientName = new System.Windows.Forms.TextBox();
106 this.tabPatientInfo = new System.Windows.Forms.TabPage();
107 this.groupBox2 = new System.Windows.Forms.GroupBox();
108 this.label17 = new System.Windows.Forms.Label();
109 this.txtEmail = new System.Windows.Forms.TextBox();
110 this.label16 = new System.Windows.Forms.Label();
111 this.txtPhoneCell = new System.Windows.Forms.TextBox();
112 this.label7 = new System.Windows.Forms.Label();
113 this.txtCountry = new System.Windows.Forms.TextBox();
114 this.label12 = new System.Windows.Forms.Label();
115 this.txtPhoneOffice = new System.Windows.Forms.TextBox();
116 this.label13 = new System.Windows.Forms.Label();
117 this.txtPhoneHome = new System.Windows.Forms.TextBox();
118 this.txtCity = new System.Windows.Forms.TextBox();
119 this.label8 = new System.Windows.Forms.Label();
120 this.label9 = new System.Windows.Forms.Label();
121 this.txtZip = new System.Windows.Forms.TextBox();
122 this.label10 = new System.Windows.Forms.Label();
123 this.txtState = new System.Windows.Forms.TextBox();
124 this.label11 = new System.Windows.Forms.Label();
125 this.txtStreet = new System.Windows.Forms.TextBox();
126 this.panel1 = new System.Windows.Forms.Panel();
127 this.chkPrint = new System.Windows.Forms.CheckBox();
128 this.cmdCancel = new System.Windows.Forms.Button();
129 this.cmdOK = new System.Windows.Forms.Button();
130 this.patientApptsBindingSource = new System.Windows.Forms.BindingSource(this.components);
131 this.dsPatientApptDisplay2BindingSource = new System.Windows.Forms.BindingSource(this.components);
132 this.dsPatientApptDisplay2 = new IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2();
133 this.tabControl1.SuspendLayout();
134 this.tabAppointment.SuspendLayout();
135 this.groupBox3.SuspendLayout();
136 this.groupBox1.SuspendLayout();
137 this.tabPatientInfo.SuspendLayout();
138 this.groupBox2.SuspendLayout();
139 this.panel1.SuspendLayout();
140 ((System.ComponentModel.ISupportInitialize)(this.patientApptsBindingSource)).BeginInit();
141 ((System.ComponentModel.ISupportInitialize)(this.dsPatientApptDisplay2BindingSource)).BeginInit();
142 ((System.ComponentModel.ISupportInitialize)(this.dsPatientApptDisplay2)).BeginInit();
143 this.SuspendLayout();
144 //
145 // tabControl1
146 //
147 this.tabControl1.Controls.Add(this.tabAppointment);
148 this.tabControl1.Controls.Add(this.tabPatientInfo);
149 this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
150 this.tabControl1.Location = new System.Drawing.Point(0, 0);
151 this.tabControl1.Name = "tabControl1";
152 this.tabControl1.SelectedIndex = 0;
153 this.tabControl1.Size = new System.Drawing.Size(471, 526);
154 this.tabControl1.TabIndex = 0;
155 //
156 // tabAppointment
157 //
158 this.tabAppointment.Controls.Add(this.groupBox4);
159 this.tabAppointment.Controls.Add(this.groupBox3);
160 this.tabAppointment.Controls.Add(this.groupBox1);
161 this.tabAppointment.Location = new System.Drawing.Point(4, 22);
162 this.tabAppointment.Name = "tabAppointment";
163 this.tabAppointment.Size = new System.Drawing.Size(463, 500);
164 this.tabAppointment.TabIndex = 1;
165 this.tabAppointment.Text = "Appointment";
166 //
167 // groupBox4
168 //
169 this.groupBox4.Location = new System.Drawing.Point(8, 254);
170 this.groupBox4.Name = "groupBox4";
171 this.groupBox4.Size = new System.Drawing.Size(439, 204);
172 this.groupBox4.TabIndex = 14;
173 this.groupBox4.TabStop = false;
174 this.groupBox4.Text = "Other Appointments";
175 //
176 // groupBox3
177 //
178 this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
179 | System.Windows.Forms.AnchorStyles.Right)));
180 this.groupBox3.Controls.Add(this.lblClinic);
181 this.groupBox3.Controls.Add(this.label15);
182 this.groupBox3.Controls.Add(this.txtNote);
183 this.groupBox3.Controls.Add(this.label1);
184 this.groupBox3.Controls.Add(this.lblDuration);
185 this.groupBox3.Controls.Add(this.lblStartTime);
186 this.groupBox3.Controls.Add(this.label4);
187 this.groupBox3.Controls.Add(this.label3);
188 this.groupBox3.Location = new System.Drawing.Point(8, 107);
189 this.groupBox3.Name = "groupBox3";
190 this.groupBox3.Size = new System.Drawing.Size(439, 141);
191 this.groupBox3.TabIndex = 13;
192 this.groupBox3.TabStop = false;
193 this.groupBox3.Text = "Appointment";
194 //
195 // lblClinic
196 //
197 this.lblClinic.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
198 this.lblClinic.Location = new System.Drawing.Point(200, 48);
199 this.lblClinic.Name = "lblClinic";
200 this.lblClinic.Size = new System.Drawing.Size(233, 16);
201 this.lblClinic.TabIndex = 19;
202 //
203 // label15
204 //
205 this.label15.Location = new System.Drawing.Point(152, 48);
206 this.label15.Name = "label15";
207 this.label15.Size = new System.Drawing.Size(40, 16);
208 this.label15.TabIndex = 18;
209 this.label15.Text = "Clinic:";
210 this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
211 //
212 // txtNote
213 //
214 this.txtNote.AcceptsReturn = true;
215 this.txtNote.Location = new System.Drawing.Point(80, 72);
216 this.txtNote.Multiline = true;
217 this.txtNote.Name = "txtNote";
218 this.txtNote.Size = new System.Drawing.Size(353, 60);
219 this.txtNote.TabIndex = 17;
220 //
221 // label1
222 //
223 this.label1.Location = new System.Drawing.Point(4, 80);
224 this.label1.Name = "label1";
225 this.label1.Size = new System.Drawing.Size(56, 16);
226 this.label1.TabIndex = 16;
227 this.label1.Text = "Notes:";
228 this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
229 //
230 // lblDuration
231 //
232 this.lblDuration.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
233 this.lblDuration.Location = new System.Drawing.Point(80, 48);
234 this.lblDuration.Name = "lblDuration";
235 this.lblDuration.Size = new System.Drawing.Size(56, 16);
236 this.lblDuration.TabIndex = 15;
237 //
238 // lblStartTime
239 //
240 this.lblStartTime.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
241 this.lblStartTime.Location = new System.Drawing.Point(80, 24);
242 this.lblStartTime.Name = "lblStartTime";
243 this.lblStartTime.Size = new System.Drawing.Size(353, 16);
244 this.lblStartTime.TabIndex = 14;
245 //
246 // label4
247 //
248 this.label4.Location = new System.Drawing.Point(16, 48);
249 this.label4.Name = "label4";
250 this.label4.Size = new System.Drawing.Size(56, 16);
251 this.label4.TabIndex = 13;
252 this.label4.Text = "Duration:";
253 this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
254 //
255 // label3
256 //
257 this.label3.Location = new System.Drawing.Point(8, 24);
258 this.label3.Name = "label3";
259 this.label3.Size = new System.Drawing.Size(64, 16);
260 this.label3.TabIndex = 12;
261 this.label3.Text = "Start Time:";
262 this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
263 //
264 // groupBox1
265 //
266 this.groupBox1.Controls.Add(this.txtSex);
267 this.groupBox1.Controls.Add(this.label18);
268 this.groupBox1.Controls.Add(this.label14);
269 this.groupBox1.Controls.Add(this.txtHRN);
270 this.groupBox1.Controls.Add(this.label6);
271 this.groupBox1.Controls.Add(this.txtPID);
272 this.groupBox1.Controls.Add(this.label5);
273 this.groupBox1.Controls.Add(this.txtDOB);
274 this.groupBox1.Controls.Add(this.label2);
275 this.groupBox1.Controls.Add(this.txtPatientName);
276 this.groupBox1.Location = new System.Drawing.Point(8, 8);
277 this.groupBox1.Name = "groupBox1";
278 this.groupBox1.Size = new System.Drawing.Size(439, 93);
279 this.groupBox1.TabIndex = 12;
280 this.groupBox1.TabStop = false;
281 this.groupBox1.Text = "Patient ID";
282 //
283 // txtSex
284 //
285 this.txtSex.BackColor = System.Drawing.SystemColors.Control;
286 this.txtSex.Location = new System.Drawing.Point(273, 41);
287 this.txtSex.Name = "txtSex";
288 this.txtSex.ReadOnly = true;
289 this.txtSex.Size = new System.Drawing.Size(160, 20);
290 this.txtSex.TabIndex = 15;
291 //
292 // label18
293 //
294 this.label18.AutoSize = true;
295 this.label18.Location = new System.Drawing.Point(238, 44);
296 this.label18.Name = "label18";
297 this.label18.Size = new System.Drawing.Size(29, 13);
298 this.label18.TabIndex = 14;
299 this.label18.Text = "Sex:";
300 //
301 // label14
302 //
303 this.label14.Location = new System.Drawing.Point(50, 64);
304 this.label14.Name = "label14";
305 this.label14.Size = new System.Drawing.Size(40, 16);
306 this.label14.TabIndex = 13;
307 this.label14.Text = "HRN:";
308 this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
309 //
310 // txtHRN
311 //
312 this.txtHRN.Location = new System.Drawing.Point(96, 64);
313 this.txtHRN.Name = "txtHRN";
314 this.txtHRN.ReadOnly = true;
315 this.txtHRN.Size = new System.Drawing.Size(120, 20);
316 this.txtHRN.TabIndex = 12;
317 //
318 // label6
319 //
320 this.label6.Location = new System.Drawing.Point(227, 65);
321 this.label6.Name = "label6";
322 this.label6.Size = new System.Drawing.Size(40, 16);
323 this.label6.TabIndex = 9;
324 this.label6.Text = "ID:";
325 this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
326 //
327 // txtPID
328 //
329 this.txtPID.Location = new System.Drawing.Point(272, 63);
330 this.txtPID.Name = "txtPID";
331 this.txtPID.ReadOnly = true;
332 this.txtPID.Size = new System.Drawing.Size(161, 20);
333 this.txtPID.TabIndex = 8;
334 //
335 // label5
336 //
337 this.label5.Location = new System.Drawing.Point(58, 41);
338 this.label5.Name = "label5";
339 this.label5.Size = new System.Drawing.Size(32, 16);
340 this.label5.TabIndex = 7;
341 this.label5.Text = "DOB:";
342 this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
343 //
344 // txtDOB
345 //
346 this.txtDOB.Location = new System.Drawing.Point(96, 40);
347 this.txtDOB.Name = "txtDOB";
348 this.txtDOB.ReadOnly = true;
349 this.txtDOB.Size = new System.Drawing.Size(120, 20);
350 this.txtDOB.TabIndex = 6;
351 //
352 // label2
353 //
354 this.label2.Location = new System.Drawing.Point(50, 16);
355 this.label2.Name = "label2";
356 this.label2.Size = new System.Drawing.Size(40, 16);
357 this.label2.TabIndex = 5;
358 this.label2.Text = "Name:";
359 this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
360 //
361 // txtPatientName
362 //
363 this.txtPatientName.Location = new System.Drawing.Point(96, 16);
364 this.txtPatientName.Name = "txtPatientName";
365 this.txtPatientName.ReadOnly = true;
366 this.txtPatientName.Size = new System.Drawing.Size(337, 20);
367 this.txtPatientName.TabIndex = 0;
368 //
369 // tabPatientInfo
370 //
371 this.tabPatientInfo.Controls.Add(this.groupBox2);
372 this.tabPatientInfo.Location = new System.Drawing.Point(4, 22);
373 this.tabPatientInfo.Name = "tabPatientInfo";
374 this.tabPatientInfo.Size = new System.Drawing.Size(463, 500);
375 this.tabPatientInfo.TabIndex = 0;
376 this.tabPatientInfo.Text = "Contact Information";
377 //
378 // groupBox2
379 //
380 this.groupBox2.Controls.Add(this.label17);
381 this.groupBox2.Controls.Add(this.txtEmail);
382 this.groupBox2.Controls.Add(this.label16);
383 this.groupBox2.Controls.Add(this.txtPhoneCell);
384 this.groupBox2.Controls.Add(this.label7);
385 this.groupBox2.Controls.Add(this.txtCountry);
386 this.groupBox2.Controls.Add(this.label12);
387 this.groupBox2.Controls.Add(this.txtPhoneOffice);
388 this.groupBox2.Controls.Add(this.label13);
389 this.groupBox2.Controls.Add(this.txtPhoneHome);
390 this.groupBox2.Controls.Add(this.txtCity);
391 this.groupBox2.Controls.Add(this.label8);
392 this.groupBox2.Controls.Add(this.label9);
393 this.groupBox2.Controls.Add(this.txtZip);
394 this.groupBox2.Controls.Add(this.label10);
395 this.groupBox2.Controls.Add(this.txtState);
396 this.groupBox2.Controls.Add(this.label11);
397 this.groupBox2.Controls.Add(this.txtStreet);
398 this.groupBox2.Location = new System.Drawing.Point(8, 16);
399 this.groupBox2.Name = "groupBox2";
400 this.groupBox2.Size = new System.Drawing.Size(444, 198);
401 this.groupBox2.TabIndex = 1;
402 this.groupBox2.TabStop = false;
403 this.groupBox2.Text = "Address";
404 //
405 // label17
406 //
407 this.label17.Location = new System.Drawing.Point(224, 94);
408 this.label17.Name = "label17";
409 this.label17.Size = new System.Drawing.Size(40, 16);
410 this.label17.TabIndex = 29;
411 this.label17.Text = "E-Mail:";
412 this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
413 //
414 // txtEmail
415 //
416 this.txtEmail.Location = new System.Drawing.Point(267, 94);
417 this.txtEmail.Name = "txtEmail";
418 this.txtEmail.ReadOnly = true;
419 this.txtEmail.Size = new System.Drawing.Size(166, 20);
420 this.txtEmail.TabIndex = 28;
421 //
422 // label16
423 //
424 this.label16.Location = new System.Drawing.Point(19, 142);
425 this.label16.Name = "label16";
426 this.label16.Size = new System.Drawing.Size(69, 16);
427 this.label16.TabIndex = 27;
428 this.label16.Text = "Cell/Mobile:";
429 this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
430 //
431 // txtPhoneCell
432 //
433 this.txtPhoneCell.Location = new System.Drawing.Point(91, 142);
434 this.txtPhoneCell.Name = "txtPhoneCell";
435 this.txtPhoneCell.ReadOnly = true;
436 this.txtPhoneCell.Size = new System.Drawing.Size(120, 20);
437 this.txtPhoneCell.TabIndex = 26;
438 //
439 // label7
440 //
441 this.label7.Location = new System.Drawing.Point(33, 94);
442 this.label7.Name = "label7";
443 this.label7.Size = new System.Drawing.Size(55, 16);
444 this.label7.TabIndex = 25;
445 this.label7.Text = "Country:";
446 this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
447 //
448 // txtCountry
449 //
450 this.txtCountry.Location = new System.Drawing.Point(91, 94);
451 this.txtCountry.Name = "txtCountry";
452 this.txtCountry.ReadOnly = true;
453 this.txtCountry.Size = new System.Drawing.Size(120, 20);
454 this.txtCountry.TabIndex = 24;
455 //
456 // label12
457 //
458 this.label12.Location = new System.Drawing.Point(2, 166);
459 this.label12.Name = "label12";
460 this.label12.Size = new System.Drawing.Size(86, 14);
461 this.label12.TabIndex = 23;
462 this.label12.Text = "Phone (Office):";
463 this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
464 //
465 // txtPhoneOffice
466 //
467 this.txtPhoneOffice.Location = new System.Drawing.Point(91, 166);
468 this.txtPhoneOffice.Name = "txtPhoneOffice";
469 this.txtPhoneOffice.ReadOnly = true;
470 this.txtPhoneOffice.Size = new System.Drawing.Size(120, 20);
471 this.txtPhoneOffice.TabIndex = 22;
472 //
473 // label13
474 //
475 this.label13.Location = new System.Drawing.Point(5, 118);
476 this.label13.Name = "label13";
477 this.label13.Size = new System.Drawing.Size(83, 16);
478 this.label13.TabIndex = 21;
479 this.label13.Text = "Phone (Home):";
480 this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
481 //
482 // txtPhoneHome
483 //
484 this.txtPhoneHome.Location = new System.Drawing.Point(91, 118);
485 this.txtPhoneHome.Name = "txtPhoneHome";
486 this.txtPhoneHome.ReadOnly = true;
487 this.txtPhoneHome.Size = new System.Drawing.Size(120, 20);
488 this.txtPhoneHome.TabIndex = 20;
489 //
490 // txtCity
491 //
492 this.txtCity.Location = new System.Drawing.Point(91, 46);
493 this.txtCity.Name = "txtCity";
494 this.txtCity.ReadOnly = true;
495 this.txtCity.Size = new System.Drawing.Size(342, 20);
496 this.txtCity.TabIndex = 18;
497 //
498 // label8
499 //
500 this.label8.Location = new System.Drawing.Point(52, 46);
501 this.label8.Name = "label8";
502 this.label8.Size = new System.Drawing.Size(36, 16);
503 this.label8.TabIndex = 19;
504 this.label8.Text = "City:";
505 this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
506 //
507 // label9
508 //
509 this.label9.Location = new System.Drawing.Point(224, 70);
510 this.label9.Name = "label9";
511 this.label9.Size = new System.Drawing.Size(40, 16);
512 this.label9.TabIndex = 17;
513 this.label9.Text = "Zip:";
514 this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
515 //
516 // txtZip
517 //
518 this.txtZip.Location = new System.Drawing.Point(267, 70);
519 this.txtZip.Name = "txtZip";
520 this.txtZip.ReadOnly = true;
521 this.txtZip.Size = new System.Drawing.Size(166, 20);
522 this.txtZip.TabIndex = 16;
523 //
524 // label10
525 //
526 this.label10.Location = new System.Drawing.Point(47, 70);
527 this.label10.Name = "label10";
528 this.label10.Size = new System.Drawing.Size(41, 16);
529 this.label10.TabIndex = 15;
530 this.label10.Text = "State:";
531 this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
532 //
533 // txtState
534 //
535 this.txtState.Location = new System.Drawing.Point(91, 70);
536 this.txtState.Name = "txtState";
537 this.txtState.ReadOnly = true;
538 this.txtState.Size = new System.Drawing.Size(120, 20);
539 this.txtState.TabIndex = 14;
540 //
541 // label11
542 //
543 this.label11.Location = new System.Drawing.Point(47, 22);
544 this.label11.Name = "label11";
545 this.label11.Size = new System.Drawing.Size(41, 16);
546 this.label11.TabIndex = 13;
547 this.label11.Text = "Street:";
548 this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
549 //
550 // txtStreet
551 //
552 this.txtStreet.Location = new System.Drawing.Point(91, 22);
553 this.txtStreet.Name = "txtStreet";
554 this.txtStreet.ReadOnly = true;
555 this.txtStreet.Size = new System.Drawing.Size(342, 20);
556 this.txtStreet.TabIndex = 12;
557 //
558 // panel1
559 //
560 this.panel1.Controls.Add(this.chkPrint);
561 this.panel1.Controls.Add(this.cmdCancel);
562 this.panel1.Controls.Add(this.cmdOK);
563 this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
564 this.panel1.Location = new System.Drawing.Point(0, 486);
565 this.panel1.Name = "panel1";
566 this.panel1.Size = new System.Drawing.Size(471, 40);
567 this.panel1.TabIndex = 1;
568 //
569 // chkPrint
570 //
571 this.chkPrint.AutoSize = true;
572 this.chkPrint.Location = new System.Drawing.Point(13, 14);
573 this.chkPrint.Name = "chkPrint";
574 this.chkPrint.Size = new System.Drawing.Size(144, 17);
575 this.chkPrint.TabIndex = 2;
576 this.chkPrint.Text = "Print Appointment Letter";
577 this.chkPrint.UseVisualStyleBackColor = true;
578 this.chkPrint.CheckedChanged += new System.EventHandler(this.chkPrint_CheckedChanged);
579 //
580 // cmdCancel
581 //
582 this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
583 this.cmdCancel.Location = new System.Drawing.Point(387, 8);
584 this.cmdCancel.Name = "cmdCancel";
585 this.cmdCancel.Size = new System.Drawing.Size(64, 24);
586 this.cmdCancel.TabIndex = 1;
587 this.cmdCancel.Text = "Cancel";
588 //
589 // cmdOK
590 //
591 this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
592 this.cmdOK.Location = new System.Drawing.Point(317, 8);
593 this.cmdOK.Name = "cmdOK";
594 this.cmdOK.Size = new System.Drawing.Size(64, 24);
595 this.cmdOK.TabIndex = 0;
596 this.cmdOK.Text = "OK";
597 this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
598 //
599 // patientApptsBindingSource
600 //
601 this.patientApptsBindingSource.DataMember = "PatientAppts";
602 this.patientApptsBindingSource.DataSource = this.dsPatientApptDisplay2BindingSource;
603 //
604 // dsPatientApptDisplay2BindingSource
605 //
606 this.dsPatientApptDisplay2BindingSource.DataSource = this.dsPatientApptDisplay2;
607 this.dsPatientApptDisplay2BindingSource.Position = 0;
608 //
609 // dsPatientApptDisplay2
610 //
611 this.dsPatientApptDisplay2.DataSetName = "dsPatientApptDisplay2";
612 this.dsPatientApptDisplay2.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
613 //
614 // DAppointPage
615 //
616 this.AcceptButton = this.cmdOK;
617 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
618 this.CancelButton = this.cmdCancel;
619 this.ClientSize = new System.Drawing.Size(471, 526);
620 this.Controls.Add(this.panel1);
621 this.Controls.Add(this.tabControl1);
622 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
623 this.Name = "DAppointPage";
624 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
625 this.Text = "Patient Appointment";
626 this.tabControl1.ResumeLayout(false);
627 this.tabAppointment.ResumeLayout(false);
628 this.groupBox3.ResumeLayout(false);
629 this.groupBox3.PerformLayout();
630 this.groupBox1.ResumeLayout(false);
631 this.groupBox1.PerformLayout();
632 this.tabPatientInfo.ResumeLayout(false);
633 this.groupBox2.ResumeLayout(false);
634 this.groupBox2.PerformLayout();
635 this.panel1.ResumeLayout(false);
636 this.panel1.PerformLayout();
637 ((System.ComponentModel.ISupportInitialize)(this.patientApptsBindingSource)).EndInit();
638 ((System.ComponentModel.ISupportInitialize)(this.dsPatientApptDisplay2BindingSource)).EndInit();
639 ((System.ComponentModel.ISupportInitialize)(this.dsPatientApptDisplay2)).EndInit();
640 this.ResumeLayout(false);
641
642 }
643 #endregion
644
645 #region Fields
646
647 private CGDocumentManager m_DocManager;
648
649 private string m_sPatientName;
650 private Sex m_enumPatientSex;
651 private string m_sPatientHRN;
652 private string m_sPatientIEN;
653 private DateTime m_dPatientDOB;
654 private string m_sPatientPID;
655
656 private string m_sCity;
657 private string m_sPhoneHome;
658 private string m_sPhoneOffice;
659 private string m_sState;
660 private string m_sStreet;
661 private string m_sZip;
662
663 private string m_sNote;
664 private DateTime m_dStartTime;
665 private DateTime m_dEndTime;
666 private int m_nDuration;
667 private string m_sClinic;
668
669 private string m_sPhoneCell;
670 private string m_sEmail;
671 private string m_sCountry;
672 private int m_iAccessTypeID;
673 private bool _myCodeIsFiringIstheCheckBoxChangedEvent;
674
675 #endregion //fields
676
677 #region Methods
678
679 public void InitializePage(CGAppointment a)
680 {
681 InitializePage(a.PatientID.ToString(), a.StartTime, a.EndTime, "", a.Note, a.AccessTypeID);
682 }
683
684 public void InitializePage(string sPatientIEN, DateTime dStart, DateTime dEnd, string sClinic, string sNote, int iAccessTypeID)
685 {
686 m_dStartTime = dStart;
687 m_dEndTime = dEnd;
688 m_nDuration = (int)(dEnd - dStart).TotalMinutes;
689 m_iAccessTypeID = iAccessTypeID;
690 m_sClinic = sClinic;
691 m_sPatientIEN = sPatientIEN;
692 m_sNote = sNote;
693 try
694 {
695 string sSql;
696 sSql = "BSDX GET BASIC REG INFO^" + m_sPatientIEN;
697
698 DataTable tb = m_DocManager.RPMSDataTable(sSql, "PatientRegInfo");
699
700 Debug.Assert(tb.Rows.Count == 1);
701 DataRow r = tb.Rows[0];
702 this.m_sPatientName = r["NAME"].ToString();
703 this.m_enumPatientSex = r["SEX"].ToString() == "MALE" ? Sex.Male : Sex.Female;
704 this.m_sPatientHRN = r["HRN"].ToString();
705 this.m_sPatientIEN = r["IEN"].ToString();
706 this.m_sPatientPID = r["PID"].ToString();
707 this.m_dPatientDOB = (DateTime) r["DOB"];
708 this.m_sStreet = r["STREET"].ToString();
709 this.m_sCity = r["CITY"].ToString();
710 this.m_sPhoneOffice = r["OFCPHONE"].ToString();
711 this.m_sState = r["STATE"].ToString();
712 this.m_sZip = r["ZIP"].ToString();
713 this.m_sPhoneHome = r["HOMEPHONE"].ToString();
714 this.m_sEmail = r["EMAIL ADDRESS"].ToString();
715 this.m_sPhoneCell = r["PHONE NUMBER [CELLULAR]"].ToString();
716 this.m_sCountry = r["COUNTRY"].ToString();
717 this.UpdateDialogData(true);
718 Control UC = new UCPatientAppts(m_DocManager, int.Parse(m_sPatientIEN));
719 UC.Dock = DockStyle.Fill;
720 groupBox4.Controls.Add(UC);
721
722 _myCodeIsFiringIstheCheckBoxChangedEvent = true;
723 chkPrint.Checked = CGDocumentManager.Current.UserPreferences.PrintAppointmentSlipAutomacially;
724 _myCodeIsFiringIstheCheckBoxChangedEvent = false;
725 }
726 catch(Exception e)
727 {
728 MessageBox.Show("DAppointPage::InitializePage -- Unable to retrieve patient information from VistA. " + e.Message);
729 }
730
731 }
732 /// <summary>
733 /// Move data from member variables to controls (b == true)
734 /// or from controls to member variables (b == false)
735 /// </summary>
736 /// <param name="b"></param>
737 private void UpdateDialogData(bool b)
738 {
739 if (b == true) //move member vars into control data
740 {
741 lblClinic.Text = m_sClinic;
742 lblDuration.Text = m_nDuration.ToString();
743 lblStartTime.Text = m_dStartTime.ToShortDateString() + " " + m_dStartTime.ToShortTimeString();
744
745 txtCity.Text = this.m_sCity;
746 txtDOB.Text = this.m_dPatientDOB.ToShortDateString();
747 txtHRN.Text = this.m_sPatientHRN;
748 txtNote.Text = this.m_sNote;
749 txtPatientName.Text = m_sPatientName;
750 txtSex.Text = m_enumPatientSex.ToString();
751 txtPhoneHome.Text = this.m_sPhoneHome;
752 txtPhoneOffice.Text = this.m_sPhoneOffice;
753 txtPID.Text = this.m_sPatientPID;
754 txtState.Text = this.m_sState;
755 txtStreet.Text = this.m_sStreet;
756 txtZip.Text = this.m_sZip;
757 txtEmail.Text = this.m_sEmail;
758 txtPhoneCell.Text = this.m_sPhoneCell;
759 txtCountry.Text = this.m_sCountry;
760
761 }
762 else //move control data into member vars
763 {
764 string sNote = txtNote.Text;
765 sNote = sNote.Replace("^", " ");
766 this.m_sNote = sNote;
767 }
768
769 }
770 private void cmdOK_Click(object sender, System.EventArgs e)
771 {
772 this.UpdateDialogData(false);
773 }
774
775 /// <summary>
776 /// Clean up any resources being used.
777 /// </summary>
778 protected override void Dispose( bool disposing )
779 {
780 if( disposing )
781 {
782 if(components != null)
783 {
784 components.Dispose();
785 }
786 }
787 base.Dispose( disposing );
788 }
789
790
791 #endregion //Methods
792
793 #region Properties
794
795 public string Note
796 {
797 get
798 {
799 return m_sNote;
800 }
801 set
802 {
803 m_sNote = value;
804 }
805 }
806
807 public CGDocumentManager DocManager
808 {
809 get
810 {
811 return m_DocManager;
812 }
813 set
814 {
815 m_DocManager = value;
816 }
817 }
818
819 public bool PrintAppointmentSlip
820 {
821 get { return chkPrint.Checked; }
822 }
823
824 public CGAppointment Appointment
825 {
826 get
827 {
828 Patient pt = new Patient
829 {
830 DFN = Int32.Parse(m_sPatientIEN),
831 Name = m_sPatientName,
832 Sex = m_enumPatientSex,
833 DOB = m_dPatientDOB,
834 ID = m_sPatientPID,
835 HRN = m_sPatientHRN,
836 Appointments = null, //for now
837 Street = m_sStreet,
838 City = m_sCity,
839 State = m_sState,
840 Zip = m_sZip,
841 Country = m_sCountry,
842 Email = m_sEmail,
843 HomePhone = m_sPhoneHome,
844 WorkPHone = m_sPhoneOffice,
845 CellPhone = m_sPhoneCell
846 };
847
848 CGAppointment appt = new CGAppointment()
849 {
850 PatientID = Convert.ToInt32(m_sPatientIEN),
851 PatientName = m_sPatientName,
852 StartTime = m_dStartTime,
853 EndTime = m_dEndTime,
854 Resource = m_sClinic,
855 Note = m_sNote,
856 HealthRecordNumber = m_sPatientHRN,
857 AccessTypeID = m_iAccessTypeID,
858 Patient = pt
859 };
860
861 return appt;
862 }
863 }
864 #endregion //Properties
865
866 /// <summary>
867 /// Save Print Slip preference in UserPreferences object.
868 /// </summary>
869 /// <param name="sender"></param>
870 /// <param name="e"></param>
871 private void chkPrint_CheckedChanged(object sender, EventArgs e)
872 {
873 if (_myCodeIsFiringIstheCheckBoxChangedEvent) return;
874
875 CGDocumentManager.Current.UserPreferences.PrintAppointmentSlipAutomacially = chkPrint.Checked;
876 }
877
878
879 } //end Class
880}
Note: See TracBrowser for help on using the repository browser.