Exemple #1
0
 /// <summary>Deletes the selected insurance payment selected.</summary>
 private void deleteEOBToolStripMenuItem_Click(object sender, EventArgs e)
 {
     RpUnfinalizedInsPay.UnfinalizedInsPay unfinalPay = (RpUnfinalizedInsPay.UnfinalizedInsPay)gridMain.Rows[gridMain.SelectedIndices[0]].Tag;
     if (unfinalPay.ClaimPaymentCur == null)
     {
         MsgBox.Show(this, "This claim payment has been deleted.");
         return;
     }
     //Most likely this claim payment is marked as partial. Everyone should have permission to delete a partial payment.
     //Added a check to make sure user has permission and claimpayment is not partial.
     if (!Security.IsAuthorized(Permissions.InsPayEdit, unfinalPay.ClaimPaymentCur.CheckDate) && !unfinalPay.ClaimPaymentCur.IsPartial)
     {
         return;
     }
     if (!MsgBox.Show(this, true, "Delete this insurance check?"))
     {
         return;
     }
     try {
         ClaimPayments.Delete(unfinalPay.ClaimPaymentCur);
     }
     catch (ApplicationException ex) {
         MessageBox.Show(ex.Message);
         return;
     }
     LoadData();
     FillGrid();
 }
        /// <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();
        }
Exemple #3
0
        /// <summary>Opens the selected insurance payment.</summary>
        private void openEOBToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.InsPayCreate))
            {
                return;
            }
            RpUnfinalizedInsPay.UnfinalizedInsPay unfinalPay = (RpUnfinalizedInsPay.UnfinalizedInsPay)gridMain.Rows[gridMain.SelectedIndices[0]].Tag;
            if (unfinalPay.ClaimPaymentCur == null)
            {
                MsgBox.Show(this, "This claim payment has been deleted.");
                return;
            }
            FormClaimPayBatch FormCPB = new FormClaimPayBatch(unfinalPay.ClaimPaymentCur);

            FormCPB.ShowDialog();
            LoadData();
            FillGrid();
        }
Exemple #4
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();
 }
Exemple #6
0
        private void gridMain_MouseUp(object sender, MouseEventArgs e)
        {
            if (gridMain.SelectedIndices.Length == 0)
            {
                contextMenuStrip1.Hide();
                return;
            }
            if (e.Button == MouseButtons.Right)
            {
                RpUnfinalizedInsPay.UnfinalizedInsPay unfinalPay = (RpUnfinalizedInsPay.UnfinalizedInsPay)gridMain.Rows[gridMain.SelectedIndices[0]].Tag;
                switch (unfinalPay.Type)
                {
                case RpUnfinalizedInsPay.UnfinalizedInsPay.UnfinalizedPaymentType.PartialPayment:
                    goToAccountToolStripMenuItem.Visible = unfinalPay.CountPats != 0;
                    openClaimToolStripMenuItem.Visible   = false;
                    createCheckToolStripMenuItem.Visible = false;
                    openEOBToolStripMenuItem.Visible     = true;
                    deleteEOBToolStripMenuItem.Visible   = true;
                    break;

                case RpUnfinalizedInsPay.UnfinalizedInsPay.UnfinalizedPaymentType.UnfinalizedPayment:
                    openEOBToolStripMenuItem.Visible     = false;
                    deleteEOBToolStripMenuItem.Visible   = false;
                    goToAccountToolStripMenuItem.Visible = true;
                    openClaimToolStripMenuItem.Visible   = true;
                    createCheckToolStripMenuItem.Visible = true;
                    break;

                default:                        //should never happen.
                    goToAccountToolStripMenuItem.Visible = false;
                    openClaimToolStripMenuItem.Visible   = false;
                    createCheckToolStripMenuItem.Visible = false;
                    openEOBToolStripMenuItem.Visible     = false;
                    deleteEOBToolStripMenuItem.Visible   = false;
                    break;
                }
            }
        }
Exemple #7
0
 /// <summary>Go to the selected patient's account.</summary>
 private void goToAccountToolStripMenuItem_Click(object sender, EventArgs e)
 {
     RpUnfinalizedInsPay.UnfinalizedInsPay unfinalPay = (RpUnfinalizedInsPay.UnfinalizedInsPay)gridMain.Rows[gridMain.SelectedIndices[0]].Tag;
     GotoModule.GotoAccount(unfinalPay.PatientCur.PatNum);
 }