Пример #1
0
        public void InsPlans_ComputeEstimatesForSubscriber_CanadianLabFees()
        {
            string      suffix     = MethodBase.GetCurrentMethod().Name;
            CultureInfo curCulture = CultureInfo.CurrentCulture;

            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-CA");          //Canada
            try {
                //Create a patient and treatment plan a procedure with a lab fee.
                Patient pat = PatientT.CreatePatient();
                ProcedureCodeT.AddIfNotPresent("14611");
                ProcedureCodeT.AddIfNotPresent("99111", isCanadianLab: true);
                Procedure proc    = ProcedureT.CreateProcedure(pat, "14611", ProcStat.TP, "", 250);
                Procedure procLab = ProcedureT.CreateProcedure(pat, "99111", ProcStat.TP, "", 149, procNumLab: proc.ProcNum);
                //Create a new primary insurance plan for this patient.
                //It is important that we add the insurance plan after the procedure has already been created for this particular scenario.
                Carrier carrier = CarrierT.CreateCarrier(suffix);
                InsPlan plan    = InsPlanT.CreateInsPlan(carrier.CarrierNum);
                InsSub  sub     = InsSubT.CreateInsSub(pat.PatNum, plan.PlanNum);
                PatPlan patPlan = PatPlanT.CreatePatPlan(1, pat.PatNum, sub.InsSubNum);
                //Invoking ComputeEstimatesForAll() will simulate the logic of adding a new insurance plan from the Family module.
                //The bug that this unit test is preventing is that a duplicate claimproc was being created for the lab fee.
                //This was causing a faux line to show up when a claim was created for the procedure in question.
                //It ironically doesn't matter if the procedures above are even covered by insurance because they'll get claimprocs created regardless.
                InsPlans.ComputeEstimatesForSubscriber(sub.Subscriber);
                //Check to see how many claimproc enteries there are for the current patient.  There should only be two.
                List <ClaimProc> listClaimProcs = ClaimProcs.Refresh(pat.PatNum);
                Assert.AreEqual(2, listClaimProcs.Count);
            }
            finally {
                Thread.CurrentThread.CurrentCulture = curCulture;
            }
        }
Пример #2
0
 public static void SetupClass(TestContext testContext)
 {
     //Add anything here that you want to run once before the tests in this class run.
     ProcedureCodeT.AddIfNotPresent("D0120");
     ProcedureCodeT.AddIfNotPresent("D1110");
     ProcedureCodeT.AddIfNotPresent("D0602");
     ProcedureCodeT.AddIfNotPresent("D1206");
     ProcedureCodes.RefreshCache();            //Refresh cache if the codes above were added
     _x271 = new X271(Properties.Resources.x271Test);
 }
Пример #3
0
        public void ProcedureCodes_GetProcCodesByTreatmentArea_MouthCodes()
        {
            string suffix = MethodBase.GetCurrentMethod().Name;
            List <ProcedureCode> listMouthProcCodesOld = ProcedureCodes.GetProcCodesByTreatmentArea(false, TreatmentArea.Mouth);
            int i = 0;

            do
            {
                i++;                //Add a nonexisting proc code.
            }while(!ProcedureCodeT.AddIfNotPresent("D" + i.ToString().PadLeft(4, '0')) && i < 10000);
            ProcedureCode newProc = ProcedureCodes.GetOne("D" + i.ToString().PadLeft(4, '0'));

            newProc.TreatArea = TreatmentArea.Mouth;
            newProc.Descript  = suffix;
            ProcedureCodeT.Update(newProc);
            List <ProcedureCode> listMouthProcCodesNew = ProcedureCodes.GetProcCodesByTreatmentArea(false, TreatmentArea.Mouth);

            Assert.IsFalse(listMouthProcCodesNew.Any(x => x.TreatArea != TreatmentArea.Mouth));
            Assert.IsTrue((listMouthProcCodesOld.Count + 1) == listMouthProcCodesNew.Count);
            Assert.IsTrue(listMouthProcCodesNew.Exists(x => x.CodeNum == newProc.CodeNum));
        }