source: Scheduling/branches/GUI1.2/DCancelAppt.cs@ 1297

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

Initial committ of scheduling package

File size: 18.8 KB
Line 
1using System;
2using System.Drawing;
3using System.Collections;
4using System.ComponentModel;
5using System.Windows.Forms;
6using System.Data;
7
8namespace IndianHealthService.ClinicalScheduling
9{
10 /// <summary>
11 /// Summary description for DCancelAppt.
12 /// </summary>
13 public class DCancelAppt : System.Windows.Forms.Form
14 {
15 private System.Windows.Forms.Panel pnlPageBottom;
16 private System.Windows.Forms.Button cmdCancel;
17 private System.Windows.Forms.Button cmdOK;
18 private System.Windows.Forms.Panel pnlDescription;
19 private System.Windows.Forms.GroupBox grpDescriptionResourceGroup;
20 private System.Windows.Forms.Label lblDescriptionResourceGroup;
21 private System.Windows.Forms.GroupBox grpCancelledby;
22 private System.Windows.Forms.RadioButton rdoClinic;
23 private System.Windows.Forms.RadioButton rdoPatient;
24 private System.Windows.Forms.Label label1;
25 private System.Windows.Forms.ListBox lstReason;
26 private System.Windows.Forms.TextBox txtNote;
27 private System.Windows.Forms.Label label2;
28 private System.Windows.Forms.GroupBox grpAutoRebook;
29 private System.Windows.Forms.CheckBox chkAutoRebook;
30 private System.Windows.Forms.NumericUpDown udStart;
31 private System.Windows.Forms.NumericUpDown udMax;
32 private System.Windows.Forms.Label label3;
33 private System.Windows.Forms.Label label4;
34 private System.Windows.Forms.RadioButton rdoRebookSameType;
35 private System.Windows.Forms.RadioButton rdoRebookAnyType;
36 private System.Windows.Forms.RadioButton rdoRebookSelectedType;
37 private System.Windows.Forms.Label lblRebookSelectedType;
38 private System.Windows.Forms.Label label6;
39 /// <summary>
40 /// Required designer variable.
41 /// </summary>
42 private System.ComponentModel.Container components = null;
43
44 public DCancelAppt()
45 {
46 //
47 // Required for Windows Form Designer support
48 //
49 InitializeComponent();
50
51 }
52 #region Fields
53
54 private bool m_bClinicCancelled = true;
55 private int m_nReason = 0;
56 private string m_sNote = "";
57 private DataTable m_dtCR;
58 private DataView m_dvCR;
59 private bool m_bAutoRebook = false;
60 private int m_nStart = 7;
61 private int m_nMax = 30;
62
63 // -1: use current, -2: use any non-zero type, >0 use this access type id
64 private int m_nRebookAccessType = -1;
65
66
67 #endregion Fields
68
69 #region Methods
70
71 public void InitializePage(CGDocumentManager DocManager)
72 {
73 m_bClinicCancelled = true;
74 m_nReason = 0;
75 m_sNote = "";
76
77 //Load Reasons listbox
78
79 m_dtCR = DocManager.RPMSDataTable(@"SELECT BMXIEN, NAME FROM CANCELLATION_REASONS WHERE INACTIVE=''", "CR");
80 m_dvCR = new DataView(m_dtCR);
81 m_dvCR.Sort = "NAME ASC";
82 lstReason.DataSource = m_dvCR;
83 lstReason.DisplayMember = "NAME";
84 lstReason.ValueMember = "BMXIEN";
85
86 UpdateDialogData(true);
87 }
88
89 /// <summary>
90 /// If b is true, moves member vars into control data
91 /// otherwise, moves control data into member vars
92 /// </summary>
93 /// <param name="b"></param>
94 private void UpdateDialogData(bool b)
95 {
96 if (b == true)
97 {
98 rdoClinic.Checked = m_bClinicCancelled;
99 if (m_nReason != 0)
100 {
101 lstReason.SelectedValue = m_nReason;
102 }
103 txtNote.Text = m_sNote;
104 chkAutoRebook.Checked = m_bAutoRebook;
105 udStart.Value = m_nStart;
106 udMax.Value = m_nMax;
107
108 this.rdoRebookSameType.Checked = true;
109 this.rdoRebookAnyType.Checked = false;
110 this.rdoRebookSelectedType.Checked = false;
111 }
112 else
113 {
114 m_bClinicCancelled = rdoClinic.Checked;
115 m_nReason = (int) lstReason.SelectedValue;
116 m_sNote = txtNote.Text;
117 m_bAutoRebook = chkAutoRebook.Checked;
118 m_nStart = (int) udStart.Value;
119 m_nMax = (int) udMax.Value;
120 if (this.rdoRebookSameType.Checked == true)
121 {
122 m_nRebookAccessType = -1;
123 }
124 else
125 {
126 m_nRebookAccessType = -2;
127 }
128
129 }
130 }
131
132 /// <summary>
133 /// Clean up any resources being used.
134 /// </summary>
135 protected override void Dispose( bool disposing )
136 {
137 if( disposing )
138 {
139 if(components != null)
140 {
141 components.Dispose();
142 }
143 }
144 base.Dispose( disposing );
145 }
146
147 private void cmdOK_Click(object sender, System.EventArgs e)
148 {
149 this.UpdateDialogData(false);
150 }
151 #endregion Methods
152
153 #region Properties
154
155 /// <summary>
156 /// Sets or returns the rebook access type: -1 = use current type, -2 = use any type, 0 = prompt for a type
157 /// </summary>
158 public int RebookAccessType
159 {
160 get
161 {
162 return m_nRebookAccessType;
163 }
164 set
165 {
166 m_nRebookAccessType = value;
167 if (m_nRebookAccessType == -1)
168 {
169 this.rdoRebookSameType.Checked = true;
170 }
171 else
172 {
173 this.rdoRebookAnyType.Checked = true;
174 }
175
176 }
177 }
178 /// <summary>
179 /// Returns true if appt cancelled by Clinic, otherwise false
180 /// </summary>
181 public bool ClinicCancelled
182 {
183 get
184 {
185 return m_bClinicCancelled;
186 }
187 }
188
189 /// <summary>
190 /// Returns value of AutoRebook check box
191 /// </summary>
192 public bool AutoRebook
193 {
194 get
195 {
196 return m_bAutoRebook;
197 }
198 set
199 {
200 m_bAutoRebook = value;
201 }
202 }
203
204 /// <summary>
205 /// Returns internal entry in the CANCELLATION REASON file (409.2)
206 /// </summary>
207 public int CancelReason
208 {
209 get
210 {
211 return m_nReason;
212 }
213 }
214
215 /// <summary>
216 /// Returns cancellation remarks.
217 /// </summary>
218 public string CancelRemarks
219 {
220 get
221 {
222 return m_sNote;
223 }
224 }
225
226 /// <summary>
227 /// Sets or returns the number of days in the future to start searching for availability
228 /// </summary>
229 public int RebookStartDays
230 {
231 get
232 {
233 return m_nStart;
234 }
235 set
236 {
237 m_nStart = value;
238 }
239 }
240
241 /// <summary>
242 /// Sets and returns the maximum number of days in the future to look for rebook availability
243 /// </summary>
244 public int RebookMaxDays
245 {
246 get
247 {
248 return m_nMax;
249 }
250 set
251 {
252 m_nMax = value;
253 }
254 }
255
256 #endregion Properties
257
258 #region Windows Form Designer generated code
259 /// <summary>
260 /// Required method for Designer support - do not modify
261 /// the contents of this method with the code editor.
262 /// </summary>
263 private void InitializeComponent()
264 {
265 this.pnlPageBottom = new System.Windows.Forms.Panel();
266 this.cmdCancel = new System.Windows.Forms.Button();
267 this.cmdOK = new System.Windows.Forms.Button();
268 this.pnlDescription = new System.Windows.Forms.Panel();
269 this.grpDescriptionResourceGroup = new System.Windows.Forms.GroupBox();
270 this.lblDescriptionResourceGroup = new System.Windows.Forms.Label();
271 this.grpCancelledby = new System.Windows.Forms.GroupBox();
272 this.rdoPatient = new System.Windows.Forms.RadioButton();
273 this.rdoClinic = new System.Windows.Forms.RadioButton();
274 this.lstReason = new System.Windows.Forms.ListBox();
275 this.label1 = new System.Windows.Forms.Label();
276 this.txtNote = new System.Windows.Forms.TextBox();
277 this.label2 = new System.Windows.Forms.Label();
278 this.grpAutoRebook = new System.Windows.Forms.GroupBox();
279 this.label6 = new System.Windows.Forms.Label();
280 this.lblRebookSelectedType = new System.Windows.Forms.Label();
281 this.rdoRebookSameType = new System.Windows.Forms.RadioButton();
282 this.label3 = new System.Windows.Forms.Label();
283 this.udMax = new System.Windows.Forms.NumericUpDown();
284 this.udStart = new System.Windows.Forms.NumericUpDown();
285 this.chkAutoRebook = new System.Windows.Forms.CheckBox();
286 this.label4 = new System.Windows.Forms.Label();
287 this.rdoRebookAnyType = new System.Windows.Forms.RadioButton();
288 this.rdoRebookSelectedType = new System.Windows.Forms.RadioButton();
289 this.pnlPageBottom.SuspendLayout();
290 this.pnlDescription.SuspendLayout();
291 this.grpDescriptionResourceGroup.SuspendLayout();
292 this.grpCancelledby.SuspendLayout();
293 this.grpAutoRebook.SuspendLayout();
294 ((System.ComponentModel.ISupportInitialize)(this.udMax)).BeginInit();
295 ((System.ComponentModel.ISupportInitialize)(this.udStart)).BeginInit();
296 this.SuspendLayout();
297 //
298 // pnlPageBottom
299 //
300 this.pnlPageBottom.Controls.Add(this.cmdCancel);
301 this.pnlPageBottom.Controls.Add(this.cmdOK);
302 this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
303 this.pnlPageBottom.Location = new System.Drawing.Point(0, 488);
304 this.pnlPageBottom.Name = "pnlPageBottom";
305 this.pnlPageBottom.Size = new System.Drawing.Size(594, 40);
306 this.pnlPageBottom.TabIndex = 6;
307 //
308 // cmdCancel
309 //
310 this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
311 this.cmdCancel.Location = new System.Drawing.Point(512, 8);
312 this.cmdCancel.Name = "cmdCancel";
313 this.cmdCancel.Size = new System.Drawing.Size(56, 24);
314 this.cmdCancel.TabIndex = 2;
315 this.cmdCancel.Text = "Cancel";
316 //
317 // cmdOK
318 //
319 this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
320 this.cmdOK.Location = new System.Drawing.Point(432, 8);
321 this.cmdOK.Name = "cmdOK";
322 this.cmdOK.Size = new System.Drawing.Size(64, 24);
323 this.cmdOK.TabIndex = 1;
324 this.cmdOK.Text = "OK";
325 this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
326 //
327 // pnlDescription
328 //
329 this.pnlDescription.Controls.Add(this.grpDescriptionResourceGroup);
330 this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
331 this.pnlDescription.Location = new System.Drawing.Point(0, 416);
332 this.pnlDescription.Name = "pnlDescription";
333 this.pnlDescription.Size = new System.Drawing.Size(594, 72);
334 this.pnlDescription.TabIndex = 7;
335 //
336 // grpDescriptionResourceGroup
337 //
338 this.grpDescriptionResourceGroup.Controls.Add(this.lblDescriptionResourceGroup);
339 this.grpDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
340 this.grpDescriptionResourceGroup.Location = new System.Drawing.Point(0, 0);
341 this.grpDescriptionResourceGroup.Name = "grpDescriptionResourceGroup";
342 this.grpDescriptionResourceGroup.Size = new System.Drawing.Size(594, 72);
343 this.grpDescriptionResourceGroup.TabIndex = 1;
344 this.grpDescriptionResourceGroup.TabStop = false;
345 this.grpDescriptionResourceGroup.Text = "Description";
346 //
347 // lblDescriptionResourceGroup
348 //
349 this.lblDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
350 this.lblDescriptionResourceGroup.Location = new System.Drawing.Point(3, 16);
351 this.lblDescriptionResourceGroup.Name = "lblDescriptionResourceGroup";
352 this.lblDescriptionResourceGroup.Size = new System.Drawing.Size(588, 53);
353 this.lblDescriptionResourceGroup.TabIndex = 0;
354 this.lblDescriptionResourceGroup.Text = @"Use this panel to cancel an appointment. Indicate whether the appointment was cancelled by the clinic or by the patient. Select a reason for the cancellation. Enter remarks in the text box. To automatically rebook cancelled appointments, check the Auto Rebook box. The Start Time in Days and Maximum Days values control the time window for rebooked appointments.";
355 //
356 // grpCancelledby
357 //
358 this.grpCancelledby.Controls.Add(this.rdoPatient);
359 this.grpCancelledby.Controls.Add(this.rdoClinic);
360 this.grpCancelledby.Location = new System.Drawing.Point(24, 24);
361 this.grpCancelledby.Name = "grpCancelledby";
362 this.grpCancelledby.Size = new System.Drawing.Size(256, 80);
363 this.grpCancelledby.TabIndex = 8;
364 this.grpCancelledby.TabStop = false;
365 this.grpCancelledby.Text = "Appointment Cancelled By";
366 //
367 // rdoPatient
368 //
369 this.rdoPatient.Location = new System.Drawing.Point(24, 48);
370 this.rdoPatient.Name = "rdoPatient";
371 this.rdoPatient.Size = new System.Drawing.Size(160, 16);
372 this.rdoPatient.TabIndex = 1;
373 this.rdoPatient.Text = "Cancelled by Patient";
374 //
375 // rdoClinic
376 //
377 this.rdoClinic.Location = new System.Drawing.Point(24, 24);
378 this.rdoClinic.Name = "rdoClinic";
379 this.rdoClinic.Size = new System.Drawing.Size(160, 16);
380 this.rdoClinic.TabIndex = 0;
381 this.rdoClinic.Text = "Cancelled by Clinic";
382 //
383 // lstReason
384 //
385 this.lstReason.ColumnWidth = 250;
386 this.lstReason.Location = new System.Drawing.Point(24, 136);
387 this.lstReason.Name = "lstReason";
388 this.lstReason.Size = new System.Drawing.Size(256, 264);
389 this.lstReason.TabIndex = 9;
390 //
391 // label1
392 //
393 this.label1.Location = new System.Drawing.Point(24, 112);
394 this.label1.Name = "label1";
395 this.label1.Size = new System.Drawing.Size(248, 16);
396 this.label1.TabIndex = 10;
397 this.label1.Text = "Reason for Cancellation (Select one)";
398 //
399 // txtNote
400 //
401 this.txtNote.Location = new System.Drawing.Point(312, 304);
402 this.txtNote.Multiline = true;
403 this.txtNote.Name = "txtNote";
404 this.txtNote.Size = new System.Drawing.Size(272, 96);
405 this.txtNote.TabIndex = 11;
406 this.txtNote.Text = "";
407 //
408 // label2
409 //
410 this.label2.Location = new System.Drawing.Point(312, 280);
411 this.label2.Name = "label2";
412 this.label2.Size = new System.Drawing.Size(280, 64);
413 this.label2.TabIndex = 10;
414 this.label2.Text = "Remarks (Optional)";
415 //
416 // grpAutoRebook
417 //
418 this.grpAutoRebook.Controls.Add(this.label6);
419 this.grpAutoRebook.Controls.Add(this.lblRebookSelectedType);
420 this.grpAutoRebook.Controls.Add(this.rdoRebookSameType);
421 this.grpAutoRebook.Controls.Add(this.label3);
422 this.grpAutoRebook.Controls.Add(this.udMax);
423 this.grpAutoRebook.Controls.Add(this.udStart);
424 this.grpAutoRebook.Controls.Add(this.chkAutoRebook);
425 this.grpAutoRebook.Controls.Add(this.label4);
426 this.grpAutoRebook.Controls.Add(this.rdoRebookAnyType);
427 this.grpAutoRebook.Controls.Add(this.rdoRebookSelectedType);
428 this.grpAutoRebook.Location = new System.Drawing.Point(312, 24);
429 this.grpAutoRebook.Name = "grpAutoRebook";
430 this.grpAutoRebook.Size = new System.Drawing.Size(272, 248);
431 this.grpAutoRebook.TabIndex = 13;
432 this.grpAutoRebook.TabStop = false;
433 this.grpAutoRebook.Text = "Auto Rebook";
434 //
435 // label6
436 //
437 this.label6.Location = new System.Drawing.Point(16, 128);
438 this.label6.Name = "label6";
439 this.label6.Size = new System.Drawing.Size(232, 16);
440 this.label6.TabIndex = 19;
441 this.label6.Text = "Access Type for Rebooked Appointment:";
442 //
443 // lblRebookSelectedType
444 //
445 this.lblRebookSelectedType.Enabled = false;
446 this.lblRebookSelectedType.Location = new System.Drawing.Point(64, 224);
447 this.lblRebookSelectedType.Name = "lblRebookSelectedType";
448 this.lblRebookSelectedType.Size = new System.Drawing.Size(168, 16);
449 this.lblRebookSelectedType.TabIndex = 18;
450 //
451 // rdoRebookSameType
452 //
453 this.rdoRebookSameType.Location = new System.Drawing.Point(24, 152);
454 this.rdoRebookSameType.Name = "rdoRebookSameType";
455 this.rdoRebookSameType.Size = new System.Drawing.Size(160, 16);
456 this.rdoRebookSameType.TabIndex = 17;
457 this.rdoRebookSameType.Text = "Same as Current";
458 //
459 // label3
460 //
461 this.label3.Location = new System.Drawing.Point(88, 56);
462 this.label3.Name = "label3";
463 this.label3.Size = new System.Drawing.Size(104, 16);
464 this.label3.TabIndex = 16;
465 this.label3.Text = "Start time in Days";
466 //
467 // udMax
468 //
469 this.udMax.Increment = new System.Decimal(new int[] {
470 7,
471 0,
472 0,
473 0});
474 this.udMax.Location = new System.Drawing.Point(16, 88);
475 this.udMax.Maximum = new System.Decimal(new int[] {
476 730,
477 0,
478 0,
479 0});
480 this.udMax.Minimum = new System.Decimal(new int[] {
481 1,
482 0,
483 0,
484 0});
485 this.udMax.Name = "udMax";
486 this.udMax.Size = new System.Drawing.Size(56, 20);
487 this.udMax.TabIndex = 15;
488 this.udMax.Value = new System.Decimal(new int[] {
489 30,
490 0,
491 0,
492 0});
493 //
494 // udStart
495 //
496 this.udStart.Location = new System.Drawing.Point(16, 54);
497 this.udStart.Maximum = new System.Decimal(new int[] {
498 730,
499 0,
500 0,
501 0});
502 this.udStart.Name = "udStart";
503 this.udStart.Size = new System.Drawing.Size(56, 20);
504 this.udStart.TabIndex = 14;
505 this.udStart.Value = new System.Decimal(new int[] {
506 14,
507 0,
508 0,
509 0});
510 //
511 // chkAutoRebook
512 //
513 this.chkAutoRebook.Location = new System.Drawing.Point(16, 24);
514 this.chkAutoRebook.Name = "chkAutoRebook";
515 this.chkAutoRebook.Size = new System.Drawing.Size(120, 16);
516 this.chkAutoRebook.TabIndex = 13;
517 this.chkAutoRebook.Text = "Auto Rebook";
518 //
519 // label4
520 //
521 this.label4.Location = new System.Drawing.Point(88, 88);
522 this.label4.Name = "label4";
523 this.label4.Size = new System.Drawing.Size(104, 16);
524 this.label4.TabIndex = 16;
525 this.label4.Text = "Maximum Days";
526 //
527 // rdoRebookAnyType
528 //
529 this.rdoRebookAnyType.Location = new System.Drawing.Point(24, 176);
530 this.rdoRebookAnyType.Name = "rdoRebookAnyType";
531 this.rdoRebookAnyType.Size = new System.Drawing.Size(160, 16);
532 this.rdoRebookAnyType.TabIndex = 17;
533 this.rdoRebookAnyType.Text = "Any Access Type";
534 //
535 // rdoRebookSelectedType
536 //
537 this.rdoRebookSelectedType.Enabled = false;
538 this.rdoRebookSelectedType.Location = new System.Drawing.Point(24, 200);
539 this.rdoRebookSelectedType.Name = "rdoRebookSelectedType";
540 this.rdoRebookSelectedType.Size = new System.Drawing.Size(136, 16);
541 this.rdoRebookSelectedType.TabIndex = 17;
542 this.rdoRebookSelectedType.Text = "Selected Access Type:";
543 //
544 // DCancelAppt
545 //
546 this.AcceptButton = this.cmdOK;
547 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
548 this.CancelButton = this.cmdCancel;
549 this.ClientSize = new System.Drawing.Size(594, 528);
550 this.ControlBox = false;
551 this.Controls.Add(this.grpAutoRebook);
552 this.Controls.Add(this.txtNote);
553 this.Controls.Add(this.label1);
554 this.Controls.Add(this.lstReason);
555 this.Controls.Add(this.grpCancelledby);
556 this.Controls.Add(this.pnlDescription);
557 this.Controls.Add(this.pnlPageBottom);
558 this.Controls.Add(this.label2);
559 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
560 this.Name = "DCancelAppt";
561 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
562 this.Text = "Cancel Appointment";
563 this.pnlPageBottom.ResumeLayout(false);
564 this.pnlDescription.ResumeLayout(false);
565 this.grpDescriptionResourceGroup.ResumeLayout(false);
566 this.grpCancelledby.ResumeLayout(false);
567 this.grpAutoRebook.ResumeLayout(false);
568 ((System.ComponentModel.ISupportInitialize)(this.udMax)).EndInit();
569 ((System.ComponentModel.ISupportInitialize)(this.udStart)).EndInit();
570 this.ResumeLayout(false);
571
572 }
573 #endregion
574
575
576
577
578
579 }
580}
Note: See TracBrowser for help on using the repository browser.