///<summary>All of the code from this method is copied directly from the account module, ContrAccount.FillSummary().</summary> private void FillSummary() { textFamPriMax.Text = ""; textFamPriDed.Text = ""; textFamSecMax.Text = ""; textFamSecDed.Text = ""; textPriMax.Text = ""; textPriDed.Text = ""; textPriDedRem.Text = ""; textPriUsed.Text = ""; textPriPend.Text = ""; textPriRem.Text = ""; textSecMax.Text = ""; textSecDed.Text = ""; textSecDedRem.Text = ""; textSecUsed.Text = ""; textSecPend.Text = ""; textSecRem.Text = ""; if (_patCur == null) { return; } double maxFam = 0; double maxInd = 0; double ded = 0; double dedFam = 0; double dedRem = 0; double remain = 0; double pend = 0; double used = 0; InsPlan PlanCur; InsSub SubCur; List <PatPlan> PatPlanList = PatPlans.Refresh(_patCur.PatNum); if (!PatPlans.IsPatPlanListValid(PatPlanList)) { //PatPlans had invalid references and need to be refreshed. PatPlanList = PatPlans.Refresh(_patCur.PatNum); } List <InsSub> subList = InsSubs.RefreshForFam(_famCur); List <InsPlan> InsPlanList = InsPlans.RefreshForSubList(subList); List <Benefit> BenefitList = Benefits.Refresh(PatPlanList, subList); List <Claim> ClaimList = Claims.Refresh(_patCur.PatNum); List <ClaimProcHist> HistList = ClaimProcs.GetHistList(_patCur.PatNum, BenefitList, PatPlanList, InsPlanList, DateTimeOD.Today, subList); if (PatPlanList.Count > 0) { SubCur = InsSubs.GetSub(PatPlanList[0].InsSubNum, subList); PlanCur = InsPlans.GetPlan(SubCur.PlanNum, InsPlanList); pend = InsPlans.GetPendingDisplay(HistList, DateTimeOD.Today, PlanCur, PatPlanList[0].PatPlanNum, -1, _patCur.PatNum, PatPlanList[0].InsSubNum, BenefitList); used = InsPlans.GetInsUsedDisplay(HistList, DateTimeOD.Today, PlanCur.PlanNum, PatPlanList[0].PatPlanNum, -1, InsPlanList, BenefitList, _patCur.PatNum, PatPlanList[0].InsSubNum); textPriPend.Text = pend.ToString("F"); textPriUsed.Text = used.ToString("F"); maxFam = Benefits.GetAnnualMaxDisplay(BenefitList, PlanCur.PlanNum, PatPlanList[0].PatPlanNum, true); maxInd = Benefits.GetAnnualMaxDisplay(BenefitList, PlanCur.PlanNum, PatPlanList[0].PatPlanNum, false); if (maxFam == -1) { textFamPriMax.Text = ""; } else { textFamPriMax.Text = maxFam.ToString("F"); } if (maxInd == -1) //if annual max is blank { textPriMax.Text = ""; textPriRem.Text = ""; } else { remain = maxInd - used - pend; if (remain < 0) { remain = 0; } //textFamPriMax.Text=max.ToString("F"); textPriMax.Text = maxInd.ToString("F"); textPriRem.Text = remain.ToString("F"); } //deductible: ded = Benefits.GetDeductGeneralDisplay(BenefitList, PlanCur.PlanNum, PatPlanList[0].PatPlanNum, BenefitCoverageLevel.Individual); dedFam = Benefits.GetDeductGeneralDisplay(BenefitList, PlanCur.PlanNum, PatPlanList[0].PatPlanNum, BenefitCoverageLevel.Family); if (ded != -1) { textPriDed.Text = ded.ToString("F"); dedRem = InsPlans.GetDedRemainDisplay(HistList, DateTimeOD.Today, PlanCur.PlanNum, PatPlanList[0].PatPlanNum, -1, InsPlanList, _patCur.PatNum, ded, dedFam); textPriDedRem.Text = dedRem.ToString("F"); } if (dedFam != -1) { textFamPriDed.Text = dedFam.ToString("F"); } } if (PatPlanList.Count > 1) { SubCur = InsSubs.GetSub(PatPlanList[1].InsSubNum, subList); PlanCur = InsPlans.GetPlan(SubCur.PlanNum, InsPlanList); pend = InsPlans.GetPendingDisplay(HistList, DateTimeOD.Today, PlanCur, PatPlanList[1].PatPlanNum, -1, _patCur.PatNum, PatPlanList[1].InsSubNum, BenefitList); textSecPend.Text = pend.ToString("F"); used = InsPlans.GetInsUsedDisplay(HistList, DateTimeOD.Today, PlanCur.PlanNum, PatPlanList[1].PatPlanNum, -1, InsPlanList, BenefitList, _patCur.PatNum, PatPlanList[1].InsSubNum); textSecUsed.Text = used.ToString("F"); //max=Benefits.GetAnnualMaxDisplay(BenefitList,PlanCur.PlanNum,PatPlanList[1].PatPlanNum); maxFam = Benefits.GetAnnualMaxDisplay(BenefitList, PlanCur.PlanNum, PatPlanList[1].PatPlanNum, true); maxInd = Benefits.GetAnnualMaxDisplay(BenefitList, PlanCur.PlanNum, PatPlanList[1].PatPlanNum, false); if (maxFam == -1) { textFamSecMax.Text = ""; } else { textFamSecMax.Text = maxFam.ToString("F"); } if (maxInd == -1) //if annual max is blank { textSecMax.Text = ""; textSecRem.Text = ""; } else { remain = maxInd - used - pend; if (remain < 0) { remain = 0; } //textFamSecMax.Text=max.ToString("F"); textSecMax.Text = maxInd.ToString("F"); textSecRem.Text = remain.ToString("F"); } //deductible: ded = Benefits.GetDeductGeneralDisplay(BenefitList, PlanCur.PlanNum, PatPlanList[1].PatPlanNum, BenefitCoverageLevel.Individual); dedFam = Benefits.GetDeductGeneralDisplay(BenefitList, PlanCur.PlanNum, PatPlanList[1].PatPlanNum, BenefitCoverageLevel.Family); if (ded != -1) { textSecDed.Text = ded.ToString("F"); dedRem = InsPlans.GetDedRemainDisplay(HistList, DateTimeOD.Today, PlanCur.PlanNum, PatPlanList[1].PatPlanNum, -1, InsPlanList, _patCur.PatNum, ded, dedFam); textSecDedRem.Text = dedRem.ToString("F"); } if (dedFam != -1) { textFamSecDed.Text = dedFam.ToString("F"); } } }