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

Last change on this file since 766 was 753, checked in by Sam Habiel, 15 years ago

Reworked DAppointPage. Removed dependence of DPatientApptDisplay on Crystal Reports. Added UserControl UCPatientAppts to encapsulate functionality of DPatientApptDisplay; right now it does not include printing. DAppointPage now uses UCPatientAppts to provide functionality of seeing patient's previous appointments. DPatientApptDisplay does not yet, but will soon.

Exe is not included.

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