Example #1
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.ClaimView))
            {
                return;
            }
            Claim claim = Claims.GetClaim(((UnsentInsClaim)gridMain.Rows[e.Row].Tag).ClaimNum);

            if (claim == null)
            {
                MsgBox.Show(this, "The claim has been deleted.");
                FillGrid();
                return;
            }
            Patient       pat    = Patients.GetPat(claim.PatNum);
            Family        fam    = Patients.GetFamily(pat.PatNum);
            FormClaimEdit FormCE = new FormClaimEdit(claim, pat, fam);

            FormCE.IsNew = false;
            FormCE.ShowDialog();
            if (FormCE.DialogResult == DialogResult.OK)
            {
                FillGrid();                //FillGrid() is necessary here as we are allowing the user to open up claim details and they could change the claim status or claim type.
                return;
            }
        }
Example #2
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            Claim         claim  = Claims.GetClaim(PIn.Long(Table.Rows[e.Row]["ClaimNum"].ToString()));
            Patient       pat    = Patients.GetPat(claim.PatNum);
            Family        fam    = Patients.GetFamily(pat.PatNum);
            FormClaimEdit FormCE = new FormClaimEdit(claim, pat, fam);

            FormCE.IsNew = false;
            FormCE.ShowDialog();
        }
        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();
        }
Example #5
0
        /// <summary>Opens the current selected claim.</summary>
        private void openClaimToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.ClaimView))
            {
                return;
            }
            RpUnfinalizedInsPay.UnfinalizedInsPay unfinalPay = (RpUnfinalizedInsPay.UnfinalizedInsPay)gridMain.Rows[gridMain.SelectedIndices[0]].Tag;
            if (unfinalPay.ClaimCur == null)
            {
                MsgBox.Show(this, "This claim has been deleted.");
                return;
            }
            Family        famCur = Patients.GetFamily(unfinalPay.PatientCur.PatNum);
            FormClaimEdit FormCE = new FormClaimEdit(unfinalPay.ClaimCur, unfinalPay.PatientCur, famCur);

            FormCE.ShowDialog();
            LoadData();
            FillGrid();
        }
 /// <summary>Opens the current selected claim.</summary>
 private void openClaimToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!Security.IsAuthorized(Permissions.ClaimView))
     {
         return;
     }
     RpUnfinalizedInsPay.UnfinalizedInsPay unfinalPay = (RpUnfinalizedInsPay.UnfinalizedInsPay)gridMain.ListGridRows[gridMain.SelectedIndices[0]].Tag;
     //Refresh claim from database.  Will return null if not in db, or unfinalPay.ClaimCur already null.
     unfinalPay.ClaimCur = Claims.GetClaim(unfinalPay.ClaimCur?.ClaimNum ?? 0);
     if (unfinalPay.ClaimCur == null)
     {
         MsgBox.Show(this, "Claim has been deleted by another user.");
     }
     else
     {
         Family        famCur = Patients.GetFamily(unfinalPay.PatientCur.PatNum);
         FormClaimEdit FormCE = new FormClaimEdit(unfinalPay.ClaimCur, unfinalPay.PatientCur, famCur);
         FormCE.ShowDialog();
     }
     LoadData();
     FillGrid();
 }
Example #7
0
        ///<summary>Click method used by all gridClaimDetails right click options.</summary>
        private void gridClaimDetails_RightClickHelper(object sender, EventArgs e)
        {
            int index = gridClaimDetails.GetSelectedIndex();

            if (index == -1)           //Should not happen, menu item is only enabled when exactly 1 row is selected.
            {
                return;
            }
            Hx835_Claim claimPaid     = (Hx835_Claim)gridClaimDetails.ListGridRows[index].Tag;
            int         menuItemIndex = ((MenuItem)sender).Index;  //sender is the selected menuItem

            #region Go To Account
            if (menuItemIndex == 0)
            {
                if (claimPaid.ClaimNum != 0)
                {
                    Claim claim = Claims.GetClaim(claimPaid.ClaimNum);
                    if (claim != null)
                    {
                        GotoModule.GotoAccount(claim.PatNum);
                        return;
                    }
                }
                PtTableSearchParams ptTableSearchParams = new PtTableSearchParams(false, claimPaid.PatientName.Lname, claimPaid.PatientName.Fname, "", "", false,
                                                                                  "", "", "", "", "", 0, false, false, DateTime.MinValue, 0, "", "", "", "", "", "", "");
                DataTable ptTable = Patients.GetPtDataTable(ptTableSearchParams);              //Mimics FormPatientSelect.cs
                if (ptTable.Rows.Count == 0)
                {
                    MsgBox.Show(this, "Patient could not be found.  Please manually attach to a claim and try again.");
                }
                else if (ptTable.Rows.Count == 1)
                {
                    GotoModule.GotoAccount(PIn.Long(ptTable.Rows[0]["PatNum"].ToString()));
                }
                else
                {
                    MsgBox.Show(this, "Multiple patients with same name found.  Please manually attach to a claim and try again.");
                }
            }
            #endregion
            #region Add Tracking Status
            else if (menuItemIndex == 1)
            {
                Claim claim          = claimPaid.GetClaimFromDb();
                bool  isAttachNeeded = (!claimPaid.IsAttachedToClaim);
                if (claim == null)               //Not found in db.
                {
                    claim = ClaimSelectionHelper(claimPaid);
                    if (claim != null)                   //A claim was selected.
                    {
                        isAttachNeeded = true;           //Hard attach selected claim to db claim, since user manually picked matching claim.
                    }
                }
                if (claim == null)               //Claim not found and user did not select one.
                {
                    return;
                }
                CreateAttachForClaim(claimPaid, claim.ClaimNum, isAttachNeeded);
                if (FormClaimEdit.AddClaimCustomTracking(claim, claimPaid.GetRemarks()))                //A tracking status was chosen and the tracking status contains an error code.
                {
                    DetachClaimHelper(new List <int> {
                        index
                    });                                                            //Detach claim from ERA for convenience.
                }
                FillClaimDetails();
            }
            #endregion
        }
Example #8
0
        private void gridClaimDetails_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            Hx835_Claim claimPaid      = (Hx835_Claim)gridClaimDetails.ListGridRows[e.Row].Tag;
            Claim       claim          = claimPaid.GetClaimFromDb();
            bool        isAttachNeeded = (!claimPaid.IsAttachedToClaim);

            if (claim == null)           //Not found in db.
            {
                claim = ClaimSelectionHelper(claimPaid);
                if (claim != null)               //A claim was selected.
                {
                    isAttachNeeded = true;       //Hard attach selected claim to db claim, since user manually picked matching claim.
                }
            }
            if (claim == null)           //Claim not found and user did not select one.
            {
                return;
            }
            //From this point on claim is not null.
            bool isReadOnly = true;

            CreateAttachForClaim(claimPaid, claim.ClaimNum, isAttachNeeded);
            if (claimPaid.IsSplitClaim)
            {
                //Sync ClaimNum for all split claims in the same group, based on user selection.
                claimPaid.GetOtherNotDetachedSplitClaims()
                .ForEach(x => CreateAttachForClaim(x, claim.ClaimNum, isAttachNeeded));
            }
            if (claimPaid.IsProcessed(_listClaimProcs, _listAttaches))
            {
                //If the claim is already received, then we do not allow the user to enter payments.
                //The user can edit the claim to change the status from received if they wish to enter the payments again.
                if (Security.IsAuthorized(Permissions.ClaimView))
                {
                    Patient       pat    = Patients.GetPat(claim.PatNum);
                    Family        fam    = Patients.GetFamily(claim.PatNum);
                    FormClaimEdit formCE = new FormClaimEdit(claim, pat, fam);
                    formCE.ShowDialog();                    //Modal, because the user could edit information in this window.
                }
                isReadOnly = false;
            }
            else if (Security.IsAuthorized(Permissions.InsPayCreate))             //Claim found and is not received.  Date not checked here, but it will be checked when actually creating the check.
            {
                EtransL.ImportEraClaimData(_x835, claimPaid, claim, false);
                RefreshFromDb();                //ClaimProcs could have been split, need to refresh both claimProc list and attaches.
                isReadOnly = false;
            }
            if (isReadOnly)
            {
                FormEtrans835ClaimEdit formC = new FormEtrans835ClaimEdit(_x835, claimPaid);
                formC.Show(this);                //This window is just used to display information.
            }
            if (!gridClaimDetails.IsDisposed)    //Not sure how the grid is sometimes disposed, perhaps because of it being non-modal.
            //Refresh the claim detail row in case something changed above.
            {
                gridClaimDetails.BeginUpdate();
                List <GridRow> listRows = new List <GridRow>()
                {
                    gridClaimDetails.ListGridRows[e.Row]
                };                                          //Row associated to claimPaid
                if (claimPaid.IsSplitClaim)                 //Need to update multiple rows.
                {
                    List <Hx835_Claim> listOtherSplitClaims = claimPaid.GetOtherNotDetachedSplitClaims();
                    List <GridRow>     listAdditionalRows   = gridClaimDetails.ListGridRows
                                                              .Where(x =>
                                                                     x != gridClaimDetails.ListGridRows[e.Row] &&
                                                                     listOtherSplitClaims.Contains((Hx835_Claim)x.Tag)
                                                                     ).ToList();
                    listRows.AddRange(listAdditionalRows);
                }
                SetClaimDetailRows(listRows, listRows.Select(x => (Hx835_Claim)x.Tag).ToList(), true);
                gridClaimDetails.EndUpdate();
            }
        }