private void ShowShortCodes() { List <long> listClinicNums = 0L.SingleItemToList(); if (PrefC.HasClinicsEnabled) { listClinicNums.AddRange(Clinics.GetDeepCopy().Select(x => x.ClinicNum)); } groupShortCode.Visible = listClinicNums .Where(x => PatComm.IsAnyShortCodeServiceEnabled(x)) .Count() > 0; FillShortCodes(); }
private AgeOfAccount GenerateLists(List <long> listProvNums, List <long> listClinicNums, List <long> listBillingTypeDefNums) { if (!checkProvAll.Checked) { listProvNums.AddRange(listProv.SelectedIndices.OfType <int>().Select(x => _listProviders[x].ProvNum).ToList()); } if (PrefC.HasClinicsEnabled) { //if "All" is selected and the user is not restricted, show ALL clinics, including the 0 clinic. if (checkAllClin.Checked && !Security.CurUser.ClinicIsRestricted) { listClinicNums.Clear(); listClinicNums.Add(0); Clinics.GetDeepCopy().ForEach(x => listClinicNums.Add(x.ClinicNum)); } else { listClinicNums.AddRange(listClin.SelectedItems.OfType <ODBoxItem <Clinic> >().Select(x => x.Tag.ClinicNum).ToList()); } } if (!checkBillTypesAll.Checked) { for (int i = 0; i < listBillType.SelectedIndices.Count; i++) { listBillingTypeDefNums.Add(_listBillingTypeDefs[listBillType.SelectedIndices[i]].DefNum); } } AgeOfAccount accountAge = AgeOfAccount.Any; if (radioAny.Checked) { accountAge = AgeOfAccount.Any; } else if (radio30.Checked) { accountAge = AgeOfAccount.Over30; } else if (radio60.Checked) { accountAge = AgeOfAccount.Over60; } else if (radio90.Checked) { accountAge = AgeOfAccount.Over90; } return(accountAge); }
private void FillGridWebSchedNewPatApptHostedURLs() { panelHostedURLs.Controls.Clear(); List <Clinic> clinicsAll = Clinics.GetDeepCopy(); var eServiceData = WebServiceMainHQProxy.GetSignups <WebServiceMainHQProxy.EServiceSetup.SignupOut.SignupOutEService>(_signupOut, eServiceCode.WebSchedNewPatAppt) .Select(x => new { Signup = x, ClinicName = (clinicsAll.FirstOrDefault(y => y.ClinicNum == x.ClinicNum) ?? new Clinic() { Abbr = "N\\A" }).Abbr }) .Where(x => //When clinics off, only show headquarters (!PrefC.HasClinicsEnabled && x.Signup.ClinicNum == 0) || //When clinics are on, only show if not hidden. (PrefC.HasClinicsEnabled && clinicsAll.Any(y => y.ClinicNum == x.Signup.ClinicNum && !y.IsHidden)) ) //Alpha sorted .OrderBy(x => x.ClinicName); _listClinicPrefsWebSchedNewPats.Clear(); foreach (var clinic in eServiceData) { ContrNewPatHostedURL contr = new ContrNewPatHostedURL(clinic.Signup); if (!PrefC.HasClinicsEnabled || eServiceData.Count() == 1) { contr.IsExpanded = true; contr.DoHideExpandButton = true; } Lan.C(this, contr); panelHostedURLs.Controls.Add(contr); comboWSNPClinics.Items.Add(new ODBoxItem <WebServiceMainHQProxy.EServiceSetup.SignupOut.SignupOutEService>(clinic.ClinicName, clinic.Signup)); if (clinic.Signup.ClinicNum == 0) { continue; } else { AddClinicPrefToList(PrefName.WebSchedNewPatAllowChildren, clinic.Signup.ClinicNum); AddClinicPrefToList(PrefName.WebSchedNewPatVerifyInfo, clinic.Signup.ClinicNum); AddClinicPrefToList(PrefName.WebSchedNewPatDoAuthEmail, clinic.Signup.ClinicNum); AddClinicPrefToList(PrefName.WebSchedNewPatDoAuthText, clinic.Signup.ClinicNum); AddClinicPrefToList(PrefName.WebSchedNewPatWebFormsURL, clinic.Signup.ClinicNum); } } }
private void FillGridWebSchedNewPatApptHostedURLs() { List <Clinic> clinicsAll = Clinics.GetDeepCopy(); var eServiceData = WebServiceMainHQProxy.GetSignups <WebServiceMainHQProxy.EServiceSetup.SignupOut.SignupOutEService>(_signupOut, eServiceCode.WebSchedNewPatAppt) .Select(x => new { Signup = x, ClinicName = x.ClinicNum == 0 ? Lan.g(this, "Headquarters") : (clinicsAll.FirstOrDefault(y => y.ClinicNum == x.ClinicNum) ?? new Clinic() { Abbr = "N\\A" }).Abbr }) .Where(x => //Always show HQ x.Signup.ClinicNum == 0 || //If not HQ then only show if not hidden. clinicsAll.Any(y => y.ClinicNum == x.Signup.ClinicNum && !y.IsHidden) ) //HQ to the top. .OrderBy(x => x.Signup.ClinicNum != 0) //Everything else is alpha sorted. .ThenBy(x => x.ClinicName); _listClinicPrefsWebSchedNewPats.Clear(); foreach (var clinic in eServiceData) { ContrNewPatHostedURL contr = new ContrNewPatHostedURL(clinic.Signup); Lan.C(this, contr); panelHostedURLs.Controls.Add(contr); comboWSNPClinics.Items.Add(new ODBoxItem <WebServiceMainHQProxy.EServiceSetup.SignupOut.SignupOutEService>(clinic.ClinicName, clinic.Signup)); if (clinic.Signup.ClinicNum == 0) { continue; } else { AddClinicPrefToList(PrefName.WebSchedNewPatAllowChildren, clinic.Signup.ClinicNum); AddClinicPrefToList(PrefName.WebSchedNewPatVerifyInfo, clinic.Signup.ClinicNum); AddClinicPrefToList(PrefName.WebSchedNewPatDoAuthEmail, clinic.Signup.ClinicNum); AddClinicPrefToList(PrefName.WebSchedNewPatDoAuthText, clinic.Signup.ClinicNum); AddClinicPrefToList(PrefName.WebSchedNewPatWebFormsURL, clinic.Signup.ClinicNum); } } }
private void FillComboClinics() { if (PrefC.HasClinicsEnabled) { comboClinic.Items.Clear(); comboClinic.Items.Add(new ODBoxItem <Clinic>("Inherit")); //Inherit was carefully approved by Nathan (and reluctantly Allen) _listClinics = Clinics.GetDeepCopy(true); foreach (Clinic clin in _listClinics) { comboClinic.Items.Add(new ODBoxItem <Clinic>(Lan.g(this, clin.Abbr), clin)); } comboClinic.SelectedIndex = 0; } else { comboClinic.Visible = false; butPickClinic.Visible = false; labelClinic.Visible = false; } }
private void FormEhrPatientExport_Load(object sender, EventArgs e) { comboProv.Items.Add(Lan.g(this, "All")); comboProv.SelectedIndex = 0; _listProviders = Providers.GetDeepCopy(true); for (int i = 0; i < _listProviders.Count; i++) { comboProv.Items.Add(_listProviders[i].GetLongDesc()); } if (PrefC.GetBool(PrefName.EasyNoClinics)) { comboClinic.Visible = false; labelClinic.Visible = false; } else { comboClinic.Items.Add(Lan.g(this, "All")); comboClinic.SelectedIndex = 0; _listClinics = Clinics.GetDeepCopy(true); foreach (Clinic clin in _listClinics) { comboClinic.Items.Add(clin.Abbr); } } if (PrefC.GetBool(PrefName.EasyHidePublicHealth)) { comboSite.Visible = false; labelSite.Visible = false; } else { comboSite.Items.Add(Lan.g(this, "All")); comboSite.SelectedIndex = 0; _listSites = Sites.GetDeepCopy(); for (int i = 0; i < _listSites.Count; i++) { comboSite.Items.Add(_listSites[i].Description); } } }
private void FormClaimPayList_Load(object sender, EventArgs e) { textDateFrom.Text = DateTime.Now.AddDays(-10).ToShortDateString(); textDateTo.Text = DateTime.Now.ToShortDateString(); if (!PrefC.HasClinicsEnabled) { comboClinic.Visible = false; labelClinic.Visible = false; } else { comboClinic.Items.Add(Lan.g(this, "All")); comboClinic.SelectedIndex = 0; _listClinics = Clinics.GetDeepCopy(true); foreach (Clinic clin in _listClinics) { comboClinic.Items.Add(clin.Abbr); } } _listCPGroups = Defs.GetDefsForCategory(DefCat.ClaimPaymentGroups, true); FillComboPaymentGroup(); FillGrid(); }
///<summary>Fills the filter comboboxes on the "Users" tab.</summary> private void FillFilters() { foreach (UserFilters filterCur in Enum.GetValues(typeof(UserFilters))) { if (PrefC.GetBool(PrefName.EasyHideDentalSchools) && (filterCur == UserFilters.Students || filterCur == UserFilters.Instructors)) { continue; } comboShowOnly.Items.Add(new ODBoxItem <UserFilters>(Lan.g(this, filterCur.GetDescription()), filterCur)); } comboShowOnly.SelectedIndex = 0; comboSchoolClass.Items.Add(new ODBoxItem <SchoolClass>(Lan.g(this, "All"))); comboSchoolClass.SelectedIndex = 0; foreach (SchoolClass schoolClassCur in SchoolClasses.GetDeepCopy()) { comboSchoolClass.Items.Add(new ODBoxItem <SchoolClass>(SchoolClasses.GetDescript(schoolClassCur), schoolClassCur)); } if (PrefC.HasClinicsEnabled) { comboClinic.Visible = true; labelClinic.Visible = true; comboClinic.Items.Clear(); comboClinic.Items.Add(new ODBoxItem <Clinic>(Lan.g(this, "All Clinics"))); comboClinic.SelectedIndex = 0; foreach (Clinic clinicCur in Clinics.GetDeepCopy(true)) { comboClinic.Items.Add(new ODBoxItem <Clinic>(clinicCur.Abbr, clinicCur)); } } comboGroups.Items.Clear(); comboGroups.Items.Add(new ODBoxItem <UserGroup>(Lan.g(this, "All Groups"))); comboGroups.SelectedIndex = 0; foreach (UserGroup groupCur in UserGroups.GetList(IsForCEMT)) { comboGroups.Items.Add(new ODBoxItem <UserGroup>(groupCur.Description, groupCur)); } }
private void FillTabWebSchedRecall() { switch (PrefC.GetInt(PrefName.WebSchedAutomaticSendSetting)) { case (int)WebSchedAutomaticSend.DoNotSend: radioDoNotSend.Checked = true; break; case (int)WebSchedAutomaticSend.SendToEmail: radioSendToEmail.Checked = true; break; case (int)WebSchedAutomaticSend.SendToEmailNoPreferred: radioSendToEmailNoPreferred.Checked = true; break; case (int)WebSchedAutomaticSend.SendToEmailOnlyPreferred: radioSendToEmailOnlyPreferred.Checked = true; break; } switch (PrefC.GetInt(PrefName.WebSchedAutomaticSendTextSetting)) { case (int)WebSchedAutomaticSend.DoNotSend: radioDoNotSendText.Checked = true; break; case (int)WebSchedAutomaticSend.SendToText: radioSendText.Checked = true; break; } textWebSchedPerBatch.Text = PrefC.GetString(PrefName.WebSchedTextsPerBatch); textWebSchedDateStart.Text = DateTime.Today.ToShortDateString(); comboWebSchedClinic.Items.Clear(); comboWebSchedClinic.Items.Add(Lan.g(this, "Unassigned")); _listWebSchedClinics = Clinics.GetDeepCopy(); for (int i = 0; i < _listWebSchedClinics.Count; i++) { comboWebSchedClinic.Items.Add(_listWebSchedClinics[i].Abbr); } comboWebSchedClinic.SelectedIndex = 0; _listWebSchedProviders = Providers.GetDeepCopy(true); comboWebSchedProviders.Items.Clear(); comboWebSchedProviders.Items.Add(Lan.g(this, "All")); for (int i = 0; i < _listWebSchedProviders.Count; i++) { comboWebSchedProviders.Items.Add(_listWebSchedProviders[i].GetLongDesc()); } comboWebSchedProviders.SelectedIndex = 0; if (PrefC.GetBool(PrefName.EasyNoClinics)) { labelWebSchedClinic.Visible = false; comboWebSchedClinic.Visible = false; butWebSchedPickClinic.Visible = false; } FillListBoxWebSchedBlockoutTypes(PrefC.GetString(PrefName.WebSchedRecallIgnoreBlockoutTypes).Split(new char[] { ',' }), listboxWebSchedRecallIgnoreBlockoutTypes); FillGridWebSchedRecallTypes(); FillGridWebSchedOperatories(); FillGridWebSchedTimeSlotsThreaded(); listBoxWebSchedProviderPref.SelectedIndex = PrefC.GetInt(PrefName.WebSchedProviderRule); checkRecallAllowProvSelection.Checked = PrefC.GetBool(PrefName.WebSchedRecallAllowProvSelection); long defaultStatus = PrefC.GetLong(PrefName.WebSchedRecallConfirmStatus); List <Def> listDefs = Defs.GetDefsForCategory(DefCat.ApptConfirmed, true); for (int i = 0; i < listDefs.Count; i++) { int idx = comboWSRConfirmStatus.Items.Add(listDefs[i].ItemName); if (listDefs[i].DefNum == defaultStatus) { comboWSRConfirmStatus.SelectedIndex = idx; } } comboWSRConfirmStatus.IndexSelectOrSetText(listDefs.ToList().FindIndex(x => x.DefNum == defaultStatus), () => { return(defaultStatus == 0 ? "" : Defs.GetName(DefCat.ApptConfirmed, defaultStatus) + " (" + Lan.g(this, "hidden") + ")"); }); }
private void RunProdGoal() { //If adding the unearned column, need more space. Set report to landscape. if (checkAllProv.Checked) { for (int i = 0; i < listProv.Items.Count; i++) { listProv.SetSelected(i, true); } } if (checkAllClin.Checked) { for (int i = 0; i < listClin.Items.Count; i++) { listClin.SetSelected(i, true); } } _dateFrom = PIn.Date(textDateFrom.Text); _dateTo = PIn.Date(textDateTo.Text); List <Provider> listProvs = checkAllProv.Checked?_listProviders: listProv.SelectedIndices.Count > 0?listProv.SelectedIndices.OfType <int>().Select(x => _listFilteredProviders[x]).ToList():new List <Provider>(); List <Clinic> listClinics = new List <Clinic>(); List <long> listSelectedClinicNums = new List <long>(); if (PrefC.HasClinicsEnabled) { if (listClin.SelectedIndices.Count > 0) { int offset = Security.CurUser.ClinicIsRestricted?0:1; listClinics.AddRange(listClin.SelectedIndices.OfType <int>() .Select(x => offset == 1 && x == 0?new Clinic { ClinicNum = 0, Abbr = Lan.g(this, "Unassigned") }:_listClinics[x - offset])); } //Check here for multi clinic schedule overlap and give notification. listSelectedClinicNums = listClinics.Select(x => x.ClinicNum).ToList(); var listConflicts = listProvs .Select(x => new { x.Abbr, listScheds = Schedules.GetClinicOverlapsForProv(_dateFrom, _dateTo, x.ProvNum, listSelectedClinicNums) }) .Where(x => x.listScheds.Count > 0).ToList(); if (listConflicts.Count > 0) { string errorMsg = "This report is designed to show production goals by clinic and provider. You have one or more providers during the " + "specified period that are scheduled in more than one clinic at the same time. Due to this, production goals cannot be reported " + "accurately.\r\nTo run this report, please fix your scheduling so each provider is only scheduled at one clinic at a time, or select " + "different providers or clinics.\r\nIn the mean time, you can run regular production and income reports instead.\r\n\r\n" + "Conflicts:\r\n" + string.Join("\r\n", listConflicts .SelectMany(x => x.listScheds .Select(y => x.Abbr + " " + y.SchedDate.ToShortDateString() + " " + y.StartTime.ToShortTimeString() + " - " + y.StopTime.ToShortTimeString()))); MsgBoxCopyPaste msgBox = new MsgBoxCopyPaste(errorMsg); msgBox.ShowDialog(); return; } } ReportComplex report = new ReportComplex(true, false); bool hasAllClinics = checkAllClin.Checked && listSelectedClinicNums.Contains(0) && Clinics.GetDeepCopy().Select(x => x.ClinicNum).All(x => x.In(listSelectedClinicNums)); using (DataSet ds = RpProdGoal.GetData(_dateFrom, _dateTo, listProvs, listClinics, checkAllProv.Checked, hasAllClinics, GetWriteoffType())) using (DataTable dt = ds.Tables["Total"]) using (DataTable dtClinic = PrefC.HasClinicsEnabled?ds.Tables["Clinic"]:new DataTable()) using (Font font = new Font("Tahoma", 8, FontStyle.Regular)) { report.ReportName = "MonthlyP&IGoals"; report.AddTitle("Title", Lan.g(this, "Monthly Production Goal")); report.AddSubTitle("PracName", PrefC.GetString(PrefName.PracticeTitle)); report.AddSubTitle("Date", _dateFrom.ToShortDateString() + " - " + _dateTo.ToShortDateString()); report.AddSubTitle("Providers", checkAllProv.Checked?Lan.g(this, "All Providers"):listProvs.Count == 0?"":string.Join(", ", listProvs.Select(x => x.Abbr))); if (PrefC.HasClinicsEnabled) { report.AddSubTitle("Clinics", hasAllClinics?Lan.g(this, "All Clinics"):listClinics.Count == 0?"":string.Join(", ", listClinics.Select(x => x.Abbr))); } //setup query QueryObject query; if (PrefC.HasClinicsEnabled && checkClinicBreakdown.Checked) { query = report.AddQuery(dtClinic, "", "Clinic", SplitByKind.Value, 1, true); } else { query = report.AddQuery(dt, "", "", SplitByKind.None, 1, true); } // add columns to report int dateWidth = 70; int weekdayWidth = 65; int prodWidth = 90; int prodGoalWidth = 90; int schedWidth = 85; int adjWidth = 85; int writeoffWidth = 95; int writeoffestwidth = 95; int writeoffadjwidth = 70; int totProdWidth = 90; int summaryOffSetY = 30; int groups = 1; if (PrefC.HasClinicsEnabled && listClin.SelectedIndices.Count > 1 && checkClinicBreakdown.Checked) { groups = 2; } for (int i = 0; i < groups; i++) //groups will be 1 or 2 if there are clinic breakdowns { if (i > 0) //If more than one clinic selected, we want to add a table to the end of the report that totals all the clinics together { query = report.AddQuery(dt, "Totals", "", SplitByKind.None, 2, true); } query.AddColumn("Date", dateWidth, FieldValueType.String, font); query.AddColumn("Weekday", weekdayWidth, FieldValueType.String, font); query.AddColumn("Production", prodWidth, FieldValueType.Number, font); query.AddColumn("Prod Goal", prodGoalWidth, FieldValueType.Number, font); query.AddColumn("Scheduled", schedWidth, FieldValueType.Number, font); query.AddColumn("Adjusts", adjWidth, FieldValueType.Number, font); if (GetWriteoffType() == PPOWriteoffDateCalc.ClaimPayDate) { query.AddColumn("Writeoff Est", writeoffestwidth, FieldValueType.Number, font); query.AddColumn("Writeoff Adj", writeoffadjwidth, FieldValueType.Number, font); } else { query.AddColumn("Writeoff", writeoffWidth, FieldValueType.Number, font); } query.AddColumn("Tot Prod", totProdWidth, FieldValueType.Number, font); } string colNameAlign = "Writeoff" + (GetWriteoffType() == PPOWriteoffDateCalc.ClaimPayDate?" Est":"");//Column used to align the summary fields. string summaryText = "Total Production (Production + Scheduled + Adjustments - Writeoff" + (GetWriteoffType() == PPOWriteoffDateCalc.ClaimPayDate?" Ests - Writeoff Adjs":"s") + "): "; query.AddGroupSummaryField(summaryText, colNameAlign, "Tot Prod", SummaryOperation.Sum, new List <int> { groups }, Color.Black, new Font("Tahoma", 9, FontStyle.Bold), 75, summaryOffSetY); report.AddPageNum(); // execute query if (!report.SubmitQueries()) { return; } // display report using (FormReportComplex FormR = new FormReportComplex(report)) { FormR.ShowDialog(); } } }
private void FillTabWebSchedRecall() { int recallApptDays = PrefC.GetInt(PrefName.WebSchedRecallApptSearchAfterDays); textWebSchedRecallApptSearchDays.Text = recallApptDays > 0 ? recallApptDays.ToString() : ""; switch (PrefC.GetInt(PrefName.WebSchedAutomaticSendSetting)) { case (int)WebSchedAutomaticSend.DoNotSend: radioDoNotSend.Checked = true; break; case (int)WebSchedAutomaticSend.SendToEmail: radioSendToEmail.Checked = true; break; case (int)WebSchedAutomaticSend.SendToEmailNoPreferred: radioSendToEmailNoPreferred.Checked = true; break; case (int)WebSchedAutomaticSend.SendToEmailOnlyPreferred: radioSendToEmailOnlyPreferred.Checked = true; break; } switch (PrefC.GetInt(PrefName.WebSchedAutomaticSendTextSetting)) { case (int)WebSchedAutomaticSend.DoNotSend: radioDoNotSendText.Checked = true; break; case (int)WebSchedAutomaticSend.SendToText: radioSendText.Checked = true; break; } textWebSchedPerBatch.Text = PrefC.GetString(PrefName.WebSchedTextsPerBatch); textWebSchedDateStart.Text = DateTime.Today.AddDays(recallApptDays).ToShortDateString(); comboWebSchedClinic.Items.Clear(); comboWebSchedClinic.Items.Add(Lan.g(this, "Unassigned")); _listWebSchedClinics = Clinics.GetDeepCopy(); for (int i = 0; i < _listWebSchedClinics.Count; i++) { comboWebSchedClinic.Items.Add(_listWebSchedClinics[i].Abbr); } comboWebSchedClinic.SelectedIndex = 0; _listWebSchedProviders = Providers.GetDeepCopy(true); comboWebSchedProviders.Items.Clear(); comboWebSchedProviders.Items.Add(Lan.g(this, "All")); for (int i = 0; i < _listWebSchedProviders.Count; i++) { comboWebSchedProviders.Items.Add(_listWebSchedProviders[i].GetLongDesc()); } comboWebSchedProviders.SelectedIndex = 0; if (!PrefC.HasClinicsEnabled) { labelWebSchedClinic.Visible = false; comboWebSchedClinic.Visible = false; butWebSchedPickClinic.Visible = false; } FillListBoxWebSchedBlockoutTypes(PrefC.GetString(PrefName.WebSchedRecallIgnoreBlockoutTypes).Split(new char[] { ',' }), listboxWebSchedRecallIgnoreBlockoutTypes); FillGridWebSchedRecallTypes(); FillGridWebSchedOperatories(); FillGridWebSchedTimeSlotsThreaded(); FillWebSchedProviderRule(); checkRecallAllowProvSelection.Checked = PrefC.GetBool(PrefName.WebSchedRecallAllowProvSelection); long defaultStatus = PrefC.GetLong(PrefName.WebSchedRecallConfirmStatus); comboWSRConfirmStatus.Items.AddDefs(Defs.GetDefsForCategory(DefCat.ApptConfirmed, true)); comboWSRConfirmStatus.SetSelectedDefNum(defaultStatus); checkWSRDoubleBooking.Checked = PrefC.GetInt(PrefName.WebSchedRecallDoubleBooking) > 0; //0 = Allow double booking, 1 = prevent }
///<summary>Sets parameters/fills lists based on form controls.</summary> private RpAgingParamObject GetParamsFromForm() { RpAgingParamObject rpo = new RpAgingParamObject(); rpo.AsOfDate = PIn.Date(textDate.Text); if (rpo.AsOfDate.Year < 1880) { rpo.AsOfDate = DateTime.Today; } rpo.IsHistoric = (rpo.AsOfDate.Date != DateTime.Today); rpo.IsGroupByFam = radioGroupByFam.Checked; rpo.IsInsPayWoCombined = false; if (!checkBillTypesAll.Checked) { rpo.ListBillTypes = listBillType.SelectedIndices.OfType <int>().Select(x => _listBillingTypeDefs[x].DefNum).ToList(); } if (!checkProvAll.Checked) { rpo.ListProvNums = listProv.SelectedIndices.OfType <int>().Select(x => _listProviders[x].ProvNum).ToList(); } if (PrefC.HasClinicsEnabled) { //if "All" is selected and the user is not restricted, show ALL clinics, including the 0 clinic. if (checkAllClin.Checked && !Security.CurUser.ClinicIsRestricted) { rpo.ListClinicNums.Clear(); rpo.ListClinicNums.Add(0); rpo.ListClinicNums.AddRange(Clinics.GetDeepCopy().Select(x => x.ClinicNum)); } else { rpo.ListClinicNums = listClin.GetListSelected <Clinic>().Select(x => x.ClinicNum).ToList(); } } rpo.AccountAge = AgeOfAccount.Any; if (radio30.Checked) { rpo.AccountAge = AgeOfAccount.Over30; } else if (radio60.Checked) { rpo.AccountAge = AgeOfAccount.Over60; } else if (radio90.Checked) { rpo.AccountAge = AgeOfAccount.Over90; } if (checkOnlyShowPatsOutstandingClaims.Checked) { rpo.IsDetailedBreakdown = true; } rpo.GroupByCarrier = rpo.IsDetailedBreakdown; rpo.GroupByGroupName = rpo.IsDetailedBreakdown; rpo.CarrierNameFilter = textCarrier.Text; rpo.GroupNameFilter = textGroupName.Text; rpo.IsWoAged = true; rpo.IsIncludeNeg = true; rpo.IsForInsAging = true; rpo.IsIncludeInsNoBal = true; return(rpo); }
private void FormUserEdit_Load(object sender, System.EventArgs e) { checkIsHidden.Checked = UserCur.IsHidden; if (UserCur.UserNum != 0) { textUserNum.Text = UserCur.UserNum.ToString(); } textUserName.Text = UserCur.UserName; textDomainUser.Text = UserCur.DomainUser; if (!PrefC.GetBool(PrefName.DomainLoginEnabled)) { labelDomainUser.Visible = false; textDomainUser.Visible = false; butPickDomainUser.Visible = false; } checkRequireReset.Checked = UserCur.IsPasswordResetRequired; _listUserGroups = UserGroups.GetList(); _isFillingList = true; for (int i = 0; i < _listUserGroups.Count; i++) { listUserGroup.Items.Add(new ODBoxItem <UserGroup>(_listUserGroups[i].Description, _listUserGroups[i])); if (!_isFromAddUser && UserCur.IsInUserGroup(_listUserGroups[i].UserGroupNum)) { listUserGroup.SetSelected(i, true); } if (_isFromAddUser && _listUserGroups[i].UserGroupNum == PrefC.GetLong(PrefName.DefaultUserGroup)) { listUserGroup.SetSelected(i, true); } } if (listUserGroup.SelectedIndex == -1) //never allowed to delete last group, so this won't fail { listUserGroup.SelectedIndex = 0; } _isFillingList = false; securityTreeUser.FillTreePermissionsInitial(); RefreshUserTree(); listEmployee.Items.Clear(); listEmployee.Items.Add(Lan.g(this, "none")); listEmployee.SelectedIndex = 0; _listEmployees = Employees.GetDeepCopy(true); for (int i = 0; i < _listEmployees.Count; i++) { listEmployee.Items.Add(Employees.GetNameFL(_listEmployees[i])); if (UserCur.EmployeeNum == _listEmployees[i].EmployeeNum) { listEmployee.SelectedIndex = i + 1; } } listProv.Items.Clear(); listProv.Items.Add(Lan.g(this, "none")); listProv.SelectedIndex = 0; _listProviders = Providers.GetDeepCopy(true); for (int i = 0; i < _listProviders.Count; i++) { listProv.Items.Add(_listProviders[i].GetLongDesc()); if (UserCur.ProvNum == _listProviders[i].ProvNum) { listProv.SelectedIndex = i + 1; } } _listClinics = Clinics.GetDeepCopy(true); _listUserAlertTypesOld = AlertSubs.GetAllForUser(UserCur.UserNum); List <long> listSubscribedClinics; bool isAllClinicsSubscribed = false; if (_listUserAlertTypesOld.Select(x => x.ClinicNum).Contains(-1)) //User subscribed to all clinics { isAllClinicsSubscribed = true; listSubscribedClinics = _listClinics.Select(x => x.ClinicNum).Distinct().ToList(); } else { listSubscribedClinics = _listUserAlertTypesOld.Select(x => x.ClinicNum).Distinct().ToList(); } List <long> listAlertCatNums = _listUserAlertTypesOld.Select(x => x.AlertCategoryNum).Distinct().ToList(); listAlertSubMulti.Items.Clear(); _listAlertCategories = AlertCategories.GetDeepCopy(); List <long> listUserAlertCatNums = _listUserAlertTypesOld.Select(x => x.AlertCategoryNum).ToList(); foreach (AlertCategory cat in _listAlertCategories) { int index = listAlertSubMulti.Items.Add(Lan.g(this, cat.Description)); listAlertSubMulti.SetSelected(index, listUserAlertCatNums.Contains(cat.AlertCategoryNum)); } if (!PrefC.HasClinicsEnabled) { tabClinics.Enabled = false; //Disables all controls in the clinics tab. Tab is still selectable. listAlertSubsClinicsMulti.Visible = false; labelAlertClinic.Visible = false; } else { listClinic.Items.Clear(); listClinic.Items.Add(Lan.g(this, "All")); listAlertSubsClinicsMulti.Items.Add(Lan.g(this, "All")); listAlertSubsClinicsMulti.Items.Add(Lan.g(this, "Headquarters")); if (UserCur.ClinicNum == 0) //Unrestricted { listClinic.SetSelected(0, true); checkClinicIsRestricted.Enabled = false; //We don't really need this checkbox any more but it's probably better for users to keep it.... } if (isAllClinicsSubscribed) //They are subscribed to all clinics { listAlertSubsClinicsMulti.SetSelected(0, true); } else if (listSubscribedClinics.Contains(0)) //They are subscribed to Headquarters { listAlertSubsClinicsMulti.SetSelected(1, true); } List <UserClinic> listUserClinics = UserClinics.GetForUser(UserCur.UserNum); for (int i = 0; i < _listClinics.Count; i++) { listClinic.Items.Add(_listClinics[i].Abbr); listClinicMulti.Items.Add(_listClinics[i].Abbr); listAlertSubsClinicsMulti.Items.Add(_listClinics[i].Abbr); if (UserCur.ClinicNum == _listClinics[i].ClinicNum) { listClinic.SetSelected(i + 1, true); } if (UserCur.ClinicNum != 0 && listUserClinics.Exists(x => x.ClinicNum == _listClinics[i].ClinicNum)) { listClinicMulti.SetSelected(i, true); //No "All" option, don't select i+1 } if (!isAllClinicsSubscribed && _listUserAlertTypesOld.Exists(x => x.ClinicNum == _listClinics[i].ClinicNum)) { listAlertSubsClinicsMulti.SetSelected(i + 2, true); //All+HQ } } checkClinicIsRestricted.Checked = UserCur.ClinicIsRestricted; } if (string.IsNullOrEmpty(UserCur.PasswordHash)) { butPassword.Text = Lan.g(this, "Create Password"); } if (!PrefC.IsODHQ) { butJobRoles.Visible = false; } if (IsNew) { butUnlock.Visible = false; } _listDoseSpotUserPrefOld = UserOdPrefs.GetByUserAndFkeyAndFkeyType(UserCur.UserNum, Programs.GetCur(ProgramName.eRx).ProgramNum, UserOdFkeyType.Program, Clinics.GetForUserod(Security.CurUser, true).Select(x => x.ClinicNum) .Union(new List <long>() { 0 }) //Always include 0 clinic, this is the default, NOT a headquarters only value. .Distinct() .ToList()); _listDoseSpotUserPrefNew = _listDoseSpotUserPrefOld.Select(x => x.Clone()).ToList(); _doseSpotUserPrefDefault = _listDoseSpotUserPrefNew.Find(x => x.ClinicNum == 0); if (_doseSpotUserPrefDefault == null) { _doseSpotUserPrefDefault = DoseSpot.GetDoseSpotUserIdFromPref(UserCur.UserNum, 0); _listDoseSpotUserPrefNew.Add(_doseSpotUserPrefDefault); } textDoseSpotUserID.Text = _doseSpotUserPrefDefault.ValueString; if (_isFromAddUser && !Security.IsAuthorized(Permissions.SecurityAdmin, true)) { butPassword.Visible = false; checkRequireReset.Checked = true; checkRequireReset.Enabled = false; butUnlock.Visible = false; butJobRoles.Visible = false; } if (!PrefC.HasClinicsEnabled) { butDoseSpotAdditional.Visible = false; } }