private void UpdatePreferenceChanges()
        {
            bool hasChanges = false;

            if (Prefs.UpdateBool(PrefName.AgingCalculatedMonthlyInsteadOfDaily, checkAgingMonthly.Checked)
                | Prefs.UpdateBool(PrefName.ApptSecondaryProviderConsiderOpOnly, checkUseOpHygProv.Checked)
                | Prefs.UpdateBool(PrefName.ApptsRequireProc, checkApptsRequireProcs.Checked)
                | Prefs.UpdateBool(PrefName.BillingShowSendProgress, checkBillingShowProgress.Checked)
                | Prefs.UpdateBool(PrefName.BillingShowTransSinceBalZero, checkBillShowTransSinceZero.Checked)
                | Prefs.UpdateBool(PrefName.ClaimReportReceivedByService, checkReceiveReportsService.Checked)
                | Prefs.UpdateBool(PrefName.CloneCreateSuperFamily, checkSuperFamCloneCreate.Checked)
                | Prefs.UpdateBool(PrefName.EnterpriseApptList, checkEnterpriseApptList.Checked)
                | Prefs.UpdateBool(PrefName.EnterpriseNoneApptViewDefaultDisabled, checkEnableNoneView.Checked)
                | Prefs.UpdateBool(PrefName.PasswordsMustBeStrong, checkPasswordsMustBeStrong.Checked)
                | Prefs.UpdateBool(PrefName.PasswordsStrongIncludeSpecial, checkPasswordsStrongIncludeSpecial.Checked)
                | Prefs.UpdateBool(PrefName.PasswordsWeakChangeToStrong, checkPasswordForceWeakToStrong.Checked)
                | Prefs.UpdateBool(PrefName.PaymentWindowDefaultHideSplits, checkHidePaysplits.Checked)
                | Prefs.UpdateBool(PrefName.PaymentsPromptForPayType, checkPaymentsPromptForPayType.Checked)
                | Prefs.UpdateBool(PrefName.SecurityLockIncludesAdmin, checkLockIncludesAdmin.Checked)
                | Prefs.UpdateBool(PrefName.ShowFeaturePatientClone, checkPatClone.Checked)
                | Prefs.UpdateBool(PrefName.ShowFeatureSuperfamilies, checkSuperFam.Checked)
                | Prefs.UpdateBool(PrefName.ShowFeeSchedGroups, checkShowFeeSchedGroups.Checked)
                | Prefs.UpdateBool(PrefName.UserNameManualEntry, checkUserNameManualEntry.Checked)
                | Prefs.UpdateInt(PrefName.BillingElectBatchMax, PIn.Int(textBillingElectBatchMax.Text))
                | Prefs.UpdateString(PrefName.ClaimIdPrefix, textClaimIdentifier.Text)
                | Prefs.UpdateInt(PrefName.ClaimReportReceiveInterval, PIn.Int(textReportCheckInterval.Text))
                | Prefs.UpdateDateT(PrefName.ClaimReportReceiveTime, PIn.DateT(textReportCheckTime.Text))
                | Prefs.UpdateLong(PrefName.ProcessSigsIntervalInSecs, PIn.Long(textSigInterval.Text))
                //SecurityLockDate and SecurityLockDays are handled in FormSecurityLock
                //| Prefs.UpdateString(PrefName.SecurityLockDate,POut.Date(PIn.Date(textDateLock.Text),false))
                //| Prefs.UpdateInt(PrefName.SecurityLockDays,PIn.Int(textDaysLock.Text))
                | Prefs.UpdateInt(PrefName.SecurityLogOffAfterMinutes, PIn.Int(textLogOffAfterMinutes.Text))
                | Prefs.UpdateLong(PrefName.SignalInactiveMinutes, PIn.Long(textInactiveSignal.Text))
                | Prefs.UpdateInt(PrefName.AutoSplitLogic, comboAutoSplitPref.SelectedIndex)
                | Prefs.UpdateInt(PrefName.PayPlansVersion, comboPayPlansVersion.SelectedIndex + 1)
                | Prefs.UpdateInt(PrefName.PaymentClinicSetting, comboPaymentClinicSetting.SelectedIndex)
                | Prefs.UpdateInt(PrefName.PatientSelectSearchMinChars, PIn.Int(textPatSelectMinChars.Text))
                | Prefs.UpdateInt(PrefName.PatientSelectSearchPauseMs, PIn.Int(textPatSelectPauseMs.Text))
                | Prefs.UpdateBool(PrefName.PatientSelectFilterRestrictedClinics, checkPatientSelectFilterRestrictedClinics.Checked)
                )
            {
                hasChanges = true;
            }
            if (checkPatSearchEmptyParams.CheckState != CheckState.Indeterminate)
            {
                hasChanges |= Prefs.UpdateInt(PrefName.PatientSelectSearchWithEmptyParams, (int)(checkPatSearchEmptyParams.Checked ? YN.Yes : YN.No));
            }
            if (checkUsePhoneNumTable.CheckState != CheckState.Indeterminate)
            {
                hasChanges |= Prefs.UpdateYN(PrefName.PatientPhoneUsePhonenumberTable, checkUsePhoneNumTable.Checked ? YN.Yes : YN.No);
            }
            int prefRigorousAccounting = PrefC.GetInt(PrefName.RigorousAccounting);

            //Copied logging for RigorousAccounting and RigorousAdjustments from FormModuleSetup.
            if (Prefs.UpdateInt(PrefName.RigorousAccounting, comboRigorousAccounting.SelectedIndex))
            {
                hasChanges = true;
                SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Rigorous accounting changed from " +
                                          ((RigorousAccounting)prefRigorousAccounting).GetDescription() + " to "
                                          + ((RigorousAccounting)comboRigorousAccounting.SelectedIndex).GetDescription() + ".");
            }
            int prefRigorousAdjustments = PrefC.GetInt(PrefName.RigorousAdjustments);

            if (Prefs.UpdateInt(PrefName.RigorousAdjustments, comboRigorousAdjustments.SelectedIndex))
            {
                hasChanges = true;
                SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Rigorous adjustments changed from " +
                                          ((RigorousAdjustments)prefRigorousAdjustments).GetDescription() + " to "
                                          + ((RigorousAdjustments)comboRigorousAdjustments.SelectedIndex).GetDescription() + ".");
            }
            hasChanges |= UpdateReportingServer();
            hasChanges |= UpdateClaimSnapshotRuntime();
            hasChanges |= UpdateClaimSnapshotTrigger();
            if (hasChanges)
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
        }