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:
parent
f0836e8bf9
commit
54b4cdf2b4
|
@ -58,6 +58,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
|
||||
this.lblResource = new System.Windows.Forms.Label();
|
||||
this.panelCenter = new System.Windows.Forms.Panel();
|
||||
this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid();
|
||||
this.ctxCalendarGrid = new System.Windows.Forms.ContextMenu();
|
||||
this.ctxCalGridAdd = 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.mnuLoadTemplate = 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.mnuSchedulingManagment = 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.splitter1 = new System.Windows.Forms.Splitter();
|
||||
this.saveAccessBlocksWorker = new System.ComponentModel.BackgroundWorker();
|
||||
this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid();
|
||||
this.panelRight.SuspendLayout();
|
||||
this.panelClip.SuspendLayout();
|
||||
this.panelBottom.SuspendLayout();
|
||||
|
@ -221,6 +221,34 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.panelCenter.Size = new System.Drawing.Size(712, 345);
|
||||
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
|
||||
//
|
||||
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.mnuLoadTemplate,
|
||||
this.mnuSaveTemplate,
|
||||
this.mnuDeleteAllAppointments,
|
||||
this.mnuDeleteAllSlots,
|
||||
this.menuItem6,
|
||||
this.mnuSchedulingManagment,
|
||||
this.menuItem5,
|
||||
|
@ -293,13 +321,12 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.mnuSaveTemplate.Text = "&Save Template";
|
||||
this.mnuSaveTemplate.Click += new System.EventHandler(this.mnuSaveTemplate_Click);
|
||||
//
|
||||
// mnuDeleteAllAppointments
|
||||
// mnuDeleteAllSlots
|
||||
//
|
||||
this.mnuDeleteAllAppointments.Enabled = false;
|
||||
this.mnuDeleteAllAppointments.Index = 2;
|
||||
this.mnuDeleteAllAppointments.Shortcut = System.Windows.Forms.Shortcut.CtrlD;
|
||||
this.mnuDeleteAllAppointments.Text = "&Delete All Appointments";
|
||||
this.mnuDeleteAllAppointments.Click += new System.EventHandler(this.mnuDeleteAllAppointments_Click);
|
||||
this.mnuDeleteAllSlots.Index = 2;
|
||||
this.mnuDeleteAllSlots.Shortcut = System.Windows.Forms.Shortcut.CtrlD;
|
||||
this.mnuDeleteAllSlots.Text = "&Delete All Slots";
|
||||
this.mnuDeleteAllSlots.Click += new System.EventHandler(this.mnuDeleteAllSlots_Click);
|
||||
//
|
||||
// menuItem6
|
||||
//
|
||||
|
@ -467,34 +494,6 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.saveAccessBlocksWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.saveAccessBlocksWorker_ProgressChanged);
|
||||
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
|
||||
//
|
||||
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 ctxCalGridDelete;
|
||||
private BackgroundWorker saveAccessBlocksWorker;
|
||||
private MenuItem mnuDeleteAllAppointments;
|
||||
private MenuItem mnuDeleteAllSlots;
|
||||
private bool m_bDragDropStart = false;
|
||||
|
||||
#endregion
|
||||
|
@ -768,7 +767,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
}
|
||||
}//End AvailabilityAddNew
|
||||
|
||||
private void MassAppointmentDelete()
|
||||
private void MassSlotDelete()
|
||||
{
|
||||
DialogResult msgResult = MessageBox.Show("Delete all Access Slots?", "Delete Slots?",MessageBoxButtons.YesNo);
|
||||
if (msgResult != DialogResult.Yes) return;
|
||||
|
@ -1556,9 +1555,10 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
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();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
*Otherwise, returns 0 for failure and errormessage in ERRORTXT
|
||||
*THIS routine returns "" if success or the message in ERRORTEXT if failed
|
||||
*Exceptions should be caught by caller
|
||||
*Otherwise, returns negative numbers for failure and errormessage in ERRORTXT
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -666,6 +666,14 @@
|
|||
Rectangle rectangle = new Rectangle();
|
||||
int startTotalMinutesoffset = (int) startTime.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 (this.m_sResourcesArray.Count > 1)
|
||||
{
|
||||
|
@ -676,15 +684,14 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
//columnToPutAppt = (startTime - this.m_dtStart).Days + 1;
|
||||
//test sam
|
||||
columnToPutAppt = (startTime - this.m_dtStart).Days + 1;
|
||||
}
|
||||
if (columnToPutAppt < 1)
|
||||
{
|
||||
bRet = false;
|
||||
return rectangle;
|
||||
}
|
||||
// this if should not get tripped; it did the same function as the new first if check.
|
||||
//if (columnToPutAppt < 1)
|
||||
//{
|
||||
// bRet = false;
|
||||
// return rectangle;
|
||||
//}
|
||||
originX = col0Width + (cellWidth * (columnToPutAppt - 1));
|
||||
int num8 = startTotalMinutesoffset + this.m_nTimeScale;
|
||||
int num9 = (endTotalMinutesoffset > 0) ? endTotalMinutesoffset : 0x5a0;
|
||||
|
|
Binary file not shown.
|
@ -31,20 +31,38 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
}
|
||||
catch (Exception ex) { MessageBox.Show(ex.Message); }
|
||||
|
||||
dvAppt = new DataView(dtAppt);
|
||||
dvAppt.Sort = "ApptDate ASC";
|
||||
SetPastFilter(false);
|
||||
dgAppts.DataSource = dvAppt;
|
||||
|
||||
|
||||
// dgAppts.DataSource = dvAppt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 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>
|
||||
/// <param name="ShowPastAppts">boolean - self explanatory</param>
|
||||
void SetPastFilter(bool ShowPastAppts)
|
||||
{
|
||||
if (ShowPastAppts) dvAppt.RowFilter = "";
|
||||
else dvAppt.RowFilter = "ApptDate > " + "'" + DateTime.Today.ToShortDateString() + "'";
|
||||
if (ShowPastAppts)
|
||||
{
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue