public void RpProcNotBilledIns_GetProcsNotBilled_MedicalInsOnly() { string suffix = MethodBase.GetCurrentMethod().Name; Patient patient = PatientT.CreatePatient(suffix); Carrier carrier = CarrierT.CreateCarrier(suffix); ProcedureCode procedureCode = ProcedureCodeT.CreateProcCode("T7782"); //Create a primary medical insurance plan InsuranceInfo insuranceInfo = InsuranceT.AddInsurance(patient, carrier.CarrierName, ordinal: 1, isMedical: true); insuranceInfo.AddBenefit(BenefitT.CreatePercentForProc(insuranceInfo.MedInsPlan.PlanNum, procedureCode.CodeNum, 80)); Procedure procedure = ProcedureT.CreateProcedure(patient, procedureCode.ProcCode, ProcStat.TP, "", 55, procDate: DateTime.Now.AddDays(-3)); ProcedureT.ComputeEstimates(patient, insuranceInfo); ProcedureT.SetComplete(procedure, patient, insuranceInfo); //Run the procs not billed report with "includeMedProcs" set to false. //The patient should not be returned due to not having any dental insurance estimates. DataTable table = RpProcNotBilledIns.GetProcsNotBilled(new List <long>(), false, DateTime.Now.AddDays(-10), DateTime.Now, false, false); Assert.IsNotNull(table); Assert.IsFalse(table.Select().Select(x => PIn.Long(x["PatNum"].ToString())).Contains(patient.PatNum)); //Run the procs not billed report with "includeMedProcs" set to true. //The patient should be returned due to the medical insurance estimates. table = RpProcNotBilledIns.GetProcsNotBilled(new List <long>(), true, DateTime.Now.AddDays(-10), DateTime.Now, false, false); Assert.IsNotNull(table); Assert.IsTrue(table.Rows.Count > 0); Assert.IsTrue(table.Select().Select(x => PIn.Long(x["PatNum"].ToString())).Contains(patient.PatNum)); }
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); }