Changeset 848 for Scheduling


Ignore:
Timestamp:
Jul 10, 2010, 11:30:32 AM (14 years ago)
Author:
Sam Habiel
Message:

More refactoring.

Location:
Scheduling/trunk/cs/bsdx0200GUISourceCode
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DAL.cs

    r843 r848  
    1515    {
    1616        private BMXNetConnectInfo _thisConnection; // set in constructor
     17       
    1718        delegate DataTable RPMSDataTableDelegate(string CommandString, string TableName); // for use in calling (Sync and Async)
    1819
     
    4950        }
    5051
     52        /// <summary>
     53        /// Get the Patients who have appointments in between dates for the clinics requested
     54        /// </summary>
     55        /// <param name="sClinicList">| delimited resource list (resource IENS, not names)</param>
     56        /// <param name="BeginDate">Self Explanatory</param>
     57        /// <param name="EndDate">Self Explanatory</param>
     58        /// <returns>DataTable with the following columns:
     59        /// T00030Name^D00020DOB^T00030Sex^T00030HRN^D00030ApptDate^T00030Clinic^T00030TypeStatus
     60        /// I00010RESOURCEID^T00030APPT_MADE_BY^D00020DATE_APPT_MADE^T00250NOTE^T00030STREET^
     61        /// T00030CITY^T00030STATE^T00030ZIP^T00030HOMEPHONE
     62        ///</returns>
     63        ///<remarks>Mirrors dsPatientApptDisplay2.PatientAppts Schema in this project. Can merge table into schema.</remarks>
     64        public DataTable GetClinicSchedules(string sClinicList, DateTime BeginDate, DateTime EndDate)
     65        {
     66            string sBegin = FMDateTime.Create(BeginDate).DateOnly.FMDateString;
     67            string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
     68            string cmd = String.Format("BSDX CLINIC LETTERS^{0}^{1}^{2}", sClinicList, sBegin, sEnd);
     69            return RPMSDataTable(cmd, "");
     70        }
    5171
     72        /// <summary>
     73        /// Get the letter templates associated with the requested clinics (reminder letter, cancellation letter etc)
     74        /// </summary>
     75        /// <param name="sClinicList">| delimited resource list (resource IENS, not names)</param>
     76        /// <returns>DataTable with the following columns:
     77        /// I00010RESOURCEID^T00030RESOURCE_NAME^T00030LETTER_TEXT^T00030NO_SHOW_LETTER^T00030CLINIC_CANCELLATION_LETTER
     78        /// </returns>
     79        /// <remarks>Mirrors dsPatientApptDisplay2.BSDXResource Schema. Can merge table into schema.</remarks>
     80        public DataTable GetResourceLetters(string sClinicList)
     81        {
     82            string cmd = String.Format("BSDX RESOURCE LETTERS^{0}", sClinicList);
     83            return RPMSDataTable(cmd, "");
     84        }
     85
     86        /// <summary>
     87        /// Get the list of Patients who have Rebooked Appointments
     88        /// </summary>
     89        /// <param name="sClinicList">| delimited resource list (resource IENS, not names)</param>
     90        /// <param name="BeginDate">Self Explanatory</param>
     91        /// <param name="EndDate">Self Explanatory</param>
     92        /// <returns>T00030Name^D00020DOB^T00030Sex^T00030HRN^D00030NewApptDate^T00030Clinic^T00030TypeStatus
     93        /// ^I00010RESOURCEID^T00030APPT_MADE_BY^D00020DATE_APPT_MADE^T00250NOTE^T00030STREET^T00030CITY
     94        /// ^T00030STATE^T00030ZIP^T00030HOMEPHONE^D00030OldApptDate
     95        ///</returns>
     96        /// <remarks>Not sure if this works yet</remarks>
     97        /// <remarks>Mirrors dsRebookAppts.PatientAppt Schema. Can merge table into schema.</remarks>
     98        public DataTable GetRebookedAppointments(string sClinicList, DateTime BeginDate, DateTime EndDate)
     99        {
     100            string sBegin = FMDateTime.Create(BeginDate).DateOnly.FMDateString;
     101            string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
     102            string cmd = String.Format("BSDX REBOOK CLINIC LIST^{0}^{1}^{2}", sClinicList, sBegin, sEnd);
     103            return RPMSDataTable(cmd, "");
     104        }
    52105
    53106        /// <summary>
     
    56109        /// <param name="sSQL"></param>
    57110        /// <param name="sTableName"></param>
    58         /// <param name="ds"></param>
    59111        /// <returns></returns>
    60112        private DataTable RPMSDataTable(string sSQL, string sTableName)
     
    75127            catch (Exception ex)
    76128            {
    77                 sErrorMessage = "CGDocumentManager.RPMSDataTable error: " + ex.Message;
     129                sErrorMessage = "DAL.RPMSDataTable error: " + ex.Message;
    78130                throw ex;
    79131            }
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.cs

    r789 r848  
    5353                                        throw new Exception("At least one clinic must be selected.");
    5454                                }
    55                 _dtBegin = dtBegin;
    56                 _dtEnd = dtEnd;
    57                                 string sBegin = dtBegin.ToShortDateString();
    58                                 string sEnd = dtEnd.ToShortDateString();
    59                                 this.Text="Clinic Schedules";
    60 
    61                                 string sSql = "BSDX CLINIC LETTERS^" + sClinicList + "^" + sBegin + "^" + sEnd;
    62                 string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;
    63 
     55
     56                _dtBegin = dtBegin; // Global variable to use in Printing method below
     57                _dtEnd = dtEnd; // ditto
     58
     59                this.Text="Clinic Schedules";
     60
     61                // Get Data
     62                DataTable PatientAppts = docManager.DAL.GetClinicSchedules(sClinicList, dtBegin, dtEnd);
     63                DataTable Resources = docManager.DAL.GetResourceLetters(sClinicList);
     64
     65                // Merge tables into typed dataset
    6466                _dsApptDisplay = new dsPatientApptDisplay2();
    65                 _dsApptDisplay.BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources"));
    66                 _dsApptDisplay.PatientAppts.Merge(docManager.RPMSDataTable(sSql, "PatientAppts"));
     67                _dsApptDisplay.PatientAppts.Merge(PatientAppts);
     68                _dsApptDisplay.BSDXResource.Merge(Resources);
    6769
    6870                this.PrintPreviewControl.Document = printAppts;
     
    8183        /// <param name="dtBegin">Beginning Date</param>
    8284        /// <param name="dtEnd">End Date</param>
     85        /// working on moving this over...
    8386        public void InitializeFormRebookLetters(CGDocumentManager docManager,
    8487                        string sClinicList,
Note: See TracChangeset for help on using the changeset viewer.