///<summary>Fixes item orders in DB if needed. Returns true if changes were made.</summary> public static bool FixItemOrders() { bool retVal = false; List <DiseaseDef> listDD = GetDeepCopy(); listDD.Sort(DiseaseDefs.SortItemOrder); for (int i = 0; i < listDD.Count; i++) { if (listDD[i].ItemOrder == i) { continue; } listDD[i].ItemOrder = i; DiseaseDefs.Update(listDD[i]); retVal = true; } if (retVal) { DiseaseDefs.RefreshCache(); } return(retVal); }
///<summary>If ClientWeb, then this method is instead run on the server, and the result passed back to the client. And since it's ClientWeb, FillCache will be run on the client.</summary> public static DataSet GetCacheDs(string itypesStr) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetDS(MethodBase.GetCurrentMethod(), itypesStr)); } //so this part below only happens if direct or server------------------------------------------------ List <int> itypes = new List <int>(); string[] strArray = itypesStr.Split(','); for (int i = 0; i < strArray.Length; i++) { itypes.Add(PIn.Int(strArray[i])); } bool isAll = false; if (itypes.Contains((int)InvalidType.AllLocal)) { isAll = true; } DataSet ds = new DataSet(); if (itypes.Contains((int)InvalidType.AccountingAutoPays) || isAll) { ds.Tables.Add(AccountingAutoPays.RefreshCache()); } if (itypes.Contains((int)InvalidType.AutoCodes) || isAll) { ds.Tables.Add(AutoCodes.RefreshCache()); ds.Tables.Add(AutoCodeItems.RefreshCache()); ds.Tables.Add(AutoCodeConds.RefreshCache()); } if (itypes.Contains((int)InvalidType.Automation) || isAll) { ds.Tables.Add(Automations.RefreshCache()); } if (itypes.Contains((int)InvalidType.AutoNotes) || isAll) { ds.Tables.Add(AutoNotes.RefreshCache()); ds.Tables.Add(AutoNoteControls.RefreshCache()); } if (itypes.Contains((int)InvalidType.Carriers) || isAll) { ds.Tables.Add(Carriers.RefreshCache()); //run on startup, after telephone reformat, after list edit. } if (itypes.Contains((int)InvalidType.ClaimForms) || isAll) { ds.Tables.Add(ClaimFormItems.RefreshCache()); ds.Tables.Add(ClaimForms.RefreshCache()); } if (itypes.Contains((int)InvalidType.ClearHouses) || isAll) { ds.Tables.Add(Clearinghouses.RefreshCache()); //kh wants to add an EasyHideClearHouses to disable this } if (itypes.Contains((int)InvalidType.Computers) || isAll) { ds.Tables.Add(Computers.RefreshCache()); ds.Tables.Add(Printers.RefreshCache()); } if (itypes.Contains((int)InvalidType.Defs) || isAll) { ds.Tables.Add(Defs.RefreshCache()); } if (itypes.Contains((int)InvalidType.DentalSchools) || isAll) { ds.Tables.Add(SchoolClasses.RefreshCache()); ds.Tables.Add(SchoolCourses.RefreshCache()); } if (itypes.Contains((int)InvalidType.DictCustoms) || isAll) { ds.Tables.Add(DictCustoms.RefreshCache()); } if (itypes.Contains((int)InvalidType.Diseases) || isAll) { ds.Tables.Add(DiseaseDefs.RefreshCache()); ds.Tables.Add(ICD9s.RefreshCache()); } if (itypes.Contains((int)InvalidType.DisplayFields) || isAll) { ds.Tables.Add(DisplayFields.RefreshCache()); } if (itypes.Contains((int)InvalidType.ElectIDs) || isAll) { ds.Tables.Add(ElectIDs.RefreshCache()); } if (itypes.Contains((int)InvalidType.Email) || isAll) { ds.Tables.Add(EmailAddresses.RefreshCache()); ds.Tables.Add(EmailTemplates.RefreshCache()); } if (itypes.Contains((int)InvalidType.Employees) || isAll) { ds.Tables.Add(Employees.RefreshCache()); ds.Tables.Add(PayPeriods.RefreshCache()); } if (itypes.Contains((int)InvalidType.Employers) || isAll) { ds.Tables.Add(Employers.RefreshCache()); } if (itypes.Contains((int)InvalidType.Fees) || isAll) { ds.Tables.Add(Fees.RefreshCache()); } if (itypes.Contains((int)InvalidType.FeeScheds) || isAll) { ds.Tables.Add(FeeScheds.RefreshCache()); } if (itypes.Contains((int)InvalidType.HL7Defs) || isAll) { ds.Tables.Add(HL7Defs.RefreshCache()); ds.Tables.Add(HL7DefMessages.RefreshCache()); ds.Tables.Add(HL7DefSegments.RefreshCache()); ds.Tables.Add(HL7DefFields.RefreshCache()); } if (itypes.Contains((int)InvalidType.InsCats) || isAll) { ds.Tables.Add(CovCats.RefreshCache()); ds.Tables.Add(CovSpans.RefreshCache()); } if (itypes.Contains((int)InvalidType.InsFilingCodes) || isAll) { ds.Tables.Add(InsFilingCodes.RefreshCache()); ds.Tables.Add(InsFilingCodeSubtypes.RefreshCache()); } if (itypes.Contains((int)InvalidType.Languages) || isAll) { if (CultureInfo.CurrentCulture.Name != "en-US") { ds.Tables.Add(Lans.RefreshCache()); } } if (itypes.Contains((int)InvalidType.Letters) || isAll) { ds.Tables.Add(Letters.RefreshCache()); } if (itypes.Contains((int)InvalidType.LetterMerge) || isAll) { ds.Tables.Add(LetterMergeFields.RefreshCache()); ds.Tables.Add(LetterMerges.RefreshCache()); } if (itypes.Contains((int)InvalidType.Operatories) || isAll) { ds.Tables.Add(Operatories.RefreshCache()); } if (itypes.Contains((int)InvalidType.PatFields) || isAll) { ds.Tables.Add(PatFieldDefs.RefreshCache()); ds.Tables.Add(ApptFieldDefs.RefreshCache()); } if (itypes.Contains((int)InvalidType.Pharmacies) || isAll) { ds.Tables.Add(Pharmacies.RefreshCache()); } if (itypes.Contains((int)InvalidType.Prefs) || isAll) { ds.Tables.Add(Prefs.RefreshCache()); } if (itypes.Contains((int)InvalidType.ProcButtons) || isAll) { ds.Tables.Add(ProcButtons.RefreshCache()); ds.Tables.Add(ProcButtonItems.RefreshCache()); } if (itypes.Contains((int)InvalidType.ProcCodes) || isAll) { ds.Tables.Add(ProcedureCodes.RefreshCache()); ds.Tables.Add(ProcCodeNotes.RefreshCache()); } if (itypes.Contains((int)InvalidType.Programs) || isAll) { ds.Tables.Add(Programs.RefreshCache()); ds.Tables.Add(ProgramProperties.RefreshCache()); } if (itypes.Contains((int)InvalidType.ProviderIdents) || isAll) { ds.Tables.Add(ProviderIdents.RefreshCache()); } if (itypes.Contains((int)InvalidType.Providers) || isAll) { ds.Tables.Add(Providers.RefreshCache()); } if (itypes.Contains((int)InvalidType.QuickPaste) || isAll) { ds.Tables.Add(QuickPasteNotes.RefreshCache()); ds.Tables.Add(QuickPasteCats.RefreshCache()); } if (itypes.Contains((int)InvalidType.RecallTypes) || isAll) { ds.Tables.Add(RecallTypes.RefreshCache()); ds.Tables.Add(RecallTriggers.RefreshCache()); } if (itypes.Contains((int)InvalidType.ReplicationServers) || isAll) { ds.Tables.Add(ReplicationServers.RefreshCache()); } if (itypes.Contains((int)InvalidType.Security) || isAll) { ds.Tables.Add(Userods.RefreshCache()); ds.Tables.Add(UserGroups.RefreshCache()); } if (itypes.Contains((int)InvalidType.Sheets) || isAll) { ds.Tables.Add(SheetDefs.RefreshCache()); ds.Tables.Add(SheetFieldDefs.RefreshCache()); } if (itypes.Contains((int)InvalidType.Signals) || isAll) { ds.Tables.Add(SigElementDefs.RefreshCache()); ds.Tables.Add(SigButDefs.RefreshCache()); //includes SigButDefElements.Refresh() } if (itypes.Contains((int)InvalidType.Sites) || isAll) { ds.Tables.Add(Sites.RefreshCache()); } if (itypes.Contains((int)InvalidType.Sops) || isAll) { ds.Tables.Add(Sops.RefreshCache()); } //InvalidTypes.Tasks not handled here. if (itypes.Contains((int)InvalidType.TimeCardRules) || isAll) { ds.Tables.Add(TimeCardRules.RefreshCache()); } if (itypes.Contains((int)InvalidType.ToolBut) || isAll) { ds.Tables.Add(ToolButItems.RefreshCache()); } if (itypes.Contains((int)InvalidType.Vaccines) || isAll) { ds.Tables.Add(VaccineDefs.RefreshCache()); ds.Tables.Add(DrugManufacturers.RefreshCache()); ds.Tables.Add(DrugUnits.RefreshCache()); } if (itypes.Contains((int)InvalidType.Views) || isAll) { ds.Tables.Add(ApptViews.RefreshCache()); ds.Tables.Add(ApptViewItems.RefreshCache()); ds.Tables.Add(AppointmentRules.RefreshCache()); ds.Tables.Add(ProcApptColors.RefreshCache()); } if (itypes.Contains((int)InvalidType.Wiki) || isAll) { ds.Tables.Add(WikiListHeaderWidths.RefreshCache()); ds.Tables.Add(WikiPages.RefreshCache()); } if (itypes.Contains((int)InvalidType.ZipCodes) || isAll) { ds.Tables.Add(ZipCodes.RefreshCache()); } return(ds); }