///<summary>Gets the data necessary to load FormProcEdit.</summary> public static LoadData GetLoadData(Procedure proc, Patient pat, Family fam) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetObject <LoadData>(MethodBase.GetCurrentMethod(), proc, pat, fam)); } LoadData data = new LoadData(); data.ListPatPlans = PatPlans.Refresh(pat.PatNum); if (!PatPlans.IsPatPlanListValid(data.ListPatPlans)) //PatPlans had invalid references and need to be refreshed. { data.ListPatPlans = PatPlans.Refresh(pat.PatNum); } data.ListInsSubs = InsSubs.RefreshForFam(fam); data.ListInsPlans = InsPlans.RefreshForSubList(data.ListInsSubs); data.ListClaims = Claims.Refresh(pat.PatNum); data.ListClaimProcsForProc = ClaimProcs.RefreshForProc(proc.ProcNum); data.ListBenefits = Benefits.Refresh(data.ListPatPlans, data.ListInsSubs); data.ListRefAttaches = RefAttaches.RefreshFiltered(proc.PatNum, false, proc.ProcNum); data.ArrPaySplits = PaySplits.Refresh(proc.PatNum); List <long> listPayNums = data.ArrPaySplits.Where(x => x.ProcNum == proc.ProcNum).Select(x => x.PayNum).ToList(); data.ListPaymentsForProc = Payments.GetPayments(listPayNums); data.ArrAdjustments = Adjustments.Refresh(proc.PatNum); data.OrthoProcedureLink = OrthoProcLinks.GetByProcNum(proc.ProcNum); return(data); }
///<summary>Gets a good chunk of the data used in the TP Module.</summary> public static TPModuleData GetModuleData(long patNum, bool doMakeSecLog) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) //Remoting role check here to reduce round-trips to the server. { return(Meth.GetObject <TPModuleData>(MethodBase.GetCurrentMethod(), patNum, doMakeSecLog)); } TPModuleData tpData = new TPModuleData(); tpData.Fam = Patients.GetFamily(patNum); tpData.Pat = tpData.Fam.GetPatient(patNum); tpData.PatPlanList = PatPlans.Refresh(patNum); if (!PatPlans.IsPatPlanListValid(tpData.PatPlanList)) { //PatPlans had invalid references and need to be refreshed. tpData.PatPlanList = PatPlans.Refresh(patNum); } tpData.SubList = InsSubs.RefreshForFam(tpData.Fam); tpData.InsPlanList = InsPlans.RefreshForSubList(tpData.SubList); tpData.BenefitList = Benefits.Refresh(tpData.PatPlanList, tpData.SubList); tpData.ClaimList = Claims.Refresh(tpData.Pat.PatNum); tpData.HistList = ClaimProcs.GetHistList(tpData.Pat.PatNum, tpData.BenefitList, tpData.PatPlanList, tpData.InsPlanList, DateTime.Today, tpData.SubList); tpData.ListSubstLinks = SubstitutionLinks.GetAllForPlans(tpData.InsPlanList); TreatPlanType tpTypeCur = (tpData.Pat.DiscountPlanNum == 0?TreatPlanType.Insurance:TreatPlanType.Discount); TreatPlans.AuditPlans(patNum, tpTypeCur); tpData.ListProcedures = Procedures.Refresh(patNum); tpData.ListTreatPlans = TreatPlans.GetAllForPat(patNum); tpData.ArrProcTPs = ProcTPs.Refresh(patNum); if (doMakeSecLog) { SecurityLogs.MakeLogEntry(Permissions.TPModule, patNum, ""); } return(tpData); }
///<summary>Gets the data necessary to load the Family Module.</summary> public static LoadData GetLoadData(long patNum, bool doCreateSecLog) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetObject <LoadData>(MethodBase.GetCurrentMethod(), patNum, doCreateSecLog)); } LoadData data = new LoadData(); data.Fam = Patients.GetFamily(patNum); data.Pat = data.Fam.GetPatient(patNum); data.ListPatPlans = PatPlans.Refresh(patNum); if (!PatPlans.IsPatPlanListValid(data.ListPatPlans)) //PatPlans had invalid references and need to be refreshed. { data.ListPatPlans = PatPlans.Refresh(patNum); } data.PatNote = PatientNotes.Refresh(patNum, data.Pat.Guarantor); data.ListInsSubs = InsSubs.RefreshForFam(data.Fam); data.ListInsPlans = InsPlans.RefreshForSubList(data.ListInsSubs); data.ListBenefits = Benefits.Refresh(data.ListPatPlans, data.ListInsSubs); data.ListRecalls = Recalls.GetList(data.Fam.ListPats.Select(x => x.PatNum).ToList()); data.ArrPatFields = PatFields.Refresh(patNum); data.SuperFamilyMembers = Patients.GetBySuperFamily(data.Pat.SuperFamily); data.SuperFamilyGuarantors = Patients.GetSuperFamilyGuarantors(data.Pat.SuperFamily); data.DictCloneSpecialities = Patients.GetClonesAndSpecialties(patNum); data.PatPict = Documents.GetPatPictFromDb(patNum); data.HasPatPict = (data.PatPict == null ? YN.No : YN.Yes); List <DisplayField> listDisplayFields = DisplayFields.GetForCategory(DisplayFieldCategory.PatientInformation); foreach (DisplayField field in listDisplayFields) { switch (field.InternalName) { case "Guardians": data.ListGuardians = Guardians.Refresh(patNum); break; case "Pat Restrictions": data.ListPatRestricts = PatRestrictions.GetAllForPat(patNum); break; case "Payor Types": data.PayorTypeDesc = PayorTypes.GetCurrentDescription(patNum); break; case "PatFields": data.ListPatFieldDefLinks = FieldDefLinks.GetForLocation(FieldLocations.Family); break; case "References": data.ListCustRefEntries = CustRefEntries.GetEntryListForCustomer(patNum); break; case "Referrals": data.ListRefAttaches = RefAttaches.Refresh(patNum); break; case "ResponsParty": if (data.Pat.ResponsParty != 0) { data.ResponsibleParty = Patients.GetLim(data.Pat.ResponsParty); } break; } } if (data.Pat.DiscountPlanNum != 0) { data.DiscountPlan = DiscountPlans.GetPlan(data.Pat.DiscountPlanNum); } data.ListMergeLinks = PatientLinks.GetLinks(data.Fam.ListPats.Select(x => x.PatNum).ToList(), PatientLinkType.Merge); if (doCreateSecLog) { SecurityLogs.MakeLogEntry(Permissions.FamilyModule, patNum, ""); } return(data); }