public void X834_ImportInsurancePlans_ReplacePatPlan() { Patient pat = Createx834Patient(); string suffix = MethodBase.GetCurrentMethod().Name; //Create old insurance plan and associate it to them. InsuranceInfo insuranceOld = InsuranceT.AddInsurance(pat, "Old Carrier" + suffix); //Create x834 X834 x834 = new X834(new X12object(Properties.Resources.x834Test)); int createdPatsCount, updatedPatsCount, skippedPatsCount, createdCarrierCount, createdInsPlanCount, updatedInsPlanCount, createdInsSubCount, updatedInsSubCount, createdPatPlanCount, droppedPatPlanCount, updatedPatPlanCount; StringBuilder sbErrorMessages; //Pass in true for dropExistingInsurance EtransL.ImportInsurancePlans(x834, new List <Patient> { pat }, true, true, out createdPatsCount, out updatedPatsCount, out skippedPatsCount, out createdCarrierCount, out createdInsPlanCount, out updatedInsPlanCount, out createdInsSubCount, out updatedInsSubCount, out createdPatPlanCount, out droppedPatPlanCount, out updatedPatPlanCount, out sbErrorMessages); //Get the pat plans for this patient from the database. List <PatPlan> listPatPlans = PatPlans.GetPatPlansForPat(pat.PatNum); Assert.AreEqual(1, listPatPlans.Count); Assert.AreEqual(1, droppedPatPlanCount); InsSub subForPatPlan = InsSubs.GetOne(listPatPlans[0].InsSubNum); //These should be different as a new plan was created and the old plan was dropped. Assert.AreNotEqual(insuranceOld.PriInsPlan.PlanNum, subForPatPlan.PlanNum); }
public void X834_ImportInsurancePlans_ReplaceSecondaryPatPlan() { Patient pat = Createx834Patient(); string suffix = MethodBase.GetCurrentMethod().Name; //Create primary insurance plan that appears in the 834. InsuranceInfo insurancePrimary = InsuranceT.AddInsurance(pat, "Old Carrier" + suffix, subscriberID: "CG00000B"); //Create secondary insurance that does not appear in the 834. InsuranceInfo insuranceSecondary = InsuranceT.AddInsurance(pat, "Secondary Carrier" + suffix); //Get the pat plans for this patient from the database. List <PatPlan> listPatPlans = PatPlans.GetPatPlansForPat(pat.PatNum); Assert.AreEqual(2, listPatPlans.Count); //Create x834 X834 x834 = new X834(new X12object(Properties.Resources.x834Test)); int createdPatsCount, updatedPatsCount, skippedPatsCount, createdCarrierCount, createdInsPlanCount, updatedInsPlanCount, createdInsSubCount, updatedInsSubCount, createdPatPlanCount, droppedPatPlanCount, updatedPatPlanCount; StringBuilder sbErrorMessages; //Pass in true for dropExistingInsurance EtransL.ImportInsurancePlans(x834, new List <Patient> { pat }, true, true, out createdPatsCount, out updatedPatsCount, out skippedPatsCount, out createdCarrierCount, out createdInsPlanCount, out updatedInsPlanCount, out createdInsSubCount, out updatedInsSubCount, out createdPatPlanCount, out droppedPatPlanCount, out updatedPatPlanCount, out sbErrorMessages); //Get the pat plans for this patient from the database. listPatPlans = PatPlans.GetPatPlansForPat(pat.PatNum); Assert.AreEqual(1, listPatPlans.Count); Assert.AreEqual(1, droppedPatPlanCount); //These should be different as a new plan was created and the old plan was dropped. Assert.AreEqual(insurancePrimary.ListPatPlans[0].PatPlanNum, listPatPlans[0].PatPlanNum); }
public void X834_ImportInsurancePlans_DoNotReplacePatPlan() { Patient pat = Createx834Patient(); string suffix = MethodBase.GetCurrentMethod().Name; //Create old insurance plan and associate it to them. InsuranceInfo insuranceOld = InsuranceT.AddInsurance(pat, "Old Carrier" + suffix); //Create x834 X834 x834 = new X834(new X12object(Properties.Resources.x834Test)); int createdPatsCount, updatedPatsCount, skippedPatsCount, createdCarrierCount, createdInsPlanCount, updatedInsPlanCount, createdInsSubCount, updatedInsSubCount, createdPatPlanCount, droppedPatPlanCount, updatedPatPlanCount; StringBuilder sbErrorMessages; EtransL.ImportInsurancePlans(x834, new List <Patient> { pat }, true, false, out createdPatsCount, out updatedPatsCount, out skippedPatsCount, out createdCarrierCount, out createdInsPlanCount, out updatedInsPlanCount, out createdInsSubCount, out updatedInsSubCount, out createdPatPlanCount, out droppedPatPlanCount, out updatedPatPlanCount, out sbErrorMessages); //Get the pat plans for this patient from the database. List <PatPlan> listPatPlans = PatPlans.GetPatPlansForPat(pat.PatNum); //No patient was created. Should have matched the one we created. Assert.AreEqual(0, createdPatsCount); //There should be two now as the old was kept. Assert.AreEqual(2, listPatPlans.Count); Assert.AreEqual(1, createdPatPlanCount); }