Changeset 1110
- Timestamp:
- Mar 21, 2011, 8:47:45 AM (14 years ago)
- Location:
- Scheduling/trunk/cs/bsdx0200GUISourceCode
- Files:
-
- 1 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs
r1106 r1110 177 177 /// <returns>Clears and repopluates m_appointments</returns> 178 178 /// </summary> 179 private bool Refresh DaysSchedule()179 private bool RefreshAppointments() 180 180 { 181 181 try … … 239 239 bWalkIn = (sWalkIn == "1") ? true : false; 240 240 241 Patient pt = new Patient() 242 { 243 DFN = Convert.ToInt32(sPatientID), 244 Name = sPatientName, 245 DOB = (DateTime)r["DOB"], 246 ID = r["PID"].ToString(), 247 HRN = sHRN, 248 Sex = r["SEX"].ToString() == "MALE" ? Sex.Male : Sex.Female 249 }; 250 241 251 pAppointment = new CGAppointment(); 252 pAppointment.Patient = pt; 242 253 pAppointment.CreateAppointment(dStart, dEnd, sNote, nKeyID, sResource); 243 254 pAppointment.PatientName = sPatientName; … … 396 407 { 397 408 this.RefreshAvailabilitySchedule(); 398 this.Refresh DaysSchedule();409 this.RefreshAppointments(); 399 410 return true; 400 411 } -
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs
r1106 r1110 42 42 43 43 //Custom Printing 44 private CustomPrinting m_PrintingObject = null;44 private Printing m_PrintingObject = null; 45 45 #endregion 46 46 … … 134 134 } 135 135 136 public CustomPrinting PrintingObject136 public Printing PrintingObject 137 137 { 138 138 get … … 445 445 if (DllLocation == string.Empty) 446 446 { 447 this.m_PrintingObject = new CustomPrinting();447 this.m_PrintingObject = new Printing(); 448 448 } 449 449 else -
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs
r1106 r1110 1 1 using System; 2 using System.Drawing;3 2 using System.Collections; 4 3 using System.ComponentModel; … … 9 8 using IndianHealthService.BMXNet; 10 9 using System.Runtime.InteropServices; 10 using System.Drawing.Printing; 11 11 12 12 namespace IndianHealthService.ClinicalScheduling … … 97 97 private System.Windows.Forms.MenuItem mnuDisplayWalkIns; 98 98 private System.Windows.Forms.MenuItem mnuRPMSDivision; 99 private System.Drawing.Printing.PrintDocument printRoutingSlip;100 99 private MenuItem menuItem10; 101 private MenuItem ctxCalGridReprint RoutingSlip;100 private MenuItem ctxCalGridReprintApptSlip; 102 101 private IContainer components; 103 102 … … 233 232 this.lblResource = new System.Windows.Forms.Label(); 234 233 this.panelCenter = new System.Windows.Forms.Panel(); 234 this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid(); 235 235 this.ctxCalendarGrid = new System.Windows.Forms.ContextMenu(); 236 236 this.ctxCalGridAdd = new System.Windows.Forms.MenuItem(); … … 244 244 this.ctxCalGridWalkin = new System.Windows.Forms.MenuItem(); 245 245 this.menuItem10 = new System.Windows.Forms.MenuItem(); 246 this.ctxCalGridReprint RoutingSlip = new System.Windows.Forms.MenuItem();246 this.ctxCalGridReprintApptSlip = new System.Windows.Forms.MenuItem(); 247 247 this.panelBottom = new System.Windows.Forms.Panel(); 248 248 this.statusBar1 = new System.Windows.Forms.StatusBar(); 249 249 this.splitter1 = new System.Windows.Forms.Splitter(); 250 250 this.splitter2 = new System.Windows.Forms.Splitter(); 251 this.printRoutingSlip = new System.Drawing.Printing.PrintDocument();252 this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid();253 251 this.panelRight.SuspendLayout(); 254 252 this.panelClip.SuspendLayout(); … … 763 761 this.panelCenter.Size = new System.Drawing.Size(857, 345); 764 762 this.panelCenter.TabIndex = 7; 765 //766 // ctxCalendarGrid767 //768 this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {769 this.ctxCalGridAdd,770 this.ctxCalGridEdit,771 this.ctxCalGridDelete,772 this.ctxCalGridCheckIn,773 this.menuItem2,774 this.ctxCalGridNoShow,775 this.ctxCalGridNoShowUndo,776 this.menuItem9,777 this.ctxCalGridWalkin,778 this.menuItem10,779 this.ctxCalGridReprintRoutingSlip});780 this.ctxCalendarGrid.Popup += new System.EventHandler(this.ctxCalendarGrid_Popup);781 //782 // ctxCalGridAdd783 //784 this.ctxCalGridAdd.Index = 0;785 this.ctxCalGridAdd.Text = "Add Appointment";786 this.ctxCalGridAdd.Click += new System.EventHandler(this.ctxCalGridAdd_Click);787 //788 // ctxCalGridEdit789 //790 this.ctxCalGridEdit.Index = 1;791 this.ctxCalGridEdit.Text = "Edit Appointment";792 this.ctxCalGridEdit.Click += new System.EventHandler(this.ctxCalGridEdit_Click);793 //794 // ctxCalGridDelete795 //796 this.ctxCalGridDelete.Index = 2;797 this.ctxCalGridDelete.Text = "Cancel Appointment";798 this.ctxCalGridDelete.Click += new System.EventHandler(this.ctxCalGridDelete_Click);799 //800 // ctxCalGridCheckIn801 //802 this.ctxCalGridCheckIn.Index = 3;803 this.ctxCalGridCheckIn.Text = "Check In Patient";804 this.ctxCalGridCheckIn.Click += new System.EventHandler(this.ctxCalGridCheckIn_Click);805 //806 // menuItem2807 //808 this.menuItem2.Index = 4;809 this.menuItem2.Text = "-";810 //811 // ctxCalGridNoShow812 //813 this.ctxCalGridNoShow.Index = 5;814 this.ctxCalGridNoShow.Text = "Mark as No Show";815 this.ctxCalGridNoShow.Click += new System.EventHandler(this.ctxCalGridNoShow_Click);816 //817 // ctxCalGridNoShowUndo818 //819 this.ctxCalGridNoShowUndo.Index = 6;820 this.ctxCalGridNoShowUndo.Text = "Undo NoShow";821 this.ctxCalGridNoShowUndo.Click += new System.EventHandler(this.ctxCalGridNoShowUndo_Click);822 //823 // menuItem9824 //825 this.menuItem9.Index = 7;826 this.menuItem9.Text = "-";827 //828 // ctxCalGridWalkin829 //830 this.ctxCalGridWalkin.Index = 8;831 this.ctxCalGridWalkin.Text = "Create Wal&k-In Appointment";832 this.ctxCalGridWalkin.Click += new System.EventHandler(this.ctxCalGridWalkin_Click);833 //834 // menuItem10835 //836 this.menuItem10.Index = 9;837 this.menuItem10.Text = "-";838 //839 // ctxCalGridReprintRoutingSlip840 //841 this.ctxCalGridReprintRoutingSlip.Index = 10;842 this.ctxCalGridReprintRoutingSlip.Text = "&Reprint Routing Slip";843 this.ctxCalGridReprintRoutingSlip.Click += new System.EventHandler(this.ctxCalGridReprintRoutingSlip_Click);844 //845 // panelBottom846 //847 this.panelBottom.Controls.Add(this.statusBar1);848 this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;849 this.panelBottom.Location = new System.Drawing.Point(136, 369);850 this.panelBottom.Name = "panelBottom";851 this.panelBottom.Size = new System.Drawing.Size(857, 24);852 this.panelBottom.TabIndex = 8;853 //854 // statusBar1855 //856 this.statusBar1.Dock = System.Windows.Forms.DockStyle.Fill;857 this.statusBar1.Location = new System.Drawing.Point(0, 0);858 this.statusBar1.Name = "statusBar1";859 this.statusBar1.Size = new System.Drawing.Size(857, 24);860 this.statusBar1.SizingGrip = false;861 this.statusBar1.TabIndex = 0;862 //863 // splitter1864 //865 this.splitter1.Location = new System.Drawing.Point(128, 24);866 this.splitter1.Name = "splitter1";867 this.splitter1.Size = new System.Drawing.Size(8, 369);868 this.splitter1.TabIndex = 9;869 this.splitter1.TabStop = false;870 //871 // splitter2872 //873 this.splitter2.Dock = System.Windows.Forms.DockStyle.Right;874 this.splitter2.Location = new System.Drawing.Point(993, 24);875 this.splitter2.Name = "splitter2";876 this.splitter2.Size = new System.Drawing.Size(3, 369);877 this.splitter2.TabIndex = 10;878 this.splitter2.TabStop = false;879 //880 // printRoutingSlip881 //882 this.printRoutingSlip.DocumentName = "Routing Slip";883 this.printRoutingSlip.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printRoutingSlip_PrintPage);884 763 // 885 764 // calendarGrid1 … … 912 791 this.calendarGrid1.MouseEnter += new System.EventHandler(this.calendarGrid1_MouseEnter); 913 792 // 793 // ctxCalendarGrid 794 // 795 this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { 796 this.ctxCalGridAdd, 797 this.ctxCalGridEdit, 798 this.ctxCalGridDelete, 799 this.ctxCalGridCheckIn, 800 this.menuItem2, 801 this.ctxCalGridNoShow, 802 this.ctxCalGridNoShowUndo, 803 this.menuItem9, 804 this.ctxCalGridWalkin, 805 this.menuItem10, 806 this.ctxCalGridReprintApptSlip}); 807 this.ctxCalendarGrid.Popup += new System.EventHandler(this.ctxCalendarGrid_Popup); 808 // 809 // ctxCalGridAdd 810 // 811 this.ctxCalGridAdd.Index = 0; 812 this.ctxCalGridAdd.Text = "Add Appointment"; 813 this.ctxCalGridAdd.Click += new System.EventHandler(this.ctxCalGridAdd_Click); 814 // 815 // ctxCalGridEdit 816 // 817 this.ctxCalGridEdit.Index = 1; 818 this.ctxCalGridEdit.Text = "Edit Appointment"; 819 this.ctxCalGridEdit.Click += new System.EventHandler(this.ctxCalGridEdit_Click); 820 // 821 // ctxCalGridDelete 822 // 823 this.ctxCalGridDelete.Index = 2; 824 this.ctxCalGridDelete.Text = "Cancel Appointment"; 825 this.ctxCalGridDelete.Click += new System.EventHandler(this.ctxCalGridDelete_Click); 826 // 827 // ctxCalGridCheckIn 828 // 829 this.ctxCalGridCheckIn.Index = 3; 830 this.ctxCalGridCheckIn.Text = "Check In Patient"; 831 this.ctxCalGridCheckIn.Click += new System.EventHandler(this.ctxCalGridCheckIn_Click); 832 // 833 // menuItem2 834 // 835 this.menuItem2.Index = 4; 836 this.menuItem2.Text = "-"; 837 // 838 // ctxCalGridNoShow 839 // 840 this.ctxCalGridNoShow.Index = 5; 841 this.ctxCalGridNoShow.Text = "Mark as No Show"; 842 this.ctxCalGridNoShow.Click += new System.EventHandler(this.ctxCalGridNoShow_Click); 843 // 844 // ctxCalGridNoShowUndo 845 // 846 this.ctxCalGridNoShowUndo.Index = 6; 847 this.ctxCalGridNoShowUndo.Text = "Undo NoShow"; 848 this.ctxCalGridNoShowUndo.Click += new System.EventHandler(this.ctxCalGridNoShowUndo_Click); 849 // 850 // menuItem9 851 // 852 this.menuItem9.Index = 7; 853 this.menuItem9.Text = "-"; 854 // 855 // ctxCalGridWalkin 856 // 857 this.ctxCalGridWalkin.Index = 8; 858 this.ctxCalGridWalkin.Text = "Create Wal&k-In Appointment"; 859 this.ctxCalGridWalkin.Click += new System.EventHandler(this.ctxCalGridWalkin_Click); 860 // 861 // menuItem10 862 // 863 this.menuItem10.Index = 9; 864 this.menuItem10.Text = "-"; 865 // 866 // ctxCalGridReprintApptSlip 867 // 868 this.ctxCalGridReprintApptSlip.Index = 10; 869 this.ctxCalGridReprintApptSlip.Text = "&Reprint Appointment Slip"; 870 this.ctxCalGridReprintApptSlip.Click += new System.EventHandler(this.ctxCalGridReprintApptSlip_Click); 871 // 872 // panelBottom 873 // 874 this.panelBottom.Controls.Add(this.statusBar1); 875 this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom; 876 this.panelBottom.Location = new System.Drawing.Point(136, 369); 877 this.panelBottom.Name = "panelBottom"; 878 this.panelBottom.Size = new System.Drawing.Size(857, 24); 879 this.panelBottom.TabIndex = 8; 880 // 881 // statusBar1 882 // 883 this.statusBar1.Dock = System.Windows.Forms.DockStyle.Fill; 884 this.statusBar1.Location = new System.Drawing.Point(0, 0); 885 this.statusBar1.Name = "statusBar1"; 886 this.statusBar1.Size = new System.Drawing.Size(857, 24); 887 this.statusBar1.SizingGrip = false; 888 this.statusBar1.TabIndex = 0; 889 // 890 // splitter1 891 // 892 this.splitter1.Location = new System.Drawing.Point(128, 24); 893 this.splitter1.Name = "splitter1"; 894 this.splitter1.Size = new System.Drawing.Size(8, 369); 895 this.splitter1.TabIndex = 9; 896 this.splitter1.TabStop = false; 897 // 898 // splitter2 899 // 900 this.splitter2.Dock = System.Windows.Forms.DockStyle.Right; 901 this.splitter2.Location = new System.Drawing.Point(993, 24); 902 this.splitter2.Name = "splitter2"; 903 this.splitter2.Size = new System.Drawing.Size(3, 369); 904 this.splitter2.TabIndex = 10; 905 this.splitter2.TabStop = false; 906 // 914 907 // CGView 915 908 // … … 1224 1217 ctxCalGridWalkin.Enabled = ctxCalGridAdd.Enabled; 1225 1218 //smh new code 1226 ctxCalGridReprint RoutingSlip.Enabled = ctxCalGridEdit.Enabled;1219 ctxCalGridReprintApptSlip.Enabled = ctxCalGridEdit.Enabled; 1227 1220 //end new code 1228 1221 } … … 1265 1258 1266 1259 //new code smh 1267 private void ctxCalGridReprint RoutingSlip_Click(object sender, EventArgs e)1260 private void ctxCalGridReprintApptSlip_Click(object sender, EventArgs e) 1268 1261 { 1269 printRoutingSlip.Print(); 1262 int apptID = this.CGrid.SelectedAppointment; 1263 if (apptID <= 0) return; 1264 1265 CGAppointment a = (CGAppointment) this.Appointments.AppointmentTable[apptID]; 1266 1267 PrintDocument pd = new PrintDocument() { DocumentName = "Appointment Slip for Appt " + apptID }; //Autoinit for DocName 1268 pd.PrintPage += (s, pe) => //son of a lambda 1269 { 1270 CGDocumentManager.Current.PrintingObject.PrintAppointmentSlip(a, pe); 1271 }; 1272 1273 pd.Print(); 1270 1274 } 1271 1275 //end new code … … 1996 2000 //smh new code 1997 2001 if (dlgCheckin.PrintRouteSlip) 1998 this.printRoutingSlip.Print();2002 // this.printRoutingSlip.Print(); 1999 2003 // end new code 2000 2004 … … 3247 3251 int nApptID = this.calendarGrid1.SelectedAppointment; 3248 3252 CGAppointment a = (CGAppointment)this.Appointments.AppointmentTable[nApptID]; 3249 C linicalScheduling.Printing.PrintRoutingSlip(a, "Routing Slip", e);3253 CGDocumentManager.Current.PrintingObject.PrintRoutingSlip(a, "Routing Slip", e); 3250 3254 } 3251 3255 -
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.resx
r1066 r1110 136 136 </value> 137 137 </data> 138 <metadata name="printRoutingSlip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">139 <value>512, 17</value>140 </metadata>141 138 <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 142 139 <value>75</value> -
Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj
r1106 r1110 303 303 <Compile Include="Options.cs" /> 304 304 <Compile Include="Patient.cs" /> 305 <Compile Include="Printing.cs" />306 305 <Compile Include="UCPatientAppts.cs"> 307 306 <SubType>UserControl</SubType> -
Scheduling/trunk/cs/bsdx0200GUISourceCode/DAppointPage.cs
r1106 r1110 64 64 private TextBox txtCountry; 65 65 private CheckBox chkPrint; 66 private Label label18; 67 private TextBox txtSex; 66 68 private IContainer components; 67 69 … … 121 123 this.txtStreet = new System.Windows.Forms.TextBox(); 122 124 this.panel1 = new System.Windows.Forms.Panel(); 125 this.chkPrint = new System.Windows.Forms.CheckBox(); 123 126 this.cmdCancel = new System.Windows.Forms.Button(); 124 127 this.cmdOK = new System.Windows.Forms.Button(); … … 126 129 this.dsPatientApptDisplay2BindingSource = new System.Windows.Forms.BindingSource(this.components); 127 130 this.dsPatientApptDisplay2 = new IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2(); 128 this.chkPrint = new System.Windows.Forms.CheckBox(); 131 this.label18 = new System.Windows.Forms.Label(); 132 this.txtSex = new System.Windows.Forms.TextBox(); 129 133 this.tabControl1.SuspendLayout(); 130 134 this.tabAppointment.SuspendLayout(); … … 260 264 // groupBox1 261 265 // 266 this.groupBox1.Controls.Add(this.txtSex); 267 this.groupBox1.Controls.Add(this.label18); 262 268 this.groupBox1.Controls.Add(this.label14); 263 269 this.groupBox1.Controls.Add(this.txtHRN); … … 277 283 // label14 278 284 // 279 this.label14.Location = new System.Drawing.Point(5 6, 64);285 this.label14.Location = new System.Drawing.Point(50, 64); 280 286 this.label14.Name = "label14"; 281 287 this.label14.Size = new System.Drawing.Size(40, 16); … … 294 300 // label6 295 301 // 296 this.label6.Location = new System.Drawing.Point(22 4, 40);302 this.label6.Location = new System.Drawing.Point(227, 65); 297 303 this.label6.Name = "label6"; 298 304 this.label6.Size = new System.Drawing.Size(40, 16); … … 303 309 // txtPID 304 310 // 305 this.txtPID.Location = new System.Drawing.Point(272, 40);311 this.txtPID.Location = new System.Drawing.Point(272, 63); 306 312 this.txtPID.Name = "txtPID"; 307 313 this.txtPID.ReadOnly = true; … … 311 317 // label5 312 318 // 313 this.label5.Location = new System.Drawing.Point( 64, 40);319 this.label5.Location = new System.Drawing.Point(58, 41); 314 320 this.label5.Name = "label5"; 315 321 this.label5.Size = new System.Drawing.Size(32, 16); … … 328 334 // label2 329 335 // 330 this.label2.Location = new System.Drawing.Point(5 6, 16);336 this.label2.Location = new System.Drawing.Point(50, 16); 331 337 this.label2.Name = "label2"; 332 338 this.label2.Size = new System.Drawing.Size(40, 16); … … 543 549 this.panel1.TabIndex = 1; 544 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 // 545 561 // cmdCancel 546 562 // … … 577 593 this.dsPatientApptDisplay2.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; 578 594 // 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; 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; 588 612 // 589 613 // DAppointPage … … 623 647 624 648 private string m_sPatientName; 649 private Sex m_enumPatientSex; 625 650 private string m_sPatientHRN; 626 651 private string m_sPatientIEN; … … 674 699 DataRow r = tb.Rows[0]; 675 700 this.m_sPatientName = r["NAME"].ToString(); 701 this.m_enumPatientSex = r["SEX"].ToString() == "MALE" ? Sex.Male : Sex.Female; 676 702 this.m_sPatientHRN = r["HRN"].ToString(); 677 703 this.m_sPatientIEN = r["IEN"].ToString(); … … 716 742 txtNote.Text = this.m_sNote; 717 743 txtPatientName.Text = m_sPatientName; 744 txtSex.Text = m_enumPatientSex.ToString(); 718 745 txtPhoneHome.Text = this.m_sPhoneHome; 719 746 txtPhoneOffice.Text = this.m_sPhoneOffice; … … 797 824 DFN = Int32.Parse(m_sPatientIEN), 798 825 Name = m_sPatientName, 826 Sex = m_enumPatientSex, 799 827 DOB = m_dPatientDOB, 800 828 ID = m_sPatientPID, -
Scheduling/trunk/cs/bsdx0200GUISourceCode/DAppointPage.resx
r1106 r1110 124 124 <value>179, 17</value> 125 125 </metadata> 126 <metadata name="dsPatientApptDisplay2BindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 127 <value>179, 17</value> 128 </metadata> 129 <metadata name="dsPatientApptDisplay2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 130 <value>17, 17</value> 131 </metadata> 126 132 <metadata name="dsPatientApptDisplay2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 127 133 <value>17, 17</value> -
Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.cs
r884 r1110 302 302 303 303 // _currentResourcePrinting starts with zero. There will be at least this one. 304 C linicalScheduling.Printing.PrintAppointments(_dsApptDisplay, e, _dtBegin, _dtEnd,304 CGDocumentManager.Current.PrintingObject.PrintAppointments(_dsApptDisplay, e, _dtBegin, _dtEnd, 305 305 _currentResourcePrinting, ref _currentApptPrinting, _pageNumber); 306 306 … … 332 332 if (_dsApptDisplay.PatientAppts.Count == 0) 333 333 { 334 C linicalScheduling.Printing.PrintMessage("No Appointments found", e);334 CGDocumentManager.Current.PrintingObject.PrintMessage("No Appointments found", e); 335 335 return; 336 336 } … … 340 340 dsPatientApptDisplay2.BSDXResourceRow c = (dsPatientApptDisplay2.BSDXResourceRow) 341 341 _dsApptDisplay.PatientAppts[_currentApptPrinting].GetParentRow(_dsApptDisplay.Relations[0]); 342 C linicalScheduling.Printing.PrintReminderLetter(_dsApptDisplay.PatientAppts[_currentApptPrinting], e, c.LETTER_TEXT, "Reminder Letter");342 CGDocumentManager.Current.PrintingObject.PrintReminderLetter(_dsApptDisplay.PatientAppts[_currentApptPrinting], e, c.LETTER_TEXT, "Reminder Letter"); 343 343 _currentApptPrinting++; 344 344 if (_currentApptPrinting < _dsApptDisplay.PatientAppts.Count) … … 359 359 if (_dsRebookAppts.PatientAppts.Count == 0) 360 360 { 361 C linicalScheduling.Printing.PrintMessage("No Appointments found", e);361 CGDocumentManager.Current.PrintingObject.PrintMessage("No Appointments found", e); 362 362 return; 363 363 } … … 367 367 dsRebookAppts.BSDXResourceRow c = (dsRebookAppts.BSDXResourceRow) 368 368 _dsRebookAppts.PatientAppts[_currentApptPrinting].GetParentRow(_dsRebookAppts.Relations[0]); 369 C linicalScheduling.Printing.PrintCancelLetter(_dsRebookAppts.PatientAppts[_currentApptPrinting], e, c.CLINIC_CANCELLATION_LETTER, "Cancellation Letter");369 CGDocumentManager.Current.PrintingObject.PrintCancelLetter(_dsRebookAppts.PatientAppts[_currentApptPrinting], e, c.CLINIC_CANCELLATION_LETTER, "Cancellation Letter"); 370 370 _currentApptPrinting++; 371 371 if (_currentApptPrinting < _dsRebookAppts.PatientAppts.Count) … … 384 384 if (_dsRebookAppts.PatientAppts.Count == 0) 385 385 { 386 C linicalScheduling.Printing.PrintMessage("No Appointments found", e);386 CGDocumentManager.Current.PrintingObject.PrintMessage("No Appointments found", e); 387 387 return; 388 388 } … … 393 393 _dsRebookAppts.PatientAppts[_currentApptPrinting].GetParentRow(_dsRebookAppts.Relations[0]); 394 394 //XXX: Rebook letter rather oddly currently stored in NO SHOW LETTER field. What gives??? 395 C linicalScheduling.Printing.PrintRebookLetter(_dsRebookAppts.PatientAppts[_currentApptPrinting], e, c.NO_SHOW_LETTER, "Rebook Letter");395 CGDocumentManager.Current.PrintingObject.PrintRebookLetter(_dsRebookAppts.PatientAppts[_currentApptPrinting], e, c.NO_SHOW_LETTER, "Rebook Letter"); 396 396 _currentApptPrinting++; 397 397 if (_currentApptPrinting < _dsRebookAppts.PatientAppts.Count) -
Scheduling/trunk/cs/bsdx0200GUISourceCode/Patient.cs
r1107 r1110 6 6 namespace IndianHealthService.ClinicalScheduling 7 7 { 8 9 /// <summary> 10 /// You guessed it. 11 /// </summary> 12 public enum Sex 13 { 14 Male, Female 15 }; 16 8 17 /// <summary> 9 18 /// Puppet standing for a Real Patient … … 13 22 public int DFN { get; set; } 14 23 public string Name { get; set; } 24 public Sex Sex; 15 25 public DateTime DOB { get; set; } 16 26 public string ID { get; set; } … … 26 36 public string WorkPHone { get; set; } 27 37 public string CellPhone { get; set; } 38 public TimeSpan Age 39 { 40 get 41 { 42 return (DateTime.Today - this.DOB); 43 } 44 } 45 46 public string UserFriendlyAge 47 { 48 get 49 { 50 if (Age.TotalDays / 365.24 > 5) 51 return Math.Floor((Age.TotalDays / 365.24)).ToString() + " years"; 52 else 53 return Math.Floor((Age.TotalDays / 365.24)).ToString() + " years & " 54 + Math.Floor(Age.TotalDays % 365.24 / 30).ToString() + " months"; 55 } 56 } 28 57 } 29 58 } -
Scheduling/trunk/cs/bsdx0200GUISourceCode/Printing.cs
r900 r1110 1 1 using System; 2 using System.Collections.Generic;3 using System.Linq;4 using System.Text;5 2 using System.Drawing.Printing; 6 3 using System.Drawing; 4 using System.Text; 5 using System.Drawing.Drawing2D; 6 using System.Linq; 7 7 using System.Data; 8 using System.Drawing.Drawing2D;9 8 10 9 namespace IndianHealthService.ClinicalScheduling 11 10 { 12 /// <summary> 13 /// Class that encapsulates printing functions in Clinical Scheduling 14 /// </summary> 15 public static class Printing 16 { 11 public class Printing 12 { 17 13 /// <summary> 18 14 /// Print Appointments … … 26 22 /// <param name="pageNumber">Current page number</param> 27 23 /// <remarks>beg and end have no effect on operation--they are there for documentation for user only</remarks> 28 public static void PrintAppointments(dsPatientApptDisplay2 ds, PrintPageEventArgs e, DateTime beg, DateTime end, 29 int resourceToPrint, ref int apptPrinting, int pageNumber) 24 public virtual void PrintAppointments(dsPatientApptDisplay2 ds, PrintPageEventArgs e, DateTime beg, DateTime end, int resourceToPrint, ref int apptPrinting, int pageNumber) 30 25 { 31 26 Graphics g = e.Graphics; … … 122 117 123 118 /// <summary> 119 /// Prints a single appointment slip to give to the patient 120 /// </summary> 121 /// <param name="appt">The Appointment to print</param> 122 /// <param name="e">PrintPageEventArgs from PrintDocument Print handler</param> 123 public virtual void PrintAppointmentSlip(CGAppointment appt, PrintPageEventArgs e) 124 { 125 // Prep 126 Graphics g = e.Graphics; 127 Rectangle printArea = e.MarginBounds; 128 Rectangle pageArea = e.PageBounds; 129 Rectangle headerArea = new Rectangle() 130 { 131 X = e.MarginBounds.X, 132 Y = e.PageBounds.Y, 133 Height = e.MarginBounds.Y - e.PageBounds.Y, 134 Width = e.MarginBounds.Width 135 }; 136 137 // A few fonts 138 Font fTitle = new Font(FontFamily.GenericSerif, 24, FontStyle.Bold); //for title 139 Font fBody = new Font(FontFamily.GenericSerif, 12); 140 Font fGroupTitle = new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold); 141 142 StringFormat sf0 = new StringFormat() 143 { 144 Alignment = StringAlignment.Center, 145 LineAlignment = StringAlignment.Center 146 }; 147 148 // Draw Header 149 string division = CGDocumentManager.Current.ConnectInfo.DivisionName; 150 g.DrawString(division, fBody, Brushes.Black, headerArea, sf0); 151 152 // Draw Title 153 StringFormat sf = new StringFormat(); 154 sf.Alignment = StringAlignment.Center; //for title & header 155 156 string s = "Appointment Reminder Slip"; 157 g.DrawString(s, fTitle, Brushes.Black, printArea, sf); //title 158 159 // move down 160 int titleHeight = (int)g.MeasureString(s, fTitle, printArea.Width).Height; 161 printArea.Y += titleHeight; 162 printArea.Height -= titleHeight; 163 164 // draw underline 165 g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y)); 166 printArea.Y += 15; 167 printArea.Height -= 15; 168 169 // draw curved rectangle. 170 Rectangle personalInfoRectangle = new Rectangle(e.MarginBounds.X, printArea.Y + 30, 280, 300); 171 using (GraphicsPath path = GetRoundedRectPath(personalInfoRectangle, 10)) 172 { 173 g.DrawPath(Pens.Black, path); 174 } 175 176 // group header 177 g.DrawString("Patient Information", fGroupTitle, Brushes.Black, new Point(personalInfoRectangle.X, personalInfoRectangle.Y - 20)); 178 179 // inner rectangle for drawing strings: 180 Rectangle personalInfoInnerRectangle = new Rectangle(personalInfoRectangle.X + 20, personalInfoRectangle.Y + 20, 280 - 40, 300 - 40); 181 182 // Strings to write 183 StringBuilder sb = new StringBuilder(500); 184 sb.AppendLine("Name:" + "\t" + appt.Patient.Name); 185 sb.AppendLine(); 186 sb.AppendLine("ID#:" + "\t" + appt.Patient.ID); 187 sb.AppendLine(); 188 sb.AppendLine("DOB:" + "\t" + appt.Patient.DOB.ToShortDateString()); 189 sb.AppendLine(); 190 sb.AppendLine("Age:" + "\t" + appt.Patient.UserFriendlyAge); 191 sb.AppendLine(); 192 sb.AppendLine("Sex:" + "\t" + appt.Patient.Sex.ToString()); 193 194 // Draw them 195 g.DrawString(sb.ToString(), fBody, Brushes.Black, personalInfoInnerRectangle); 196 197 // draw curved rectangle 198 Rectangle apptInfoRectangle = new Rectangle(e.MarginBounds.X + e.MarginBounds.Width - 280, printArea.Y + 30, 280, 300); 199 using (GraphicsPath path = GetRoundedRectPath(apptInfoRectangle, 10)) 200 { 201 g.DrawPath(Pens.Black, path); 202 } 203 204 // group header 205 g.DrawString("Appointment Information", fGroupTitle, Brushes.Black, new Point(apptInfoRectangle.X, apptInfoRectangle.Y - 20)); 206 207 // Strings to write 208 sb = new StringBuilder(); 209 sb.AppendLine("Clinic: " + "\t" + appt.Resource); 210 sb.AppendLine(); 211 sb.AppendLine("Date: " + "\t" + appt.StartTime.ToShortDateString()); 212 sb.AppendLine(); 213 sb.AppendLine("Day: " + "\t" + appt.StartTime.DayOfWeek.ToString()); 214 sb.AppendLine(); 215 sb.AppendLine("Time: " + "\t" + appt.StartTime.ToShortTimeString()); 216 217 // Draw them 218 Rectangle apptInfoInnerRectangle = new Rectangle(apptInfoRectangle.X + 20, apptInfoRectangle.Y + 20, 280 - 40, 300 - 40); 219 220 // Draw them 221 g.DrawString(sb.ToString(), fBody, Brushes.Black, apptInfoInnerRectangle); 222 223 // Move Drawing Rectangle Down 224 printArea.Y += 300 + 30 + 20; 225 printArea.Height -= 300 + 30 + 20; 226 227 // Draw New Line 228 g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y)); 229 printArea.Y += 5; 230 printArea.Height -= 5; 231 232 // Draw new Title 233 s = "Clinic Instructions"; 234 g.DrawString(s, fTitle, Brushes.Black, printArea, sf); //title 235 236 // move down 237 titleHeight = (int)g.MeasureString(s, fTitle, printArea.Width).Height; 238 printArea.Y += titleHeight; 239 printArea.Height -= titleHeight; 240 241 // Draw New Line 242 g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y)); 243 printArea.Y += 15; 244 printArea.Height -= 15; 245 246 // Get Resource Clinic Appointment Letter Text 247 DataTable resources = CGDocumentManager.Current.GlobalDataSet.Tables["Resources"]; 248 249 string ltrTxt = (from resource in resources.AsEnumerable() 250 where resource.Field<string>("RESOURCE_NAME") == appt.Resource 251 select resource.Field<string>("LETTER_TEXT")).SingleOrDefault<string>(); 252 253 if (String.IsNullOrWhiteSpace(ltrTxt)) ltrTxt = "(no instructions provided)"; 254 255 g.DrawString(ltrTxt, fBody, Brushes.Black, printArea); 256 257 int ltrTxtHeight = (int)g.MeasureString(ltrTxt, fBody).Height; 258 259 printArea.Y += ltrTxtHeight + 15; 260 printArea.Height -= ltrTxtHeight + 15; 261 262 g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y)); 263 printArea.Y += 5; 264 printArea.Height -= 5; 265 266 s = "Notes"; 267 g.DrawString(s, fTitle, Brushes.Black, printArea, sf); // Notes title 268 269 // move down 270 titleHeight = (int)g.MeasureString(s, fTitle, printArea.Width).Height; 271 printArea.Y += titleHeight; 272 printArea.Height -= titleHeight; 273 274 // Draw New Line 275 g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y)); 276 printArea.Y += 15; 277 printArea.Height -= 15; 278 279 // Draw Notes Area 280 using (GraphicsPath path = GetRoundedRectPath(printArea, 15)) 281 { 282 g.DrawPath(Pens.Black, path); 283 } 284 285 // Draw Footer 286 // Get footer rectangle 287 Rectangle footerArea = new Rectangle() 288 { 289 X = e.MarginBounds.X, 290 Y = e.MarginBounds.Height + headerArea.Height, 291 Width = e.MarginBounds.Width, 292 Height = pageArea.Height - (e.MarginBounds.Height + headerArea.Height) 293 }; 294 295 //use sf0 to print the footer (center all the way) 296 s = "Printed: " + DateTime.Now.ToString(); 297 Font fFooter = new Font(FontFamily.GenericSerif, 7); 298 g.DrawString(s, fFooter, Brushes.Black, footerArea, sf0); 299 300 } 301 302 303 private GraphicsPath GetRoundedRectPath(Rectangle rect, int radius) 304 { 305 int diameter = 2 * radius; 306 307 Rectangle arcRect = new Rectangle(rect.Location, new Size(diameter, diameter)); 308 GraphicsPath path = new GraphicsPath(); 309 310 path.AddArc(arcRect, 180, 90); //top left 311 arcRect.X = rect.Right - diameter; 312 path.AddArc(arcRect, 270, 90); // top right 313 arcRect.Y = rect.Bottom - diameter; 314 path.AddArc(arcRect, 0, 90); // bottom right 315 arcRect.X = rect.Left; 316 path.AddArc(arcRect, 90, 90); // bottom left 317 318 path.CloseFigure(); 319 320 return path; 321 } 322 323 /// <summary> 124 324 /// Print Letter to be given or mailed to the patient 125 325 /// </summary> … … 128 328 /// <param name="letter">Contains letter string</param> 129 329 /// <param name="title">Title of the letter</param> 130 public staticvoid PrintReminderLetter(dsPatientApptDisplay2.PatientApptsRow ptRow, PrintPageEventArgs e, string letter, string title)330 public virtual void PrintReminderLetter(dsPatientApptDisplay2.PatientApptsRow ptRow, PrintPageEventArgs e, string letter, string title) 131 331 { 132 332 … … 177 377 g.DrawString(address.ToString(), fBody, Brushes.Black, printArea, sf); 178 378 } 179 379 180 380 /// <summary> 181 381 /// Cancellation Letter to be given or mailed to the patient … … 185 385 /// <param name="letter">Contains letter string</param> 186 386 /// <param name="title">Title of the letter</param> 187 public staticvoid PrintCancelLetter(dsRebookAppts.PatientApptsRow ptRow, PrintPageEventArgs e, string letter, string title)387 public virtual void PrintCancelLetter(dsRebookAppts.PatientApptsRow ptRow, PrintPageEventArgs e, string letter, string title) 188 388 { 189 389 Rectangle printArea = e.MarginBounds; … … 241 441 /// <param name="letter">Text of the letter to print</param> 242 442 /// <param name="title">Title to print at the top of the letter</param> 243 public staticvoid PrintRebookLetter(dsRebookAppts.PatientApptsRow ptRow, PrintPageEventArgs e, string letter, string title)443 public virtual void PrintRebookLetter(dsRebookAppts.PatientApptsRow ptRow, PrintPageEventArgs e, string letter, string title) 244 444 { 245 445 Rectangle printArea = e.MarginBounds; … … 298 498 /// <param name="msg">The exact string to print.</param> 299 499 /// <param name="e">Print Page event args</param> 300 public staticvoid PrintMessage(string msg, PrintPageEventArgs e)500 public virtual void PrintMessage(string msg, PrintPageEventArgs e) 301 501 { 302 502 e.Graphics.DrawString(msg, new Font(FontFamily.GenericSerif, 14), … … 310 510 /// <param name="title">String to print for title</param> 311 511 /// <param name="e">etc</param> 312 public staticvoid PrintRoutingSlip(CGAppointment a, string title, PrintPageEventArgs e)512 public virtual void PrintRoutingSlip(CGAppointment a, string title, PrintPageEventArgs e) 313 513 { 314 514 Rectangle printArea = e.MarginBounds; … … 354 554 Font fFooter = new Font(FontFamily.GenericSerif, 8); 355 555 g.DrawString("Printed: " + DateTime.Now, fFooter, Brushes.Black, printArea, sf2); 356 357 } 556 } 557 358 558 } 559 public abstract class PrintingCreator 560 { 561 public abstract Printing PrintFactory(); 562 } 563 359 564 }
Note:
See TracChangeset
for help on using the changeset viewer.