コード例 #1
0
        public void RefreshInsurance(Patient pat, List <InsPlan> listInsPlans, List <InsSub> listInsSubs, List <PatPlan> listPatPlans, List <Benefit> listBenefits)
        {
            textFamPriMax.Text = "";
            textFamPriDed.Text = "";
            textFamSecMax.Text = "";
            textFamSecDed.Text = "";
            if (pat == null)
            {
                return;
            }
            double  maxFam = 0;
            double  maxInd = 0;
            double  dedFam = 0;
            InsPlan PlanCur;            //=new InsPlan();
            InsSub  SubCur;

            if (listPatPlans.Count > 0)
            {
                SubCur  = InsSubs.GetSub(listPatPlans[0].InsSubNum, listInsSubs);
                PlanCur = InsPlans.GetPlan(SubCur.PlanNum, listInsPlans);
                maxFam  = Benefits.GetAnnualMaxDisplay(listBenefits, PlanCur.PlanNum, listPatPlans[0].PatPlanNum, true);
                maxInd  = Benefits.GetAnnualMaxDisplay(listBenefits, PlanCur.PlanNum, listPatPlans[0].PatPlanNum, false);
                if (maxFam == -1)
                {
                    textFamPriMax.Text = "";
                }
                else
                {
                    textFamPriMax.Text = maxFam.ToString("F");
                }
                //deductible:
                dedFam = Benefits.GetDeductGeneralDisplay(listBenefits, PlanCur.PlanNum, listPatPlans[0].PatPlanNum, BenefitCoverageLevel.Family);
                if (dedFam != -1)
                {
                    textFamPriDed.Text = dedFam.ToString("F");
                }
            }
            if (listPatPlans.Count > 1)
            {
                SubCur  = InsSubs.GetSub(listPatPlans[1].InsSubNum, listInsSubs);
                PlanCur = InsPlans.GetPlan(SubCur.PlanNum, listInsPlans);
                //max=Benefits.GetAnnualMaxDisplay(listBenefits,PlanCur.PlanNum,listPatPlans[1].PatPlanNum);
                maxFam = Benefits.GetAnnualMaxDisplay(listBenefits, PlanCur.PlanNum, listPatPlans[1].PatPlanNum, true);
                maxInd = Benefits.GetAnnualMaxDisplay(listBenefits, PlanCur.PlanNum, listPatPlans[1].PatPlanNum, false);
                if (maxFam == -1)
                {
                    textFamSecMax.Text = "";
                }
                else
                {
                    textFamSecMax.Text = maxFam.ToString("F");
                }
                //deductible:
                dedFam = Benefits.GetDeductGeneralDisplay(listBenefits, PlanCur.PlanNum, listPatPlans[1].PatPlanNum, BenefitCoverageLevel.Family);
                if (dedFam != -1)
                {
                    textFamSecDed.Text = dedFam.ToString("F");
                }
            }
        }
コード例 #2
0
        public void RefreshInsurance(Patient pat, List <InsPlan> listInsPlans, List <InsSub> listInsSubs, List <PatPlan> listPatPlans, List <Benefit> listBenefits, List <ClaimProcHist> histList)
        {
            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 (pat == null)
            {
                return;
            }
            double  maxInd = 0;
            double  ded    = 0;
            double  dedFam = 0;
            double  dedRem = 0;
            double  remain = 0;
            double  pend   = 0;
            double  used   = 0;
            InsPlan isnPlanCur;            //=new InsPlan();
            InsSub  subCur;

            if (listPatPlans.Count > 0)
            {
                subCur           = InsSubs.GetSub(listPatPlans[0].InsSubNum, listInsSubs);
                isnPlanCur       = InsPlans.GetPlan(subCur.PlanNum, listInsPlans);
                pend             = InsPlans.GetPendingDisplay(histList, DateTime.Today, isnPlanCur, listPatPlans[0].PatPlanNum, -1, pat.PatNum, listPatPlans[0].InsSubNum, listBenefits);
                used             = InsPlans.GetInsUsedDisplay(histList, DateTime.Today, isnPlanCur.PlanNum, listPatPlans[0].PatPlanNum, -1, listInsPlans, listBenefits, pat.PatNum, listPatPlans[0].InsSubNum);
                textPriPend.Text = pend.ToString("F");
                textPriUsed.Text = used.ToString("F");
                maxInd           = Benefits.GetAnnualMaxDisplay(listBenefits, isnPlanCur.PlanNum, listPatPlans[0].PatPlanNum, false);
                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(listBenefits, isnPlanCur.PlanNum, listPatPlans[0].PatPlanNum, BenefitCoverageLevel.Individual);
                dedFam = Benefits.GetDeductGeneralDisplay(listBenefits, isnPlanCur.PlanNum, listPatPlans[0].PatPlanNum, BenefitCoverageLevel.Family);
                if (ded != -1)
                {
                    textPriDed.Text    = ded.ToString("F");
                    dedRem             = InsPlans.GetDedRemainDisplay(histList, DateTime.Today, isnPlanCur.PlanNum, listPatPlans[0].PatPlanNum, -1, listInsPlans, pat.PatNum, ded, dedFam);
                    textPriDedRem.Text = dedRem.ToString("F");
                }
            }
            if (listPatPlans.Count > 1)
            {
                subCur           = InsSubs.GetSub(listPatPlans[1].InsSubNum, listInsSubs);
                isnPlanCur       = InsPlans.GetPlan(subCur.PlanNum, listInsPlans);
                pend             = InsPlans.GetPendingDisplay(histList, DateTime.Today, isnPlanCur, listPatPlans[1].PatPlanNum, -1, pat.PatNum, listPatPlans[1].InsSubNum, listBenefits);
                textSecPend.Text = pend.ToString("F");
                used             = InsPlans.GetInsUsedDisplay(histList, DateTime.Today, isnPlanCur.PlanNum, listPatPlans[1].PatPlanNum, -1, listInsPlans, listBenefits, pat.PatNum, listPatPlans[1].InsSubNum);
                textSecUsed.Text = used.ToString("F");
                maxInd           = Benefits.GetAnnualMaxDisplay(listBenefits, isnPlanCur.PlanNum, listPatPlans[1].PatPlanNum, false);
                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(listBenefits, isnPlanCur.PlanNum, listPatPlans[1].PatPlanNum, BenefitCoverageLevel.Individual);
                dedFam = Benefits.GetDeductGeneralDisplay(listBenefits, isnPlanCur.PlanNum, listPatPlans[1].PatPlanNum, BenefitCoverageLevel.Family);
                if (ded != -1)
                {
                    textSecDed.Text    = ded.ToString("F");
                    dedRem             = InsPlans.GetDedRemainDisplay(histList, DateTime.Today, isnPlanCur.PlanNum, listPatPlans[1].PatPlanNum, -1, listInsPlans, pat.PatNum, ded, dedFam);
                    textSecDedRem.Text = dedRem.ToString("F");
                }
            }
        }
コード例 #3
0
ファイル: FormInsRemain.cs プロジェクト: ChemBrain/OpenDental
        ///<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");
                }
            }
        }