コード例 #1
0
        public static ApptReminderRule CreateApptReminderRule(long clinicNum, ApptReminderType type, TimeSpan tsPrior,
                                                              bool isSendAll           = true, CommType priority1 = CommType.Preferred, CommType priority2 = CommType.Text, CommType priority3 = CommType.Email,
                                                              TimeSpan doNotSendWithin = default(TimeSpan), bool isAutoReplyEnabled = true)
        {
            ApptReminderRule clinicRule = ApptReminderRules.CreateDefaultReminderRule(type, clinicNum);

            clinicRule.TSPrior   = tsPrior;
            clinicRule.IsSendAll = isSendAll;
            clinicRule.SendOrder = string.Join(",", new List <CommType>()
            {
                priority1, priority2, priority3
            }.Select(x => ((int)x).ToString()).ToArray());
            clinicRule.DoNotSendWithin = doNotSendWithin;
            if (type == ApptReminderType.PatientPortalInvite && clinicNum > 0)
            {
                clinicRule.SendOrder = "2";              //Email only
                clinicRule.IsSendAll = false;
                if (ClinicPrefs.Upsert(PrefName.PatientPortalInviteEnabled, clinicNum, "1")
                    | ClinicPrefs.Upsert(PrefName.PatientPortalInviteUseDefaults, clinicNum, "0"))
                {
                    ClinicPrefs.RefreshCache();
                }
            }
            clinicRule.IsAutoReplyEnabled = isAutoReplyEnabled;
            ApptReminderRules.Insert(clinicRule);
            return(clinicRule);
        }
コード例 #2
0
        private void butAddThankYou_Click(object sender, EventArgs e)
        {
            if (_ecClinicCur != null && _ecClinicCur.ClinicNum > 0 && _ecClinicCur.IsConfirmDefault)
            {
                if (!SwitchFromDefaults())
                {
                    return;
                }
            }
            ApptReminderRule         arr      = ApptReminderRules.CreateDefaultReminderRule(ApptReminderType.ScheduleThankYou, _ecClinicCur.ClinicNum);
            FormApptReminderRuleEdit FormARRE = new FormApptReminderRuleEdit(arr, _dictClinicRules[_clinicRuleClinicNum]);

            FormARRE.ShowDialog();
            if (FormARRE.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (FormARRE.ApptReminderRuleCur == null || FormARRE.ApptReminderRuleCur.IsNew)           //Delete or Update
            //Nothing to update, this was a new rule.
            {
            }
            else              //Insert
            {
                _dictClinicRules[_clinicRuleClinicNum].Add(FormARRE.ApptReminderRuleCur);
            }
            if (FormARRE.IsPrefsChanged)
            {
                FillConfStatusesGrid();
            }
            FillRemindConfirmData();
        }
コード例 #3
0
        private void butActivateThankYou_Click(object sender, EventArgs e)
        {
            //todo Discuss if this feature should be tied to eConfirmations...seems more likely that it should work like reminders.
            //or does it need its own eServiceCode?
            //if(!WebServiceMainHQProxy.IsEServiceActive(_signupOut,eServiceCode.ConfirmationRequest)) { //Not yet activated with HQ.
            //	MsgBox.Show(this,"You must first signup for eConfirmations via the Signup tab before activating eConfirmations.");
            //	return;
            //}
            bool isApptThankYouAutoEnabled = PrefC.GetBool(PrefName.ApptThankYouAutoEnabled);

            isApptThankYouAutoEnabled = !isApptThankYouAutoEnabled;
            Prefs.UpdateBool(PrefName.ApptConfirmAutoEnabled, isApptThankYouAutoEnabled);
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Automated appointment eThankYou " + (isApptThankYouAutoEnabled ? "activated" : "deactivated") + ".");
            Prefs.RefreshCache();
            Signalods.SetInvalid(InvalidType.Prefs);
            FillECRActivationButtons();
            //Add a default confirmation rule if none exists.
            if (isApptThankYouAutoEnabled && _dictClinicRules[0].Count(x => x.TypeCur == ApptReminderType.ScheduleThankYou) == 0)
            {
                //defaults to 0 days, 0 hours after appt created.
                ApptReminderRule arr = ApptReminderRules.CreateDefaultReminderRule(ApptReminderType.ScheduleThankYou, 0);
                _dictClinicRules[0].Add(arr);
                FillRemindConfirmData();
            }
        }
コード例 #4
0
        private void butAddConfirmation_Click(object sender, EventArgs e)
        {
            if (_ecClinicCur != null && _ecClinicCur.ClinicNum > 0 && _ecClinicCur.IsConfirmDefault)
            {
                if (!SwitchFromDefaults())
                {
                    return;
                }
            }
            ApptReminderRule         arr      = ApptReminderRules.CreateDefaultReminderRule(ApptReminderType.ConfirmationFutureDay, _ecClinicCur.ClinicNum);
            FormApptReminderRuleEdit FormARRE = new FormApptReminderRuleEdit(arr, _dictClinicRules[_clinicRuleClinicNum]);

            FormARRE.ShowDialog();
            if (FormARRE.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (FormARRE.ApptReminderRuleCur == null || FormARRE.ApptReminderRuleCur.IsNew)
            {
                //Delete or Update
                //Nothing to delete or update, this was a new rule.
            }
            else              //Insert
            {
                _dictClinicRules[_clinicRuleClinicNum].Add(FormARRE.ApptReminderRuleCur);
            }
            FillRemindConfirmData();
        }
コード例 #5
0
        private void butActivateReminder_Click(object sender, EventArgs e)
        {
            bool isApptRemindAutoEnabled = PrefC.GetBool(PrefName.ApptRemindAutoEnabled);

            isApptRemindAutoEnabled = !isApptRemindAutoEnabled;
            Prefs.UpdateBool(PrefName.ApptRemindAutoEnabled, isApptRemindAutoEnabled);
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Automated appointment eReminders " + (isApptRemindAutoEnabled ? "activated" : "deactivated") + ".");
            Prefs.RefreshCache();
            Signalods.SetInvalid(InvalidType.Prefs);
            FillECRActivationButtons();
            //Add two default reminder rules if none exists.
            if (isApptRemindAutoEnabled && _dictClinicRules[0].Count(x => x.TypeCur == ApptReminderType.Reminder) == 0)
            {
                ApptReminderRule arr = ApptReminderRules.CreateDefaultReminderRule(ApptReminderType.Reminder, 0);             //defaults to 3 hours before appt
                _dictClinicRules[0].Add(arr);
                ApptReminderRule arr2 = ApptReminderRules.CreateDefaultReminderRule(ApptReminderType.Reminder, 0);
                arr2.TSPrior = TimeSpan.FromDays(2);
                _dictClinicRules[0].Add(arr2);
                FillRemindConfirmData();
            }
        }
コード例 #6
0
        private void butActivateInvites_Click(object sender, EventArgs e)
        {
            if (!WebServiceMainHQProxy.IsEServiceActive(_signupOut, eServiceCode.PatientPortal))             //Not yet activated with HQ.
            {
                MsgBox.Show(this, "You must first signup for Patient Portal via the Signup tab before activating Patient Portal Invites.");
                return;
            }
            bool isPatPortalInvitesEnabled = PrefC.GetBool(PrefName.PatientPortalInviteEnabled);

            isPatPortalInvitesEnabled = !isPatPortalInvitesEnabled;
            Prefs.UpdateBool(PrefName.PatientPortalInviteEnabled, isPatPortalInvitesEnabled);
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Patient Portal Invites " + (isPatPortalInvitesEnabled ? "activated" : "deactivated") + ".");
            Prefs.RefreshCache();
            Signalods.SetInvalid(InvalidType.Prefs);
            FillPPInviteActivationButton();
            if (isPatPortalInvitesEnabled && _listPatPortalInviteRules.Count == 0)
            {
                _listPatPortalInviteRules.Add(ApptReminderRules.CreateDefaultReminderRule(ApptReminderType.PatientPortalInvite, 0, isBeforeAppointment: false));
                _listPatPortalInviteRules.Add(ApptReminderRules.CreateDefaultReminderRule(ApptReminderType.PatientPortalInvite, 0, isBeforeAppointment: true));
                FillPatPortalInvites();
            }
        }
コード例 #7
0
        private void butActivateConfirm_Click(object sender, EventArgs e)
        {
            if (!WebServiceMainHQProxy.IsEServiceActive(_signupOut, eServiceCode.ConfirmationRequest))             //Not yet activated with HQ.
            {
                MsgBox.Show(this, "You must first signup for eConfirmations via the Signup tab before activating eConfirmations.");
                return;
            }
            bool isApptConfirmAutoEnabled = PrefC.GetBool(PrefName.ApptConfirmAutoEnabled);

            isApptConfirmAutoEnabled = !isApptConfirmAutoEnabled;
            Prefs.UpdateBool(PrefName.ApptConfirmAutoEnabled, isApptConfirmAutoEnabled);
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Automated appointment eConfirmations " + (isApptConfirmAutoEnabled ? "activated" : "deactivated") + ".");
            Prefs.RefreshCache();
            Signalods.SetInvalid(InvalidType.Prefs);
            FillECRActivationButtons();
            //Add a default confirmation rule if none exists.
            if (isApptConfirmAutoEnabled && _dictClinicRules[0].Count(x => x.TypeCur == ApptReminderType.ConfirmationFutureDay) == 0)
            {
                ApptReminderRule arr = ApptReminderRules.CreateDefaultReminderRule(ApptReminderType.ConfirmationFutureDay, 0);             //defaults to 7 days before appt
                _dictClinicRules[0].Add(arr);
                FillRemindConfirmData();
            }
        }
コード例 #8
0
        private void butAddPPInviteRule_Click(object sender, EventArgs e)
        {
            if (_clinicCurPPInvite.ClinicNum > 0 && _useDefaultsPPInvite && !SwitchFromDefaultsPPInvites())
            {
                return;
            }
            ApptReminderRule         arr      = ApptReminderRules.CreateDefaultReminderRule(ApptReminderType.PatientPortalInvite, _clinicCurPPInvite.ClinicNum);
            FormApptReminderRuleEdit FormARRE = new FormApptReminderRuleEdit(arr);

            FormARRE.ShowDialog();
            if (FormARRE.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (FormARRE.ApptReminderRuleCur == null || FormARRE.ApptReminderRuleCur.IsNew)           //Delete or Update
            //Nothing to delete or update, this was a new rule.
            {
            }
            else              //Insert
            {
                _listPatPortalInviteRules.Add(FormARRE.ApptReminderRuleCur);
            }
            FillPatPortalInvites();
        }