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

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

CGAVDocument contains changes for start day of grid based on weekday locale and colummns
CGAVView: Shortcut keys; correct updating when number of columns is changed in grid
CGDocument: changes for start day of grid. Modified algorithm.
DAccessTemplate: Takes any weekday now for applying a template, not just Monday. Then calculation of start day is done in CGAVView based on locale in the same algorithm that the rest of the GUI uses.
DAppointPage: Now says Mobile/Cell instead of Cell Phone.

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