UCPatientAppts: Now uses LINQ. Mumps side fixes deal with other bugs.

calendarGrid: Fixes 1 day drawing bug showing yesterday's appointments
CGAVView: Cosmetic changes so far
CGDocument: Documentation change due to change in return values from Mumps.
This commit is contained in:
sam 2010-12-08 14:44:29 +00:00
parent f0836e8bf9
commit 54b4cdf2b4
5 changed files with 80 additions and 57 deletions

View File

@ -58,6 +58,7 @@ namespace IndianHealthService.ClinicalScheduling
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker(); this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.lblResource = new System.Windows.Forms.Label(); this.lblResource = new System.Windows.Forms.Label();
this.panelCenter = new System.Windows.Forms.Panel(); this.panelCenter = new System.Windows.Forms.Panel();
this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid();
this.ctxCalendarGrid = new System.Windows.Forms.ContextMenu(); this.ctxCalendarGrid = new System.Windows.Forms.ContextMenu();
this.ctxCalGridAdd = new System.Windows.Forms.MenuItem(); this.ctxCalGridAdd = new System.Windows.Forms.MenuItem();
this.ctxCalGridEdit = new System.Windows.Forms.MenuItem(); this.ctxCalGridEdit = new System.Windows.Forms.MenuItem();
@ -67,7 +68,7 @@ namespace IndianHealthService.ClinicalScheduling
this.menuItem1 = new System.Windows.Forms.MenuItem(); this.menuItem1 = new System.Windows.Forms.MenuItem();
this.mnuLoadTemplate = new System.Windows.Forms.MenuItem(); this.mnuLoadTemplate = new System.Windows.Forms.MenuItem();
this.mnuSaveTemplate = new System.Windows.Forms.MenuItem(); this.mnuSaveTemplate = new System.Windows.Forms.MenuItem();
this.mnuDeleteAllAppointments = new System.Windows.Forms.MenuItem(); this.mnuDeleteAllSlots = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem(); this.menuItem6 = new System.Windows.Forms.MenuItem();
this.mnuSchedulingManagment = new System.Windows.Forms.MenuItem(); this.mnuSchedulingManagment = new System.Windows.Forms.MenuItem();
this.menuItem5 = new System.Windows.Forms.MenuItem(); this.menuItem5 = new System.Windows.Forms.MenuItem();
@ -91,7 +92,6 @@ namespace IndianHealthService.ClinicalScheduling
this.mnuHelpAbout = new System.Windows.Forms.MenuItem(); this.mnuHelpAbout = new System.Windows.Forms.MenuItem();
this.splitter1 = new System.Windows.Forms.Splitter(); this.splitter1 = new System.Windows.Forms.Splitter();
this.saveAccessBlocksWorker = new System.ComponentModel.BackgroundWorker(); this.saveAccessBlocksWorker = new System.ComponentModel.BackgroundWorker();
this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid();
this.panelRight.SuspendLayout(); this.panelRight.SuspendLayout();
this.panelClip.SuspendLayout(); this.panelClip.SuspendLayout();
this.panelBottom.SuspendLayout(); this.panelBottom.SuspendLayout();
@ -221,6 +221,34 @@ namespace IndianHealthService.ClinicalScheduling
this.panelCenter.Size = new System.Drawing.Size(712, 345); this.panelCenter.Size = new System.Drawing.Size(712, 345);
this.panelCenter.TabIndex = 4; this.panelCenter.TabIndex = 4;
// //
// calendarGrid1
//
this.calendarGrid1.AllowDrop = true;
this.calendarGrid1.Appointments = null;
this.calendarGrid1.ApptDragSource = null;
this.calendarGrid1.AutoScroll = true;
this.calendarGrid1.AutoScrollMinSize = new System.Drawing.Size(600, 1898);
this.calendarGrid1.AvailabilityArray = null;
this.calendarGrid1.BackColor = System.Drawing.SystemColors.Window;
this.calendarGrid1.Columns = 5;
this.calendarGrid1.ContextMenu = this.ctxCalendarGrid;
this.calendarGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
this.calendarGrid1.DrawWalkIns = true;
this.calendarGrid1.GridBackColor = "blue";
this.calendarGrid1.GridEnter = false;
this.calendarGrid1.Location = new System.Drawing.Point(0, 0);
this.calendarGrid1.Name = "calendarGrid1";
this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
this.calendarGrid1.SelectedAppointment = 0;
this.calendarGrid1.Size = new System.Drawing.Size(712, 345);
this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
this.calendarGrid1.TabIndex = 2;
this.calendarGrid1.TimeScale = 20;
this.calendarGrid1.CGAppointmentAdded += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentAdded);
this.calendarGrid1.CGAppointmentChanged += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentChanged);
this.calendarGrid1.CGSelectionChanged += new IndianHealthService.ClinicalScheduling.CGSelectionChangedHandler(this.calendarGrid1_CGSelectionChanged);
this.calendarGrid1.DoubleClick += new System.EventHandler(this.calendarGrid1_DoubleClick);
//
// ctxCalendarGrid // ctxCalendarGrid
// //
this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
@ -272,7 +300,7 @@ namespace IndianHealthService.ClinicalScheduling
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mnuLoadTemplate, this.mnuLoadTemplate,
this.mnuSaveTemplate, this.mnuSaveTemplate,
this.mnuDeleteAllAppointments, this.mnuDeleteAllSlots,
this.menuItem6, this.menuItem6,
this.mnuSchedulingManagment, this.mnuSchedulingManagment,
this.menuItem5, this.menuItem5,
@ -293,13 +321,12 @@ namespace IndianHealthService.ClinicalScheduling
this.mnuSaveTemplate.Text = "&Save Template"; this.mnuSaveTemplate.Text = "&Save Template";
this.mnuSaveTemplate.Click += new System.EventHandler(this.mnuSaveTemplate_Click); this.mnuSaveTemplate.Click += new System.EventHandler(this.mnuSaveTemplate_Click);
// //
// mnuDeleteAllAppointments // mnuDeleteAllSlots
// //
this.mnuDeleteAllAppointments.Enabled = false; this.mnuDeleteAllSlots.Index = 2;
this.mnuDeleteAllAppointments.Index = 2; this.mnuDeleteAllSlots.Shortcut = System.Windows.Forms.Shortcut.CtrlD;
this.mnuDeleteAllAppointments.Shortcut = System.Windows.Forms.Shortcut.CtrlD; this.mnuDeleteAllSlots.Text = "&Delete All Slots";
this.mnuDeleteAllAppointments.Text = "&Delete All Appointments"; this.mnuDeleteAllSlots.Click += new System.EventHandler(this.mnuDeleteAllSlots_Click);
this.mnuDeleteAllAppointments.Click += new System.EventHandler(this.mnuDeleteAllAppointments_Click);
// //
// menuItem6 // menuItem6
// //
@ -467,34 +494,6 @@ namespace IndianHealthService.ClinicalScheduling
this.saveAccessBlocksWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.saveAccessBlocksWorker_ProgressChanged); this.saveAccessBlocksWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.saveAccessBlocksWorker_ProgressChanged);
this.saveAccessBlocksWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.saveAccessBlocksWorker_RunWorkerCompleted); this.saveAccessBlocksWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.saveAccessBlocksWorker_RunWorkerCompleted);
// //
// calendarGrid1
//
this.calendarGrid1.AllowDrop = true;
this.calendarGrid1.Appointments = null;
this.calendarGrid1.ApptDragSource = null;
this.calendarGrid1.AutoScroll = true;
this.calendarGrid1.AutoScrollMinSize = new System.Drawing.Size(600, 1898);
this.calendarGrid1.AvailabilityArray = null;
this.calendarGrid1.BackColor = System.Drawing.SystemColors.Window;
this.calendarGrid1.Columns = 5;
this.calendarGrid1.ContextMenu = this.ctxCalendarGrid;
this.calendarGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
this.calendarGrid1.DrawWalkIns = true;
this.calendarGrid1.GridBackColor = "blue";
this.calendarGrid1.GridEnter = false;
this.calendarGrid1.Location = new System.Drawing.Point(0, 0);
this.calendarGrid1.Name = "calendarGrid1";
this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
this.calendarGrid1.SelectedAppointment = 0;
this.calendarGrid1.Size = new System.Drawing.Size(712, 345);
this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
this.calendarGrid1.TabIndex = 2;
this.calendarGrid1.TimeScale = 20;
this.calendarGrid1.CGAppointmentAdded += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentAdded);
this.calendarGrid1.CGAppointmentChanged += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentChanged);
this.calendarGrid1.CGSelectionChanged += new IndianHealthService.ClinicalScheduling.CGSelectionChangedHandler(this.calendarGrid1_CGSelectionChanged);
this.calendarGrid1.DoubleClick += new System.EventHandler(this.calendarGrid1_DoubleClick);
//
// CGAVView // CGAVView
// //
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
@ -574,7 +573,7 @@ namespace IndianHealthService.ClinicalScheduling
private System.Windows.Forms.MenuItem ctxCalGridEdit; private System.Windows.Forms.MenuItem ctxCalGridEdit;
private System.Windows.Forms.MenuItem ctxCalGridDelete; private System.Windows.Forms.MenuItem ctxCalGridDelete;
private BackgroundWorker saveAccessBlocksWorker; private BackgroundWorker saveAccessBlocksWorker;
private MenuItem mnuDeleteAllAppointments; private MenuItem mnuDeleteAllSlots;
private bool m_bDragDropStart = false; private bool m_bDragDropStart = false;
#endregion #endregion
@ -768,7 +767,7 @@ namespace IndianHealthService.ClinicalScheduling
} }
}//End AvailabilityAddNew }//End AvailabilityAddNew
private void MassAppointmentDelete() private void MassSlotDelete()
{ {
DialogResult msgResult = MessageBox.Show("Delete all Access Slots?", "Delete Slots?",MessageBoxButtons.YesNo); DialogResult msgResult = MessageBox.Show("Delete all Access Slots?", "Delete Slots?",MessageBoxButtons.YesNo);
if (msgResult != DialogResult.Yes) return; if (msgResult != DialogResult.Yes) return;
@ -1556,9 +1555,10 @@ namespace IndianHealthService.ClinicalScheduling
this.statusBar1.Text = "Saving Data to VISTA. Progress: " + e.ProgressPercentage + " %"; this.statusBar1.Text = "Saving Data to VISTA. Progress: " + e.ProgressPercentage + " %";
} }
private void mnuDeleteAllAppointments_Click(object sender, EventArgs e) private void mnuDeleteAllSlots_Click(object sender, EventArgs e)
{ {
MassAppointmentDelete();
} }
} }
} }

View File

@ -1030,9 +1030,7 @@ namespace IndianHealthService.ClinicalScheduling
{ {
/* /*
* BSDX NOSHOW RPC Returns 1 in ERRORID if successfully sets NOSHOW flag in BSDX APPOINTMENT and, if applicable, File 2 * BSDX NOSHOW RPC Returns 1 in ERRORID if successfully sets NOSHOW flag in BSDX APPOINTMENT and, if applicable, File 2
*Otherwise, returns 0 for failure and errormessage in ERRORTXT *Otherwise, returns negative numbers for failure and errormessage in ERRORTXT
*THIS routine returns "" if success or the message in ERRORTEXT if failed
*Exceptions should be caught by caller
* *
*/ */

View File

@ -666,6 +666,14 @@
Rectangle rectangle = new Rectangle(); Rectangle rectangle = new Rectangle();
int startTotalMinutesoffset = (int) startTime.TimeOfDay.TotalMinutes; int startTotalMinutesoffset = (int) startTime.TimeOfDay.TotalMinutes;
int endTotalMinutesoffset = (int) endTime.TimeOfDay.TotalMinutes; int endTotalMinutesoffset = (int) endTime.TimeOfDay.TotalMinutes;
// To fix a bug with 1 day view: if the start time of appt is before Calendar Start Date, don't draw anything.
if (startTime < this.m_dtStart)
{
bRet = false;
return rectangle;
}
// if grid has more than one reource // if grid has more than one reource
if (this.m_sResourcesArray.Count > 1) if (this.m_sResourcesArray.Count > 1)
{ {
@ -676,15 +684,14 @@
} }
else else
{ {
//columnToPutAppt = (startTime - this.m_dtStart).Days + 1;
//test sam
columnToPutAppt = (startTime - this.m_dtStart).Days + 1; columnToPutAppt = (startTime - this.m_dtStart).Days + 1;
} }
if (columnToPutAppt < 1) // this if should not get tripped; it did the same function as the new first if check.
{ //if (columnToPutAppt < 1)
bRet = false; //{
return rectangle; // bRet = false;
} // return rectangle;
//}
originX = col0Width + (cellWidth * (columnToPutAppt - 1)); originX = col0Width + (cellWidth * (columnToPutAppt - 1));
int num8 = startTotalMinutesoffset + this.m_nTimeScale; int num8 = startTotalMinutesoffset + this.m_nTimeScale;
int num9 = (endTotalMinutesoffset > 0) ? endTotalMinutesoffset : 0x5a0; int num9 = (endTotalMinutesoffset > 0) ? endTotalMinutesoffset : 0x5a0;

View File

@ -31,20 +31,38 @@ namespace IndianHealthService.ClinicalScheduling
} }
catch (Exception ex) { MessageBox.Show(ex.Message); } catch (Exception ex) { MessageBox.Show(ex.Message); }
dvAppt = new DataView(dtAppt);
dvAppt.Sort = "ApptDate ASC";
SetPastFilter(false); SetPastFilter(false);
dgAppts.DataSource = dvAppt;
// dgAppts.DataSource = dvAppt;
} }
/// <summary> /// <summary>
/// Sets the filter for the DataView on whether to show past appointments or not /// Sets the filter for the DataView on whether to show past appointments or not
/// Uses LINQ. Must use .Net 3.5 or above. Hope the LINQ is self-explanatory.
/// </summary> /// </summary>
/// <param name="ShowPastAppts">boolean - self explanatory</param> /// <param name="ShowPastAppts">boolean - self explanatory</param>
void SetPastFilter(bool ShowPastAppts) void SetPastFilter(bool ShowPastAppts)
{ {
if (ShowPastAppts) dvAppt.RowFilter = ""; if (ShowPastAppts)
else dvAppt.RowFilter = "ApptDate > " + "'" + DateTime.Today.ToShortDateString() + "'"; {
var uncancelledAppts = from appt in dtAppt.AsEnumerable()
orderby appt.Field<DateTime>("ApptDate")
select appt;
dvAppt = uncancelledAppts.AsDataView();
}
else
{
var uncancelledAppts = from appt in dtAppt.AsEnumerable()
where appt.Field<DateTime>("ApptDate") > DateTime.Today
orderby appt.Field<DateTime>("ApptDate")
select appt;
dvAppt = uncancelledAppts.AsDataView();
}
// It's strange that I have to bind it here; but look like dvAppt points to a new memory
// location when reassigned up above in the LINQ statement, so we have to rebind it.
dgAppts.DataSource = dvAppt;
} }
private void chkPastAppts_CheckedChanged(object sender, EventArgs e) private void chkPastAppts_CheckedChanged(object sender, EventArgs e)