public async Task <IActionResult> Edit(long id, [Bind("Id,Name,Description,IdroboticEntity")] Benefits benefits) { if (id != benefits.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(benefits); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BenefitsExists(benefits.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdroboticEntity"] = new SelectList(_context.RoboticEntity, "Id", "Name", benefits.IdroboticEntity); return(View(benefits)); }
///<summary>Gets the data necessary to load FormProcEdit.</summary> public static LoadData GetLoadData(Procedure proc, Patient pat, Family fam) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetObject <LoadData>(MethodBase.GetCurrentMethod(), proc, pat, fam)); } LoadData data = new LoadData(); data.ListPatPlans = PatPlans.Refresh(pat.PatNum); if (!PatPlans.IsPatPlanListValid(data.ListPatPlans)) //PatPlans had invalid references and need to be refreshed. { data.ListPatPlans = PatPlans.Refresh(pat.PatNum); } data.ListInsSubs = InsSubs.RefreshForFam(fam); data.ListInsPlans = InsPlans.RefreshForSubList(data.ListInsSubs); data.ListClaims = Claims.Refresh(pat.PatNum); data.ListClaimProcsForProc = ClaimProcs.RefreshForProc(proc.ProcNum); data.ListBenefits = Benefits.Refresh(data.ListPatPlans, data.ListInsSubs); data.ListRefAttaches = RefAttaches.RefreshFiltered(proc.PatNum, false, proc.ProcNum); data.ArrPaySplits = PaySplits.Refresh(proc.PatNum); List <long> listPayNums = data.ArrPaySplits.Where(x => x.ProcNum == proc.ProcNum).Select(x => x.PayNum).ToList(); data.ListPaymentsForProc = Payments.GetPayments(listPayNums); data.ArrAdjustments = Adjustments.Refresh(proc.PatNum); return(data); }
public void InsPlan_GetInsUsedDisplay_OrthoProcsNotAffectInsUsed() { string suffix = "13"; Patient pat = PatientT.CreatePatient(suffix); Carrier carrier = CarrierT.CreateCarrier(suffix); InsPlan plan = InsPlanT.CreateInsPlan(carrier.CarrierNum); InsSub sub = InsSubT.CreateInsSub(pat.PatNum, plan.PlanNum); long subNum = sub.InsSubNum; PatPlan patPlan = PatPlanT.CreatePatPlan(1, pat.PatNum, subNum); BenefitT.CreateAnnualMax(plan.PlanNum, 100); BenefitT.CreateOrthoMax(plan.PlanNum, 500); BenefitT.CreateCategoryPercent(plan.PlanNum, EbenefitCategory.Diagnostic, 100); BenefitT.CreateCategoryPercent(plan.PlanNum, EbenefitCategory.Orthodontics, 100); Procedure proc1 = ProcedureT.CreateProcedure(pat, "D0140", ProcStat.C, "", 59); //limEx Procedure proc2 = ProcedureT.CreateProcedure(pat, "D8090", ProcStat.C, "", 348); //Comprehensive ortho ClaimProcT.AddInsPaid(pat.PatNum, plan.PlanNum, proc1.ProcNum, 59, subNum, 0, 0); ClaimProcT.AddInsPaid(pat.PatNum, plan.PlanNum, proc2.ProcNum, 348, subNum, 0, 0); //Lists Family fam = Patients.GetFamily(pat.PatNum); List <InsSub> subList = InsSubs.RefreshForFam(fam); List <InsPlan> planList = InsPlans.RefreshForSubList(subList); List <PatPlan> patPlans = PatPlans.Refresh(pat.PatNum); List <Benefit> benefitList = Benefits.Refresh(patPlans, subList); List <ClaimProcHist> histList = ClaimProcs.GetHistList(pat.PatNum, benefitList, patPlans, planList, DateTime.Today, subList); //Validate double insUsed = InsPlans.GetInsUsedDisplay(histList, DateTime.Today, plan.PlanNum, patPlan.PatPlanNum, -1, planList, benefitList, pat.PatNum, subNum); Assert.AreEqual(59, insUsed); }
protected void Page_Load(object sender, EventArgs e) { //menu menu.GenerateMenu("Shops"); //Tabbar Repository.Menu.HideTab(RadTabStrip1); Repository.Menu.disableControls(ShopID, Name, Pri_Address, Pri_City, Pri_State, Pri_Zip, Pri_Zip_Plus4, Sec_Address, Sec_City, Sec_State, Sec_Zip, Sec_Zip_Plus4, Pri_Phone, Pri_Fax, Pri_Email, Sec_Phone, Sec_Fax, Sec_Email, DelegateID, OLPD, OLPH, LPD, LPH, Contract_Start, Contract_End, Pri_Extn, Sec_Extn); //initialize if (!Page.IsPostBack) { Session["Sid"] = 0; Repository.Delegate.GetDelegate_cb(DelegateID); if (Request.QueryString["id"] != null) { Session["Sid"] = Request.QueryString["id"].ToString(); bool Isvalid = Repository.Shops.Select_Shop(ShopID, Name, Pri_Address, Pri_City, Pri_State, Pri_Zip, Pri_Zip_Plus4, Sec_Address, Sec_City, Sec_State, Sec_Zip, Sec_Zip_Plus4, Pri_Phone, Pri_Fax, Pri_Email, Sec_Phone, Sec_Fax, Sec_Email, DelegateID, OLPD, OLPH, LPD, LPH, Contract_Start, Contract_End, Session["Sid"].ToString(), BenefitType, Pri_Extn, Sec_Extn); BenefitType_SelectedIndexChanged(null, EventArgs.Empty); if (Isvalid) { contactgrid.Rebind(); feegrid.Rebind(); Benefits.Rebind(); } } } }
public void DeductionTest() { var benef = new Benefits(cost, discounts); var anton = new Employee { Name = "Anton" }; var deduct = benef.Deduction(anton); double result = (empCost * (1 - percent)); Assert.AreEqual(deduct, result); anton.Dependents = new List <Dependent> { new Dependent { Name = "Mary" }, new Dependent { Name = "Adam" }, }; deduct = benef.Deduction(anton); result += depCost + (depCost * (1 - percent)); Assert.AreEqual(deduct, result); }
public async Task SaveAsync(Benefits entity) { try { if (entity == null) { return; } using (var timeLineContext = _contextFactory.GetTimeLineContext()) { var entityModel = await timeLineContext .Benefits .FirstOrDefaultAsync(item => item.Id.Equals(entity.Id)); if (entityModel == null) { entityModel = new DA.Benefits(); MapForUpdateentity(entity, entityModel); await timeLineContext.Benefits.AddAsync(entityModel); } else { MapForUpdateentity(entity, entityModel); } timeLineContext.SaveChanges(); } } catch (Exception ex) { throw ex; } }
///<summary>Creates a procedure and computes estimates for a patient where the secondary insurance has a COB rule of Medicaid.</summary> private void ComputeEstimatesMedicaidCOB(string suffix, double procFee, double priAllowed, double secAllowed, int priPercentCovered, int secPercentCovered, Action <ClaimProc /*Primary*/, ClaimProc /*Secondary*/, Procedure> assertAct) { Patient pat = PatientT.CreatePatient(suffix); long ppoFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "PPO " + suffix); InsuranceT.AddInsurance(pat, suffix, "p", ppoFeeSchedNum); long medicaidFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "PPO " + suffix); InsuranceT.AddInsurance(pat, suffix, "p", medicaidFeeSchedNum, 2, cobRule: EnumCobRule.SecondaryMedicaid); List <InsSub> listSubs = InsSubT.GetInsSubs(pat); List <InsPlan> listPlans = InsPlans.RefreshForSubList(listSubs); List <PatPlan> listPatPlans = PatPlans.Refresh(pat.PatNum); InsPlan priPlan = InsPlanT.GetPlanForPriSecMed(PriSecMed.Primary, listPatPlans, listPlans, listSubs); BenefitT.CreateCategoryPercent(priPlan.PlanNum, EbenefitCategory.Diagnostic, priPercentCovered); InsPlan secPlan = InsPlanT.GetPlanForPriSecMed(PriSecMed.Secondary, listPatPlans, listPlans, listSubs); BenefitT.CreateCategoryPercent(secPlan.PlanNum, EbenefitCategory.Diagnostic, secPercentCovered); List <Benefit> listBens = Benefits.Refresh(listPatPlans, listSubs); string procStr = "D0150"; Procedure proc = ProcedureT.CreateProcedure(pat, procStr, ProcStat.TP, "", procFee); ProcedureCode procCode = ProcedureCodes.GetProcCode(procStr); FeeT.CreateFee(ppoFeeSchedNum, procCode.CodeNum, priAllowed); FeeT.CreateFee(medicaidFeeSchedNum, procCode.CodeNum, secAllowed); Procedures.ComputeEstimates(proc, pat.PatNum, new List <ClaimProc>(), false, listPlans, listPatPlans, listBens, pat.Age, listSubs); List <ClaimProc> listClaimProcs = ClaimProcs.Refresh(pat.PatNum); assertAct(listClaimProcs.FirstOrDefault(x => x.PlanNum == priPlan.PlanNum), listClaimProcs.FirstOrDefault(x => x.PlanNum == secPlan.PlanNum), proc); }
///<summary>Gets a good chunk of the data used in the TP Module.</summary> public static TPModuleData GetModuleData(long patNum, bool doMakeSecLog) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) //Remoting role check here to reduce round-trips to the server. { return(Meth.GetObject <TPModuleData>(MethodBase.GetCurrentMethod(), patNum, doMakeSecLog)); } TPModuleData tpData = new TPModuleData(); tpData.Fam = Patients.GetFamily(patNum); tpData.Pat = tpData.Fam.GetPatient(patNum); tpData.PatPlanList = PatPlans.Refresh(patNum); if (!PatPlans.IsPatPlanListValid(tpData.PatPlanList)) { //PatPlans had invalid references and need to be refreshed. tpData.PatPlanList = PatPlans.Refresh(patNum); } tpData.SubList = InsSubs.RefreshForFam(tpData.Fam); tpData.InsPlanList = InsPlans.RefreshForSubList(tpData.SubList); tpData.BenefitList = Benefits.Refresh(tpData.PatPlanList, tpData.SubList); tpData.ClaimList = Claims.Refresh(tpData.Pat.PatNum); tpData.HistList = ClaimProcs.GetHistList(tpData.Pat.PatNum, tpData.BenefitList, tpData.PatPlanList, tpData.InsPlanList, DateTime.Today, tpData.SubList); tpData.ListSubstLinks = SubstitutionLinks.GetAllForPlans(tpData.InsPlanList); TreatPlanType tpTypeCur = (tpData.Pat.DiscountPlanNum == 0?TreatPlanType.Insurance:TreatPlanType.Discount); TreatPlans.AuditPlans(patNum, tpTypeCur); tpData.ListProcedures = Procedures.Refresh(patNum); tpData.ListTreatPlans = TreatPlans.GetAllForPat(patNum); tpData.ArrProcTPs = ProcTPs.Refresh(patNum); if (doMakeSecLog) { SecurityLogs.MakeLogEntry(Permissions.TPModule, patNum, ""); } return(tpData); }
public async Task <IActionResult> Edit(int id, [Bind("BenefitsId,Date,DateEnd,Count,PointsMainId")] Benefits benefits) { if (id != benefits.BenefitsId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(benefits); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BenefitsExists(benefits.BenefitsId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["PointsMainId"] = new SelectList(_context.Set <PointsMain>(), "PointsMainId", "PointsMainId", benefits.PointsMainId); return(View(benefits)); }
///<summary>Creates a general deductible of $50, a deductible of $50 on D0220, sets a $30 D0220 complete and creates a claim, ///creates a $100 D2750, that is TP'ed, and then creates a $30 D0220 that is TP'ed.</summary> ///<param name="actAssert">The first claimproc is for the D2750 and the second claimproc is for the second D0220.</param> public void GetDeductibleByCodeDeductLessThanGeneral(string suffix, Action <ClaimProc, ClaimProc> actAssert) { Patient pat = PatientT.CreatePatient(suffix); InsuranceT.AddInsurance(pat, suffix); List <InsSub> listSubs = InsSubT.GetInsSubs(pat); List <InsPlan> listPlans = InsPlans.RefreshForSubList(listSubs); List <PatPlan> listPatPlans = PatPlans.Refresh(pat.PatNum); InsPlan plan = InsPlanT.GetPlanForPriSecMed(PriSecMed.Primary, listPatPlans, listPlans, listSubs); BenefitT.CreateDeductibleGeneral(plan.PlanNum, BenefitCoverageLevel.Individual, 50); BenefitT.CreateCategoryPercent(plan.PlanNum, EbenefitCategory.Diagnostic, 100); BenefitT.CreateCategoryPercent(plan.PlanNum, EbenefitCategory.Crowns, 50); BenefitT.CreateDeductible(plan.PlanNum, EbenefitCategory.Diagnostic, 0); BenefitT.CreateDeductible(plan.PlanNum, "D0220", 50); List <Benefit> listBens = Benefits.Refresh(listPatPlans, listSubs); Procedure proc1 = ProcedureT.CreateProcedure(pat, "D0220", ProcStat.C, "", 30);//proc1 - Intraoral - periapical first film ClaimT.CreateClaim("P", listPatPlans, listPlans, new List <ClaimProc>(), new List <Procedure> { proc1 }, pat, new List <Procedure> { proc1 }, listBens, listSubs); Procedure proc2 = ProcedureT.CreateProcedure(pat, "D2750", ProcStat.TP, "", 100, priority: 0); //proc2 - Crown Procedure proc3 = ProcedureT.CreateProcedure(pat, "D0220", ProcStat.TP, "", 30, priority: 1); //proc3 - Intraoral - periapical first film List <ClaimProc> claimProcs = ProcedureT.ComputeEstimates(pat, listPatPlans, listPlans, listSubs, listBens); ClaimProc claimProc2 = claimProcs.FirstOrDefault(x => x.ProcNum == proc2.ProcNum); ClaimProc claimProc3 = claimProcs.FirstOrDefault(x => x.ProcNum == proc3.ProcNum); actAssert(claimProc2, claimProc3); }
public async Task <IActionResult> Edit(int id, [Bind("ID,EmployeeID,Category,Dental,Vision,Health,LifeIns")] Benefits benefits) { if (id != benefits.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(benefits); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BenefitsExists(benefits.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["EmployeeID"] = new SelectList(_context.Employees, "ID", "ID", benefits.EmployeeID); return(View(benefits)); }
protected void btn_tab1_Click(object sender, EventArgs e) { bool hasValue = false; hasValue = LPD.SelectedDate.HasValue; string strLPD = (hasValue ? LPD.SelectedDate.Value.ToShortDateString() : null); hasValue = LPH.SelectedDate.HasValue; string strLPH = (hasValue ? LPH.SelectedDate.Value.ToShortDateString() : null); hasValue = Contract_Start.SelectedDate.HasValue; string strContract_Start = (hasValue ? Contract_Start.SelectedDate.Value.ToShortDateString() : null); hasValue = Contract_End.SelectedDate.HasValue; string strContract_End = (hasValue ? Contract_End.SelectedDate.Value.ToShortDateString() : null); Repository.Struct.SpResultset resultset = Repository.Shops.Shops_Add(ShopID.Text, Name.Text.ToUpper(), Pri_Address.Text.ToUpper(), Pri_City.Text.ToUpper(), Pri_State.Text.ToUpper(), Pri_Zip.Text, Pri_Zip_Plus4.Text, Sec_Address.Text.ToUpper(), Sec_City.Text.ToUpper() , Sec_State.Text.ToUpper(), Sec_Zip.Text, Sec_Zip_Plus4.Text, Pri_Phone.Text, Pri_Fax.Text, Pri_Email.Text, Sec_Phone.Text, Sec_Fax.Text, Sec_Email.Text , Convert.ToInt32(DelegateID.SelectedValue.ToString()), OLPD.Text, OLPH.Text, strLPD, strLPH, strContract_Start, strContract_End, Pri_Extn.Text, Sec_Extn.Text); if (resultset.Isresult) { btnNotes.Visible = true; Session["Sid"] = resultset.scope; contactgrid.Rebind(); feegrid.Rebind(); Benefits.Rebind(); } RadTabStrip1.Tabs[1].Selected = true; RadMultiPage1.PageViews[1].Selected = true; }
private Benefits GetBenefits() { BusinessLogic _bl = new BusinessLogic(); Benefits bene = _bl.GetBenefits(); return(bene); }
public void InsPlan_GetPendingDisplay_LimitationsOverrideGeneralLimitations() { string suffix = "31"; Patient pat = PatientT.CreatePatient(suffix); long patNum = pat.PatNum; Carrier carrier = CarrierT.CreateCarrier(suffix); InsPlan plan = InsPlanT.CreateInsPlan(carrier.CarrierNum); long planNum = plan.PlanNum; InsSub sub = InsSubT.CreateInsSub(pat.PatNum, planNum); //guarantor is subscriber long subNum = sub.InsSubNum; long patPlanNum = PatPlanT.CreatePatPlan(1, pat.PatNum, subNum).PatPlanNum; BenefitT.CreateAnnualMax(planNum, 1000); BenefitT.CreateCategoryPercent(planNum, EbenefitCategory.RoutinePreventive, 100); BenefitT.CreateLimitation(planNum, EbenefitCategory.RoutinePreventive, 1000); //Changing this amount would affect patient portion vs ins portion. But regardless of the amount, this should prevent any pending from showing in the box, which is for general pending only. Procedure proc = ProcedureT.CreateProcedure(pat, "D1110", ProcStat.C, "", 125); //Prophy //Lists List <ClaimProc> claimProcs = ClaimProcs.Refresh(pat.PatNum); Family fam = Patients.GetFamily(patNum); List <InsSub> subList = InsSubs.RefreshForFam(fam); List <InsPlan> planList = InsPlans.RefreshForSubList(subList); List <PatPlan> patPlans = PatPlans.Refresh(patNum); List <Benefit> benefitList = Benefits.Refresh(patPlans, subList); List <Procedure> ProcList = Procedures.Refresh(pat.PatNum); Claim claim = ClaimT.CreateClaim("P", patPlans, planList, claimProcs, ProcList, pat, ProcList, benefitList, subList);//Creates the claim in the same manner as the account module, including estimates and status NotReceived. List <ClaimProcHist> histList = ClaimProcs.GetHistList(patNum, benefitList, patPlans, planList, DateTime.Today, subList); //Validate Assert.AreEqual(0, InsPlans.GetPendingDisplay(histList, DateTime.Today, plan, patPlanNum, -1, patNum, subNum, benefitList)); }
public void InsPlan_GetInsUsedDisplay_LimitationsOverride() { string suffix = "6"; Patient pat = PatientT.CreatePatient(suffix); long patNum = pat.PatNum; Carrier carrier = CarrierT.CreateCarrier(suffix); InsPlan plan = InsPlanT.CreateInsPlan(carrier.CarrierNum); long planNum = plan.PlanNum; InsSub sub = InsSubT.CreateInsSub(pat.PatNum, planNum); //guarantor is subscriber long subNum = sub.InsSubNum; long patPlanNum = PatPlanT.CreatePatPlan(1, pat.PatNum, subNum).PatPlanNum; BenefitT.CreateAnnualMax(planNum, 1000); BenefitT.CreateLimitation(planNum, EbenefitCategory.Diagnostic, 1000); Procedure proc = ProcedureT.CreateProcedure(pat, "D0120", ProcStat.C, "", 50); //An exam long procNum = proc.ProcNum; Procedure proc2 = ProcedureT.CreateProcedure(pat, "D2750", ProcStat.C, "8", 830); //create a crown ClaimProcT.AddInsPaid(patNum, planNum, procNum, 50, subNum, 0, 0); ClaimProcT.AddInsPaid(patNum, planNum, proc2.ProcNum, 400, subNum, 0, 0); //Lists Family fam = Patients.GetFamily(patNum); List <InsSub> subList = InsSubs.RefreshForFam(fam); List <InsPlan> planList = InsPlans.RefreshForSubList(subList); List <PatPlan> patPlans = PatPlans.Refresh(patNum); List <Benefit> benefitList = Benefits.Refresh(patPlans, subList); List <ClaimProcHist> histList = ClaimProcs.GetHistList(patNum, benefitList, patPlans, planList, DateTime.Today, subList); //Validate double insUsed = InsPlans.GetInsUsedDisplay(histList, DateTime.Today, planNum, patPlanNum, -1, planList, benefitList, patNum, subNum); Assert.AreEqual(400, insUsed); }
protected void btn_tab4_Click(object sender, EventArgs e) { if (Session["Sid"] != null && Session["Sid"].ToString() != "0") { //update Benefit type Repository.Shops.UpdateBenefitType(BenefitType.SelectedValue.ToString(), Session["Sid"].ToString()); if (BenefitType.SelectedValue.ToString() != "0") { string Shops_Benefits = InsXMLBenefit(); if (Shops_Benefits != "") { Repository.Struct.SpResultset resultset = Repository.Shops.InsertBenefit(Shops_Benefits, Session["Sid"].ToString()); if (resultset.Isresult) { RadWindowManager.RadAlert("Information Saved!", 300, 150, "Alert", ""); } } else { Repository.Shops.NoBenefit(Session["Sid"].ToString()); RadWindowManager.RadAlert("Information Saved!", 300, 150, "Alert", ""); } } else { Repository.Shops.NoBenefit(Session["Sid"].ToString()); RadWindowManager.RadAlert("Information Saved!", 300, 150, "Alert", ""); } Benefits.Rebind(); } //RadTabStrip1.Tabs[4].Selected = true; //RadMultiPage1.PageViews[4].Selected = true; }
protected void btn_tab2_Click(object sender, EventArgs e) { if (Session["Mid"] != null && Session["Mid"].ToString() != "0") { //update Status Repository.Members.UpdateApplicableTo(ApplicableTo.SelectedValue.ToString(), Session["Mid"].ToString()); //update Benefit type Repository.Members.UpdateBenefitType(BenefitType.SelectedValue.ToString(), Session["Mid"].ToString()); string Members_Benefits = InsXMLBenefit(); if (BenefitType.SelectedValue.ToString() != "0") { if (Members_Benefits != "") { Repository.Struct.SpResultset resultset = Repository.Members.InsertBenefit(Members_Benefits, Session["Mid"].ToString()); if (resultset.Isresult) { Benefits.Rebind(); } } } RadTabStrip1.Tabs[2].Selected = true; RadMultiPage1.PageViews[2].Selected = true; } }
///<summary>Gets most of the data necessary to fill the static text fields.</summary> public static StaticTextData GetStaticTextData(Patient pat, Family fam, List <long> listProcCodeNums) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetObject <StaticTextData>(MethodBase.GetCurrentMethod(), pat, fam, listProcCodeNums)); } StaticTextData data = new StaticTextData(); data.PatNote = PatientNotes.Refresh(pat.PatNum, pat.Guarantor); data.ListRefAttaches = RefAttaches.Refresh(pat.PatNum); data.ListSubs = InsSubs.RefreshForFam(fam); data.ListPlans = InsPlans.RefreshForSubList(data.ListSubs); data.ListPatPlans = PatPlans.Refresh(pat.PatNum); data.ListBenefits = Benefits.Refresh(data.ListPatPlans, data.ListSubs); data.HistList = ClaimProcs.GetHistList(pat.PatNum, data.ListBenefits, data.ListPatPlans, data.ListPlans, DateTime.Today, data.ListSubs); data.ListTreatPlans = TreatPlans.Refresh(pat.PatNum); data.ListRecallsForFam = Recalls.GetList(fam.ListPats.Select(x => x.PatNum).ToList()); data.ListAppts = Appointments.GetListForPat(pat.PatNum); data.ListFutureApptsForFam = Appointments.GetFutureSchedApts(fam.ListPats.Select(x => x.PatNum).ToList()); data.ListDiseases = Diseases.Refresh(pat.PatNum, true); data.ListAllergies = Allergies.GetAll(pat.PatNum, false); data.ListMedicationPats = MedicationPats.Refresh(pat.PatNum, false); data.ListFamPopups = Popups.GetForFamily(pat); data.ListProceduresSome = Procedures.RefreshForProcCodeNums(pat.PatNum, listProcCodeNums); return(data); }
///<summary>Gets the data necesary to load FormApptEdit.</summary> public static LoadData GetLoadData(Appointment AptCur, bool IsNew) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetObject <LoadData>(MethodBase.GetCurrentMethod(), AptCur, IsNew)); } LoadData data = new LoadData(); data.ListProcsForAppt = Procedures.GetProcsForApptEdit(AptCur); data.ListAppointments = Appointments.GetAppointmentsForProcs(data.ListProcsForAppt); data.Family = Patients.GetFamily(AptCur.PatNum); data.ListPatPlans = PatPlans.Refresh(AptCur.PatNum); data.ListInsSubs = InsSubs.RefreshForFam(data.Family); data.ListBenefits = Benefits.Refresh(data.ListPatPlans, data.ListInsSubs); data.ListInsPlans = InsPlans.RefreshForSubList(data.ListInsSubs); data.TableApptFields = Appointments.GetApptFields(AptCur.AptNum); data.TableComms = Appointments.GetCommTable(AptCur.PatNum.ToString(), AptCur.AptNum); data.Lab = (IsNew ? null : LabCases.GetForApt(AptCur)); data.PatientTable = Appointments.GetPatTable(AptCur.PatNum.ToString()); if (!PrefC.GetBool(PrefName.EasyHideDentalSchools)) { data.ListStudents = ReqStudents.GetForAppt(AptCur.AptNum); } return(data); }
public ActionResult Costs(Benefits benefits) { List <string> dependents = new List <string>(); if (string.IsNullOrEmpty(benefits.EmployeeName)) { benefits.Message = "Please enter Employee Name"; return(View("Benefits", benefits)); } if (string.IsNullOrEmpty(benefits.Dependents) == false) { string[] separators = { ",", ".", "!", "?", ";", ":", " " }; dependents = benefits.Dependents.Split(separators, StringSplitOptions.RemoveEmptyEntries).ToList(); } decimal cost = BenefitCalculator.CalculateCost(benefits.EmployeeName, dependents); decimal grossPay = BenefitCalculator.CalculateGrossPay(); decimal netPay = grossPay - cost; benefits.GrossPayMessage = $"Gross Pay: ${grossPay}"; benefits.CostMessage = $"Cost of Benefits: ${ cost}"; benefits.NetPayMessage = $"Net Pay:${netPay}"; return(View("Benefits", benefits)); }
public ActionResult DeleteConfirmed(int id) { Benefits benefits = db.Benefits.Find(id); db.Benefits.Remove(benefits); db.SaveChanges(); return(RedirectToAction("Index")); }
public static Benefit CreateFrequencyLimitation(string procCode, byte quantity, BenefitQuantity quantityQualifier, long planNum, BenefitTimePeriod timePeriod) { Benefit ben = Benefits.CreateFrequencyBenefit(ProcedureCodes.GetCodeNum(procCode), quantity, quantityQualifier, planNum, timePeriod); Benefits.Insert(ben); return(ben); }
private static bool HasNoQualifyingBenefits(Benefits mainBenefits, Benefits partnerBenefits) { if (mainBenefits == null || partnerBenefits == null) { return(false); // can't know } return(mainBenefits.HasExistingBenefit() == YesNoDk.No && partnerBenefits.HasExistingBenefit() == YesNoDk.No); }
public PaycheckContext(EmployeeInfo employeeInfo, Earnings earnings, Deductions deductions, Taxes taxes, Benefits benefits) { EmployeeInfo = employeeInfo; Earnings = earnings; Deductions = deductions; Taxes = taxes; Benefits = benefits; }
public async Task <IActionResult> DeleteBenefit(int id) { Benefits benefit = await _repo.Get(id); _repo.RemoveBenefits(benefit); await _unitofwork.CompleteAsync(); return(Ok(id)); }
public void DiscountTest3() { var benef = new Benefits(cost, discounts); double discount = benef.Discount(new Employee { Name = "x123y" }); Assert.AreEqual(discount, percent * 3); }
public void DiscountTest4() { var benef = new Benefits(cost, discounts); double discount = benef.Discount(new Employee { Age = 78 }); Assert.AreEqual(discount, percent * 4); }
public void DiscountTest() { var benef = new Benefits(cost, discounts); double discount = benef.Discount("Anton"); Assert.AreEqual(discount, percent); discount = benef.Discount("Mary"); Assert.AreEqual(discount, 0); }
private ActionResult GuardianPartnerBenefits_Render(string formId, Benefits details) { return(NavigableView <BenefitsModel>(formId, BsgViews.Benefits, Sections.GuardianPartnerBenefits, (m, f) => { m.Title = BsgText.GuardianPartnerBenefitsTitle(); m.Question = BsgText.GuardianPartnerBenefitsQuestion(); m.Benefits = details ?? f.GuardianPartnerBenefits; })); }
private static Claim CreatePredetermination(Patient pat, List <Procedure> procList, long provTreat) { Family fam = Patients.GetFamily(pat.PatNum); List <InsSub> subList = InsSubs.RefreshForFam(fam); List <InsPlan> planList = InsPlans.RefreshForSubList(subList); List <PatPlan> patPlanList = PatPlans.Refresh(pat.PatNum); List <Benefit> benefitList = Benefits.Refresh(patPlanList, subList); List <ClaimProc> claimProcList = ClaimProcs.Refresh(pat.PatNum); List <Procedure> procsForPat = Procedures.Refresh(pat.PatNum); InsSub sub = InsSubs.GetSub(PatPlans.GetInsSubNum(patPlanList, 1), subList); InsPlan insPlan = InsPlans.GetPlan(sub.PlanNum, planList); Claim claim = new Claim(); Claims.Insert(claim); //to retreive a key for new Claim.ClaimNum claim.PatNum = pat.PatNum; claim.DateService = procList[0].ProcDate; claim.DateSent = DateTime.Today; claim.ClaimStatus = "W"; claim.InsSubNum = PatPlans.GetInsSubNum(patPlanList, 1); claim.InsSubNum2 = PatPlans.GetInsSubNum(patPlanList, 2); InsSub sub1 = InsSubs.GetSub(claim.InsSubNum, subList); InsSub sub2 = InsSubs.GetSub(claim.InsSubNum, subList); claim.PlanNum = sub1.PlanNum; claim.PlanNum2 = sub2.PlanNum; claim.PatRelat = PatPlans.GetRelat(patPlanList, 1); claim.PatRelat2 = PatPlans.GetRelat(patPlanList, 2); claim.ClaimType = "PreAuth"; claim.ProvTreat = provTreat; claim.IsProsthesis = "N"; claim.ProvBill = Providers.GetBillingProvNum(claim.ProvTreat, 0); claim.EmployRelated = YN.No; ClaimProc cp; List <Procedure> procListClaim = new List <Procedure>(); //this list will exclude lab fees for (int i = 0; i < procList.Count; i++) { if (procList[i].ProcNumLab == 0) { procListClaim.Add(procList[i]); } } for (int i = 0; i < procListClaim.Count; i++) { cp = new ClaimProc(); ClaimProcs.CreateEst(cp, procListClaim[i], insPlan, sub); cp.ClaimNum = claim.ClaimNum; cp.Status = ClaimProcStatus.NotReceived; cp.CodeSent = ProcedureCodes.GetProcCode(procListClaim[i].CodeNum).ProcCode; cp.LineNumber = (byte)(i + 1); ClaimProcs.Update(cp); } claimProcList = ClaimProcs.Refresh(pat.PatNum); ClaimL.CalculateAndUpdate(procsForPat, planList, claim, patPlanList, benefitList, pat.Age, subList); return(claim); }