public static Fee GetNewFee(long feeSchedNum, long codeNum, double amount = 0, long clinicNum = 0, long provNum = 0) { Fee fee = new Fee(); fee.CodeNum = codeNum; fee.FeeSched = feeSchedNum; fee.Amount = amount; fee.ClinicNum = clinicNum; fee.ProvNum = provNum; fee.FeeNum = Fees.Insert(fee); Fees.InvalidateFeeSchedule(fee.FeeSched); RefreshCache(); return(fee); }
public static Fee GetNewFee(long feeSchedNum, long codeNum, double amount = 0, long clinicNum = 0, long provNum = 0, bool doInsert = true) { Fee fee = new Fee(); fee.CodeNum = codeNum; fee.FeeSched = feeSchedNum; fee.Amount = amount; fee.ClinicNum = clinicNum; fee.ProvNum = provNum; if (doInsert) { fee.FeeNum = Fees.Insert(fee); } return(fee); }
public void Claims_CalculateAndUpdate_Allowed1Allowed2CompletedProcedures() { string suffix = "8"; Patient pat = PatientT.CreatePatient(suffix); long patNum = pat.PatNum; long feeSchedNum1 = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, suffix); long feeSchedNum2 = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, suffix + "b"); //Standard Fee long codeNum = ProcedureCodes.GetCodeNum("D2750"); Fee fee = Fees.GetFee(codeNum, 53, 0, 0); if (fee == null) { fee = new Fee(); fee.CodeNum = codeNum; fee.FeeSched = 53; fee.Amount = 1200; Fees.Insert(fee); } else { fee.Amount = 1200; Fees.Update(fee); } //PPO fees fee = new Fee(); fee.CodeNum = codeNum; fee.FeeSched = feeSchedNum1; fee.Amount = 600; Fees.Insert(fee); fee = new Fee(); fee.CodeNum = codeNum; fee.FeeSched = feeSchedNum2; fee.Amount = 800; Fees.Insert(fee); //Carrier Carrier carrier = CarrierT.CreateCarrier(suffix); long planNum1 = InsPlanT.CreateInsPlanPPO(carrier.CarrierNum, feeSchedNum1).PlanNum; long planNum2 = InsPlanT.CreateInsPlanPPO(carrier.CarrierNum, feeSchedNum2).PlanNum; InsSub sub1 = InsSubT.CreateInsSub(pat.PatNum, planNum1); long subNum1 = sub1.InsSubNum; InsSub sub2 = InsSubT.CreateInsSub(pat.PatNum, planNum2); long subNum2 = sub2.InsSubNum; BenefitT.CreateCategoryPercent(planNum1, EbenefitCategory.Crowns, 50); BenefitT.CreateCategoryPercent(planNum2, EbenefitCategory.Crowns, 50); BenefitT.CreateAnnualMax(planNum1, 1000); BenefitT.CreateAnnualMax(planNum2, 1000); PatPlanT.CreatePatPlan(1, patNum, subNum1); PatPlanT.CreatePatPlan(2, patNum, subNum2); Procedure proc = ProcedureT.CreateProcedure(pat, "D2750", ProcStat.TP, "8", Fees.GetAmount0(codeNum, 53)); //crown on 8 long procNum = proc.ProcNum; //Lists List <ClaimProc> claimProcs = ClaimProcs.Refresh(patNum); Family fam = Patients.GetFamily(patNum); List <InsSub> subList = InsSubs.RefreshForFam(fam); List <InsPlan> planList = InsPlans.RefreshForSubList(subList); List <PatPlan> patPlans = PatPlans.Refresh(patNum); List <Benefit> benefitList = Benefits.Refresh(patPlans, subList); List <Procedure> procList = Procedures.Refresh(patNum); //Set complete and attach to claim ProcedureT.SetComplete(proc, pat, planList, patPlans, claimProcs, benefitList, subList); claimProcs = ClaimProcs.Refresh(patNum); List <Procedure> procsForClaim = new List <Procedure>(); procsForClaim.Add(proc); Claim claim = ClaimT.CreateClaim("P", patPlans, planList, claimProcs, procList, pat, procsForClaim, benefitList, subList); //Validate Assert.AreEqual(500, claim.WriteOff); }