예제 #1
0
        /// <summary>Creates the request number of fee schedules, clinics and providers, and creates fees for each combination and code num.</summary>
        private FeeTestArgs CreateManyFees(int numFeeScheds, int numClinics, int numProvs, string suffix)
        {
            FeeTestArgs retVal = new FeeTestArgs();

            //Set up fee schedules
            for (int i = 0; i < numFeeScheds; i++)
            {
                retVal.ListFeeSchedNums.Add(FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, suffix, false));
            }
            //Set up clinics
            Prefs.UpdateBool(PrefName.EasyNoClinics, false);
            for (int i = 0; i < numClinics; i++)
            {
                retVal.ListClinics.Add(ClinicT.CreateClinic(suffix + i));
            }
            //Set up providers
            for (int i = 0; i < numProvs; i++)
            {
                retVal.ListProvNums.Add(ProviderT.CreateProvider(suffix));
            }
            //Create the fees
            List <Fee> listFees = new List <Fee>();

            foreach (long codeNum in _listProcCodes.Select(x => x.CodeNum))
            {
                foreach (long feeSchedNum in retVal.ListFeeSchedNums)
                {
                    foreach (Clinic clinic in retVal.ListClinics)
                    {
                        foreach (long provNum in retVal.ListProvNums)
                        {
                            listFees.Add(new Fee()
                            {
                                FeeSched  = feeSchedNum,
                                ClinicNum = clinic.ClinicNum,
                                ProvNum   = provNum,
                                CodeNum   = codeNum,
                                Amount    = _defaultFeeAmt * _rand.NextDouble()
                            });
                        }
                    }
                }
            }
            Fees.InsertMany(listFees);
            retVal.ListFees = Fees.GetByFeeSchedNumsClinicNums(retVal.ListFeeSchedNums, retVal.ListClinics.Select(x => x.ClinicNum).ToList())
                              .Union(Fees.GetByFeeSchedNumsClinicNums(new List <long>()
            {
                _standardFeeSchedNum
            }, new List <long>()
            {
                0
            })).ToList();
            //create an empty feeschedule for the Insert/Update/Delete tests
            retVal.emptyFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "Empty" + suffix, false);
            return(retVal);
        }
예제 #2
0
        public void Fees_GetByFeeSchedNumsClinicNums_MiddleTier()
        {
            List <long> listFeeSchedNums = new List <long>();
            long        codeNum1         = ProcedureCodes.GetCodeNum("D1110");
            long        codeNum2         = ProcedureCodes.GetCodeNum("D1206");

            for (int i = 0; i < 300; i++)
            {
                FeeSched feeSched = FeeSchedT.GetNewFeeSched(FeeScheduleType.Normal, "FS" + i);
                FeeT.GetNewFee(feeSched.FeeSchedNum, codeNum1, 11);
                FeeT.GetNewFee(feeSched.FeeSchedNum, codeNum2, 13);
                listFeeSchedNums.Add(feeSched.FeeSchedNum);
            }
            DataAction.RunMiddleTierMock(() => {
                List <FeeLim> listFees = Fees.GetByFeeSchedNumsClinicNums(listFeeSchedNums, new List <long> {
                    0
                });
                Assert.AreEqual(600, listFees.Count);
            });
        }