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));
        }
Exemple #2
0
        public void Fees_GetListFromObjects_DiscountPlan()
        {
            string        suffix        = MethodBase.GetCurrentMethod().Name;
            ProcedureCode procedureCode = ProcedureCodeT.CreateProcCode("D1110");
            Fee           fee           = CreateSingleFee(suffix, (_defaultFeeAmt * _rand.NextDouble()), hasProv: true, codeNum: procedureCode.CodeNum);
            //Create a discount plan and associate it to the fee schedule that was just created.
            DiscountPlan discountPlan = DiscountPlanT.CreateDiscountPlan(suffix, feeSchedNum: fee.FeeSched);
            //Act like a discount plan has our fee schedule which should return the corresponding fees by GetListFromObjects().
            List <Fee> listFees = Fees.GetListFromObjects(new List <ProcedureCode>()
            {
                procedureCode
            },
                                                          null,
                                                          null,
                                                          0,
                                                          0,
                                                          0,
                                                          null,
                                                          null,
                                                          null,
                                                          null,
                                                          discountPlan.DiscountPlanNum);

            Assert.IsTrue(listFees.Exists(x => x.FeeNum == fee.FeeNum));
        }
Exemple #3
0
        public void Fees_GetListFromObjects_AppointmentProviderSecondary()
        {
            string        suffix        = MethodBase.GetCurrentMethod().Name;
            ProcedureCode procedureCode = ProcedureCodeT.CreateProcCode("D1110");
            Fee           fee           = CreateSingleFee(suffix, (_defaultFeeAmt * _rand.NextDouble()), hasProv: true, codeNum: procedureCode.CodeNum);
            //Update our new provider so that they are associated to the new fee schedule that was just created.
            Provider prov = Providers.GetProv(fee.ProvNum);

            prov.FeeSched = fee.FeeSched;
            ProviderT.Update(prov);
            //Make an appointment that has the new provider set as the secondary provider.
            Appointment appt = AppointmentT.CreateAppointment(0, DateTime.Now, 0, 0, provHyg: prov.ProvNum);
            //The fees associated to the fee schedule of the appointment's secondary provider should be returned by GetListFromObjects().
            List <Fee> listFees = Fees.GetListFromObjects(new List <ProcedureCode>()
            {
                procedureCode
            },
                                                          null,
                                                          null,
                                                          0,
                                                          0,
                                                          0,
                                                          null,
                                                          null,
                                                          new List <Appointment>()
            {
                appt
            },
                                                          null,
                                                          0);

            Assert.IsTrue(listFees.Exists(x => x.FeeNum == fee.FeeNum));
        }
Exemple #4
0
        public void Fees_GetListFromObjects_InsPlanAllowedFeeSched()
        {
            string        suffix        = MethodBase.GetCurrentMethod().Name;
            ProcedureCode procedureCode = ProcedureCodeT.CreateProcCode("D1110");
            Fee           fee           = CreateSingleFee(suffix, (_defaultFeeAmt * _rand.NextDouble()), hasProv: true, codeNum: procedureCode.CodeNum);
            //Create an insurance plan and associate the allowed fee schedule to the fee schedule that was just created.
            InsPlan insPlan = InsPlanT.CreateInsPlan(0, allowedFeeSched: fee.FeeSched);
            //Act like an ins plan has our fee schedule which should return the corresponding fees by GetListFromObjects().
            List <Fee> listFees = Fees.GetListFromObjects(new List <ProcedureCode>()
            {
                procedureCode
            },
                                                          null,
                                                          null,
                                                          0,
                                                          0,
                                                          0,
                                                          new List <InsPlan>()
            {
                insPlan
            },
                                                          null,
                                                          null,
                                                          null,
                                                          0);

            Assert.IsTrue(listFees.Exists(x => x.FeeNum == fee.FeeNum));
        }
Exemple #5
0
        public void Fees_GetListFromObjects_ProviderProcCodeDefault()
        {
            string        suffix        = MethodBase.GetCurrentMethod().Name;
            ProcedureCode procedureCode = ProcedureCodeT.CreateProcCode("D1110");
            Fee           fee           = CreateSingleFee(suffix, (_defaultFeeAmt * _rand.NextDouble()), hasProv: true, codeNum: procedureCode.CodeNum);
            //Update our new provider so that they are associated to the new fee schedule that was just created.
            Provider prov = Providers.GetProv(fee.ProvNum);

            prov.FeeSched = fee.FeeSched;
            ProviderT.Update(prov);
            //Make the default provider associated to the procedure code our new provider.
            procedureCode.ProvNumDefault = prov.ProvNum;
            ProcedureCodeT.Update(procedureCode);
            //The fees associated to the fee schedule of the procedure code's default provider should be returned by GetListFromObjects().
            List <Fee> listFees = Fees.GetListFromObjects(new List <ProcedureCode>()
            {
                procedureCode
            },
                                                          null,
                                                          null,
                                                          0,
                                                          0,
                                                          0,
                                                          null,
                                                          null,
                                                          null,
                                                          null,
                                                          0);

            Assert.IsTrue(listFees.Exists(x => x.FeeNum == fee.FeeNum));
        }
Exemple #6
0
        public void Fees_GetListFromObjects_ProviderPatientSecondary()
        {
            string        suffix        = MethodBase.GetCurrentMethod().Name;
            ProcedureCode procedureCode = ProcedureCodeT.CreateProcCode("D1110");
            Fee           fee           = CreateSingleFee(suffix, (_defaultFeeAmt * _rand.NextDouble()), hasProv: true, codeNum: procedureCode.CodeNum);
            //Update our new provider so that they are associated to the new fee schedule that was just created.
            Provider prov = Providers.GetProv(fee.ProvNum);

            prov.FeeSched = fee.FeeSched;
            ProviderT.Update(prov);
            //Act like this provider is a secondary provider of a patient which should return the fees for the provider by GetListFromObjects().
            List <Fee> listFees = Fees.GetListFromObjects(new List <ProcedureCode>()
            {
                procedureCode
            },
                                                          null,
                                                          null,
                                                          0,
                                                          prov.ProvNum,
                                                          0,
                                                          null,
                                                          null,
                                                          null,
                                                          null,
                                                          0);

            Assert.IsTrue(listFees.Exists(x => x.FeeNum == fee.FeeNum));
        }
Exemple #7
0
        public void Fees_GetListFromObjects_ProviderPracticeDefault()
        {
            string        suffix        = MethodBase.GetCurrentMethod().Name;
            ProcedureCode procedureCode = ProcedureCodeT.CreateProcCode("D1110");
            Fee           fee           = CreateSingleFee(suffix, (_defaultFeeAmt * _rand.NextDouble()), hasProv: true, codeNum: procedureCode.CodeNum);
            //Update our new provider so that they are associated to the new fee schedule that was just created.
            Provider prov = Providers.GetProv(fee.ProvNum);

            prov.FeeSched = fee.FeeSched;
            ProviderT.Update(prov);
            //Update the database so that the practice provider is the provider associated to our new fee.
            long practiceDefaultProvOld = PrefC.GetLong(PrefName.PracticeDefaultProv);

            PrefT.UpdateLong(PrefName.PracticeDefaultProv, fee.ProvNum);
            //Since our new fee is associated to the fee schedule of the practice default provider, it should be returned by GetListFromObjects().
            List <Fee> listFees = Fees.GetListFromObjects(new List <ProcedureCode>()
            {
                procedureCode
            },
                                                          null,
                                                          null,
                                                          0,
                                                          0,
                                                          0,
                                                          null,
                                                          null,
                                                          null,
                                                          null,
                                                          0);

            //Put the default provider back the way it was prior to asserting.
            PrefT.UpdateLong(PrefName.PracticeDefaultProv, practiceDefaultProvOld);
            Assert.IsTrue(listFees.Exists(x => x.FeeNum == fee.FeeNum));
        }
Exemple #8
0
        public void Fees_GetListFromObjects_ProviderFirst()
        {
            string        suffix        = MethodBase.GetCurrentMethod().Name;
            ProcedureCode procedureCode = ProcedureCodeT.CreateProcCode("D1110");
            Fee           fee           = CreateSingleFee(suffix, (_defaultFeeAmt * _rand.NextDouble()), codeNum: procedureCode.CodeNum);
            //Update the database so that provFirst is associated to the new fee schedule we just created.
            Provider provFirst = Providers.GetFirst();

            provFirst.FeeSched = fee.FeeSched;
            ProviderT.Update(provFirst);
            //Since our new fee is associated to the fee schedule of the first provider, it should be returned by GetListFromObjects().
            List <Fee> listFees = Fees.GetListFromObjects(new List <ProcedureCode>()
            {
                procedureCode
            },
                                                          null,
                                                          null,
                                                          0,
                                                          0,
                                                          0,
                                                          null,
                                                          null,
                                                          null,
                                                          null,
                                                          0);

            Assert.IsTrue(listFees.Exists(x => x.FeeNum == fee.FeeNum));
        }
        public void RpProcNotBilledIns_GetProcsNotBilled_ShowProcsBeforeIns()
        {
            string        suffix        = MethodBase.GetCurrentMethod().Name;
            Patient       patient       = PatientT.CreatePatient(suffix);
            Carrier       carrier       = CarrierT.CreateCarrier(suffix);
            ProcedureCode procedureCode = ProcedureCodeT.CreateProcCode("T7782");
            Procedure     procedure     = ProcedureT.CreateProcedure(patient, procedureCode.ProcCode, ProcStat.C, "", 55, procDate: DateTime.Now.AddDays(-3));
            //Add insurance after the procedure has been set complete.
            InsuranceInfo insuranceInfo = InsuranceT.AddInsurance(patient, carrier.CarrierName, ordinal: 1, isMedical: true);
            //The patient should not be returned when 'showProcsBeforeIns' is set to false.
            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));
            //The patient should be returned when 'showProcsBeforeIns' is set to true.
            table = RpProcNotBilledIns.GetProcsNotBilled(new List <long>(), true, DateTime.Now.AddDays(-10), DateTime.Now, true, false);
            Assert.IsNotNull(table);
            Assert.IsTrue(table.Rows.Count > 0);
            Assert.IsTrue(table.Select().Select(x => PIn.Long(x["PatNum"].ToString())).Contains(patient.PatNum));
        }
Exemple #10
0
        public void Fees_GetListFromObjects_PatientFeeSched()
        {
            string        suffix        = MethodBase.GetCurrentMethod().Name;
            ProcedureCode procedureCode = ProcedureCodeT.CreateProcCode("D1110");
            Fee           fee           = CreateSingleFee(suffix, (_defaultFeeAmt * _rand.NextDouble()), hasProv: true, codeNum: procedureCode.CodeNum);
            //Act like a patient has our fee schedule which should return the corresponding fees by GetListFromObjects().
            List <Fee> listFees = Fees.GetListFromObjects(new List <ProcedureCode>()
            {
                procedureCode
            },
                                                          null,
                                                          null,
                                                          0,
                                                          0,
                                                          fee.FeeSched,
                                                          null,
                                                          null,
                                                          null,
                                                          null,
                                                          0);

            Assert.IsTrue(listFees.Exists(x => x.FeeNum == fee.FeeNum));
        }