private void FillTabPatientPortal() { //Office may have set a customer URL textPatientFacingUrlPortal.Text = PrefC.GetString(PrefName.PatientPortalURL); //HQ provides this URL for this customer. WebServiceMainHQProxy.EServiceSetup.SignupOut.SignupOutEService urlsFromHQ = WebServiceMainHQProxy.GetSignups <WebServiceMainHQProxy.EServiceSetup.SignupOut.SignupOutEService>(_signupOut, eServiceCode.PatientPortal).FirstOrDefault() ?? new WebServiceMainHQProxy.EServiceSetup.SignupOut.SignupOutEService() { HostedUrl = "", HostedUrlPayment = "" }; textHostedUrlPortal.Text = urlsFromHQ.HostedUrl; textHostedUrlPortalPayment.Text = urlsFromHQ.HostedUrlPayment; if (textPatientFacingUrlPortal.Text == "") //Customer has not set their own URL so use the URL provided by OD. { textPatientFacingUrlPortal.Text = urlsFromHQ.HostedUrl; } textBoxNotificationSubject.Text = PrefC.GetString(PrefName.PatientPortalNotifySubject); textBoxNotificationBody.Text = PrefC.GetString(PrefName.PatientPortalNotifyBody); _listPatPortalInviteRules = ApptReminderRules.GetForTypes(ApptReminderType.PatientPortalInvite); if (PrefC.HasClinicsEnabled) { _clinicCurPPInvite = comboClinicsPPInvites.SelectedTag <Clinic>(); } else { _clinicCurPPInvite = Clinics.GetPracticeAsClinicZero(); labelClinicPPInvites.Visible = false; checkUseDefaultsPPInvites.Visible = false; checkIsPPInvitesEnabled.Visible = false; } FillPatPortalInvites(); }
public ContrNewPatHostedURL(WebServiceMainHQProxy.EServiceSetup.SignupOut.SignupOutEService signup) { InitializeComponent(); IsExpanded = false; AddContextMenu(textWebFormToLaunch); AddContextMenu(textSchedulingURL); Signup = signup; FillControl(); }
private void FillGridWebSchedNewPatApptTimeSlotsThreaded() { if (this.InvokeRequired) { this.BeginInvoke((Action) delegate() { FillGridWebSchedNewPatApptTimeSlotsThreaded(); }); return; } if (comboWSNPADefApptType.GetSelected <Def>() == null) { if (tabControl.SelectedTab == tabWebSched && tabControlWebSched.SelectedTab == tabWebSchedNewPatAppts) { MsgBox.Show(this, "Set a Web Sched New Pat Appt Type in Definitions to show appointment time slots."); } return; } //Clear the current grid rows before starting the thread below. This allows that thread to exit at any time without leaving old rows in the grid. gridWebSchedNewPatApptTimeSlots.BeginUpdate(); gridWebSchedNewPatApptTimeSlots.ListGridRows.Clear(); gridWebSchedNewPatApptTimeSlots.EndUpdate(); //Validate time slot settings. if (textWebSchedNewPatApptsDateStart.errorProvider1.GetError(textWebSchedNewPatApptsDateStart) != "") { //Don't bother warning the user. It will just be annoying. The red indicator should be sufficient. return; } if (!PrefC.HasClinicsEnabled) { comboWSNPClinics.SelectedIndex = 0; //Not visible but this will set the combo box the "N/A" which is the non-clinic signup } if (comboWSNPClinics.SelectedIndex < 0) { return; //Nothing to do. } WebServiceMainHQProxy.EServiceSetup.SignupOut.SignupOutEService signup = ((ODBoxItem <WebServiceMainHQProxy.EServiceSetup.SignupOut.SignupOutEService>)comboWSNPClinics.SelectedItem).Tag; //Protect against re-entry if (_threadFillGridWebSchedNewPatApptTimeSlots != null) { //A thread is already refreshing the time slots grid so we simply need to queue up another refresh once the one thread has finished. _isWebSchedNewPatApptTimeSlotsOutdated = true; return; } _isWebSchedNewPatApptTimeSlotsOutdated = false; _indexLastNewPatURL = comboWSNPClinics.SelectedIndex; DateTime dateStart = PIn.DateT(textWebSchedNewPatApptsDateStart.Text); DateTime dateEnd = dateStart.AddDays(30); if (!signup.IsEnabled) { return; //Do nothing, this clinic is excluded from New Pat Appts. } //Only get time slots for headquarters or clinics that are NOT excluded (aka included). var args = new { ClinicNum = signup.ClinicNum, DateStart = dateStart, DateEnd = dateStart.AddDays(30), DefApptType = comboWSNPADefApptType.GetSelected <Def>(), }; _threadFillGridWebSchedNewPatApptTimeSlots = new ODThread(new ODThread.WorkerDelegate((th) => { //The user might not have Web Sched ops set up correctly. Don't warn them here because it is just annoying. They'll figure it out. ODException.SwallowAnyException(() => { //Get the next 30 days of open time schedules with the current settings List <TimeSlot> listTimeSlots = TimeSlots.GetAvailableNewPatApptTimeSlots(args.DateStart, args.DateEnd, args.ClinicNum , args.DefApptType.DefNum); FillGridWebSchedNewPatApptTimeSlots(listTimeSlots); }); })) { Name = "ThreadWebSchedNewPatApptTimeSlots" }; _threadFillGridWebSchedNewPatApptTimeSlots.AddExitHandler(new ODThread.WorkerDelegate((th) => { _threadFillGridWebSchedNewPatApptTimeSlots = null; //If something else wanted to refresh the grid while we were busy filling it then we need to refresh again. A filter could have changed. if (_isWebSchedNewPatApptTimeSlotsOutdated) { FillGridWebSchedNewPatApptTimeSlotsThreaded(); } })); _threadFillGridWebSchedNewPatApptTimeSlots.Start(true); }