Ejemplo n.º 1
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            InsPlan plan = InsPlans.GetPlan(PIn.Long(table.Rows[e.Row]["PlanNum"].ToString()), null);

            if (plan == null || plan.PlanNum == 0)
            {
                MsgBox.Show(this, "Insurance plan selected no longer exists.");
                FillGrid();
                return;
            }
            if (IsSelectMode)
            {
                SelectedPlan = plan.Copy();
                DialogResult = DialogResult.OK;
                return;
            }
            FormInsPlan FormIP = new FormInsPlan(plan, null, null);

            FormIP.ShowDialog();
            if (FormIP.DialogResult != DialogResult.OK)
            {
                return;
            }
            FillGrid();
        }
Ejemplo n.º 2
0
        public static InsuranceInfo AddInsurance(Patient pat, string carrierName, string planType = "", long feeSchedNum = 0, int ordinal = 1, bool isMedical = false,
                                                 EnumCobRule cobRule = EnumCobRule.Basic, long copayFeeSchedNum          = 0)
        {
            Carrier carrier = CarrierT.CreateCarrier(carrierName);
            InsPlan plan    = InsPlanT.CreateInsPlan(carrier.CarrierNum, cobRule);
            InsPlan planOld = plan.Copy();

            plan.PlanType      = planType;
            plan.FeeSched      = feeSchedNum;
            plan.IsMedical     = isMedical;
            plan.CopayFeeSched = copayFeeSchedNum;
            InsPlans.Update(plan, planOld);
            InsSub  sub     = InsSubT.CreateInsSub(pat.PatNum, plan.PlanNum);
            PatPlan patPlan = PatPlanT.CreatePatPlan((byte)ordinal, pat.PatNum, sub.InsSubNum);

            return(new InsuranceInfo {
                ListCarriers = new List <Carrier> {
                    carrier
                },
                ListInsPlans = new List <InsPlan> {
                    plan
                },
                ListInsSubs = new List <InsSub> {
                    sub
                },
                ListPatPlans = new List <PatPlan> {
                    patPlan
                },
            });
        }
Ejemplo n.º 3
0
        public void Claims_CalculateAndUpdate_ProcedureCodeDowngradeHigherFee()
        {
            string  suffix         = "61";
            Patient pat            = PatientT.CreatePatient(suffix);
            long    ucrFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "UCR Fees" + suffix);
            long    ppoFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "PPO Downgrades" + suffix);
            Carrier carrier        = CarrierT.CreateCarrier(suffix);
            InsPlan plan           = InsPlanT.CreateInsPlan(carrier.CarrierNum);
            InsSub  sub            = InsSubT.CreateInsSub(pat.PatNum, plan.PlanNum);
            long    subNum         = sub.InsSubNum;

            BenefitT.CreateCategoryPercent(plan.PlanNum, EbenefitCategory.Restorative, 100);
            PatPlanT.CreatePatPlan(1, pat.PatNum, subNum);
            ProcedureCode originalProcCode  = ProcedureCodes.GetProcCode("D2391");
            ProcedureCode downgradeProcCode = ProcedureCodes.GetProcCode("D2140");

            originalProcCode.SubstitutionCode = "D2140";
            originalProcCode.SubstOnlyIf      = SubstitutionCondition.Always;
            ProcedureCodes.Update(originalProcCode);
            FeeT.CreateFee(ucrFeeSchedNum, originalProcCode.CodeNum, 140);
            FeeT.CreateFee(ucrFeeSchedNum, downgradeProcCode.CodeNum, 120);
            FeeT.CreateFee(ppoFeeSchedNum, originalProcCode.CodeNum, 80);
            FeeT.CreateFee(ppoFeeSchedNum, downgradeProcCode.CodeNum, 100);
            Procedure        proc             = ProcedureT.CreateProcedure(pat, "D2391", ProcStat.C, "1", 140);//Tooth 1
            List <ClaimProc> claimProcs       = ClaimProcs.Refresh(pat.PatNum);
            List <ClaimProc> claimProcListOld = new List <ClaimProc>();
            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 <Procedure> ProcList    = Procedures.Refresh(pat.PatNum);
            InsPlan          insPlan     = planList[0];//Should only be one
            InsPlan          planOld     = insPlan.Copy();

            insPlan.PlanType = "p";
            insPlan.FeeSched = ppoFeeSchedNum;
            InsPlans.Update(insPlan, planOld);
            //Creates the claim in the same manner as the account module, including estimates.
            Claim     claim  = ClaimT.CreateClaim("P", patPlans, planList, claimProcs, ProcList, pat, ProcList, benefitList, subList);
            ClaimProc clProc = ClaimProcs.Refresh(pat.PatNum)[0];          //Should only be one

            Assert.AreEqual(80, clProc.InsEstTotal);
            Assert.AreEqual(60, clProc.WriteOff);
        }
Ejemplo n.º 4
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            InsPlan plan = InsPlans.GetPlan(PIn.Long(table.Rows[e.Row]["PlanNum"].ToString()), null);

            if (IsSelectMode)
            {
                SelectedPlan = plan.Copy();
                DialogResult = DialogResult.OK;
                return;
            }
            FormInsPlan FormIP = new FormInsPlan(plan, null, null);

            FormIP.ShowDialog();
            if (FormIP.DialogResult != DialogResult.OK)
            {
                return;
            }
            FillGrid();
        }
Ejemplo n.º 5
0
        public void AddInsurance(Patient pat, string carrierName, string planType = "", long feeSchedNum = 0, int ordinal    = 1, bool isMedical      = false,
                                 EnumCobRule cobRule         = EnumCobRule.Basic, long copayFeeSchedNum  = 0, int monthRenew = 0, string subscriberID = "1234",
                                 ExclusionRule exclusionRule = ExclusionRule.PracticeDefault)
        {
            Carrier carrier = CarrierT.CreateCarrier(carrierName);
            InsPlan plan    = InsPlanT.CreateInsPlan(carrier.CarrierNum, cobRule);
            InsPlan planOld = plan.Copy();

            plan.PlanType         = planType;
            plan.MonthRenew       = (byte)monthRenew;
            plan.FeeSched         = feeSchedNum;
            plan.IsMedical        = isMedical;
            plan.CopayFeeSched    = copayFeeSchedNum;
            plan.ExclusionFeeRule = exclusionRule;
            InsPlans.Update(plan, planOld);
            InsSub  sub     = InsSubT.CreateInsSub(pat.PatNum, plan.PlanNum, subscriberID);
            PatPlan patPlan = PatPlanT.CreatePatPlan((byte)ordinal, pat.PatNum, sub.InsSubNum);

            ListCarriers.Add(carrier);
            ListInsPlans.Add(plan);
            ListInsSubs.Add(sub);
            ListPatPlans.Add(patPlan);
            Pat = pat;
        }
Ejemplo n.º 6
0
        ///<summary>Returns number of subscribers affected.  Can throw an exception if user clicks cancel in a note box.</summary>
        private static int ProcessTrojanPlan(string trojanPlan, bool updateBenefits, bool updateNoteAutomatic)
        {
            TrojanObject troj    = ProcessTextToObject(trojanPlan);
            Carrier      carrier = new Carrier();

            carrier.Phone       = troj.ELIGPHONE;
            carrier.ElectID     = troj.PAYERID;
            carrier.CarrierName = troj.MAILTO;
            carrier.Address     = troj.MAILTOST;
            carrier.City        = troj.MAILCITYONLY;
            carrier.State       = troj.MAILSTATEONLY;
            carrier.Zip         = troj.MAILZIPONLY;
            carrier.NoSendElect = false;          //regardless of what Trojan says.  Nobody sends paper anymore.
            if (carrier.CarrierName == null || carrier.CarrierName == "")
            {
                //if, for some reason, carrier is absent from the file, we can't do a thing with it.
                return(0);
            }
            carrier = Carriers.GetIdentical(carrier);
            //now, save this all to the database.
            troj.CarrierNum = carrier.CarrierNum;
            InsPlan plan = TrojanQueries.GetPlanWithTrojanID(troj.TROJANID);

            if (plan == null)
            {
                return(0);
            }
            TrojanQueries.UpdatePlan(troj, plan.PlanNum, updateBenefits);
            plan = InsPlans.RefreshOne(plan.PlanNum);
            InsPlan planOld = plan.Copy();

            if (updateNoteAutomatic)
            {
                if (plan.PlanNote != troj.PlanNote)
                {
                    plan.PlanNote = troj.PlanNote;
                    InsPlans.Update(plan, planOld);
                }
            }
            else
            {
                //let user pick note
                if (plan.PlanNote != troj.PlanNote)
                {
                    string[] notes = new string[2];
                    notes[0] = plan.PlanNote;
                    notes[1] = troj.PlanNote;
                    FormNotePick FormN = new FormNotePick(notes);
                    FormN.ShowDialog();
                    if (FormN.DialogResult == DialogResult.OK)
                    {
                        if (plan.PlanNote != FormN.SelectedNote)
                        {
                            plan.PlanNote = FormN.SelectedNote;
                            InsPlans.Update(plan, planOld);
                        }
                    }
                }
            }
            return(1);
        }