2009-11-30 03:53:28 -05:00
|
|
|
using System;
|
|
|
|
using System.Windows.Forms;
|
|
|
|
using System.Data;
|
2010-05-21 21:03:45 -04:00
|
|
|
using System.Drawing.Printing;
|
|
|
|
using System.Drawing;
|
2009-11-30 03:53:28 -05:00
|
|
|
|
|
|
|
namespace IndianHealthService.ClinicalScheduling
|
|
|
|
{
|
|
|
|
/// <summary>
|
2010-07-11 10:09:11 -04:00
|
|
|
/// Handles Printing of letters (Reminder, Rebook, Cancellation) and a Report. Contains a Print Preview dialog.
|
2009-11-30 03:53:28 -05:00
|
|
|
/// </summary>
|
2011-09-09 14:15:30 -04:00
|
|
|
public class DPatientLetter : VR.PrintPreview.EnhancedPrintPreviewDialog
|
2010-05-21 21:03:45 -04:00
|
|
|
{
|
2009-11-30 03:53:28 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Required designer variable.
|
|
|
|
/// </summary>
|
2010-05-21 21:03:45 -04:00
|
|
|
private System.ComponentModel.Container components = null;
|
2010-06-04 22:19:48 -04:00
|
|
|
private System.Drawing.Printing.PrintDocument printAppts;
|
|
|
|
private System.Drawing.Printing.PrintDocument printReminderLetters;
|
2010-07-11 10:09:11 -04:00
|
|
|
private System.Drawing.Printing.PrintDocument printCancelLetters;
|
|
|
|
private System.Drawing.Printing.PrintDocument printRebookLetters;
|
2009-11-30 03:53:28 -05:00
|
|
|
|
|
|
|
#region Fields
|
2010-05-21 21:03:45 -04:00
|
|
|
DateTime _dtBegin, _dtEnd; //global fields to use in passing to printing method
|
2010-06-04 22:19:48 -04:00
|
|
|
|
|
|
|
//stuff to track what got printed and where we are -- very ugly, I know
|
|
|
|
//but I don't know if there is a better way to do it.
|
2010-05-21 21:03:45 -04:00
|
|
|
int _currentResourcePrinting = 0;
|
|
|
|
int _currentApptPrinting = 0;
|
2010-06-04 22:19:48 -04:00
|
|
|
int _pageNumber = 0;
|
|
|
|
|
2010-07-11 10:09:11 -04:00
|
|
|
//typed datasets to load the results of queries into and set to print routines
|
2010-06-04 22:19:48 -04:00
|
|
|
dsPatientApptDisplay2 _dsApptDisplay;
|
|
|
|
dsRebookAppts _dsRebookAppts;
|
2010-07-11 10:09:11 -04:00
|
|
|
|
2009-11-30 03:53:28 -05:00
|
|
|
#endregion Fields
|
|
|
|
|
2010-07-11 10:09:11 -04:00
|
|
|
#region Windows Form Designer generated code
|
|
|
|
/// <summary>
|
|
|
|
/// Required method for Designer support - do not modify
|
|
|
|
/// the contents of this method with the code editor.
|
|
|
|
/// </summary>
|
|
|
|
private void InitializeComponent()
|
|
|
|
{
|
|
|
|
this.printAppts = new System.Drawing.Printing.PrintDocument();
|
|
|
|
this.printReminderLetters = new System.Drawing.Printing.PrintDocument();
|
|
|
|
this.printCancelLetters = new System.Drawing.Printing.PrintDocument();
|
|
|
|
this.printRebookLetters = new System.Drawing.Printing.PrintDocument();
|
|
|
|
this.SuspendLayout();
|
|
|
|
//
|
|
|
|
// printAppts
|
|
|
|
//
|
|
|
|
this.printAppts.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printAppts_PrintPage);
|
|
|
|
//
|
|
|
|
// printReminderLetters
|
|
|
|
//
|
|
|
|
this.printReminderLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printReminderLetters_PrintPage);
|
|
|
|
//
|
|
|
|
// printCancelLetters
|
|
|
|
//
|
|
|
|
this.printCancelLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printCancelLetters_PrintPage);
|
|
|
|
//
|
|
|
|
// printRebookLetters
|
|
|
|
//
|
|
|
|
this.printRebookLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printRebookLetters_PrintPage);
|
|
|
|
//
|
|
|
|
// DPatientLetter
|
|
|
|
//
|
|
|
|
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
|
2011-03-29 05:38:18 -04:00
|
|
|
this.ClientSize = new System.Drawing.Size(748, 443);
|
2010-07-11 10:09:11 -04:00
|
|
|
this.Name = "DPatientLetter";
|
|
|
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
|
|
|
this.Text = "Patient Letter";
|
|
|
|
this.ResumeLayout(false);
|
|
|
|
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
2010-06-04 22:19:48 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Print Clinic Schedules
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="docManager">This docManger</param>
|
|
|
|
/// <param name="sClinicList">Clinics for which to print</param>
|
|
|
|
/// <param name="dtBegin">Beginning Date</param>
|
|
|
|
/// <param name="dtEnd">End Date</param>
|
|
|
|
public void InitializeFormClinicSchedule(CGDocumentManager docManager,
|
2009-11-30 03:53:28 -05:00
|
|
|
string sClinicList,
|
|
|
|
DateTime dtBegin,
|
|
|
|
DateTime dtEnd)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if (sClinicList == "")
|
|
|
|
{
|
|
|
|
throw new Exception("At least one clinic must be selected.");
|
|
|
|
}
|
|
|
|
|
2010-07-10 11:30:32 -04:00
|
|
|
_dtBegin = dtBegin; // Global variable to use in Printing method below
|
|
|
|
_dtEnd = dtEnd; // ditto
|
2009-11-30 03:53:28 -05:00
|
|
|
|
2010-07-10 11:30:32 -04:00
|
|
|
this.Text="Clinic Schedules";
|
|
|
|
|
|
|
|
// Get Data
|
|
|
|
DataTable PatientAppts = docManager.DAL.GetClinicSchedules(sClinicList, dtBegin, dtEnd);
|
|
|
|
DataTable Resources = docManager.DAL.GetResourceLetters(sClinicList);
|
|
|
|
|
|
|
|
// Merge tables into typed dataset
|
2010-06-04 22:19:48 -04:00
|
|
|
_dsApptDisplay = new dsPatientApptDisplay2();
|
2010-07-10 11:30:32 -04:00
|
|
|
_dsApptDisplay.PatientAppts.Merge(PatientAppts);
|
|
|
|
_dsApptDisplay.BSDXResource.Merge(Resources);
|
2010-06-04 22:19:48 -04:00
|
|
|
|
2011-09-09 14:15:30 -04:00
|
|
|
this.Document = printAppts;
|
2010-05-21 21:03:45 -04:00
|
|
|
}
|
2009-11-30 03:53:28 -05:00
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
throw ex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-06-06 20:59:53 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Print Rebook Letters by Date
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="docManager">This docManger</param>
|
|
|
|
/// <param name="sClinicList">Clinics for which to print</param>
|
|
|
|
/// <param name="dtBegin">Beginning Date</param>
|
|
|
|
/// <param name="dtEnd">End Date</param>
|
|
|
|
public void InitializeFormRebookLetters(CGDocumentManager docManager,
|
2009-11-30 03:53:28 -05:00
|
|
|
string sClinicList,
|
2010-06-04 22:19:48 -04:00
|
|
|
DateTime dtBegin,
|
|
|
|
DateTime dtEnd)
|
2009-11-30 03:53:28 -05:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if (sClinicList == "")
|
|
|
|
{
|
|
|
|
throw new Exception("At least one clinic must be selected.");
|
|
|
|
}
|
|
|
|
|
2010-06-04 22:19:48 -04:00
|
|
|
//Call RPC to get list of appt ids that have been rebooked for these clinics on these dates
|
2010-07-11 10:09:11 -04:00
|
|
|
DataTable PatientAppts = docManager.DAL.GetRebookedAppointments(sClinicList, dtBegin, dtEnd);
|
|
|
|
DataTable Resources = docManager.DAL.GetResourceLetters(sClinicList);
|
2010-06-06 20:59:53 -04:00
|
|
|
|
|
|
|
_dsRebookAppts = new dsRebookAppts();
|
2010-07-11 10:09:11 -04:00
|
|
|
_dsRebookAppts.PatientAppts.Merge(PatientAppts);
|
|
|
|
_dsRebookAppts.BSDXResource.Merge(Resources);
|
2010-06-06 20:59:53 -04:00
|
|
|
|
2010-06-04 22:19:48 -04:00
|
|
|
}
|
2009-11-30 03:53:28 -05:00
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
throw ex;
|
|
|
|
}
|
2010-06-06 20:59:53 -04:00
|
|
|
|
2011-09-09 14:15:30 -04:00
|
|
|
this.Document = printRebookLetters;
|
2010-06-06 20:59:53 -04:00
|
|
|
|
2009-11-30 03:53:28 -05:00
|
|
|
}
|
2010-06-06 20:59:53 -04:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Print Rebook Letters by Date
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="docManager">This docManger</param>
|
|
|
|
/// <param name="sClinicList">Clinics for which to print</param>
|
|
|
|
/// <param name="sApptIDList">List of appointments IENs in ^BSDXAPPT, delimited by |</param>
|
2010-06-04 22:19:48 -04:00
|
|
|
public void InitializeFormRebookLetters(CGDocumentManager docManager,
|
|
|
|
string sClinicList,
|
|
|
|
string sApptIDList)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if (sClinicList == "")
|
|
|
|
{
|
|
|
|
throw new Exception("At least one clinic must be selected.");
|
|
|
|
}
|
|
|
|
|
2010-07-11 10:09:11 -04:00
|
|
|
DataTable PatientAppts = docManager.DAL.GetRebookedAppointments(sApptIDList);
|
|
|
|
DataTable Resources = docManager.DAL.GetResourceLetters(sClinicList);
|
2010-06-06 20:59:53 -04:00
|
|
|
|
|
|
|
_dsRebookAppts = new dsRebookAppts();
|
2010-07-11 10:09:11 -04:00
|
|
|
_dsRebookAppts.PatientAppts.Merge(PatientAppts);
|
|
|
|
_dsRebookAppts.BSDXResource.Merge(Resources);
|
2010-06-04 22:19:48 -04:00
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
throw ex;
|
|
|
|
}
|
2010-06-06 20:59:53 -04:00
|
|
|
|
2011-09-09 14:15:30 -04:00
|
|
|
this.Document = printRebookLetters;
|
2010-06-04 22:19:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Print Cancellation letters to mail to patients
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="docManager">This Docmanager</param>
|
|
|
|
/// <param name="sClinicList">| delemited clinic list (IEN's)</param>
|
|
|
|
/// <param name="dtBegin">Beginning Date</param>
|
|
|
|
/// <param name="dtEnd">Ending Date</param>
|
2009-11-30 03:53:28 -05:00
|
|
|
public void InitializeFormCancellationLetters(CGDocumentManager docManager,
|
|
|
|
string sClinicList,
|
2010-06-04 22:19:48 -04:00
|
|
|
DateTime dtBegin,
|
|
|
|
DateTime dtEnd)
|
|
|
|
{
|
2009-11-30 03:53:28 -05:00
|
|
|
try
|
|
|
|
{
|
|
|
|
if (sClinicList == "")
|
|
|
|
{
|
|
|
|
throw new Exception("At least one clinic must be selected.");
|
|
|
|
}
|
2010-07-11 10:09:11 -04:00
|
|
|
|
|
|
|
DataTable PatientAppts = docManager.DAL.GetCancelledAppointments(sClinicList, dtBegin, dtEnd);
|
|
|
|
DataTable Resources = docManager.DAL.GetResourceLetters(sClinicList);
|
|
|
|
|
2010-06-04 22:19:48 -04:00
|
|
|
_dsRebookAppts = new dsRebookAppts();
|
2010-07-11 10:09:11 -04:00
|
|
|
_dsRebookAppts.PatientAppts.Merge(PatientAppts);
|
|
|
|
_dsRebookAppts.BSDXResource.Merge(Resources);
|
|
|
|
|
2011-09-09 14:15:30 -04:00
|
|
|
this.Document = printCancelLetters;
|
2010-06-04 22:19:48 -04:00
|
|
|
|
2009-11-30 03:53:28 -05:00
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
throw ex;
|
|
|
|
}
|
|
|
|
}
|
2010-06-04 22:19:48 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Print Reminder Letters to give or mail to patients
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="docManager">This docManger</param>
|
|
|
|
/// <param name="sClinicList">Clinics for which to print</param>
|
|
|
|
/// <param name="dtBegin">Beginning Date</param>
|
|
|
|
/// <param name="dtEnd">End Date</param>
|
|
|
|
public void InitializeFormPatientReminderLetters(CGDocumentManager docManager,
|
2009-11-30 03:53:28 -05:00
|
|
|
string sClinicList,
|
|
|
|
DateTime dtBegin,
|
|
|
|
DateTime dtEnd)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if (sClinicList == "")
|
|
|
|
{
|
|
|
|
throw new Exception("At least one clinic must be selected.");
|
|
|
|
}
|
|
|
|
|
2010-07-11 10:09:11 -04:00
|
|
|
// Global variables to use in printing routine down below
|
2010-06-04 22:19:48 -04:00
|
|
|
_dtBegin = dtBegin;
|
|
|
|
_dtEnd = dtEnd;
|
2009-11-30 03:53:28 -05:00
|
|
|
|
2010-07-11 10:09:11 -04:00
|
|
|
this.Text = "Reminder Letters";
|
|
|
|
|
|
|
|
// Get Data
|
|
|
|
DataTable PatientAppts = docManager.DAL.GetClinicSchedules(sClinicList, dtBegin, dtEnd);
|
|
|
|
DataTable Resources = docManager.DAL.GetResourceLetters(sClinicList);
|
2010-06-04 22:19:48 -04:00
|
|
|
|
2010-07-11 10:09:11 -04:00
|
|
|
// Merge tables into typed dataset
|
2010-06-04 22:19:48 -04:00
|
|
|
_dsApptDisplay = new dsPatientApptDisplay2();
|
2010-07-11 10:09:11 -04:00
|
|
|
_dsApptDisplay.PatientAppts.Merge(PatientAppts);
|
|
|
|
_dsApptDisplay.BSDXResource.Merge(Resources);
|
2010-06-04 22:19:48 -04:00
|
|
|
|
2011-09-09 14:15:30 -04:00
|
|
|
this.Document = printReminderLetters;
|
2009-11-30 03:53:28 -05:00
|
|
|
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
throw ex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-06-06 20:59:53 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Ctor
|
|
|
|
/// </summary>
|
2010-06-04 22:19:48 -04:00
|
|
|
public DPatientLetter() : base()
|
2009-11-30 03:53:28 -05:00
|
|
|
{
|
|
|
|
//
|
|
|
|
// Required for Windows Form Designer support
|
|
|
|
//
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
//
|
|
|
|
// TODO: Add any constructor code after InitializeComponent call
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Clean up any resources being used.
|
|
|
|
/// </summary>
|
|
|
|
protected override void Dispose( bool disposing )
|
|
|
|
{
|
|
|
|
if( disposing )
|
|
|
|
{
|
|
|
|
if(components != null)
|
|
|
|
{
|
|
|
|
components.Dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
base.Dispose( disposing );
|
|
|
|
}
|
|
|
|
|
2010-05-21 21:03:45 -04:00
|
|
|
|
2010-06-04 22:19:48 -04:00
|
|
|
private void printAppts_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
|
2011-09-09 14:15:30 -04:00
|
|
|
{
|
2010-06-04 22:19:48 -04:00
|
|
|
//Each time we enter here, we start off with a new page number - we start off with zero
|
|
|
|
_pageNumber++; //becomes one first time through
|
|
|
|
|
2010-05-21 21:03:45 -04:00
|
|
|
// _currentResourcePrinting starts with zero. There will be at least this one.
|
2011-03-21 08:47:45 -04:00
|
|
|
CGDocumentManager.Current.PrintingObject.PrintAppointments(_dsApptDisplay, e, _dtBegin, _dtEnd,
|
2010-06-04 22:19:48 -04:00
|
|
|
_currentResourcePrinting, ref _currentApptPrinting, _pageNumber);
|
2010-05-21 21:03:45 -04:00
|
|
|
|
|
|
|
//If the printing routine says it needs more pages to print the appointments,
|
|
|
|
//return here and have it print again.
|
|
|
|
if (e.HasMorePages == true) return;
|
|
|
|
|
|
|
|
// if there are more resouces to print, increment. Setting HasMorePages to true
|
|
|
|
// calls this routine again, so printing will happen with the incremented _currentResourcePrinting
|
2010-06-04 22:19:48 -04:00
|
|
|
if (_currentResourcePrinting < _dsApptDisplay.BSDXResource.Rows.Count - 1)
|
2010-05-21 21:03:45 -04:00
|
|
|
{
|
|
|
|
_currentResourcePrinting++;
|
2010-06-04 22:19:48 -04:00
|
|
|
//reset _currentApptPrinting
|
|
|
|
_currentApptPrinting = 0;
|
2010-05-21 21:03:45 -04:00
|
|
|
e.HasMorePages = true;
|
2010-07-18 08:27:35 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// if neither of these conditions is true, then we are done with printing.
|
|
|
|
// So reset counters for next one. Fixes ticket #15 on https://trac.opensourcevista.net/ticket/15
|
|
|
|
_currentResourcePrinting = 0;
|
|
|
|
_currentApptPrinting = 0;
|
|
|
|
_pageNumber = 0;
|
2010-06-04 22:19:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
private void printReminderLetters_PrintPage(object sender, PrintPageEventArgs e)
|
|
|
|
{
|
|
|
|
// no patients
|
|
|
|
if (_dsApptDisplay.PatientAppts.Count == 0)
|
|
|
|
{
|
2011-03-21 08:47:45 -04:00
|
|
|
CGDocumentManager.Current.PrintingObject.PrintMessage("No Appointments found", e);
|
2010-06-04 22:19:48 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
// if there are patients
|
|
|
|
else if (_currentApptPrinting < _dsApptDisplay.PatientAppts.Count)
|
|
|
|
{
|
|
|
|
dsPatientApptDisplay2.BSDXResourceRow c = (dsPatientApptDisplay2.BSDXResourceRow)
|
|
|
|
_dsApptDisplay.PatientAppts[_currentApptPrinting].GetParentRow(_dsApptDisplay.Relations[0]);
|
2011-03-21 08:47:45 -04:00
|
|
|
CGDocumentManager.Current.PrintingObject.PrintReminderLetter(_dsApptDisplay.PatientAppts[_currentApptPrinting], e, c.LETTER_TEXT, "Reminder Letter");
|
2010-06-04 22:19:48 -04:00
|
|
|
_currentApptPrinting++;
|
|
|
|
if (_currentApptPrinting < _dsApptDisplay.PatientAppts.Count)
|
2010-07-18 08:27:35 -04:00
|
|
|
{
|
2010-06-04 22:19:48 -04:00
|
|
|
e.HasMorePages = true;
|
2010-07-18 08:27:35 -04:00
|
|
|
return;
|
|
|
|
}
|
2010-05-21 21:03:45 -04:00
|
|
|
}
|
2010-07-18 08:27:35 -04:00
|
|
|
|
|
|
|
// If we reach this point, we need to reset the counter (ticket #15 on https://trac.opensourcevista.net/ticket/15)
|
|
|
|
_currentApptPrinting = 0;
|
2010-05-21 21:03:45 -04:00
|
|
|
|
2010-06-04 22:19:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
private void printCancelLetters_PrintPage(object sender, PrintPageEventArgs e)
|
|
|
|
{
|
|
|
|
// no patients
|
|
|
|
if (_dsRebookAppts.PatientAppts.Count == 0)
|
|
|
|
{
|
2011-03-21 08:47:45 -04:00
|
|
|
CGDocumentManager.Current.PrintingObject.PrintMessage("No Appointments found", e);
|
2010-06-04 22:19:48 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
// if there are patients
|
|
|
|
else if (_currentApptPrinting < _dsRebookAppts.PatientAppts.Count)
|
|
|
|
{
|
|
|
|
dsRebookAppts.BSDXResourceRow c = (dsRebookAppts.BSDXResourceRow)
|
|
|
|
_dsRebookAppts.PatientAppts[_currentApptPrinting].GetParentRow(_dsRebookAppts.Relations[0]);
|
2011-03-21 08:47:45 -04:00
|
|
|
CGDocumentManager.Current.PrintingObject.PrintCancelLetter(_dsRebookAppts.PatientAppts[_currentApptPrinting], e, c.CLINIC_CANCELLATION_LETTER, "Cancellation Letter");
|
2010-06-04 22:19:48 -04:00
|
|
|
_currentApptPrinting++;
|
|
|
|
if (_currentApptPrinting < _dsRebookAppts.PatientAppts.Count)
|
2010-07-18 08:27:35 -04:00
|
|
|
{
|
2010-06-04 22:19:48 -04:00
|
|
|
e.HasMorePages = true;
|
2010-07-18 08:27:35 -04:00
|
|
|
return;
|
|
|
|
}
|
2010-06-04 22:19:48 -04:00
|
|
|
}
|
2010-07-18 08:27:35 -04:00
|
|
|
// If we reach this point, we need to reset the counter (ticket #15 on https://trac.opensourcevista.net/ticket/15)
|
|
|
|
_currentApptPrinting = 0;
|
2010-05-21 21:03:45 -04:00
|
|
|
}
|
2010-06-06 20:59:53 -04:00
|
|
|
|
|
|
|
private void printRebookLetters_PrintPage(object sender, PrintPageEventArgs e)
|
|
|
|
{
|
|
|
|
// no patients
|
|
|
|
if (_dsRebookAppts.PatientAppts.Count == 0)
|
|
|
|
{
|
2011-03-21 08:47:45 -04:00
|
|
|
CGDocumentManager.Current.PrintingObject.PrintMessage("No Appointments found", e);
|
2010-06-06 20:59:53 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
// if there are patients
|
|
|
|
else if (_currentApptPrinting < _dsRebookAppts.PatientAppts.Count)
|
|
|
|
{
|
|
|
|
dsRebookAppts.BSDXResourceRow c = (dsRebookAppts.BSDXResourceRow)
|
|
|
|
_dsRebookAppts.PatientAppts[_currentApptPrinting].GetParentRow(_dsRebookAppts.Relations[0]);
|
|
|
|
//XXX: Rebook letter rather oddly currently stored in NO SHOW LETTER field. What gives???
|
2011-03-21 08:47:45 -04:00
|
|
|
CGDocumentManager.Current.PrintingObject.PrintRebookLetter(_dsRebookAppts.PatientAppts[_currentApptPrinting], e, c.NO_SHOW_LETTER, "Rebook Letter");
|
2010-06-06 20:59:53 -04:00
|
|
|
_currentApptPrinting++;
|
|
|
|
if (_currentApptPrinting < _dsRebookAppts.PatientAppts.Count)
|
2010-07-18 08:27:35 -04:00
|
|
|
{
|
2010-06-06 20:59:53 -04:00
|
|
|
e.HasMorePages = true;
|
2010-07-18 08:27:35 -04:00
|
|
|
return;
|
|
|
|
}
|
2010-06-06 20:59:53 -04:00
|
|
|
}
|
2010-07-18 08:27:35 -04:00
|
|
|
// If we reach this point, we need to reset the counter (ticket #15 on https://trac.opensourcevista.net/ticket/15)
|
|
|
|
_currentApptPrinting = 0;
|
2010-06-06 20:59:53 -04:00
|
|
|
}
|
2011-03-29 05:38:18 -04:00
|
|
|
|
2009-11-30 03:53:28 -05:00
|
|
|
}
|
|
|
|
}
|