示例#1
0
        private void butCombine_Click(object sender, System.EventArgs e)
        {
            if (gridMain.SelectedIndices.Length < 2)
            {
                MessageBox.Show(Lan.g(this, "Please select multiple items first while holding down the control key."));
                return;
            }
            if (MessageBox.Show(Lan.g(this, "Combine all these carriers into a single carrier? This will affect all patients using these carriers.  The next window will let you select which carrier to keep when combining."), ""
                                , MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return;
            }
            List <long> pickedCarrierNums = new List <long>();

            for (int i = 0; i < gridMain.SelectedIndices.Length; i++)
            {
                pickedCarrierNums.Add(PIn.Long(table.Rows[gridMain.SelectedIndices[i]]["CarrierNum"].ToString()));
            }
            FormCarrierCombine FormCB = new FormCarrierCombine();

            FormCB.CarrierNums = pickedCarrierNums;
            FormCB.ShowDialog();
            if (FormCB.DialogResult != DialogResult.OK)
            {
                return;
            }
            changed = true;
            //int[] combCarrierNums=new int[tbCarriers.SelectedIndices.Length];
            //for(int i=0;i<tbCarriers.SelectedIndices.Length;i++){
            //	carrierNums[i]=Carriers.List[tbCarriers.SelectedIndices[i]].CarrierNum;
            //}
            try{
                //Prepare audit trail entry data, then combine, then make audit trail entries if successful
                List <string>       carrierNames = new List <string>();
                List <List <long> > insPlanNums  = new List <List <long> >();
                string carrierTo = Carriers.GetName(FormCB.PickedCarrierNum);
                for (int i = 0; i < pickedCarrierNums.Count; i++)
                {
                    carrierNames.Add(Carriers.GetName(pickedCarrierNums[i]));
                    insPlanNums.Add(InsPlans.GetPlanNumsByCarrierNum(pickedCarrierNums[i]));
                }
                Carriers.Combine(pickedCarrierNums, FormCB.PickedCarrierNum);
                //Carriers were combined successfully. Loop through all the associated insplans and make a securitylog entry that their carrier changed.
                for (int i = 0; i < insPlanNums.Count; i++)
                {
                    for (int j = 0; j < insPlanNums[i].Count; j++)
                    {
                        SecurityLogs.MakeLogEntry(Permissions.InsPlanChangeCarrierName, 0, Lan.g(this, "Carrier with name ") + " " + carrierNames[i] + " "
                                                  + Lan.g(this, "was merged with") + " " + carrierTo, insPlanNums[i][j]);
                    }
                }
            }
            catch (ApplicationException ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            FillGrid();
        }
示例#2
0
        private void FillPlanData()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col;

            //col=new ODGridColumn(Lan.g("TableInsPlans","#"),20);
            //gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableInsPlans", "Subscriber"), 140);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableInsPlans", "Ins Carrier"), 100);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableInsPlans", "Date Effect."), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableInsPlans", "Date Term."), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableInsPlans", "Used By"), 90);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;
            //PatPlan[] patPlanArray;
            InsPlan plan;

            for (int i = 0; i < SubList.Count; i++)
            {
                row = new ODGridRow();
                //row.Cells.Add((i+1).ToString());
                row.Cells.Add(FamCur.GetNameInFamLF(SubList[i].Subscriber));
                plan = InsPlans.GetPlan(SubList[i].PlanNum, PlanList);
                row.Cells.Add(Carriers.GetName(plan.CarrierNum));
                if (SubList[i].DateEffective.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(SubList[i].DateEffective.ToString("d"));
                }
                if (SubList[i].DateTerm.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(SubList[i].DateTerm.ToString("d"));
                }
                int countPatPlans = PatPlans.GetCountBySubNum(SubList[i].InsSubNum);
                row.Cells.Add(countPatPlans.ToString());
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
            listRelat.Items.Clear();
            for (int i = 0; i < Enum.GetNames(typeof(Relat)).Length; i++)
            {
                listRelat.Items.Add(Lan.g("enumRelat", Enum.GetNames(typeof(Relat))[i]));
            }
        }
示例#3
0
        private void FillGrid()
        {
            SubList = InsSubs.RefreshForFam(FamCur);
            if (!InsSubs.ValidatePlanNumForList(SubList.Select(x => x.InsSubNum).ToList()))
            {
                SubList = InsSubs.RefreshForFam(FamCur);
            }
            PlanList = InsPlans.RefreshForSubList(SubList);
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col;

            //=new ODGridColumn(Lan.g("TableInsPlans","#"),20);
            //gridMain.Columns.Add(col);
            col = new GridColumn(Lan.g("TableInsPlans", "Subscriber"), 140);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInsPlans", "Ins Carrier"), 100);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInsPlans", "Date Effect."), 90);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInsPlans", "Date Term."), 90);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInsPlans", "Used By"), 90);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;
            //PatPlan[] patPlanArray;
            InsPlan plan;

            for (int i = 0; i < SubList.Count; i++)
            {
                plan = InsPlans.GetPlan(SubList[i].PlanNum, PlanList);
                row  = new GridRow();
                row.Cells.Add(FamCur.GetNameInFamLF(SubList[i].Subscriber));
                row.Cells.Add(Carriers.GetName(plan.CarrierNum));
                if (SubList[i].DateEffective.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(SubList[i].DateEffective.ToString("d"));
                }
                if (SubList[i].DateTerm.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(SubList[i].DateTerm.ToString("d"));
                }
                int countPatPlans = PatPlans.GetCountBySubNum(SubList[i].InsSubNum);
                row.Cells.Add(countPatPlans.ToString());
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
示例#4
0
        private void butChangePatientFrom_Click(object sender, EventArgs e)
        {
            FormInsPlans formIP = new FormInsPlans();

            formIP.IsSelectMode = true;
            if (formIP.ShowDialog() == DialogResult.OK)
            {
                _fromInsPlan             = formIP.SelectedPlan;
                textCarrierNameFrom.Text = Carriers.GetName(_fromInsPlan.CarrierNum);
            }
        }
        private void gridClaims_CellDoubleClick(object sender, UI.ODGridClickEventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.ClaimView))
            {
                return;
            }
            Claim claim = Claims.GetClaim(((Claim)gridClaims.ListGridRows[e.Row].Tag).ClaimNum); //This is the easiest way to determine if the claim was deleted.

            if (claim == null)                                                                   //Was deleted.
            {
                MsgBox.Show(this, "Claim has been deleted by another user.");
                gridClaims.BeginUpdate();
                gridClaims.ListGridRows.RemoveAt(e.Row);                //This will also deselect the row.
                gridClaims.EndUpdate();
                return;
            }
            FormClaimEdit formCE = new FormClaimEdit(claim, Patients.GetPat(_patNum), Patients.GetFamily(_patNum));

            formCE.ShowDialog();
            claim = Claims.GetClaim(((Claim)gridClaims.ListGridRows[e.Row].Tag).ClaimNum); //This is the easiest way to determine if the claim was deleted.
            if (claim == null)                                                             //Was deleted.
            {
                gridClaims.BeginUpdate();
                gridClaims.ListGridRows.RemoveAt(e.Row);                //This will also deselect the row.
                gridClaims.EndUpdate();
                return;
            }
            if (formCE.DialogResult == DialogResult.OK)
            {
                //Update row
                UI.GridRow row = new UI.GridRow();
                row.Tag = claim;
                row.Cells.Add(claim.DateService.ToShortDateString());                           //DOS
                row.Cells.Add(Carriers.GetName(InsPlans.RefreshOne(claim.PlanNum).CarrierNum)); //Carrier
                row.Cells.Add(Claims.GetClaimStatusString(claim.ClaimStatus));                  //Status
                if (PrefC.HasClinicsEnabled)                                                    //Using clinics
                {
                    Clinic clinic = Clinics.GetClinic(claim.ClinicNum);
                    if (clinic == null)
                    {
                        row.Cells.Add("");                        //Clinic
                    }
                    else
                    {
                        row.Cells.Add(clinic.Description);                        //Clinic
                    }
                }
                row.Cells.Add(claim.ClaimFee.ToString("f"));                //Claimfee
                gridClaims.BeginUpdate();
                gridClaims.ListGridRows[e.Row] = row;
                gridClaims.EndUpdate();
                gridClaims.SetSelected(e.Row, true);               //Reselect Row
            }
        }
        /// <summary>Creates a check for the claim selected. Copied logic from FormClaimEdit.cs</summary>
        private void createCheckToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.InsPayCreate))             //date not checked here, but it will be checked when saving the check to prevent backdating
            {
                return;
            }
            if (PrefC.GetBool(PrefName.ClaimPaymentBatchOnly))
            {
                //Is there a permission in the manage module that would block this behavior? Are we sending the user into a TRAP?!
                MsgBox.Show(this, "Please use Batch Insurance in Manage Module to Finalize Payments.");
                return;
            }
            RpUnfinalizedInsPay.UnfinalizedInsPay unfinalPay = (RpUnfinalizedInsPay.UnfinalizedInsPay)gridMain.ListGridRows[gridMain.SelectedIndices[0]].Tag;
            if (unfinalPay.ClaimCur == null)
            {
                MsgBox.Show(this, "Unable to find claim for this partial payment.");
                return;
            }
            List <ClaimProc> listClaimProcForClaim = ClaimProcs.RefreshForClaim(unfinalPay.ClaimCur.ClaimNum);

            if (!listClaimProcForClaim.Any(x => x.Status.In(ClaimProcs.GetInsPaidStatuses())))
            {
                MessageBox.Show(Lan.g(this, "There are no valid received payments for this claim."));
                return;
            }
            ClaimPayment claimPayment = new ClaimPayment();

            claimPayment.CheckDate = MiscData.GetNowDateTime().Date;          //Today's date for easier tracking by the office and to avoid backdating before accounting lock dates.
            claimPayment.IsPartial = true;
            claimPayment.ClinicNum = unfinalPay.ClinicCur.ClinicNum;
            Family         famCur      = Patients.GetFamily(unfinalPay.PatientCur.PatNum);
            List <InsSub>  listInsSub  = InsSubs.RefreshForFam(famCur);
            List <InsPlan> listInsPlan = InsPlans.RefreshForSubList(listInsSub);

            claimPayment.CarrierName = Carriers.GetName(InsPlans.GetPlan(unfinalPay.ClaimCur.PlanNum, listInsPlan).CarrierNum);
            ClaimPayments.Insert(claimPayment);
            double amt = ClaimProcs.AttachAllOutstandingToPayment(claimPayment.ClaimPaymentNum, PrefC.DateClaimReceivedAfter);

            claimPayment.CheckAmt = amt;
            try {
                ClaimPayments.Update(claimPayment);
            }
            catch (ApplicationException ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            FormClaimEdit.FormFinalizePaymentHelper(claimPayment, unfinalPay.ClaimCur, unfinalPay.PatientCur, famCur);
            LoadData();
            FillGrid();
        }
        private void FillPlanData()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableInsPlans", "#"), 20);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableInsPlans", "Subscriber"), 140);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableInsPlans", "Ins Carrier"), 100);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableInsPlans", "Date Effect."), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableInsPlans", "Date Term."), 90);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < PlanList.Length; i++)
            {
                row = new ODGridRow();
                row.Cells.Add((i + 1).ToString());
                row.Cells.Add(FamCur.GetNameInFamLF(PlanList[i].Subscriber));
                row.Cells.Add(Carriers.GetName(PlanList[i].CarrierNum));
                if (PlanList[i].DateEffective.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(PlanList[i].DateEffective.ToString("d"));
                }
                if (PlanList[i].DateTerm.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(PlanList[i].DateTerm.ToString("d"));
                }
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
            listRelat.Items.Clear();
            for (int i = 0; i < Enum.GetNames(typeof(Relat)).Length; i++)
            {
                listRelat.Items.Add(Lan.g("enumRelat", Enum.GetNames(typeof(Relat))[i]));
            }
        }
示例#8
0
        private void FillGrid()
        {
            PlanList = InsPlans.Refresh(FamCur);
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableInsPlans", "#"), 20);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableInsPlans", "Subscriber"), 140);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableInsPlans", "Ins Carrier"), 100);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableInsPlans", "Date Effect."), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableInsPlans", "Date Term."), 90);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < PlanList.Length; i++)
            {
                row = new ODGridRow();
                row.Cells.Add((i + 1).ToString());
                row.Cells.Add(FamCur.GetNameInFamLF(PlanList[i].Subscriber));
                row.Cells.Add(Carriers.GetName(PlanList[i].CarrierNum));
                if (PlanList[i].DateEffective.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(PlanList[i].DateEffective.ToString("d"));
                }
                if (PlanList[i].DateTerm.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(PlanList[i].DateTerm.ToString("d"));
                }
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
示例#9
0
        /*
         * private void FillClaimForms(){
         *      for(int i=0;i<ClaimForms.ListShort.Length;i++) {
         *              comboClaimForm.Items.Add(ClaimForms.ListShort[i].Description);
         *              if(ClaimForms.ListShort[i].ClaimFormNum==PrefC.GetLong(PrefName.DefaultClaimForm)) {
         *                      comboClaimForm.SelectedIndex=i;
         *              }
         *      }
         * }*/

        private void FillPlanData()
        {
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g("TableInsPlans", "Plan"), 50);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInsPlans", "Subscriber"), 140);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInsPlans", "Ins Carrier"), 100);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInsPlans", "Date Effect."), 90);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInsPlans", "Date Term."), 90);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow        row;
            List <GridRow> listRows = new List <GridRow>();         //create a list of gridrows so that we can order them by Ordinal after creating them.

            for (int i = 0; i < SubList.Count; i++)
            {
                row = new GridRow();
                if (!checkShowPlansNotInUse.Checked &&                //Only show insurance plans for PatCur.
                    !_listPatCurPatPlans.Exists(x => x.InsSubNum == SubList[i].InsSubNum))
                {
                    continue;
                }
                else if (checkShowPlansNotInUse.Checked && !_listPatCurPatPlans.Exists(x => x.InsSubNum == SubList[i].InsSubNum))
                {
                    row.Cells.Add("Not Used");
                }
                else
                {
                    PatPlan patPlan = _listPatCurPatPlans.FirstOrDefault(x => x.InsSubNum == SubList[i].InsSubNum);
                    if (patPlan == null)
                    {
                        continue;
                    }
                    if (patPlan.Ordinal == 1)
                    {
                        row.Cells.Add("Pri");
                    }
                    else if (patPlan.Ordinal == 2)
                    {
                        row.Cells.Add("Sec");
                    }
                    else
                    {
                        row.Cells.Add("Other");
                    }
                }
                InsPlan plan = InsPlans.GetPlan(SubList[i].PlanNum, PlanList);
                row.Tag = SubList[i];
                row.Cells.Add(FamCur.GetNameInFamLF(SubList[i].Subscriber));
                row.Cells.Add(Carriers.GetName(plan.CarrierNum));
                if (SubList[i].DateEffective.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(SubList[i].DateEffective.ToString("d"));
                }
                if (SubList[i].DateTerm.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(SubList[i].DateTerm.ToString("d"));
                }
                listRows.Add(row);
            }
            listRows = listRows.OrderBy(x => x.Cells[0].Text != "Pri")
                       .ThenBy(x => x.Cells[0].Text != "Sec")
                       .ThenBy(x => x.Cells[0].Text != "Other")
                       .ThenBy(x => x.Cells[0].Text != "Not Used").ToList();
            for (int i = 0; i < listRows.Count; i++)
            {
                gridMain.ListGridRows.Add(listRows[i]);
            }
            gridMain.EndUpdate();
            listRelat.Items.Clear();
            for (int i = 0; i < Enum.GetNames(typeof(Relat)).Length; i++)
            {
                listRelat.Items.Add(Lan.g("enumRelat", Enum.GetNames(typeof(Relat))[i]));
            }
        }
        ///<summary>Gets all claims for the patient selected.  Fills gridClaims and tags each row with its corrisponding claim object.</summary>
        private void FillGridClaims()
        {
            int  sortByColIdx = gridClaims.SortedByColumnIdx;           //Keep previous sorting
            bool isSortAsc    = gridClaims.SortedIsAscending;

            if (sortByColIdx == -1)
            {
                sortByColIdx = 0;
                isSortAsc    = false;
            }
            gridClaims.BeginUpdate();
            gridClaims.Rows.Clear();
            gridClaims.Columns.Clear();
            gridClaims.Columns.Add(new UI.ODGridColumn("Date Service", 100, HorizontalAlignment.Center)
            {
                SortingStrategy = UI.GridSortingStrategy.DateParse
            });
            gridClaims.Columns.Add(new UI.ODGridColumn("Carrier", 240, HorizontalAlignment.Center)
            {
                SortingStrategy = UI.GridSortingStrategy.StringCompare
            });
            gridClaims.Columns.Add(new UI.ODGridColumn("Status", 120, HorizontalAlignment.Center)
            {
                SortingStrategy = UI.GridSortingStrategy.StringCompare
            });
            if (!PrefC.GetBool(PrefName.EasyNoClinics))             //Using clinics
            {
                gridClaims.Columns.Add(new UI.ODGridColumn("Clinic", 190, HorizontalAlignment.Left)
                {
                    SortingStrategy = UI.GridSortingStrategy.StringCompare
                });
            }
            gridClaims.Columns.Add(new UI.ODGridColumn("ClaimFee", 70, HorizontalAlignment.Right)
            {
                SortingStrategy = UI.GridSortingStrategy.AmountParse
            });
            List <Claim> listClaims = Claims.Refresh(_patNum);

            for (int i = 0; i < listClaims.Count; i++)
            {
                UI.ODGridRow row = new UI.ODGridRow();
                row.Tag = listClaims[i];
                row.Cells.Add(listClaims[i].DateService.ToShortDateString());                           //DOS
                row.Cells.Add(Carriers.GetName(InsPlans.RefreshOne(listClaims[i].PlanNum).CarrierNum)); //Carrier
                row.Cells.Add(Claims.GetClaimStatusString(listClaims[i].ClaimStatus));                  //Status
                if (!PrefC.GetBool(PrefName.EasyNoClinics))                                             //Using clinics
                {
                    Clinic clinic = Clinics.GetClinic(listClaims[i].ClinicNum);
                    if (clinic == null)
                    {
                        row.Cells.Add("");                        //Clinic
                    }
                    else
                    {
                        row.Cells.Add(clinic.Description);                        //Clinic
                    }
                }
                row.Cells.Add(listClaims[i].ClaimFee.ToString("f"));                //Claimfee
                gridClaims.Rows.Add(row);
            }
            gridClaims.EndUpdate();
            gridClaims.SortForced(sortByColIdx, isSortAsc);
        }
示例#11
0
        private void butMerge_Click(object sender, EventArgs e)
        {
            if (gridMain.SelectedIndices.Length < 2)
            {
                MessageBox.Show(Lan.g(this, "Please select at least two items first."));
                return;
            }
            InsPlan[] listSelected = new InsPlan[gridMain.SelectedIndices.Length];
            for (int i = 0; i < listSelected.Length; i++)
            {
                listSelected[i] = InsPlans.GetPlan(PIn.PInt(table.Rows[gridMain.SelectedIndices[i]]["PlanNum"].ToString()), null);
            }
            FormInsPlansMerge FormI = new FormInsPlansMerge();

            FormI.ListAll = listSelected;
            FormI.ShowDialog();
            if (FormI.DialogResult != DialogResult.OK)
            {
                return;
            }
            //Do the merge.
            InsPlan        planToMergeTo = FormI.PlanToMergeTo.Copy();
            List <Benefit> benList       = Benefits.RefreshForAll(planToMergeTo);

            Cursor = Cursors.WaitCursor;
            List <int> planNums;

            for (int i = 0; i < listSelected.Length; i++)      //loop through each selected plan group
            //skip the planToMergeTo, because it's already correct
            {
                if (planToMergeTo.PlanNum == listSelected[i].PlanNum)
                {
                    continue;
                }
                planNums = new List <int>(InsPlans.GetPlanNumsOfSamePlans(Employers.GetName(listSelected[i].EmployerNum),
                                                                          listSelected[i].GroupName, listSelected[i].GroupNum, listSelected[i].DivisionNo,
                                                                          Carriers.GetName(listSelected[i].CarrierNum),
                                                                          listSelected[i].IsMedical, listSelected[i].PlanNum, false));//remember that planNum=0
                //First plan info
                InsPlans.UpdateForLike(listSelected[i], planToMergeTo);
                //for(int j=0;j<planNums.Count;j++) {
                //InsPlans.ComputeEstimatesForPlan(planNums[j]);
                //Eliminated in 5.0 for speed.
                //}
                //then benefits
                Benefits.UpdateListForIdentical(new List <Benefit>(), benList, planNums);             //there will always be changes
                //Then PlanNote.  This is much simpler than the usual synch, because user has seen all versions of note.
                InsPlans.UpdateNoteForPlans(planNums, planToMergeTo.PlanNote);
            }
            FillGrid();
            //highlight the merged plan
            for (int i = 0; i < table.Rows.Count; i++)
            {
                for (int j = 0; j < listSelected.Length; j++)
                {
                    if (table.Rows[i]["PlanNum"].ToString() == listSelected[j].PlanNum.ToString())
                    {
                        gridMain.SetSelected(i, true);
                    }
                }
            }
            Cursor = Cursors.Default;
        }