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

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

CalendarGrid:

  • Support for Autoscrolling corrected.
  • A little optimization: Grid is only drawn once now when starting, not twice (don't know why original code did that).

CGAppointment:

  • Added member Patient (new Class)

CGDocument:

  • OnOpenDocument now accepts input of DateTime to decide where to open document.
  • SlotsAvailable algorithm now includes code for scaling according to timescale and code to merge Blocks if they are adjacent.

CGDocumentManager:

  • Fix bug having to do with canceling log-in after first retry. BMX lib threw an exception which was not caught.

CGView: Many changes:

  • SlotsAvailable signature changed in CGDocument. All references to it had to be changed.
  • Opening a node in the tvSchedules by clicking on the plus sign did not select it. Code changes to make it select it.
  • UpdateStatusBar now uses a string builder; and shows a more comprehensive message on the availability in the Status Bar.
  • Focus issues on various controls.
  • Support for printing a slip after an appointment is made automatically has been added.

CustomPrinting:

  • now includes a method to print a single appointment slip

DAppointPage:

  • Checkbox to decide whether to print appt slip added.
  • New readonly property to get the appointment that has been made (of type CGAppointment).

DApptSearch:

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