Ignore:
Timestamp:
Mar 29, 2011, 5:38:18 AM (14 years ago)
Author:
Sam Habiel
Message:

CGAVDocument: Don't Update Grid. Leave that to CGAVView.
CGAVView: When updating grid, make a copy of appointments, and use the copy, so there won't be clashes when updating appointments in the background.
CGDocument: Minor Changes in AppointmentNoShow; New method AppointmentUndoCheckIn
CGDocumentManager: Resequenced load order b/c UserPreferences now talks to DB.
DAL: New Methods to save autoprint preferences; new delegate to enable some async stuff
DCheckIn & DAppointPage: _myCodeIsFiringIstheCheckBoxChangedEvent added to protect against firing event when setting checkbox in the code.
DPatientLetter: No changes.
UserPreferences: Now gets and saves user preferences from DB.

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

Legend:

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

    r1097 r1117  
    252252                                Debug.Write("CreateAvailabilityAuto -- new AV block created\n");
    253253
    254                                 UpdateAllViews();
     254                                //UpdateAllViews();
    255255
    256256                                aCopy.AppointmentKey = nApptID;
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGAVView.cs

    r1097 r1117  
    884884                        //TODO:  Create these components
    885885                        this.calendarGrid1.Resources = this.m_Document.Resources;
     886            this.calendarGrid1.Appointments = (CGAppointments)this.m_Document.m_AVBlocks.Clone();
    886887                        this.calendarGrid1.OnUpdateArrays();
    887888                        this.lblResource.Text = this.m_Document.DocName;
     
    10421043                         * Display dialog to collect:
    10431044                         * - Number of weeks to apply template
    1044                          * - Starting week Monday
     1045                         * - Starting week (application starts on Culture WeekStartDay of selected week)
    10451046                         * - Template path & filename
    10461047                         *
    1047                          * for each week,
    1048                          *      Delete all availability during that week
    1049                          *  apply the template
    10501048                         *
    10511049                         */
     
    15061504            dtStart = newStartDate;
    15071505            int nWeeksToApply = dlg.WeeksToApply;
    1508             DateTime dtEnd = dtStart.AddDays(6); // or 7?
     1506            DateTime dtEnd = dtStart.AddDays(6); // or 7? smh:: not 7 for sure.
    15091507
    15101508            string sResourceID = this.m_Document.ResourceID.ToString();
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs

    r1112 r1117  
    12461246        }
    12471247
    1248         public string AppointmentNoShow(int nApptID, bool bNoShow)
     1248        public string AppointmentNoShow(CGAppointment a, bool bNoShow)
    12491249        {
    12501250            /*
     
    12531253             *
    12541254             */
    1255 
     1255            int nApptID = a.AppointmentKey;
    12561256            string sTest = bNoShow.ToString();
    12571257            string sNoShow = (bNoShow == true) ? "1" : "0";
     
    12701270            }
    12711271
    1272             bool bRet = RefreshSchedule();
     1272            //All okay over here... then set appointment noshow or not no show...
     1273            a.NoShow = bNoShow ? true : false;
     1274
     1275            //bool bRet = RefreshSchedule();
    12731276
    12741277            return sErrorID;
     1278        }
     1279
     1280        public bool AppointmentUndoCheckin(CGAppointment a, out string msg)
     1281        {
     1282            msg = "";
     1283            //zero good, anything else bad
     1284            DataTable dt = CGDocumentManager.Current.DAL.RemoveCheckIn(a.AppointmentKey);
     1285            if (dt.Rows[0][0].ToString() == "0")
     1286            {
     1287                a.CheckInTime = DateTime.MinValue; // remove check-in time.
     1288                return true;
     1289            }
     1290
     1291            else
     1292            {
     1293                msg = dt.Rows[0][0].ToString();
     1294                return false;
     1295            }
    12751296        }
    12761297
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs

    r1112 r1117  
    354354            threadSplash.Start(m_ds); // pass form as parameter.
    355355
    356             //There are 19 steps to load the application. That's max for the progress bar.
    357             setMaxProgressDelegate(19);
     356            //There are 21 steps to load the application. That's max for the progress bar.
     357            setMaxProgressDelegate(21);
    358358           
    359359            // smh--not used: System.Configuration.ConfigurationManager.GetSection("appSettings");
     
    472472            }
    473473           
    474             //User Preferences Object
    475             _current.UserPreferences = new UserPreferences();
     474           
    476475
    477476            //User Interface Culture (m_CultureName is set from the command line flag /culture)
     
    536535                        setStatusDelegate("Setting Application Context to BSDXRPC...");
    537536                        m_ConnectInfo.AppContext = "BSDXRPC";
    538        
    539                         //Load global recordsets
     537
     538            //User Preferences Object
     539            setProgressDelegate(4); //next number is 6 b/c two calls
     540            setStatusDelegate("Getting User Preferences from the Server...");
     541
     542            _current.UserPreferences = new UserPreferences(); // Does the calling to do that...
     543           
     544            //Load global recordsets
    540545            string statusConst = "Loading VistA data tables...";
    541546                        setStatusDelegate(statusConst);
     
    545550            //Schedule User Info
    546551            // Table #4
    547             setProgressDelegate(4);
     552            setProgressDelegate(6);
    548553            setStatusDelegate(statusConst + " Schedule User");
    549554            DataTable dtUser = _dal.GetUserInfo(m_ConnectInfo.DUZ);
     
    560565            //Get Access Types
    561566            // Table #5
    562             setProgressDelegate(5);
     567            setProgressDelegate(7);
    563568            setStatusDelegate(statusConst + " Access Types");
    564569            DataTable dtAccessTypes = _dal.GetAccessTypes();
     
    568573            //Get Access Groups
    569574            // Table #6
    570             setProgressDelegate(6);
     575            setProgressDelegate(8);
    571576            setStatusDelegate(statusConst + " Access Groups");
    572577            LoadAccessGroupsTable();
     
    583588            // But they are heavily referenced throughout the code.
    584589            // Table #7
    585             setProgressDelegate(7);
     590            setProgressDelegate(9);
    586591            setStatusDelegate(statusConst + " Access Group Types");
    587592            LoadAccessGroupTypesTable();
     
    603608            // Table #8
    604609            // What shows up on the tree. The groups the user has access to.
    605             setProgressDelegate(8);
     610            setProgressDelegate(10);
    606611            setStatusDelegate(statusConst + " Resource Groups By User");
    607612            LoadResourceGroupTable();
     
    610615            // Table #9
    611616            // Individual Resources
    612             setProgressDelegate(9);
     617            setProgressDelegate(11);
    613618            setStatusDelegate(statusConst + " Resources By User");
    614619            LoadBSDXResourcesTable();
     
    622627            // Table #10
    623628            // Resource Groups and Indivdual Resources together
    624             setProgressDelegate(10);
     629            setProgressDelegate(12);
    625630            setStatusDelegate(statusConst + " Group Resources");
    626631            LoadGroupResourcesTable();
     
    640645            //HospitalLocation table
    641646            //Table #11
    642             setProgressDelegate(11);
     647            setProgressDelegate(13);
    643648            setStatusDelegate(statusConst + " Clinics");
    644649            //cmd.CommandText = "SELECT BMXIEN 'HOSPITAL_LOCATION_ID', NAME 'HOSPITAL_LOCATION', DEFAULT_PROVIDER, STOP_CODE_NUMBER, INACTIVATE_DATE, REACTIVATE_DATE FROM HOSPITAL_LOCATION";
     
    661666            //Build ScheduleUser table
    662667            //Table #12
    663             setProgressDelegate(12);
     668            setProgressDelegate(14);
    664669            setStatusDelegate(statusConst + " Schedule User");
    665670            this.LoadScheduleUserTable();
     
    674679            //Table #13
    675680            //Acess to Resources by [this] User
    676             setProgressDelegate(13);
     681            setProgressDelegate(15);
    677682            setStatusDelegate(statusConst + " Resource User");
    678683            this.LoadResourceUserTable();
     
    693698            //Table #14
    694699            //TODO: Lazy load the provider table; no need to load in advance.
    695             setProgressDelegate(14);
     700            setProgressDelegate(16);
    696701            setStatusDelegate(statusConst + " Providers");
    697702            sCommandText = "SELECT BMXIEN, NAME FROM NEW_PERSON WHERE INACTIVE_DATE = '' AND BMXIEN > 1";
     
    701706            //Build the HOLIDAY table
    702707            //Table #15
    703             setProgressDelegate(15);
     708            setProgressDelegate(17);
    704709            setStatusDelegate(statusConst + " Holiday");
    705710            sCommandText = "SELECT NAME, DATE FROM HOLIDAY WHERE INTERNAL[DATE] > '" + FMDateTime.Create(DateTime.Today).DateOnly.FMDateString + "'";
     
    721726            setStatusDelegate("Subscribing to Server Events");
    722727            //Table #16
    723             setProgressDelegate(16);
     728            setProgressDelegate(18);
    724729            _current.m_ConnectInfo.SubscribeEvent("BSDX SCHEDULE");
    725730                        //Table #17
    726             setProgressDelegate(17);
     731            setProgressDelegate(19);
    727732            _current.m_ConnectInfo.SubscribeEvent("BSDX CALL WORKSTATIONS");
    728733                        //Table #18
    729             setProgressDelegate(18);
     734            setProgressDelegate(20);
    730735            _current.m_ConnectInfo.SubscribeEvent("BSDX ADMIN MESSAGE");
    731736                        //Table #19
    732             setProgressDelegate(19);
     737            setProgressDelegate(21);
    733738            _current.m_ConnectInfo.SubscribeEvent("BSDX ADMIN SHUTDOWN");
    734739
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user

    r1112 r1117  
    3737    </RemoteDebugMachine>
    3838    <StartAction>Project</StartAction>
    39     <StartArguments>/s=172.16.16.108 /p=9250 /a=BASMA.ALDWAIRI /v=SELEN.123 /culture="ar-JO"</StartArguments>
     39    <StartArguments>/s=172.16.16.108 /p=9250 /a=BASMA.ALDWAIRI /v=SELEN.123 /culture=ar-JO</StartArguments>
    4040    <StartPage>
    4141    </StartPage>
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DAL.cs

    r1044 r1117  
    1717       
    1818        delegate DataTable RPMSDataTableDelegate(string CommandString, string TableName); // for use in calling (Sync and Async)
     19        delegate string TransmitRPCAsync(string RPCName, string Params); //same idea
    1920
    2021        /// <summary>
     
    174175
    175176        /// <summary>
     177        /// Remove the check-in for the appointment
     178        /// </summary>
     179        /// <param name="ApptID">Appointment IEN/Key</param>
     180        /// <returns>Table with 1 columns: ERRORID. ErrorID of "0" is okay;
     181        /// any other (negative numbers plus text) is bad</returns>
     182        public DataTable RemoveCheckIn(int ApptID)
     183        {
     184            string cmd = string.Format("BSDX REMOVE CHECK-IN^{0}", ApptID);
     185            return RPMSDataTable(cmd, "");
     186        }
     187
     188        /// <summary>
     189        /// Save User Preference in DB For Printing Routing Slip
     190        /// Uses Parameter BSDX AUTO PRINT RS
     191        /// </summary>
     192        /// <remarks>
     193        /// Notice Code-Fu for Async Save...
     194        /// </remarks>
     195        public bool AutoPrintRoutingSlip
     196        {
     197            get
     198            {
     199                string val = _thisConnection.bmxNetLib.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT RS");  //1 = true; 0 = false; "" = not set
     200                return val == "1" ? true : false;
     201            }
     202            set
     203            {
     204                TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.bmxNetLib.TransmitRPC);
     205                // 0 = success; anything else is wrong. Not being tested here as its success is not critical to application use.
     206                _asyncTransmitter.BeginInvoke("BSDX SET PARAM", String.Format("{0}^{1}", "BSDX AUTO PRINT RS", value ? "1" : "0"), null, null);
     207            }
     208        }
     209
     210        /// <summary>
     211        /// Save User Preference in DB For Printing Routing Slip
     212        /// Uses Parameter BSDX AUTO PRINT AS
     213        /// </summary>
     214        /// <remarks>
     215        /// Notice Code-Fu for Async Save...
     216        /// </remarks>
     217        public bool AutoPrintAppointmentSlip
     218        {
     219            get
     220            {
     221                string val = _thisConnection.bmxNetLib.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT AS");  //1 = true; 0 = false; "" = not set
     222                return val == "1" ? true : false;
     223            }
     224            set
     225            {
     226                TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.bmxNetLib.TransmitRPC);
     227                // 0 = success; anything else is wrong. Not being tested here as its success is not critical to application use.
     228                _asyncTransmitter.BeginInvoke("BSDX SET PARAM", String.Format("{0}^{1}", "BSDX AUTO PRINT AS", value ? "1" : "0"), null, null);
     229            }
     230        }
     231
     232
     233
     234        /// <summary>
    176235        /// Workhorse
    177236        /// </summary>
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DAppointPage.cs

    r1111 r1117  
    671671        private string          m_sCountry;
    672672        private int          m_iAccessTypeID;
     673        private bool _myCodeIsFiringIstheCheckBoxChangedEvent;
    673674
    674675                #endregion //fields
     
    719720                groupBox4.Controls.Add(UC);
    720721
     722                _myCodeIsFiringIstheCheckBoxChangedEvent = true;
    721723                chkPrint.Checked = CGDocumentManager.Current.UserPreferences.PrintAppointmentSlipAutomacially;
     724                _myCodeIsFiringIstheCheckBoxChangedEvent = false;
    722725            }
    723726                        catch(Exception e)
     
    862865
    863866        /// <summary>
    864         /// Save Print Slip preference in UserPreferences object. For now, it always starts false since
    865         /// it isn't saved in the DB; but that will change in the future.
     867        /// Save Print Slip preference in UserPreferences object.
    866868        /// </summary>
    867869        /// <param name="sender"></param>
     
    869871        private void chkPrint_CheckedChanged(object sender, EventArgs e)
    870872        {
     873            if (_myCodeIsFiringIstheCheckBoxChangedEvent) return;
     874
    871875            CGDocumentManager.Current.UserPreferences.PrintAppointmentSlipAutomacially = chkPrint.Checked;
    872876        }
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DCheckIn.cs

    r1111 r1117  
    2525            //
    2626            InitializeComponent();
     27
     28           
    2729        }
    2830
     
    6062        private List<Provider> _providers;
    6163        private ToolTip toolTip1;
     64        private bool _myCodeIsFiringIstheCheckBoxChangedEvent; // To prevent the event from firing when I set the control from code
    6265       
    6366        #endregion Fields
     
    233236            }
    234237
    235             //Print Routing Slip based on user preferences.
     238            _myCodeIsFiringIstheCheckBoxChangedEvent = true;
    236239            chkRoutingSlip.Checked = CGDocumentManager.Current.UserPreferences.PrintRoutingSlipAutomatically;
     240            _myCodeIsFiringIstheCheckBoxChangedEvent = false;
    237241
    238242            UpdateDialogData(true);
     
    475479        private void chkRoutingSlip_CheckedChanged(object sender, EventArgs e)
    476480        {
     481            if (_myCodeIsFiringIstheCheckBoxChangedEvent) return;
     482
    477483            CGDocumentManager.Current.UserPreferences.PrintRoutingSlipAutomatically = chkRoutingSlip.Checked;
    478484        }
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.cs

    r1110 r1117  
    6868            //
    6969            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
    70             this.ClientSize = new System.Drawing.Size(648, 398);
     70            this.ClientSize = new System.Drawing.Size(748, 443);
    7171            this.Name = "DPatientLetter";
    7272            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     
    404404            _currentApptPrinting = 0;
    405405        }
     406
    406407        }
    407408}
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.resx

    r789 r1117  
    113113  </resheader>
    114114  <resheader name="reader">
    115     <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
     115    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    116116  </resheader>
    117117  <resheader name="writer">
    118     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
     118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
    120   <metadata name="printAppts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    121     <value>116, 17</value>
     120  <metadata name="printAppts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     121    <value>122, 17</value>
    122122  </metadata>
    123   <metadata name="printReminderLetters.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    124     <value>218, 17</value>
     123  <metadata name="printReminderLetters.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     124    <value>231, 17</value>
    125125  </metadata>
    126   <metadata name="printCancelLetters.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    127     <value>374, 17</value>
     126  <metadata name="printCancelLetters.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     127    <value>397, 17</value>
    128128  </metadata>
    129   <metadata name="printRebookLetters.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    130     <value>515, 17</value>
     129  <metadata name="printRebookLetters.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     130    <value>547, 17</value>
    131131  </metadata>
    132132</root>
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/UserPreferences.cs

    r1111 r1117  
    77{
    88    /// <summary>
    9     /// Designed to keep user preferences. Very basic for now.
     9    /// Designed to keep user preferences. Gets settings from DB in constructor; Writes them back when changed.
    1010    /// </summary>
    1111    public class UserPreferences
    1212    {
     13        bool _printAppointmentSlipAutomacially;
     14        bool _printRoutingSlipAutomatically;
     15       
    1316        public UserPreferences()
    1417        {
    15             PrintAppointmentSlipAutomacially = false;
    16             PrintRoutingSlipAutomatically = false;
     18            _printAppointmentSlipAutomacially = CGDocumentManager.Current.DAL.AutoPrintAppointmentSlip;
     19            _printRoutingSlipAutomatically = CGDocumentManager.Current.DAL.AutoPrintRoutingSlip;
     20           
    1721        }
    1822
    19         public bool PrintAppointmentSlipAutomacially { get; set; }
    20         public bool PrintRoutingSlipAutomatically { get; set; }
     23        public bool PrintAppointmentSlipAutomacially {
     24            get { return _printAppointmentSlipAutomacially; }
     25            set
     26            {
     27                CGDocumentManager.Current.DAL.AutoPrintAppointmentSlip = _printAppointmentSlipAutomacially = value;
     28            }
     29        }
     30
     31        public bool PrintRoutingSlipAutomatically
     32        {
     33            get { return _printRoutingSlipAutomatically; }
     34            set
     35            {
     36                CGDocumentManager.Current.DAL.AutoPrintRoutingSlip = _printRoutingSlipAutomatically = value;
     37            }
     38        }
    2139    }
    2240}
Note: See TracChangeset for help on using the changeset viewer.