public void FeeSchedTools_CopyFeeSched_Concurrency() { //Make sure there are no duplicate fees already present within the database. string dbmResult = DatabaseMaintenances.FeeDeleteDuplicates(true, DbmMode.Check); if (dbmResult.Trim() != _feeDeleteDuplicatesExpectedResult) { DatabaseMaintenances.FeeDeleteDuplicates(true, DbmMode.Fix); } //Create two fee schedules; from and to FeeSched feeSchedFrom = FeeSchedT.GetNewFeeSched(FeeScheduleType.Normal, MethodBase.GetCurrentMethod().Name + "_FROM"); FeeSched feeSchedTo = FeeSchedT.GetNewFeeSched(FeeScheduleType.Normal, MethodBase.GetCurrentMethod().Name + "_TO"); //Create a single fee and associate it to the "from" fee schedule. FeeT.CreateFee(feeSchedFrom.FeeSchedNum, _listProcCodes[_rand.Next(_listProcCodes.Count - 1)].CodeNum, _defaultFeeAmt); //Create a helper action that will simply copy the "from" schedule into the "to" schedule for the given fee cache passed in. Action actionCopyFromTo = new Action(() => { FeeScheds.CopyFeeSchedule(feeSchedFrom, 0, 0, feeSchedTo, null, 0); }); //Mimic each user clicking the "Copy" button from within the Fee Tools window one right after the other (before they click OK). actionCopyFromTo(); actionCopyFromTo(); //Make sure that there was NOT a duplicate fee inserted into the database. dbmResult = DatabaseMaintenances.FeeDeleteDuplicates(true, DbmMode.Check); Assert.AreEqual(dbmResult.Trim(), _feeDeleteDuplicatesExpectedResult, "Duplicate fees detected due to concurrent copying."); }
public void FeeSchedTools_CopyFeeSched_Clinics() { //Make sure there are no duplicate fees already present within the database. string dbmResult = DatabaseMaintenances.FeeDeleteDuplicates(true, DbmMode.Check); if (dbmResult.Trim() != _feeDeleteDuplicatesExpectedResult) { DatabaseMaintenances.FeeDeleteDuplicates(true, DbmMode.Fix); } //Make sure that there are more than six clinics ClinicT.ClearClinicTable(); for (int i = 0; i < 10; i++) { ClinicT.CreateClinic(MethodBase.GetCurrentMethod().Name + "_" + i); } //Create two fee schedules; from and to FeeSched feeSchedNumFrom = FeeSchedT.GetNewFeeSched(FeeScheduleType.Normal, MethodBase.GetCurrentMethod().Name + "_FROM"); FeeSched feeSchedNumTo = FeeSchedT.GetNewFeeSched(FeeScheduleType.Normal, MethodBase.GetCurrentMethod().Name + "_TO"); //Create a fee for every single procedure code in the database and associate it to the "from" fee schedule. foreach (ProcedureCode code in _listProcCodes) { FeeT.CreateFee(feeSchedNumFrom.FeeSchedNum, code.CodeNum, _rand.Next(5000)); } //Copy the "from" fee schedule into the "to" fee schedule and do it for at least seven clinics. FeeScheds.CopyFeeSchedule(feeSchedNumFrom, 0, 0, feeSchedNumTo, Clinics.GetDeepCopy(true).Select(x => x.ClinicNum).ToList(), 0); //Make sure that there was NOT a duplicate fee inserted into the database. dbmResult = DatabaseMaintenances.FeeDeleteDuplicates(true, DbmMode.Check); Assert.AreEqual(dbmResult.Trim(), _feeDeleteDuplicatesExpectedResult, "Duplicate fees detected due to concurrent copying."); }
///<summary>Creates a procedure and computes estimates for a patient where the secondary insurance has a COB rule of Medicaid.</summary> private void ComputeEstimatesMedicaidCOB(string suffix, double procFee, double priAllowed, double secAllowed, int priPercentCovered, int secPercentCovered, Action <ClaimProc /*Primary*/, ClaimProc /*Secondary*/, Procedure> assertAct) { Patient pat = PatientT.CreatePatient(suffix); long ppoFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "PPO " + suffix); InsuranceT.AddInsurance(pat, suffix, "p", ppoFeeSchedNum); long medicaidFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "PPO " + suffix); InsuranceT.AddInsurance(pat, suffix, "p", medicaidFeeSchedNum, 2, cobRule: EnumCobRule.SecondaryMedicaid); List <InsSub> listSubs = InsSubT.GetInsSubs(pat); List <InsPlan> listPlans = InsPlans.RefreshForSubList(listSubs); List <PatPlan> listPatPlans = PatPlans.Refresh(pat.PatNum); InsPlan priPlan = InsPlanT.GetPlanForPriSecMed(PriSecMed.Primary, listPatPlans, listPlans, listSubs); BenefitT.CreateCategoryPercent(priPlan.PlanNum, EbenefitCategory.Diagnostic, priPercentCovered); InsPlan secPlan = InsPlanT.GetPlanForPriSecMed(PriSecMed.Secondary, listPatPlans, listPlans, listSubs); BenefitT.CreateCategoryPercent(secPlan.PlanNum, EbenefitCategory.Diagnostic, secPercentCovered); List <Benefit> listBens = Benefits.Refresh(listPatPlans, listSubs); string procStr = "D0150"; Procedure proc = ProcedureT.CreateProcedure(pat, procStr, ProcStat.TP, "", procFee); ProcedureCode procCode = ProcedureCodes.GetProcCode(procStr); FeeT.CreateFee(ppoFeeSchedNum, procCode.CodeNum, priAllowed); FeeT.CreateFee(medicaidFeeSchedNum, procCode.CodeNum, secAllowed); Procedures.ComputeEstimates(proc, pat.PatNum, new List <ClaimProc>(), false, listPlans, listPatPlans, listBens, pat.Age, listSubs); List <ClaimProc> listClaimProcs = ClaimProcs.Refresh(pat.PatNum); assertAct(listClaimProcs.FirstOrDefault(x => x.PlanNum == priPlan.PlanNum), listClaimProcs.FirstOrDefault(x => x.PlanNum == secPlan.PlanNum), proc); }
public void InsPlan_PpoNoSubWriteoffsNoSub() { string suffix = MethodBase.GetCurrentMethod().Name; Patient pat = PatientT.CreatePatient(suffix); long ucrFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "UCR Fees" + suffix); long ppoFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "PPO " + suffix); InsuranceInfo ins = InsuranceT.AddInsurance(pat, suffix, planType: "p", feeSchedNum: ppoFeeSchedNum); ins.PriInsPlan.HasPpoSubstWriteoffs = false; InsPlans.Update(ins.PriInsPlan); BenefitT.CreateCategoryPercent(ins.PriInsPlan.PlanNum, EbenefitCategory.Restorative, 50); ProcedureCode originalProcCode = ProcedureCodes.GetProcCode("D2330"); ProcedureCode downgradeProcCode = ProcedureCodes.GetProcCode("D2140"); originalProcCode.SubstitutionCode = ""; //NOT substituting originalProcCode.SubstOnlyIf = SubstitutionCondition.Always; ProcedureCodeT.Update(originalProcCode); FeeT.CreateFee(ucrFeeSchedNum, originalProcCode.CodeNum, 100); FeeT.CreateFee(ucrFeeSchedNum, downgradeProcCode.CodeNum, 80); FeeT.CreateFee(ppoFeeSchedNum, originalProcCode.CodeNum, 60); FeeT.CreateFee(ppoFeeSchedNum, downgradeProcCode.CodeNum, 50); Procedure proc = ProcedureT.CreateProcedure(pat, "D2330", ProcStat.C, "9", 100);//Tooth 9 List <ClaimProc> listClaimProcs = ClaimProcs.Refresh(pat.PatNum); List <Procedure> listProcs = Procedures.Refresh(pat.PatNum); ins.RefreshBenefits(); Claim claim = ClaimT.CreateClaim("P", ins.ListPatPlans, ins.ListInsPlans, listClaimProcs, listProcs, pat, listProcs, ins.ListBenefits, ins.ListInsSubs); ClaimProc clProc = ClaimProcs.Refresh(pat.PatNum)[0]; //Should only be one Assert.AreEqual(50, clProc.Percentage); Assert.AreEqual(30, clProc.BaseEst); Assert.AreEqual(30, clProc.InsPayEst); Assert.AreEqual(40, clProc.WriteOffEst); }
///<summary>Creates a procedure and returns its procedure fee.</summary> private double GetProcFee(string suffix, bool doUseMedicalCode) { Prefs.UpdateBool(PrefName.InsPpoAlwaysUseUcrFee, true); Prefs.UpdateBool(PrefName.MedicalFeeUsedForNewProcs, doUseMedicalCode); Patient pat = PatientT.CreatePatient(suffix); long ucrFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "UCR " + suffix); FeeSchedT.UpdateUCRFeeSched(pat, ucrFeeSchedNum); long ppoFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "PPO " + suffix); InsuranceT.AddInsurance(pat, suffix, "p", ppoFeeSchedNum, 1, true); List <InsSub> listSubs = InsSubT.GetInsSubs(pat); List <InsPlan> listPlans = InsPlans.RefreshForSubList(listSubs); List <PatPlan> listPatPlans = PatPlans.Refresh(pat.PatNum); string procStr = "D0150"; string procStrMed = "D0120"; ProcedureCode procCode = ProcedureCodes.GetProcCode(procStr); ProcedureCode procCodeMed = ProcedureCodes.GetProcCode(procStrMed); procCode.MedicalCode = procCodeMed.ProcCode; FeeT.CreateFee(ucrFeeSchedNum, procCode.CodeNum, 300); FeeT.CreateFee(ppoFeeSchedNum, procCode.CodeNum, 120); FeeT.CreateFee(ucrFeeSchedNum, procCodeMed.CodeNum, 175); FeeT.CreateFee(ppoFeeSchedNum, procCodeMed.CodeNum, 85); Procedure proc = ProcedureT.CreateProcedure(pat, procStr, ProcStat.TP, "", 300); return(Procedures.GetProcFee(pat, listPatPlans, listSubs, listPlans, procCode.CodeNum, proc.ProvNum, proc.ClinicNum, procCode.MedicalCode)); }
public void FeeSchedTools_CopyFeeSched() { //Create two fee schedules; from and to FeeSched fromFeeSched = FeeSchedT.GetNewFeeSched(FeeScheduleType.Normal, MethodBase.GetCurrentMethod().Name + "_FROM"); FeeSched toFeeSched = FeeSchedT.GetNewFeeSched(FeeScheduleType.Normal, MethodBase.GetCurrentMethod().Name + "_TO"); //Create a single fee and associate it to the "from" fee schedule. long feeCodeNum = _listProcCodes[_rand.Next(_listProcCodes.Count - 1)].CodeNum; FeeT.CreateFee(fromFeeSched.FeeSchedNum, feeCodeNum, _defaultFeeAmt * _rand.NextDouble()); FeeScheds.CopyFeeSchedule(fromFeeSched, 0, 0, toFeeSched, null, 0); //Get the two fees and check that they are the same. Fee fromFee = Fees.GetFee(feeCodeNum, fromFeeSched.FeeSchedNum, 0, 0); Fee toFee = Fees.GetFee(feeCodeNum, toFeeSched.FeeSchedNum, 0, 0); Assert.AreEqual(fromFee.Amount, toFee.Amount); }
public void Claims_CalculateAndUpdate_ProcedureCodeDowngradeHigherFee() { string suffix = "61"; Patient pat = PatientT.CreatePatient(suffix); long ucrFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "UCR Fees" + suffix); long ppoFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "PPO Downgrades" + suffix); Carrier carrier = CarrierT.CreateCarrier(suffix); InsPlan plan = InsPlanT.CreateInsPlan(carrier.CarrierNum); InsSub sub = InsSubT.CreateInsSub(pat.PatNum, plan.PlanNum); long subNum = sub.InsSubNum; BenefitT.CreateCategoryPercent(plan.PlanNum, EbenefitCategory.Restorative, 100); PatPlanT.CreatePatPlan(1, pat.PatNum, subNum); ProcedureCode originalProcCode = ProcedureCodes.GetProcCode("D2391"); ProcedureCode downgradeProcCode = ProcedureCodes.GetProcCode("D2140"); originalProcCode.SubstitutionCode = "D2140"; originalProcCode.SubstOnlyIf = SubstitutionCondition.Always; ProcedureCodes.Update(originalProcCode); FeeT.CreateFee(ucrFeeSchedNum, originalProcCode.CodeNum, 140); FeeT.CreateFee(ucrFeeSchedNum, downgradeProcCode.CodeNum, 120); FeeT.CreateFee(ppoFeeSchedNum, originalProcCode.CodeNum, 80); FeeT.CreateFee(ppoFeeSchedNum, downgradeProcCode.CodeNum, 100); Procedure proc = ProcedureT.CreateProcedure(pat, "D2391", ProcStat.C, "1", 140);//Tooth 1 List <ClaimProc> claimProcs = ClaimProcs.Refresh(pat.PatNum); List <ClaimProc> claimProcListOld = new List <ClaimProc>(); Family fam = Patients.GetFamily(pat.PatNum); List <InsSub> subList = InsSubs.RefreshForFam(fam); List <InsPlan> planList = InsPlans.RefreshForSubList(subList); List <PatPlan> patPlans = PatPlans.Refresh(pat.PatNum); List <Benefit> benefitList = Benefits.Refresh(patPlans, subList); List <Procedure> ProcList = Procedures.Refresh(pat.PatNum); InsPlan insPlan = planList[0];//Should only be one InsPlan planOld = insPlan.Copy(); insPlan.PlanType = "p"; insPlan.FeeSched = ppoFeeSchedNum; InsPlans.Update(insPlan, planOld); //Creates the claim in the same manner as the account module, including estimates. Claim claim = ClaimT.CreateClaim("P", patPlans, planList, claimProcs, ProcList, pat, ProcList, benefitList, subList); ClaimProc clProc = ClaimProcs.Refresh(pat.PatNum)[0]; //Should only be one Assert.AreEqual(80, clProc.InsEstTotal); Assert.AreEqual(60, clProc.WriteOff); }
public void Fees_GetFee_ClinicSpecificFees() { Patient pat = PatientT.CreatePatient("58"); long feeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "Standard UCR", false); long codeNum = ProcedureCodes.GetCodeNum("D2750"); long clinicNum2 = ClinicT.CreateClinic("2-58").ClinicNum; long clinicNum3 = ClinicT.CreateClinic("3-58").ClinicNum; long clinicNum1 = ClinicT.CreateClinic("1-58").ClinicNum; FeeT.CreateFee(feeSchedNum, codeNum, 65, clinicNum1, 0); FeeT.CreateFee(feeSchedNum, codeNum, 70, clinicNum2, 0); FeeT.CreateFee(feeSchedNum, codeNum, 75, clinicNum3, 0); double fee1 = Fees.GetFee(codeNum, feeSchedNum, clinicNum1, 0).Amount; double fee2 = Fees.GetFee(codeNum, feeSchedNum, clinicNum2, 0).Amount; double fee3 = Fees.GetFee(codeNum, feeSchedNum, clinicNum3, 0).Amount; Assert.AreEqual(fee1, 65); Assert.AreEqual(fee2, 70); Assert.AreEqual(fee3, 75); }
public void Fees_GetFee_ProviderSpecificFees() { Patient pat = PatientT.CreatePatient("57"); long feeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "PPOInsPlan1", false); long codeNum = ProcedureCodes.GetCodeNum("D2750"); long provNum1 = ProviderT.CreateProvider("1-57"); long provNum2 = ProviderT.CreateProvider("2-57"); long provNum3 = ProviderT.CreateProvider("3-57"); FeeT.CreateFee(feeSchedNum, codeNum, 50, 0, provNum1); FeeT.CreateFee(feeSchedNum, codeNum, 55, 0, provNum2); FeeT.CreateFee(feeSchedNum, codeNum, 60, 0, provNum3); double fee1 = Fees.GetFee(codeNum, feeSchedNum, 0, provNum1).Amount; double fee2 = Fees.GetFee(codeNum, feeSchedNum, 0, provNum2).Amount; double fee3 = Fees.GetFee(codeNum, feeSchedNum, 0, provNum3).Amount; Assert.AreEqual(50, fee1); Assert.AreEqual(55, fee2); Assert.AreEqual(60, fee3); }
public void Fees_GetFee_ClinicAndProviderSpecificFees() { Patient pat = PatientT.CreatePatient("59"); long feeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "Standard", false); long codeNum = ProcedureCodes.GetCodeNum("D2750"); long provNum1 = ProviderT.CreateProvider("1-59"); long provNum2 = ProviderT.CreateProvider("2-59"); long clinicNum1 = ClinicT.CreateClinic("1-59").ClinicNum; long clinicNum2 = ClinicT.CreateClinic("2-59").ClinicNum; FeeT.CreateFee(feeSchedNum, codeNum, 80, clinicNum1, provNum1); FeeT.CreateFee(feeSchedNum, codeNum, 85, clinicNum1, provNum2); FeeT.CreateFee(feeSchedNum, codeNum, 90, clinicNum2, provNum2); double fee1 = Fees.GetFee(codeNum, feeSchedNum, clinicNum1, provNum1).Amount; double fee2 = Fees.GetFee(codeNum, feeSchedNum, clinicNum1, provNum2).Amount; double fee3 = Fees.GetFee(codeNum, feeSchedNum, clinicNum2, provNum2).Amount; Assert.AreEqual(fee1, 80); Assert.AreEqual(fee2, 85); Assert.AreEqual(fee3, 90); }
public void Procedures_ComputeEstimates_PrimaryInsuranceMedicaidCOB() { string suffix = MethodBase.GetCurrentMethod().Name; Patient pat = PatientT.CreatePatient(suffix); long ppoFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "PPO " + suffix); InsuranceInfo insInfo = InsuranceT.AddInsurance(pat, suffix, "p", ppoFeeSchedNum, 1, cobRule: EnumCobRule.SecondaryMedicaid); InsPlan priPlan = InsPlanT.GetPlanForPriSecMed(PriSecMed.Primary, insInfo.ListPatPlans, insInfo.ListInsPlans, insInfo.ListInsSubs); BenefitT.CreateCategoryPercent(priPlan.PlanNum, EbenefitCategory.Diagnostic, percent: 50); List <Benefit> listBens = Benefits.Refresh(insInfo.ListPatPlans, insInfo.ListInsSubs); string procStr = "D0150"; Procedure proc = ProcedureT.CreateProcedure(pat, procStr, ProcStat.TP, "", 125); ProcedureCode procCode = ProcedureCodes.GetProcCode(procStr); FeeT.CreateFee(ppoFeeSchedNum, procCode.CodeNum, amount: 80); Procedures.ComputeEstimates(proc, pat.PatNum, new List <ClaimProc>(), false, insInfo.ListInsPlans, insInfo.ListPatPlans, listBens, pat.Age, insInfo.ListInsSubs); List <ClaimProc> listClaimProcs = ClaimProcs.Refresh(pat.PatNum); Assert.AreEqual(40, listClaimProcs[0].InsEstTotal, 0.001); Assert.AreEqual(45, listClaimProcs[0].WriteOffEst, 0.001); }
public void Claims_CalculateAndUpdate_PreauthOrderWriteoff() { string suffix = MethodBase.GetCurrentMethod().Name; //create the patient and insurance information Patient pat = PatientT.CreatePatient(suffix); //proc - Crown Procedure proc = ProcedureT.CreateProcedure(pat, "D2750", ProcStat.C, "8", 1000); long feeSchedNum1 = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, suffix); FeeT.CreateFee(feeSchedNum1, proc.CodeNum, 900); Carrier carrier = CarrierT.CreateCarrier(suffix); InsPlan insPlan = InsPlanT.CreateInsPlanPPO(carrier.CarrierNum, feeSchedNum1); BenefitT.CreateAnnualMax(insPlan.PlanNum, 1000); BenefitT.CreateCategoryPercent(insPlan.PlanNum, EbenefitCategory.Crowns, 100); InsSub sub = InsSubT.CreateInsSub(pat.PatNum, insPlan.PlanNum); PatPlan pp = PatPlanT.CreatePatPlan(1, pat.PatNum, sub.InsSubNum); //create lists and variables required for ComputeEstimates() List <InsSub> SubList = InsSubs.RefreshForFam(Patients.GetFamily(pat.PatNum)); List <InsPlan> listInsPlan = InsPlans.RefreshForSubList(SubList); List <PatPlan> listPatPlan = PatPlans.Refresh(pat.PatNum); List <Benefit> listBenefits = Benefits.Refresh(listPatPlan, SubList); List <Procedure> listProcsForPat = Procedures.Refresh(pat.PatNum); List <Procedure> procsForClaim = new List <Procedure>(); procsForClaim.Add(proc); //Create the claim and associated claimprocs //The order of these claimprocs is the whole point of the unit test. //Create Preauth ClaimProcs.CreateEst(new ClaimProc(), proc, insPlan, sub, 0, 500, true, true); //Create Estimate ClaimProcs.CreateEst(new ClaimProc(), proc, insPlan, sub, 1000, 1000, true, false); List <ClaimProc> listClaimProcs = ClaimProcs.Refresh(pat.PatNum); Claim claimWaiting = ClaimT.CreateClaim("W", listPatPlan, listInsPlan, listClaimProcs, listProcsForPat, pat, procsForClaim, listBenefits, SubList, false); Assert.AreEqual(100, claimWaiting.WriteOff, "WriteOff Amount"); }
///<summary>Creates a procedure and computes estimates for a patient where the secondary insurance has a COB rule of Medicaid.</summary> private void ComputeEstimatesFixedBenefits(string suffix, double procFee, double ppoFee, double fixedBenefitFee , int priPercentCoveredOverride, bool hasSecondary, double secFee, Action <FixedBenefitAssertItem> assertAct) { Patient pat = PatientT.CreatePatient(suffix); string procStr = "D0150"; Procedure proc = ProcedureT.CreateProcedure(pat, procStr, ProcStat.TP, "", procFee); ProcedureCode procCode = ProcedureCodes.GetProcCode(procStr); long ppoFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "PPO " + suffix); long catPercFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "Category % " + suffix); long fixedBenefitFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.FixedBenefit, "Fixed Benefit " + suffix); if (ppoFee > -1) { FeeT.CreateFee(ppoFeeSchedNum, procCode.CodeNum, ppoFee); } FeeT.CreateFee(fixedBenefitFeeSchedNum, procCode.CodeNum, fixedBenefitFee); InsuranceT.AddInsurance(pat, suffix, "p", ppoFeeSchedNum, copayFeeSchedNum: fixedBenefitFeeSchedNum); if (hasSecondary) { FeeT.CreateFee(catPercFeeSchedNum, procCode.CodeNum, secFee); InsuranceT.AddInsurance(pat, suffix, "", catPercFeeSchedNum, 2, false, EnumCobRule.Standard); } List <InsSub> listSubs = InsSubT.GetInsSubs(pat); List <InsPlan> listPlans = InsPlans.RefreshForSubList(listSubs); List <PatPlan> listPatPlans = PatPlans.Refresh(pat.PatNum); InsPlan priPlan = InsPlanT.GetPlanForPriSecMed(PriSecMed.Primary, listPatPlans, listPlans, listSubs); InsPlan secPlan = null; if (hasSecondary) { secPlan = InsPlanT.GetPlanForPriSecMed(PriSecMed.Secondary, listPatPlans, listPlans, listSubs); //TODO: Add diagnostic code benefit for 100% BenefitT.CreateCategoryPercent(secPlan.PlanNum, EbenefitCategory.Diagnostic, 100); } List <Benefit> listBens = Benefits.Refresh(listPatPlans, listSubs); Procedures.ComputeEstimates(proc, pat.PatNum, new List <ClaimProc>(), false, listPlans, listPatPlans, listBens, pat.Age, listSubs); List <ClaimProc> listClaimProcs = ClaimProcs.Refresh(pat.PatNum); if (priPercentCoveredOverride > 0) { foreach (ClaimProc cpCur in listClaimProcs) { cpCur.PercentOverride = priPercentCoveredOverride; ClaimProcs.Update(cpCur); } Procedures.ComputeEstimates(proc, pat.PatNum, new List <ClaimProc>(), false, listPlans, listPatPlans, listBens, pat.Age, listSubs); listClaimProcs = ClaimProcs.Refresh(pat.PatNum); } foreach (ClaimProc cpCur in listClaimProcs) { cpCur.PercentOverride = priPercentCoveredOverride; ClaimProcs.Update(cpCur); } Procedures.ComputeEstimates(proc, pat.PatNum, listClaimProcs, false, listPlans, listPatPlans, listBens, pat.Age, listSubs); listClaimProcs = ClaimProcs.Refresh(pat.PatNum); assertAct(new FixedBenefitAssertItem() { Procedure = proc, PrimaryClaimProc = listClaimProcs.FirstOrDefault(x => x.PlanNum == priPlan.PlanNum), SecondaryClaimProc = secPlan == null ? null : listClaimProcs.FirstOrDefault(x => x.PlanNum == secPlan.PlanNum), }); }