Ignore:
Timestamp:
Jun 6, 2010, 8:59:53 PM (14 years ago)
Author:
Sam Habiel
Message:

Provided framework for Rebook letters; but they don't work.
Added the appointment dates to the printed letters.
Made more shortcuts on the main menu.
Changed version to 1.1, to be more congruous with the state of the software.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.cs

    r788 r789  
    3131        dsPatientApptDisplay2 _dsApptDisplay;
    3232        private PrintDocument printCancelLetters;
     33        private PrintDocument printRebookLetters;
    3334        dsRebookAppts _dsRebookAppts;
    3435                #endregion Fields
     
    7374                }
    7475
    75                 public void InitializeFormRebookLetters(CGDocumentManager docManager,
     76        /// <summary>
     77        /// Print Rebook Letters by Date
     78        /// </summary>
     79        /// <param name="docManager">This docManger</param>
     80        /// <param name="sClinicList">Clinics for which to print</param>
     81        /// <param name="dtBegin">Beginning Date</param>
     82        /// <param name="dtEnd">End Date</param>
     83        public void InitializeFormRebookLetters(CGDocumentManager docManager,
    7684                        string sClinicList,
    7785                    DateTime dtBegin,
     
    8997
    9098                //Call RPC to get list of appt ids that have been rebooked for these clinics on these dates
    91                 string sSql1 = "BSDX REBOOK CLINIC LIST^" + sClinicList + "^" + sBegin + "^" + sEnd;
    92                 DataTable dtLetters = docManager.RPMSDataTable(sSql1, "PatientAppts");
    93                                
     99                string sSql1 = "BSDX REBOOK CLINIC LIST^" + sClinicList + "^" + sBegin + "^" + sEnd;                           
    94100                                string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;
    95                                 DataTable dt = docManager.RPMSDataTable(sSql2, "Resources");                           
     101
     102                _dsRebookAppts = new dsRebookAppts();
     103                _dsRebookAppts.PatientAppts.Merge(docManager.RPMSDataTable(sSql1, "PatientAppts"));
     104                _dsRebookAppts.BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources"));
     105
    96106            }
    97107                        catch (Exception ex)
     
    99109                                throw ex;
    100110                        }
    101                 }
     111
     112            PrintPreviewControl.Document = printRebookLetters;
     113
     114                }
     115
     116        /// <summary>
     117        /// Print Rebook Letters by Date
     118        /// </summary>
     119        /// <param name="docManager">This docManger</param>
     120        /// <param name="sClinicList">Clinics for which to print</param>
     121        /// <param name="sApptIDList">List of appointments IENs in ^BSDXAPPT, delimited by |</param>
    102122        public void InitializeFormRebookLetters(CGDocumentManager docManager,
    103123            string sClinicList,
     
    111131                }
    112132
    113                 string sSql = "BSDX REBOOK LIST^" + sApptIDList;
    114                 DataTable dtLetters = docManager.RPMSDataTable(sSql, "PatientAppts");
    115 
     133                string sSql1 = "BSDX REBOOK LIST^" + sApptIDList;
    116134                string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;
    117                 DataTable dt = docManager.RPMSDataTable(sSql2, "Resources");
     135
     136                _dsRebookAppts = new dsRebookAppts();
     137                _dsRebookAppts.PatientAppts.Merge(docManager.RPMSDataTable(sSql1, "PatientAppts"));
     138                _dsRebookAppts.BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources"));
     139
    118140
    119141            }
     
    122144                throw ex;
    123145            }
     146
     147            PrintPreviewControl.Document = printRebookLetters;
    124148        }
    125149
     
    203227                }
    204228
    205 
     229        /// <summary>
     230        /// Ctor
     231        /// </summary>
    206232                public DPatientLetter() : base()
    207233                {
     
    241267            this.printReminderLetters = new System.Drawing.Printing.PrintDocument();
    242268            this.printCancelLetters = new System.Drawing.Printing.PrintDocument();
     269            this.printRebookLetters = new System.Drawing.Printing.PrintDocument();
    243270            this.SuspendLayout();
    244271            //
     
    254281            //
    255282            this.printCancelLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printCancelLetters_PrintPage);
     283            //
     284            // printRebookLetters
     285            //
     286            this.printRebookLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printRebookLetters_PrintPage);
    256287            //
    257288            // DPatientLetter
     
    332363
    333364        }
     365
     366        private void printRebookLetters_PrintPage(object sender, PrintPageEventArgs e)
     367        {
     368            // no patients
     369            if (_dsRebookAppts.PatientAppts.Count == 0)
     370            {
     371                ClinicalScheduling.Printing.PrintMessage("No Appointments found", e);
     372                return;
     373            }
     374            // if there are patients
     375            else if (_currentApptPrinting < _dsRebookAppts.PatientAppts.Count)
     376            {
     377                dsRebookAppts.BSDXResourceRow c = (dsRebookAppts.BSDXResourceRow)
     378                   _dsRebookAppts.PatientAppts[_currentApptPrinting].GetParentRow(_dsRebookAppts.Relations[0]);
     379                //XXX: Rebook letter rather oddly currently stored in NO SHOW LETTER field. What gives???
     380                ClinicalScheduling.Printing.PrintRebookLetter(_dsRebookAppts.PatientAppts[_currentApptPrinting], e, c.NO_SHOW_LETTER, "Rebook Letter");
     381                _currentApptPrinting++;
     382                if (_currentApptPrinting < _dsRebookAppts.PatientAppts.Count)
     383                    e.HasMorePages = true;
     384            }
     385        }
    334386        }
    335387}
Note: See TracChangeset for help on using the changeset viewer.