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

Last change on this file since 1110 was 1110, checked in by Sam Habiel, 13 years ago

CGDocument:

CGDocumentManager:

CGView: (Changes to support printing of Appointment Slip)

  • Changed name and text of context menu to say "print appointment slip"
  • Logic to Print Appointment Slip

CustomPrinting.cs renamed to Printing.cs; old Printing.Cs removed.
DAppointPage:

  • New checkbox to request printing of Appointment Slip
  • Sex of patient now pulled and included in form.

DPatientLetter:

  • Redirected to use new Printing framework.

Patient:

Printing:

File size: 35.9 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.label14 = new System.Windows.Forms.Label();
97 this.txtHRN = new System.Windows.Forms.TextBox();
98 this.label6 = new System.Windows.Forms.Label();
99 this.txtPID = new System.Windows.Forms.TextBox();
100 this.label5 = new System.Windows.Forms.Label();
101 this.txtDOB = new System.Windows.Forms.TextBox();
102 this.label2 = new System.Windows.Forms.Label();
103 this.txtPatientName = new System.Windows.Forms.TextBox();
104 this.tabPatientInfo = new System.Windows.Forms.TabPage();
105 this.groupBox2 = new System.Windows.Forms.GroupBox();
106 this.label17 = new System.Windows.Forms.Label();
107 this.txtEmail = new System.Windows.Forms.TextBox();
108 this.label16 = new System.Windows.Forms.Label();
109 this.txtPhoneCell = new System.Windows.Forms.TextBox();
110 this.label7 = new System.Windows.Forms.Label();
111 this.txtCountry = new System.Windows.Forms.TextBox();
112 this.label12 = new System.Windows.Forms.Label();
113 this.txtPhoneOffice = new System.Windows.Forms.TextBox();
114 this.label13 = new System.Windows.Forms.Label();
115 this.txtPhoneHome = new System.Windows.Forms.TextBox();
116 this.txtCity = new System.Windows.Forms.TextBox();
117 this.label8 = new System.Windows.Forms.Label();
118 this.label9 = new System.Windows.Forms.Label();
119 this.txtZip = new System.Windows.Forms.TextBox();
120 this.label10 = new System.Windows.Forms.Label();
121 this.txtState = new System.Windows.Forms.TextBox();
122 this.label11 = new System.Windows.Forms.Label();
123 this.txtStreet = new System.Windows.Forms.TextBox();
124 this.panel1 = new System.Windows.Forms.Panel();
125 this.chkPrint = new System.Windows.Forms.CheckBox();
126 this.cmdCancel = new System.Windows.Forms.Button();
127 this.cmdOK = new System.Windows.Forms.Button();
128 this.patientApptsBindingSource = new System.Windows.Forms.BindingSource(this.components);
129 this.dsPatientApptDisplay2BindingSource = new System.Windows.Forms.BindingSource(this.components);
130 this.dsPatientApptDisplay2 = new IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2();
131 this.label18 = new System.Windows.Forms.Label();
132 this.txtSex = new System.Windows.Forms.TextBox();
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 // label14
284 //
285 this.label14.Location = new System.Drawing.Point(50, 64);
286 this.label14.Name = "label14";
287 this.label14.Size = new System.Drawing.Size(40, 16);
288 this.label14.TabIndex = 13;
289 this.label14.Text = "HRN:";
290 this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
291 //
292 // txtHRN
293 //
294 this.txtHRN.Location = new System.Drawing.Point(96, 64);
295 this.txtHRN.Name = "txtHRN";
296 this.txtHRN.ReadOnly = true;
297 this.txtHRN.Size = new System.Drawing.Size(120, 20);
298 this.txtHRN.TabIndex = 12;
299 //
300 // label6
301 //
302 this.label6.Location = new System.Drawing.Point(227, 65);
303 this.label6.Name = "label6";
304 this.label6.Size = new System.Drawing.Size(40, 16);
305 this.label6.TabIndex = 9;
306 this.label6.Text = "ID:";
307 this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
308 //
309 // txtPID
310 //
311 this.txtPID.Location = new System.Drawing.Point(272, 63);
312 this.txtPID.Name = "txtPID";
313 this.txtPID.ReadOnly = true;
314 this.txtPID.Size = new System.Drawing.Size(161, 20);
315 this.txtPID.TabIndex = 8;
316 //
317 // label5
318 //
319 this.label5.Location = new System.Drawing.Point(58, 41);
320 this.label5.Name = "label5";
321 this.label5.Size = new System.Drawing.Size(32, 16);
322 this.label5.TabIndex = 7;
323 this.label5.Text = "DOB:";
324 this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
325 //
326 // txtDOB
327 //
328 this.txtDOB.Location = new System.Drawing.Point(96, 40);
329 this.txtDOB.Name = "txtDOB";
330 this.txtDOB.ReadOnly = true;
331 this.txtDOB.Size = new System.Drawing.Size(120, 20);
332 this.txtDOB.TabIndex = 6;
333 //
334 // label2
335 //
336 this.label2.Location = new System.Drawing.Point(50, 16);
337 this.label2.Name = "label2";
338 this.label2.Size = new System.Drawing.Size(40, 16);
339 this.label2.TabIndex = 5;
340 this.label2.Text = "Name:";
341 this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
342 //
343 // txtPatientName
344 //
345 this.txtPatientName.Location = new System.Drawing.Point(96, 16);
346 this.txtPatientName.Name = "txtPatientName";
347 this.txtPatientName.ReadOnly = true;
348 this.txtPatientName.Size = new System.Drawing.Size(337, 20);
349 this.txtPatientName.TabIndex = 0;
350 //
351 // tabPatientInfo
352 //
353 this.tabPatientInfo.Controls.Add(this.groupBox2);
354 this.tabPatientInfo.Location = new System.Drawing.Point(4, 22);
355 this.tabPatientInfo.Name = "tabPatientInfo";
356 this.tabPatientInfo.Size = new System.Drawing.Size(463, 500);
357 this.tabPatientInfo.TabIndex = 0;
358 this.tabPatientInfo.Text = "Contact Information";
359 //
360 // groupBox2
361 //
362 this.groupBox2.Controls.Add(this.label17);
363 this.groupBox2.Controls.Add(this.txtEmail);
364 this.groupBox2.Controls.Add(this.label16);
365 this.groupBox2.Controls.Add(this.txtPhoneCell);
366 this.groupBox2.Controls.Add(this.label7);
367 this.groupBox2.Controls.Add(this.txtCountry);
368 this.groupBox2.Controls.Add(this.label12);
369 this.groupBox2.Controls.Add(this.txtPhoneOffice);
370 this.groupBox2.Controls.Add(this.label13);
371 this.groupBox2.Controls.Add(this.txtPhoneHome);
372 this.groupBox2.Controls.Add(this.txtCity);
373 this.groupBox2.Controls.Add(this.label8);
374 this.groupBox2.Controls.Add(this.label9);
375 this.groupBox2.Controls.Add(this.txtZip);
376 this.groupBox2.Controls.Add(this.label10);
377 this.groupBox2.Controls.Add(this.txtState);
378 this.groupBox2.Controls.Add(this.label11);
379 this.groupBox2.Controls.Add(this.txtStreet);
380 this.groupBox2.Location = new System.Drawing.Point(8, 16);
381 this.groupBox2.Name = "groupBox2";
382 this.groupBox2.Size = new System.Drawing.Size(444, 198);
383 this.groupBox2.TabIndex = 1;
384 this.groupBox2.TabStop = false;
385 this.groupBox2.Text = "Address";
386 //
387 // label17
388 //
389 this.label17.Location = new System.Drawing.Point(224, 94);
390 this.label17.Name = "label17";
391 this.label17.Size = new System.Drawing.Size(40, 16);
392 this.label17.TabIndex = 29;
393 this.label17.Text = "E-Mail:";
394 this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
395 //
396 // txtEmail
397 //
398 this.txtEmail.Location = new System.Drawing.Point(267, 94);
399 this.txtEmail.Name = "txtEmail";
400 this.txtEmail.ReadOnly = true;
401 this.txtEmail.Size = new System.Drawing.Size(166, 20);
402 this.txtEmail.TabIndex = 28;
403 //
404 // label16
405 //
406 this.label16.Location = new System.Drawing.Point(19, 142);
407 this.label16.Name = "label16";
408 this.label16.Size = new System.Drawing.Size(69, 16);
409 this.label16.TabIndex = 27;
410 this.label16.Text = "Cell/Mobile:";
411 this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
412 //
413 // txtPhoneCell
414 //
415 this.txtPhoneCell.Location = new System.Drawing.Point(91, 142);
416 this.txtPhoneCell.Name = "txtPhoneCell";
417 this.txtPhoneCell.ReadOnly = true;
418 this.txtPhoneCell.Size = new System.Drawing.Size(120, 20);
419 this.txtPhoneCell.TabIndex = 26;
420 //
421 // label7
422 //
423 this.label7.Location = new System.Drawing.Point(33, 94);
424 this.label7.Name = "label7";
425 this.label7.Size = new System.Drawing.Size(55, 16);
426 this.label7.TabIndex = 25;
427 this.label7.Text = "Country:";
428 this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
429 //
430 // txtCountry
431 //
432 this.txtCountry.Location = new System.Drawing.Point(91, 94);
433 this.txtCountry.Name = "txtCountry";
434 this.txtCountry.ReadOnly = true;
435 this.txtCountry.Size = new System.Drawing.Size(120, 20);
436 this.txtCountry.TabIndex = 24;
437 //
438 // label12
439 //
440 this.label12.Location = new System.Drawing.Point(2, 166);
441 this.label12.Name = "label12";
442 this.label12.Size = new System.Drawing.Size(86, 14);
443 this.label12.TabIndex = 23;
444 this.label12.Text = "Phone (Office):";
445 this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
446 //
447 // txtPhoneOffice
448 //
449 this.txtPhoneOffice.Location = new System.Drawing.Point(91, 166);
450 this.txtPhoneOffice.Name = "txtPhoneOffice";
451 this.txtPhoneOffice.ReadOnly = true;
452 this.txtPhoneOffice.Size = new System.Drawing.Size(120, 20);
453 this.txtPhoneOffice.TabIndex = 22;
454 //
455 // label13
456 //
457 this.label13.Location = new System.Drawing.Point(5, 118);
458 this.label13.Name = "label13";
459 this.label13.Size = new System.Drawing.Size(83, 16);
460 this.label13.TabIndex = 21;
461 this.label13.Text = "Phone (Home):";
462 this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
463 //
464 // txtPhoneHome
465 //
466 this.txtPhoneHome.Location = new System.Drawing.Point(91, 118);
467 this.txtPhoneHome.Name = "txtPhoneHome";
468 this.txtPhoneHome.ReadOnly = true;
469 this.txtPhoneHome.Size = new System.Drawing.Size(120, 20);
470 this.txtPhoneHome.TabIndex = 20;
471 //
472 // txtCity
473 //
474 this.txtCity.Location = new System.Drawing.Point(91, 46);
475 this.txtCity.Name = "txtCity";
476 this.txtCity.ReadOnly = true;
477 this.txtCity.Size = new System.Drawing.Size(342, 20);
478 this.txtCity.TabIndex = 18;
479 //
480 // label8
481 //
482 this.label8.Location = new System.Drawing.Point(52, 46);
483 this.label8.Name = "label8";
484 this.label8.Size = new System.Drawing.Size(36, 16);
485 this.label8.TabIndex = 19;
486 this.label8.Text = "City:";
487 this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
488 //
489 // label9
490 //
491 this.label9.Location = new System.Drawing.Point(224, 70);
492 this.label9.Name = "label9";
493 this.label9.Size = new System.Drawing.Size(40, 16);
494 this.label9.TabIndex = 17;
495 this.label9.Text = "Zip:";
496 this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
497 //
498 // txtZip
499 //
500 this.txtZip.Location = new System.Drawing.Point(267, 70);
501 this.txtZip.Name = "txtZip";
502 this.txtZip.ReadOnly = true;
503 this.txtZip.Size = new System.Drawing.Size(166, 20);
504 this.txtZip.TabIndex = 16;
505 //
506 // label10
507 //
508 this.label10.Location = new System.Drawing.Point(47, 70);
509 this.label10.Name = "label10";
510 this.label10.Size = new System.Drawing.Size(41, 16);
511 this.label10.TabIndex = 15;
512 this.label10.Text = "State:";
513 this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
514 //
515 // txtState
516 //
517 this.txtState.Location = new System.Drawing.Point(91, 70);
518 this.txtState.Name = "txtState";
519 this.txtState.ReadOnly = true;
520 this.txtState.Size = new System.Drawing.Size(120, 20);
521 this.txtState.TabIndex = 14;
522 //
523 // label11
524 //
525 this.label11.Location = new System.Drawing.Point(47, 22);
526 this.label11.Name = "label11";
527 this.label11.Size = new System.Drawing.Size(41, 16);
528 this.label11.TabIndex = 13;
529 this.label11.Text = "Street:";
530 this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
531 //
532 // txtStreet
533 //
534 this.txtStreet.Location = new System.Drawing.Point(91, 22);
535 this.txtStreet.Name = "txtStreet";
536 this.txtStreet.ReadOnly = true;
537 this.txtStreet.Size = new System.Drawing.Size(342, 20);
538 this.txtStreet.TabIndex = 12;
539 //
540 // panel1
541 //
542 this.panel1.Controls.Add(this.chkPrint);
543 this.panel1.Controls.Add(this.cmdCancel);
544 this.panel1.Controls.Add(this.cmdOK);
545 this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
546 this.panel1.Location = new System.Drawing.Point(0, 486);
547 this.panel1.Name = "panel1";
548 this.panel1.Size = new System.Drawing.Size(471, 40);
549 this.panel1.TabIndex = 1;
550 //
551 // chkPrint
552 //
553 this.chkPrint.AutoSize = true;
554 this.chkPrint.Location = new System.Drawing.Point(13, 14);
555 this.chkPrint.Name = "chkPrint";
556 this.chkPrint.Size = new System.Drawing.Size(144, 17);
557 this.chkPrint.TabIndex = 2;
558 this.chkPrint.Text = "Print Appointment Letter";
559 this.chkPrint.UseVisualStyleBackColor = true;
560 //
561 // cmdCancel
562 //
563 this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
564 this.cmdCancel.Location = new System.Drawing.Point(387, 8);
565 this.cmdCancel.Name = "cmdCancel";
566 this.cmdCancel.Size = new System.Drawing.Size(64, 24);
567 this.cmdCancel.TabIndex = 1;
568 this.cmdCancel.Text = "Cancel";
569 //
570 // cmdOK
571 //
572 this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
573 this.cmdOK.Location = new System.Drawing.Point(317, 8);
574 this.cmdOK.Name = "cmdOK";
575 this.cmdOK.Size = new System.Drawing.Size(64, 24);
576 this.cmdOK.TabIndex = 0;
577 this.cmdOK.Text = "OK";
578 this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
579 //
580 // patientApptsBindingSource
581 //
582 this.patientApptsBindingSource.DataMember = "PatientAppts";
583 this.patientApptsBindingSource.DataSource = this.dsPatientApptDisplay2BindingSource;
584 //
585 // dsPatientApptDisplay2BindingSource
586 //
587 this.dsPatientApptDisplay2BindingSource.DataSource = this.dsPatientApptDisplay2;
588 this.dsPatientApptDisplay2BindingSource.Position = 0;
589 //
590 // dsPatientApptDisplay2
591 //
592 this.dsPatientApptDisplay2.DataSetName = "dsPatientApptDisplay2";
593 this.dsPatientApptDisplay2.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
594 //
595 // label18
596 //
597 this.label18.AutoSize = true;
598 this.label18.Location = new System.Drawing.Point(238, 44);
599 this.label18.Name = "label18";
600 this.label18.Size = new System.Drawing.Size(29, 13);
601 this.label18.TabIndex = 14;
602 this.label18.Text = "Sex:";
603 //
604 // txtSex
605 //
606 this.txtSex.BackColor = System.Drawing.SystemColors.Control;
607 this.txtSex.Location = new System.Drawing.Point(273, 41);
608 this.txtSex.Name = "txtSex";
609 this.txtSex.ReadOnly = true;
610 this.txtSex.Size = new System.Drawing.Size(160, 20);
611 this.txtSex.TabIndex = 15;
612 //
613 // DAppointPage
614 //
615 this.AcceptButton = this.cmdOK;
616 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
617 this.CancelButton = this.cmdCancel;
618 this.ClientSize = new System.Drawing.Size(471, 526);
619 this.Controls.Add(this.panel1);
620 this.Controls.Add(this.tabControl1);
621 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
622 this.Name = "DAppointPage";
623 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
624 this.Text = "Patient Appointment";
625 this.tabControl1.ResumeLayout(false);
626 this.tabAppointment.ResumeLayout(false);
627 this.groupBox3.ResumeLayout(false);
628 this.groupBox3.PerformLayout();
629 this.groupBox1.ResumeLayout(false);
630 this.groupBox1.PerformLayout();
631 this.tabPatientInfo.ResumeLayout(false);
632 this.groupBox2.ResumeLayout(false);
633 this.groupBox2.PerformLayout();
634 this.panel1.ResumeLayout(false);
635 this.panel1.PerformLayout();
636 ((System.ComponentModel.ISupportInitialize)(this.patientApptsBindingSource)).EndInit();
637 ((System.ComponentModel.ISupportInitialize)(this.dsPatientApptDisplay2BindingSource)).EndInit();
638 ((System.ComponentModel.ISupportInitialize)(this.dsPatientApptDisplay2)).EndInit();
639 this.ResumeLayout(false);
640
641 }
642 #endregion
643
644 #region Fields
645
646 private CGDocumentManager m_DocManager;
647
648 private string m_sPatientName;
649 private Sex m_enumPatientSex;
650 private string m_sPatientHRN;
651 private string m_sPatientIEN;
652 private DateTime m_dPatientDOB;
653 private string m_sPatientPID;
654
655 private string m_sCity;
656 private string m_sPhoneHome;
657 private string m_sPhoneOffice;
658 private string m_sState;
659 private string m_sStreet;
660 private string m_sZip;
661
662 private string m_sNote;
663 private DateTime m_dStartTime;
664 private DateTime m_dEndTime;
665 private int m_nDuration;
666 private string m_sClinic;
667
668 private string m_sPhoneCell;
669 private string m_sEmail;
670 private string m_sCountry;
671 private int m_iAccessTypeID;
672
673 #endregion //fields
674
675 #region Methods
676
677 public void InitializePage(CGAppointment a)
678 {
679 InitializePage(a.PatientID.ToString(), a.StartTime, a.EndTime, "", a.Note, a.AccessTypeID);
680 }
681
682 public void InitializePage(string sPatientIEN, DateTime dStart, DateTime dEnd, string sClinic, string sNote, int iAccessTypeID)
683 {
684 m_dStartTime = dStart;
685 m_dEndTime = dEnd;
686 m_nDuration = (int)(dEnd - dStart).TotalMinutes;
687 m_iAccessTypeID = iAccessTypeID;
688 m_sClinic = sClinic;
689 m_sPatientIEN = sPatientIEN;
690 m_sNote = sNote;
691 try
692 {
693 string sSql;
694 sSql = "BSDX GET BASIC REG INFO^" + m_sPatientIEN;
695
696 DataTable tb = m_DocManager.RPMSDataTable(sSql, "PatientRegInfo");
697
698 Debug.Assert(tb.Rows.Count == 1);
699 DataRow r = tb.Rows[0];
700 this.m_sPatientName = r["NAME"].ToString();
701 this.m_enumPatientSex = r["SEX"].ToString() == "MALE" ? Sex.Male : Sex.Female;
702 this.m_sPatientHRN = r["HRN"].ToString();
703 this.m_sPatientIEN = r["IEN"].ToString();
704 this.m_sPatientPID = r["PID"].ToString();
705 this.m_dPatientDOB = (DateTime) r["DOB"];
706 this.m_sStreet = r["STREET"].ToString();
707 this.m_sCity = r["CITY"].ToString();
708 this.m_sPhoneOffice = r["OFCPHONE"].ToString();
709 this.m_sState = r["STATE"].ToString();
710 this.m_sZip = r["ZIP"].ToString();
711 this.m_sPhoneHome = r["HOMEPHONE"].ToString();
712 this.m_sEmail = r["EMAIL ADDRESS"].ToString();
713 this.m_sPhoneCell = r["PHONE NUMBER [CELLULAR]"].ToString();
714 this.m_sCountry = r["COUNTRY"].ToString();
715 this.UpdateDialogData(true);
716 Control UC = new UCPatientAppts(m_DocManager, int.Parse(m_sPatientIEN));
717 UC.Dock = DockStyle.Fill;
718 groupBox4.Controls.Add(UC);
719 }
720 catch(Exception e)
721 {
722 MessageBox.Show("DAppointPage::InitializePage -- Unable to retrieve patient information from VistA. " + e.Message);
723 }
724
725 }
726 /// <summary>
727 /// Move data from member variables to controls (b == true)
728 /// or from controls to member variables (b == false)
729 /// </summary>
730 /// <param name="b"></param>
731 private void UpdateDialogData(bool b)
732 {
733 if (b == true) //move member vars into control data
734 {
735 lblClinic.Text = m_sClinic;
736 lblDuration.Text = m_nDuration.ToString();
737 lblStartTime.Text = m_dStartTime.ToShortDateString() + " " + m_dStartTime.ToShortTimeString();
738
739 txtCity.Text = this.m_sCity;
740 txtDOB.Text = this.m_dPatientDOB.ToShortDateString();
741 txtHRN.Text = this.m_sPatientHRN;
742 txtNote.Text = this.m_sNote;
743 txtPatientName.Text = m_sPatientName;
744 txtSex.Text = m_enumPatientSex.ToString();
745 txtPhoneHome.Text = this.m_sPhoneHome;
746 txtPhoneOffice.Text = this.m_sPhoneOffice;
747 txtPID.Text = this.m_sPatientPID;
748 txtState.Text = this.m_sState;
749 txtStreet.Text = this.m_sStreet;
750 txtZip.Text = this.m_sZip;
751 txtEmail.Text = this.m_sEmail;
752 txtPhoneCell.Text = this.m_sPhoneCell;
753 txtCountry.Text = this.m_sCountry;
754
755 }
756 else //move control data into member vars
757 {
758 string sNote = txtNote.Text;
759 sNote = sNote.Replace("^", " ");
760 this.m_sNote = sNote;
761 }
762
763 }
764 private void cmdOK_Click(object sender, System.EventArgs e)
765 {
766 this.UpdateDialogData(false);
767 }
768
769 /// <summary>
770 /// Clean up any resources being used.
771 /// </summary>
772 protected override void Dispose( bool disposing )
773 {
774 if( disposing )
775 {
776 if(components != null)
777 {
778 components.Dispose();
779 }
780 }
781 base.Dispose( disposing );
782 }
783
784
785 #endregion //Methods
786
787 #region Properties
788
789 public string Note
790 {
791 get
792 {
793 return m_sNote;
794 }
795 set
796 {
797 m_sNote = value;
798 }
799 }
800
801 public CGDocumentManager DocManager
802 {
803 get
804 {
805 return m_DocManager;
806 }
807 set
808 {
809 m_DocManager = value;
810 }
811 }
812
813 public bool PrintAppointmentSlip
814 {
815 get { return chkPrint.Checked; }
816 }
817
818 public CGAppointment Appointment
819 {
820 get
821 {
822 Patient pt = new Patient
823 {
824 DFN = Int32.Parse(m_sPatientIEN),
825 Name = m_sPatientName,
826 Sex = m_enumPatientSex,
827 DOB = m_dPatientDOB,
828 ID = m_sPatientPID,
829 HRN = m_sPatientHRN,
830 Appointments = null, //for now
831 Street = m_sStreet,
832 City = m_sCity,
833 State = m_sState,
834 Zip = m_sZip,
835 Country = m_sCountry,
836 Email = m_sEmail,
837 HomePhone = m_sPhoneHome,
838 WorkPHone = m_sPhoneOffice,
839 CellPhone = m_sPhoneCell
840 };
841
842 CGAppointment appt = new CGAppointment()
843 {
844 PatientID = Convert.ToInt32(m_sPatientIEN),
845 PatientName = m_sPatientName,
846 StartTime = m_dStartTime,
847 EndTime = m_dEndTime,
848 Resource = m_sClinic,
849 Note = m_sNote,
850 HealthRecordNumber = m_sPatientHRN,
851 AccessTypeID = m_iAccessTypeID,
852 Patient = pt
853 };
854
855 return appt;
856 }
857 }
858 #endregion //Properties
859
860
861 } //end Class
862}
Note: See TracBrowser for help on using the repository browser.