Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
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));
        }
Ejemplo n.º 4
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));
        }
Ejemplo n.º 5
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));
        }
Ejemplo n.º 6
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));
        }
Ejemplo n.º 7
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));
        }
Ejemplo n.º 8
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));
        }