From 4503323eb2a5f1d31b037edbb32a2eddf1979de1 Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 28 Sep 2010 13:40:17 +0000 Subject: [PATCH] Several fixes: 1. Appointments in Past now trigger a warning. 2. Changes to support Division based management of Scheduling GUI. --- cs/bsdx0200GUISourceCode/CGDocumentManager.cs | 2 +- cs/bsdx0200GUISourceCode/CGView.cs | 36 +++++++++++++++++-- cs/bsdx0200GUISourceCode/DCheckIn.cs | 3 +- .../dsPatientApptDisplay2.Designer.cs | 16 +++++++-- .../dsRebookAppts.Designer.cs | 16 +++++++-- 5 files changed, 63 insertions(+), 10 deletions(-) diff --git a/cs/bsdx0200GUISourceCode/CGDocumentManager.cs b/cs/bsdx0200GUISourceCode/CGDocumentManager.cs index eafd871..866160b 100644 --- a/cs/bsdx0200GUISourceCode/CGDocumentManager.cs +++ b/cs/bsdx0200GUISourceCode/CGDocumentManager.cs @@ -510,7 +510,7 @@ namespace IndianHealthService.ClinicalScheduling public void LoadResourceUserTable(bool bAllUsers) { - string sCommandText = "SELECT BMXIEN RESOURCEUSER_ID, RESOURCENAME, INTERNAL[RESOURCENAME] RESOURCEID, OVERBOOK, MODIFY_SCHEDULE, MODIFY_APPOINTMENTS, USERNAME, INTERNAL[USERNAME] USERID FROM BSDX_RESOURCE_USER"; + string sCommandText = "SELECT BMXIEN RESOURCEUSER_ID, RESOURCENAME, INTERNAL[RESOURCENAME] RESOURCEID, OVERBOOK, MODIFY_SCHEDULE, MODIFY_APPOINTMENTS, USERNAME, INTERNAL[USERNAME] USERID FROM BSDX_RESOURCE_USER WHERE INTERNAL[INSTITUTION]=" + m_ConnectInfo.DUZ2; ConnectInfo.RPMSDataTable(sCommandText, "ResourceUser", m_dsGlobal); Debug.Write("LoadGlobalRecordsets -- ResourceUser loaded\n"); } diff --git a/cs/bsdx0200GUISourceCode/CGView.cs b/cs/bsdx0200GUISourceCode/CGView.cs index 45eb9b6..f0c4dd6 100644 --- a/cs/bsdx0200GUISourceCode/CGView.cs +++ b/cs/bsdx0200GUISourceCode/CGView.cs @@ -2094,6 +2094,13 @@ namespace IndianHealthService.ClinicalScheduling return; } + // Added check for making Walk-ins in the past. 9/28/2010 + if (dStart.Date < DateTime.Today.Date) + { + var result = MessageBox.Show("Are you sure you want to make a Walk-in in the past?", "Windows Scheduling", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2); + if (result == DialogResult.No) return; + } + /* * 8-10-05 Added overbook prompt for walkin */ @@ -2171,7 +2178,14 @@ namespace IndianHealthService.ClinicalScheduling bool bRet = this.calendarGrid1.GetSelectedTime(out dStart, out dEnd, out sResource); if (bRet == false) return; - + + // Added check for making Walk-ins in the past. 9/28/2010 + if (dStart.Date < DateTime.Today.Date) + { + var result = MessageBox.Show("Are you sure you want to make an appointment in the past?", "Windows Scheduling", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2); + if (result == DialogResult.No) return; + } + //Test dStart for Holiday DataView dvHoliday = new DataView(this.DocManager.GlobalDataSet.Tables["HOLIDAY"]); dvHoliday.Sort="DATE ASC"; @@ -2656,6 +2670,13 @@ namespace IndianHealthService.ClinicalScheduling return; } + // Added check for making Walk-ins/appts in the past. 9/28/2010 //smh + if (e.StartTime < DateTime.Today.Date) + { + var result = MessageBox.Show("Are you sure you want to make an appointment in the past?", "Windows Scheduling", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2); + if (result == DialogResult.No) return; + } + if (EditAppointmentEnabled(e.Resource) == false) return; if (EditAppointmentEnabled(e.Appointment.Resource) == false) @@ -2707,8 +2728,9 @@ namespace IndianHealthService.ClinicalScheduling e.Appointment.AccessTypeID = e.AccessTypeID; m_Document.CreateAppointment(e.Appointment); - string sError = AppointmentDeleteOne(e.Appointment.AppointmentKey); - if (sError != "") + + string sError = AppointmentDeleteOne(e.Appointment.AppointmentKey); + if (sError != "") { MessageBox.Show(sError); return; @@ -2866,6 +2888,14 @@ namespace IndianHealthService.ClinicalScheduling if (bModAppts == false) return; + // Added check for making Walk-ins/appts in the past. 9/28/2010 //smh + if (e.StartTime < DateTime.Today.Date) + { + var result = MessageBox.Show("Are you sure you want to make an appointment in the past?", "Windows Scheduling", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2); + if (result == DialogResult.No) return; + } + + bOverbook = (bool) this.m_htOverbook[e.Resource.ToString()]; bModSchedule = (bool) this.m_htModifySchedule[e.Resource.ToString()]; bSlotsAvailable = (m_Document.SlotsAvailable(e.StartTime, e.EndTime, e.Resource, out sAccessType, out sAvailabilityMessage) > 0); diff --git a/cs/bsdx0200GUISourceCode/DCheckIn.cs b/cs/bsdx0200GUISourceCode/DCheckIn.cs index 0688c89..7d18616 100644 --- a/cs/bsdx0200GUISourceCode/DCheckIn.cs +++ b/cs/bsdx0200GUISourceCode/DCheckIn.cs @@ -240,8 +240,7 @@ namespace IndianHealthService.ClinicalScheduling //an experiment (doesn't work yet, but leaving for future enlightenment): LINQ var defProv = from Provider in m_dtProvider.AsEnumerable() - where - Provider["DEFAULT"] == "YES" + where Provider.Field("DEFAULT") == "YES" select Provider; } diff --git a/cs/bsdx0200GUISourceCode/dsPatientApptDisplay2.Designer.cs b/cs/bsdx0200GUISourceCode/dsPatientApptDisplay2.Designer.cs index fa38a63..5991d22 100644 --- a/cs/bsdx0200GUISourceCode/dsPatientApptDisplay2.Designer.cs +++ b/cs/bsdx0200GUISourceCode/dsPatientApptDisplay2.Designer.cs @@ -327,7 +327,7 @@ namespace IndianHealthService.ClinicalScheduling { /// [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] - public partial class PatientApptsDataTable : global::System.Data.TypedTableBase { + public partial class PatientApptsDataTable : global::System.Data.DataTable, global::System.Collections.IEnumerable { private global::System.Data.DataColumn columnName; @@ -602,6 +602,12 @@ namespace IndianHealthService.ClinicalScheduling { return rowPatientApptsRow; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public virtual global::System.Collections.IEnumerator GetEnumerator() { + return this.Rows.GetEnumerator(); + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { @@ -803,7 +809,7 @@ namespace IndianHealthService.ClinicalScheduling { /// [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] - public partial class BSDXResourceDataTable : global::System.Data.TypedTableBase { + public partial class BSDXResourceDataTable : global::System.Data.DataTable, global::System.Collections.IEnumerable { private global::System.Data.DataColumn columnRESOURCEID; @@ -916,6 +922,12 @@ namespace IndianHealthService.ClinicalScheduling { return rowBSDXResourceRow; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public virtual global::System.Collections.IEnumerator GetEnumerator() { + return this.Rows.GetEnumerator(); + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { diff --git a/cs/bsdx0200GUISourceCode/dsRebookAppts.Designer.cs b/cs/bsdx0200GUISourceCode/dsRebookAppts.Designer.cs index 9a0a510..a763af0 100644 --- a/cs/bsdx0200GUISourceCode/dsRebookAppts.Designer.cs +++ b/cs/bsdx0200GUISourceCode/dsRebookAppts.Designer.cs @@ -327,7 +327,7 @@ namespace IndianHealthService.ClinicalScheduling { /// [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] - public partial class PatientApptsDataTable : global::System.Data.TypedTableBase { + public partial class PatientApptsDataTable : global::System.Data.DataTable, global::System.Collections.IEnumerable { private global::System.Data.DataColumn columnName; @@ -614,6 +614,12 @@ namespace IndianHealthService.ClinicalScheduling { return rowPatientApptsRow; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public virtual global::System.Collections.IEnumerator GetEnumerator() { + return this.Rows.GetEnumerator(); + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { @@ -818,7 +824,7 @@ namespace IndianHealthService.ClinicalScheduling { /// [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] - public partial class BSDXResourceDataTable : global::System.Data.TypedTableBase { + public partial class BSDXResourceDataTable : global::System.Data.DataTable, global::System.Collections.IEnumerable { private global::System.Data.DataColumn columnRESOURCEID; @@ -953,6 +959,12 @@ namespace IndianHealthService.ClinicalScheduling { return rowBSDXResourceRow; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public virtual global::System.Collections.IEnumerator GetEnumerator() { + return this.Rows.GetEnumerator(); + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() {