diff --git a/cs/bsdx0200GUISourceCode/CGAVDocument.cs b/cs/bsdx0200GUISourceCode/CGAVDocument.cs index dd09648..596c496 100644 --- a/cs/bsdx0200GUISourceCode/CGAVDocument.cs +++ b/cs/bsdx0200GUISourceCode/CGAVDocument.cs @@ -251,7 +251,7 @@ namespace IndianHealthService.ClinicalScheduling } Debug.Write("CreateAvailabilityAuto -- new AV block created\n"); - UpdateAllViews(); + //UpdateAllViews(); aCopy.AppointmentKey = nApptID; return nApptID; diff --git a/cs/bsdx0200GUISourceCode/CGAVView.cs b/cs/bsdx0200GUISourceCode/CGAVView.cs index 1519c9d..7ac2906 100644 --- a/cs/bsdx0200GUISourceCode/CGAVView.cs +++ b/cs/bsdx0200GUISourceCode/CGAVView.cs @@ -883,6 +883,7 @@ namespace IndianHealthService.ClinicalScheduling { //TODO: Create these components this.calendarGrid1.Resources = this.m_Document.Resources; + this.calendarGrid1.Appointments = (CGAppointments)this.m_Document.m_AVBlocks.Clone(); this.calendarGrid1.OnUpdateArrays(); this.lblResource.Text = this.m_Document.DocName; @@ -1041,12 +1042,9 @@ namespace IndianHealthService.ClinicalScheduling /* * Display dialog to collect: * - Number of weeks to apply template - * - Starting week Monday + * - Starting week (application starts on Culture WeekStartDay of selected week) * - Template path & filename * - * for each week, - * Delete all availability during that week - * apply the template * */ DAccessTemplate dlg = new DAccessTemplate(); @@ -1505,7 +1503,7 @@ namespace IndianHealthService.ClinicalScheduling this.Document.WeekNeedsRefresh(1, dtStart, out newStartDate, out newEndDate); dtStart = newStartDate; int nWeeksToApply = dlg.WeeksToApply; - DateTime dtEnd = dtStart.AddDays(6); // or 7? + DateTime dtEnd = dtStart.AddDays(6); // or 7? smh:: not 7 for sure. string sResourceID = this.m_Document.ResourceID.ToString(); diff --git a/cs/bsdx0200GUISourceCode/CGDocument.cs b/cs/bsdx0200GUISourceCode/CGDocument.cs index ff03566..112c8c4 100644 --- a/cs/bsdx0200GUISourceCode/CGDocument.cs +++ b/cs/bsdx0200GUISourceCode/CGDocument.cs @@ -1245,14 +1245,14 @@ namespace IndianHealthService.ClinicalScheduling } - public string AppointmentNoShow(int nApptID, bool bNoShow) + public string AppointmentNoShow(CGAppointment a, bool bNoShow) { /* * BSDX NOSHOW RPC Returns 1 in ERRORID if successfully sets NOSHOW flag in BSDX APPOINTMENT and, if applicable, File 2 *Otherwise, returns negative numbers for failure and errormessage in ERRORTXT * */ - + int nApptID = a.AppointmentKey; string sTest = bNoShow.ToString(); string sNoShow = (bNoShow == true) ? "1" : "0"; string sSql = "BSDX NOSHOW^" + nApptID.ToString(); @@ -1269,11 +1269,32 @@ namespace IndianHealthService.ClinicalScheduling return r["ERRORTEXT"].ToString(); } - bool bRet = RefreshSchedule(); + //All okay over here... then set appointment noshow or not no show... + a.NoShow = bNoShow ? true : false; + + //bool bRet = RefreshSchedule(); return sErrorID; } + public bool AppointmentUndoCheckin(CGAppointment a, out string msg) + { + msg = ""; + //zero good, anything else bad + DataTable dt = CGDocumentManager.Current.DAL.RemoveCheckIn(a.AppointmentKey); + if (dt.Rows[0][0].ToString() == "0") + { + a.CheckInTime = DateTime.MinValue; // remove check-in time. + return true; + } + + else + { + msg = dt.Rows[0][0].ToString(); + return false; + } + } + #endregion Methods }//End class diff --git a/cs/bsdx0200GUISourceCode/CGDocumentManager.cs b/cs/bsdx0200GUISourceCode/CGDocumentManager.cs index 8605cb6..5b65f92 100644 --- a/cs/bsdx0200GUISourceCode/CGDocumentManager.cs +++ b/cs/bsdx0200GUISourceCode/CGDocumentManager.cs @@ -353,8 +353,8 @@ namespace IndianHealthService.ClinicalScheduling threadSplash.Name = "Splash Thread"; threadSplash.Start(m_ds); // pass form as parameter. - //There are 19 steps to load the application. That's max for the progress bar. - setMaxProgressDelegate(19); + //There are 21 steps to load the application. That's max for the progress bar. + setMaxProgressDelegate(21); // smh--not used: System.Configuration.ConfigurationManager.GetSection("appSettings"); @@ -471,8 +471,7 @@ namespace IndianHealthService.ClinicalScheduling this.m_PrintingObject = Creator.PrintFactory(); } - //User Preferences Object - _current.UserPreferences = new UserPreferences(); + //User Interface Culture (m_CultureName is set from the command line flag /culture) try { Thread.CurrentThread.CurrentUICulture = new CultureInfo(m_CultureName); } // if "", invariant culture @@ -535,8 +534,14 @@ namespace IndianHealthService.ClinicalScheduling setProgressDelegate(3); setStatusDelegate("Setting Application Context to BSDXRPC..."); m_ConnectInfo.AppContext = "BSDXRPC"; - - //Load global recordsets + + //User Preferences Object + setProgressDelegate(4); //next number is 6 b/c two calls + setStatusDelegate("Getting User Preferences from the Server..."); + + _current.UserPreferences = new UserPreferences(); // Does the calling to do that... + + //Load global recordsets string statusConst = "Loading VistA data tables..."; setStatusDelegate(statusConst); @@ -544,7 +549,7 @@ namespace IndianHealthService.ClinicalScheduling //Schedule User Info // Table #4 - setProgressDelegate(4); + setProgressDelegate(6); setStatusDelegate(statusConst + " Schedule User"); DataTable dtUser = _dal.GetUserInfo(m_ConnectInfo.DUZ); dtUser.TableName = "SchedulingUser"; @@ -559,7 +564,7 @@ namespace IndianHealthService.ClinicalScheduling //Get Access Types // Table #5 - setProgressDelegate(5); + setProgressDelegate(7); setStatusDelegate(statusConst + " Access Types"); DataTable dtAccessTypes = _dal.GetAccessTypes(); dtAccessTypes.TableName = "AccessTypes"; @@ -567,7 +572,7 @@ namespace IndianHealthService.ClinicalScheduling //Get Access Groups // Table #6 - setProgressDelegate(6); + setProgressDelegate(8); setStatusDelegate(statusConst + " Access Groups"); LoadAccessGroupsTable(); @@ -582,7 +587,7 @@ namespace IndianHealthService.ClinicalScheduling //Optimization Note: Can eliminate Access type and Access Group Table // But they are heavily referenced throughout the code. // Table #7 - setProgressDelegate(7); + setProgressDelegate(9); setStatusDelegate(statusConst + " Access Group Types"); LoadAccessGroupTypesTable(); @@ -602,14 +607,14 @@ namespace IndianHealthService.ClinicalScheduling //ResourceGroup Table (Resource Groups by User) // Table #8 // What shows up on the tree. The groups the user has access to. - setProgressDelegate(8); + setProgressDelegate(10); setStatusDelegate(statusConst + " Resource Groups By User"); LoadResourceGroupTable(); //Resources by user // Table #9 // Individual Resources - setProgressDelegate(9); + setProgressDelegate(11); setStatusDelegate(statusConst + " Resources By User"); LoadBSDXResourcesTable(); @@ -621,7 +626,7 @@ namespace IndianHealthService.ClinicalScheduling //GroupResources table // Table #10 // Resource Groups and Indivdual Resources together - setProgressDelegate(10); + setProgressDelegate(12); setStatusDelegate(statusConst + " Group Resources"); LoadGroupResourcesTable(); @@ -639,7 +644,7 @@ namespace IndianHealthService.ClinicalScheduling //HospitalLocation table //Table #11 - setProgressDelegate(11); + setProgressDelegate(13); setStatusDelegate(statusConst + " Clinics"); //cmd.CommandText = "SELECT BMXIEN 'HOSPITAL_LOCATION_ID', NAME 'HOSPITAL_LOCATION', DEFAULT_PROVIDER, STOP_CODE_NUMBER, INACTIVATE_DATE, REACTIVATE_DATE FROM HOSPITAL_LOCATION"; sCommandText = "BSDX HOSPITAL LOCATION"; @@ -660,7 +665,7 @@ namespace IndianHealthService.ClinicalScheduling //Build ScheduleUser table //Table #12 - setProgressDelegate(12); + setProgressDelegate(14); setStatusDelegate(statusConst + " Schedule User"); this.LoadScheduleUserTable(); @@ -673,7 +678,7 @@ namespace IndianHealthService.ClinicalScheduling //Build ResourceUser table //Table #13 //Acess to Resources by [this] User - setProgressDelegate(13); + setProgressDelegate(15); setStatusDelegate(statusConst + " Resource User"); this.LoadResourceUserTable(); @@ -692,7 +697,7 @@ namespace IndianHealthService.ClinicalScheduling //Build active provider table //Table #14 //TODO: Lazy load the provider table; no need to load in advance. - setProgressDelegate(14); + setProgressDelegate(16); setStatusDelegate(statusConst + " Providers"); sCommandText = "SELECT BMXIEN, NAME FROM NEW_PERSON WHERE INACTIVE_DATE = '' AND BMXIEN > 1"; ConnectInfo.RPMSDataTable(sCommandText, "Provider", m_dsGlobal); @@ -700,7 +705,7 @@ namespace IndianHealthService.ClinicalScheduling //Build the HOLIDAY table //Table #15 - setProgressDelegate(15); + setProgressDelegate(17); setStatusDelegate(statusConst + " Holiday"); sCommandText = "SELECT NAME, DATE FROM HOLIDAY WHERE INTERNAL[DATE] > '" + FMDateTime.Create(DateTime.Today).DateOnly.FMDateString + "'"; ConnectInfo.RPMSDataTable(sCommandText, "HOLIDAY", m_dsGlobal); @@ -720,16 +725,16 @@ namespace IndianHealthService.ClinicalScheduling // Event Subsriptions setStatusDelegate("Subscribing to Server Events"); //Table #16 - setProgressDelegate(16); + setProgressDelegate(18); _current.m_ConnectInfo.SubscribeEvent("BSDX SCHEDULE"); //Table #17 - setProgressDelegate(17); + setProgressDelegate(19); _current.m_ConnectInfo.SubscribeEvent("BSDX CALL WORKSTATIONS"); //Table #18 - setProgressDelegate(18); + setProgressDelegate(20); _current.m_ConnectInfo.SubscribeEvent("BSDX ADMIN MESSAGE"); //Table #19 - setProgressDelegate(19); + setProgressDelegate(21); _current.m_ConnectInfo.SubscribeEvent("BSDX ADMIN SHUTDOWN"); _current.m_ConnectInfo.EventPollingInterval = 5000; //in milliseconds diff --git a/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user b/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user index 0580374..8981f56 100644 --- a/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user +++ b/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user @@ -36,7 +36,7 @@ Project - /s=172.16.16.108 /p=9250 /a=BASMA.ALDWAIRI /v=SELEN.123 /culture="ar-JO" + /s=172.16.16.108 /p=9250 /a=BASMA.ALDWAIRI /v=SELEN.123 /culture=ar-JO C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\IEExec.exe diff --git a/cs/bsdx0200GUISourceCode/ClinicalScheduling.suo b/cs/bsdx0200GUISourceCode/ClinicalScheduling.suo index 6daf9a2..bd12fd4 100644 Binary files a/cs/bsdx0200GUISourceCode/ClinicalScheduling.suo and b/cs/bsdx0200GUISourceCode/ClinicalScheduling.suo differ diff --git a/cs/bsdx0200GUISourceCode/DAL.cs b/cs/bsdx0200GUISourceCode/DAL.cs index d362cab..2ca24d9 100644 --- a/cs/bsdx0200GUISourceCode/DAL.cs +++ b/cs/bsdx0200GUISourceCode/DAL.cs @@ -16,6 +16,7 @@ namespace IndianHealthService.ClinicalScheduling private BMXNetConnectInfo _thisConnection; // set in constructor delegate DataTable RPMSDataTableDelegate(string CommandString, string TableName); // for use in calling (Sync and Async) + delegate string TransmitRPCAsync(string RPCName, string Params); //same idea /// /// Constructor @@ -172,6 +173,64 @@ namespace IndianHealthService.ClinicalScheduling return RPMSDataTable(cmd, "Cancelled"); } + /// + /// Remove the check-in for the appointment + /// + /// Appointment IEN/Key + /// Table with 1 columns: ERRORID. ErrorID of "0" is okay; + /// any other (negative numbers plus text) is bad + public DataTable RemoveCheckIn(int ApptID) + { + string cmd = string.Format("BSDX REMOVE CHECK-IN^{0}", ApptID); + return RPMSDataTable(cmd, ""); + } + + /// + /// Save User Preference in DB For Printing Routing Slip + /// Uses Parameter BSDX AUTO PRINT RS + /// + /// + /// Notice Code-Fu for Async Save... + /// + public bool AutoPrintRoutingSlip + { + get + { + string val = _thisConnection.bmxNetLib.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT RS"); //1 = true; 0 = false; "" = not set + return val == "1" ? true : false; + } + set + { + TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.bmxNetLib.TransmitRPC); + // 0 = success; anything else is wrong. Not being tested here as its success is not critical to application use. + _asyncTransmitter.BeginInvoke("BSDX SET PARAM", String.Format("{0}^{1}", "BSDX AUTO PRINT RS", value ? "1" : "0"), null, null); + } + } + + /// + /// Save User Preference in DB For Printing Routing Slip + /// Uses Parameter BSDX AUTO PRINT AS + /// + /// + /// Notice Code-Fu for Async Save... + /// + public bool AutoPrintAppointmentSlip + { + get + { + string val = _thisConnection.bmxNetLib.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT AS"); //1 = true; 0 = false; "" = not set + return val == "1" ? true : false; + } + set + { + TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.bmxNetLib.TransmitRPC); + // 0 = success; anything else is wrong. Not being tested here as its success is not critical to application use. + _asyncTransmitter.BeginInvoke("BSDX SET PARAM", String.Format("{0}^{1}", "BSDX AUTO PRINT AS", value ? "1" : "0"), null, null); + } + } + + + /// /// Workhorse /// diff --git a/cs/bsdx0200GUISourceCode/DAppointPage.cs b/cs/bsdx0200GUISourceCode/DAppointPage.cs index 43d2515..3a0d7d8 100644 --- a/cs/bsdx0200GUISourceCode/DAppointPage.cs +++ b/cs/bsdx0200GUISourceCode/DAppointPage.cs @@ -670,6 +670,7 @@ namespace IndianHealthService.ClinicalScheduling private string m_sEmail; private string m_sCountry; private int m_iAccessTypeID; + private bool _myCodeIsFiringIstheCheckBoxChangedEvent; #endregion //fields @@ -718,7 +719,9 @@ namespace IndianHealthService.ClinicalScheduling UC.Dock = DockStyle.Fill; groupBox4.Controls.Add(UC); + _myCodeIsFiringIstheCheckBoxChangedEvent = true; chkPrint.Checked = CGDocumentManager.Current.UserPreferences.PrintAppointmentSlipAutomacially; + _myCodeIsFiringIstheCheckBoxChangedEvent = false; } catch(Exception e) { @@ -861,13 +864,14 @@ namespace IndianHealthService.ClinicalScheduling #endregion //Properties /// - /// Save Print Slip preference in UserPreferences object. For now, it always starts false since - /// it isn't saved in the DB; but that will change in the future. + /// Save Print Slip preference in UserPreferences object. /// /// /// private void chkPrint_CheckedChanged(object sender, EventArgs e) { + if (_myCodeIsFiringIstheCheckBoxChangedEvent) return; + CGDocumentManager.Current.UserPreferences.PrintAppointmentSlipAutomacially = chkPrint.Checked; } diff --git a/cs/bsdx0200GUISourceCode/DCheckIn.cs b/cs/bsdx0200GUISourceCode/DCheckIn.cs index cc75db9..dd4fc51 100644 --- a/cs/bsdx0200GUISourceCode/DCheckIn.cs +++ b/cs/bsdx0200GUISourceCode/DCheckIn.cs @@ -24,6 +24,8 @@ namespace IndianHealthService.ClinicalScheduling // Required for Windows Form Designer support // InitializeComponent(); + + } @@ -59,6 +61,7 @@ namespace IndianHealthService.ClinicalScheduling public bool m_bPrintRouteSlip; private List _providers; private ToolTip toolTip1; + private bool _myCodeIsFiringIstheCheckBoxChangedEvent; // To prevent the event from firing when I set the control from code #endregion Fields @@ -232,8 +235,9 @@ namespace IndianHealthService.ClinicalScheduling m_dCheckIn = DateTime.Now; } - //Print Routing Slip based on user preferences. + _myCodeIsFiringIstheCheckBoxChangedEvent = true; chkRoutingSlip.Checked = CGDocumentManager.Current.UserPreferences.PrintRoutingSlipAutomatically; + _myCodeIsFiringIstheCheckBoxChangedEvent = false; UpdateDialogData(true); } @@ -474,6 +478,8 @@ namespace IndianHealthService.ClinicalScheduling /// private void chkRoutingSlip_CheckedChanged(object sender, EventArgs e) { + if (_myCodeIsFiringIstheCheckBoxChangedEvent) return; + CGDocumentManager.Current.UserPreferences.PrintRoutingSlipAutomatically = chkRoutingSlip.Checked; } diff --git a/cs/bsdx0200GUISourceCode/DPatientLetter.cs b/cs/bsdx0200GUISourceCode/DPatientLetter.cs index 6bc3d29..7a4fc97 100644 --- a/cs/bsdx0200GUISourceCode/DPatientLetter.cs +++ b/cs/bsdx0200GUISourceCode/DPatientLetter.cs @@ -67,7 +67,7 @@ namespace IndianHealthService.ClinicalScheduling // DPatientLetter // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(648, 398); + this.ClientSize = new System.Drawing.Size(748, 443); this.Name = "DPatientLetter"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Patient Letter"; @@ -403,5 +403,6 @@ namespace IndianHealthService.ClinicalScheduling // If we reach this point, we need to reset the counter (ticket #15 on https://trac.opensourcevista.net/ticket/15) _currentApptPrinting = 0; } + } } diff --git a/cs/bsdx0200GUISourceCode/DPatientLetter.resx b/cs/bsdx0200GUISourceCode/DPatientLetter.resx index 058249f..d3de862 100644 --- a/cs/bsdx0200GUISourceCode/DPatientLetter.resx +++ b/cs/bsdx0200GUISourceCode/DPatientLetter.resx @@ -112,21 +112,21 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 116, 17 + + 122, 17 - - 218, 17 + + 231, 17 - - 374, 17 + + 397, 17 - - 515, 17 + + 547, 17 \ No newline at end of file diff --git a/cs/bsdx0200GUISourceCode/UserPreferences.cs b/cs/bsdx0200GUISourceCode/UserPreferences.cs index b95840b..e04d79c 100644 --- a/cs/bsdx0200GUISourceCode/UserPreferences.cs +++ b/cs/bsdx0200GUISourceCode/UserPreferences.cs @@ -6,17 +6,35 @@ using System.Text; namespace IndianHealthService.ClinicalScheduling { /// - /// Designed to keep user preferences. Very basic for now. + /// Designed to keep user preferences. Gets settings from DB in constructor; Writes them back when changed. /// public class UserPreferences { + bool _printAppointmentSlipAutomacially; + bool _printRoutingSlipAutomatically; + public UserPreferences() { - PrintAppointmentSlipAutomacially = false; - PrintRoutingSlipAutomatically = false; + _printAppointmentSlipAutomacially = CGDocumentManager.Current.DAL.AutoPrintAppointmentSlip; + _printRoutingSlipAutomatically = CGDocumentManager.Current.DAL.AutoPrintRoutingSlip; + } - public bool PrintAppointmentSlipAutomacially { get; set; } - public bool PrintRoutingSlipAutomatically { get; set; } + public bool PrintAppointmentSlipAutomacially { + get { return _printAppointmentSlipAutomacially; } + set + { + CGDocumentManager.Current.DAL.AutoPrintAppointmentSlip = _printAppointmentSlipAutomacially = value; + } + } + + public bool PrintRoutingSlipAutomatically + { + get { return _printRoutingSlipAutomatically; } + set + { + CGDocumentManager.Current.DAL.AutoPrintRoutingSlip = _printRoutingSlipAutomatically = value; + } + } } } diff --git a/cs/bsdx0200GUISourceCode/bin/Release/BMXNet23.dll b/cs/bsdx0200GUISourceCode/bin/Release/BMXNet23.dll index 5cda2bd..686e280 100644 Binary files a/cs/bsdx0200GUISourceCode/bin/Release/BMXNet23.dll and b/cs/bsdx0200GUISourceCode/bin/Release/BMXNet23.dll differ diff --git a/cs/bsdx0200GUISourceCode/bin/Release/ClinicalScheduling.exe b/cs/bsdx0200GUISourceCode/bin/Release/ClinicalScheduling.exe index d811632..f34df3e 100644 Binary files a/cs/bsdx0200GUISourceCode/bin/Release/ClinicalScheduling.exe and b/cs/bsdx0200GUISourceCode/bin/Release/ClinicalScheduling.exe differ