Example #1
0
        private void gridProcedureBreakdown_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            Hx835_Proc            proc = (Hx835_Proc)gridProcedureBreakdown.ListGridRows[e.Row].Tag;
            FormEtrans835ProcEdit form = new FormEtrans835ProcEdit(proc);

            form.Show(this);            //This window is just used to display information.
        }
Example #2
0
 private void FillProcedureBreakdown()
 {
     if (_claimPaid.ListProcs.Count == 0)
     {
         gridProcedureBreakdown.Title = "EOB Procedure Breakdown (None Reported)";
     }
     else
     {
         gridProcedureBreakdown.Title = "EOB Procedure Breakdown";
     }
     gridProcedureBreakdown.BeginUpdate();
     gridProcedureBreakdown.ListGridColumns.Clear();
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("ProcNum", 80, HorizontalAlignment.Left));
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("ProcCode", 80, HorizontalAlignment.Center));
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("ProcDescript", 0, HorizontalAlignment.Left));
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("FeeBilled", 70, HorizontalAlignment.Right));
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("InsPaid", 70, HorizontalAlignment.Right));
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("PatPort", 70, HorizontalAlignment.Right));
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("Deduct", 70, HorizontalAlignment.Right));
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("Writeoff", 70, HorizontalAlignment.Right));
     gridProcedureBreakdown.ListGridRows.Clear();
     _procAdjAmtSum = 0;
     for (int i = 0; i < _claimPaid.ListProcs.Count; i++)
     {
         //Logic mimics SheetUtil.getTable_EraClaimsPaid(...)
         Hx835_Proc proc = _claimPaid.ListProcs[i];
         GridRow    row  = new GridRow();
         row.Tag = proc;
         if (proc.ProcNum == 0)
         {
             row.Cells.Add(new GridCell(""));                    //ProcNum
         }
         else
         {
             row.Cells.Add(new GridCell(proc.ProcNum.ToString()));             //ProcNum
         }
         row.Cells.Add(new GridCell(proc.ProcCodeAdjudicated));                //ProcCode
         string procDescript = "";
         if (ProcedureCodes.IsValidCode(proc.ProcCodeAdjudicated))
         {
             ProcedureCode procCode = ProcedureCodes.GetProcCode(proc.ProcCodeAdjudicated);
             procDescript = procCode.AbbrDesc;
         }
         row.Cells.Add(new GridCell(procDescript));                          //ProcDescript
         row.Cells.Add(new GridCell(proc.ProcFee.ToString("f2")));           //FeeBilled
         row.Cells.Add(new GridCell(proc.InsPaid.ToString("f2")));           //InsPaid
         row.Cells.Add(new GridCell(proc.PatientPortionAmt.ToString("f2"))); //PatPort
         row.Cells.Add(new GridCell(proc.DeductibleAmt.ToString("f2")));     //Deduct
         row.Cells.Add(new GridCell(proc.WriteoffAmt.ToString("f2")));       //Writeoff
         gridProcedureBreakdown.ListGridRows.Add(row);
     }
     gridProcedureBreakdown.EndUpdate();
     textProcAdjAmtSum.Text = _procAdjAmtSum.ToString("f2");
 }
 public FormEtrans835ProcEdit(Hx835_Proc proc)
 {
     InitializeComponent();
     Lan.F(this);
     _proc = proc;
 }
Example #4
0
        private void FillGridMain()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            gridMain.Columns.Add(new UI.ODGridColumn("EnterBy", 50, HorizontalAlignment.Center));
            gridMain.Columns.Add(new UI.ODGridColumn("Claim", 0, HorizontalAlignment.Left));          //Dynamic width
            gridMain.Columns.Add(new UI.ODGridColumn("Date", 66, HorizontalAlignment.Center));
            gridMain.Columns.Add(new UI.ODGridColumn("Code", 40, HorizontalAlignment.Center));
            gridMain.Columns.Add(new UI.ODGridColumn("CodeBill", 56, HorizontalAlignment.Center));
            gridMain.Columns.Add(new UI.ODGridColumn("Billed", 56, HorizontalAlignment.Right));
            gridMain.Columns.Add(new UI.ODGridColumn("PatResp", 48, HorizontalAlignment.Right));
            gridMain.Columns.Add(new UI.ODGridColumn("Allowed", 56, HorizontalAlignment.Right));
            gridMain.Columns.Add(new UI.ODGridColumn("InsPay", 56, HorizontalAlignment.Right));
            gridMain.Rows.Clear();
            List <Hx835_Claim> listClaims;

            if (_x835 != null)
            {
                listClaims = _x835.ListClaimsPaid;
            }
            else
            {
                listClaims = new List <Hx835_Claim>()
                {
                    _claimPaid
                };
            }
            for (int i = 0; i < listClaims.Count; i++)
            {
                Hx835_Claim  claimPaid = listClaims[i];
                UI.ODGridRow rowClaim  = new UI.ODGridRow();
                //If there is no procedure detail, then the user will need to enter by total, because they will not know the procedure amounts paid.
                if (claimPaid.ListProcs.Count == 0)
                {
                    rowClaim.Cells.Add(new UI.ODGridCell("Total"));                    //EnterBy
                }
                //If there is procedure detail, and there are also claim level adjustments, then the user will need to enter the procedure amounts by procedure and the claim adjustment by total.
                else if (claimPaid.ClaimAdjustmentTotal != 0)
                {
                    rowClaim.Cells.Add(new UI.ODGridCell("Proc &\r\nTotal"));                    //EnterBy
                }
                //If there is procedure detail, and there are no claim level adjustments, the user will need to enter the payments by procedure only.
                else
                {
                    rowClaim.Cells.Add(new UI.ODGridCell("Proc"));                    //EnterBy
                }
                string strClaim = "Patient: " + claimPaid.PatientName;
                if (claimPaid.SubscriberName != claimPaid.PatientName)
                {
                    strClaim += "\r\nSubscriber: " + claimPaid.SubscriberName;
                }
                if (claimPaid.ClaimTrackingNumber != "")
                {
                    strClaim += "\r\nClaim Identifier: " + claimPaid.ClaimTrackingNumber;
                }
                if (claimPaid.PayerControlNumber != "")
                {
                    strClaim += "\r\nPayer Control Number: " + claimPaid.PayerControlNumber;
                }
                if (claimPaid.ListProcs.Count > 0 && claimPaid.ClaimAdjustmentTotal != 0)
                {
                    //If there is no procedure detail, then the user will need to enter the claim payment by total.  In this case, the user only cares about the InsPaid for the entire claim.  Showing the adjustments would cause user confusion.
                    //If there is procedure detail, then we need to show the claim adjustment total, because the user will need to enter this amount by total in addition to any procedure amounts entered.
                    strClaim += "\r\nClaim Adjustments: " + claimPaid.ClaimAdjustmentTotal.ToString("f2");
                }
                rowClaim.Cells.Add(new UI.ODGridCell(strClaim));                //Claim
                string strDateClaim = claimPaid.DateServiceStart.ToShortDateString();
                if (claimPaid.DateServiceEnd.Year > 1880)
                {
                    strDateClaim += " to \r\n" + claimPaid.DateServiceEnd.ToShortDateString();
                }
                rowClaim.Cells.Add(new UI.ODGridCell(strDateClaim));                            //Date
                rowClaim.Cells.Add(new UI.ODGridCell(""));                                      //Code
                rowClaim.Cells.Add(new UI.ODGridCell(""));                                      //CodeBilled
                rowClaim.Cells.Add(new UI.ODGridCell(claimPaid.ClaimFee.ToString("f2")));       //Billed
                rowClaim.Cells.Add(new UI.ODGridCell(claimPaid.PatientRespAmt.ToString("f2"))); //PatResp
                rowClaim.Cells.Add(new UI.ODGridCell(""));                                      //Allowed
                rowClaim.Cells.Add(new UI.ODGridCell(claimPaid.InsPaid.ToString("f2")));        //InsPay
                gridMain.Rows.Add(rowClaim);
                for (int j = 0; j < claimPaid.ListProcs.Count; j++)
                {
                    Hx835_Proc   proc    = claimPaid.ListProcs[j];
                    UI.ODGridRow rowProc = new UI.ODGridRow();
                    rowProc.Cells.Add(new UI.ODGridCell(""));                    //EnterBy
                    rowProc.Cells.Add(new UI.ODGridCell(""));                    //Claim
                    string strDateProc = proc.DateServiceStart.ToShortDateString();
                    if (proc.DateServiceEnd.Year > 1880)
                    {
                        strDateProc += " to \r\n" + proc.DateServiceEnd.ToShortDateString();
                    }
                    rowProc.Cells.Add(new UI.ODGridCell(strDateProc));                      //Date
                    rowProc.Cells.Add(new UI.ODGridCell(proc.ProcCodeAdjudicated));         //Code
                    rowProc.Cells.Add(new UI.ODGridCell(proc.ProcCodeBilled));              //CodeBilled
                    rowProc.Cells.Add(new UI.ODGridCell(proc.ProcFee.ToString("f2")));      //Billed
                    rowProc.Cells.Add(new UI.ODGridCell(proc.PatRespTotal.ToString("f2"))); //PatResp
                    rowProc.Cells.Add(new UI.ODGridCell(proc.AllowedAmt.ToString("f2")));   //Allowed
                    rowProc.Cells.Add(new UI.ODGridCell(proc.InsPaid.ToString("f2")));      //InsPay
                    gridMain.Rows.Add(rowProc);
                }
            }
            gridMain.EndUpdate();
        }
        private void FillClaimDetails(int rowIndex)
        {
            Claim claimSelected  = (Claim)gridClaims.Rows[rowIndex].Tag;
            bool  isSupplemental = (claimSelected.ClaimStatus == "R");

            _listClaimProcsForClaim = ClaimProcs.RefreshForClaim(claimSelected.ClaimNum)
                                      .Where(x => x.ProcNum != 0 && x.Status.In(ClaimProcStatus.Received, ClaimProcStatus.NotReceived, ClaimProcStatus.Preauth))
                                      .ToList();
            gridClaimDetails.BeginUpdate();
            if (gridClaimDetails.Columns.Count == 0)
            {
                #region grid columns
                gridClaimDetails.Columns.Add(new UI.ODGridColumn("ProcCode", 100));
                gridClaimDetails.Columns.Add(new UI.ODGridColumn("ProcFee", 100));
                gridClaimDetails.Columns.Add(new UI.ODGridColumn("ProcStatus", 0));
                gridClaimDetails.Columns.Add(new UI.ODGridColumn("IsMatch", 0));
                gridClaimDetails.Columns.Add(new UI.ODGridColumn("EraCode", 100));
                gridClaimDetails.Columns.Add(new UI.ODGridColumn("EraFee", 100));
                #endregion
            }
            gridClaimDetails.Rows.Clear();
            List <Hx835_Proc> listUnMatchedEraProcs = new List <Hx835_Proc>();
            List <Tuple <Hx835_Proc, ClaimProc> > listMatchedEraProcs = new List <Tuple <Hx835_Proc, ClaimProc> >();
            foreach (Hx835_Proc proc in _x835Claim.ListProcs)
            {
                ClaimProc claimProc = _listClaimProcsForClaim.FirstOrDefault(x =>
                                                                             //Mimics proc matching in claimPaid.GetPaymentsForClaimProcs(...)
                                                                             x.ProcNum != 0 && ((x.ProcNum == proc.ProcNum) ||
                                                                                                (x.CodeSent == proc.ProcCodeBilled &&
                                                                                                 (decimal)x.FeeBilled == proc.ProcFee &&
                                                                                                 (isSupplemental && x.Status == ClaimProcStatus.Received || !isSupplemental && x.Status == ClaimProcStatus.NotReceived) &&
                                                                                                 x.TagOD == null))
                                                                             );
                if (claimProc == null)               //Not found
                {
                    listUnMatchedEraProcs.Add(proc);
                }
                else
                {
                    claimProc.TagOD = true;                  //Flag set to indicate that claimProc has been handled
                    listMatchedEraProcs.Add(new Tuple <Hx835_Proc, ClaimProc>(proc, claimProc));
                }
            }
            #region ERA procs that could not be matched
            foreach (Hx835_Proc proc in listUnMatchedEraProcs)
            {
                UI.ODGridRow row = new UI.ODGridRow();
                row.Cells.Add("");
                row.Cells.Add("");
                row.Cells.Add("");
                row.Cells.Add("N");
                row.Cells.Add(proc.ProcCodeBilled);
                row.Cells.Add(POut.Decimal(proc.ProcFee));
                row.ColorText = Color.Red;
                row.Bold      = true;
                gridClaimDetails.Rows.Add(row);
            }
            #endregion
            #region ERA procs that we can match.
            foreach (Tuple <Hx835_Proc, ClaimProc> match in listMatchedEraProcs)
            {
                Hx835_Proc   proc      = match.Item1;
                ClaimProc    claimProc = match.Item2;
                UI.ODGridRow row       = new UI.ODGridRow();
                row.Cells.Add(claimProc.CodeSent);
                row.Cells.Add(POut.Double(claimProc.FeeBilled));
                #region Status column
                switch (claimProc.Status)
                {
                case ClaimProcStatus.Received:
                    row.Cells.Add("Recd");
                    break;

                case ClaimProcStatus.NotReceived:
                    row.Cells.Add("");
                    break;
                }
                #endregion
                row.Cells.Add("Y");
                row.Cells.Add(proc.ProcCodeBilled);
                row.Cells.Add(POut.Decimal(proc.ProcFee));
                row.ColorText = Color.Green;
                row.Bold      = true;
                gridClaimDetails.Rows.Add(row);
            }
            #endregion
            #region Claim claimProcs that could not be matched.
            foreach (ClaimProc claimProc in _listClaimProcsForClaim)
            {
                if (claimProc.TagOD != null)
                {
                    continue;
                }
                UI.ODGridRow row = new UI.ODGridRow();
                row.Cells.Add(claimProc.CodeSent);
                row.Cells.Add(POut.Double(claimProc.FeeBilled));
                switch (claimProc.Status)
                {
                    #region Status column
                case ClaimProcStatus.Received:
                    row.Cells.Add("Recd");
                    break;

                case ClaimProcStatus.NotReceived:
                    row.Cells.Add("");
                    break;
                }
                #endregion
                row.Cells.Add("N");
                row.Cells.Add("");
                row.Cells.Add("");
                gridClaimDetails.Rows.Add(row);
            }
            #endregion
            gridClaimDetails.EndUpdate();
        }
        ///<summary>Sets the foreground text to red if any row has a DOS between textDOSFrom and textDOSTo and matches textClaimFee </summary>
        private void HighlightRows()
        {
            DateTime dateFrom           = PIn.Date(textDateFrom.Text);
            DateTime dateTo             = PIn.Date(textDateTo.Text);
            double   fee                = PIn.Double(textClaimFee.Text);
            int      rowsHighlightCount = 0;
            int      lastHighlightIndex = 0;

            gridClaims.BeginUpdate();
            for (int i = 0; i < gridClaims.ListGridRows.Count; i++)
            {
                gridClaims.ListGridRows[i].ColorText = Color.Black; //reset row highlighting
                gridClaims.ListGridRows[i].Bold      = false;       //reset row highlighting
                Claim claim       = (Claim)gridClaims.ListGridRows[i].Tag;
                YN    isFeeMatch  = YN.No;                          //If fee matches then yes, if fee doesnt match then no, if no fee entered then unknown
                YN    isDateMatch = YN.No;                          //If both dates match then yes, if both dates dont match then no, if no dates entered then unknown
                //Check fee
                if (textClaimFee.Text == "")                        //No fee entered
                {
                    isFeeMatch = YN.Unknown;
                }
                else
                {
                    if (claim.ClaimFee.ToString("f").Contains(textClaimFee.Text))
                    {
                        isFeeMatch = YN.Yes;
                    }
                }
                //Check date
                if (dateFrom == DateTime.MinValue && dateTo == DateTime.MinValue)               //No dates entered
                {
                    isDateMatch = YN.Unknown;
                }
                else                    //At least one date entered
                {
                    if ((dateFrom.CompareTo(claim.DateService) <= 0 || dateFrom == DateTime.MinValue) &&
                        (dateTo.CompareTo(claim.DateService) >= 0 || dateTo == DateTime.MinValue))
                    {
                        isDateMatch = YN.Yes;
                    }
                }
                Hx835_Proc proc         = _x835Claim.ListProcs.FirstOrDefault();
                bool       isPlanMatch  = true;                                                                                             //Assume true for backwards compatiablity, because older 837s did not send out the Ordinal and PlanNum.
                bool       isBasicMatch = (isFeeMatch == YN.Yes || isDateMatch == YN.Yes) && (isFeeMatch != YN.No && isDateMatch != YN.No); //If either match and neither don't match
                if (isBasicMatch && proc != null && proc.PlanNum != 0)                                                                      //Consider new 837 REF*6R pattern for values starting with 'x'.
                {
                    if (_listPatPlans == null)
                    {
                        _listPatPlans = PatPlans.GetPatPlansForPat(_patNum);
                    }
                    //Strict PlanNum AND Ordinal match.  Users can manually change ordinals easily after sending claims.
                    //A failure to match here is OK because we will give the user the option to manually select the correct claim from the grid.
                    if (proc.PlanNum != claim.PlanNum || PatPlans.GetOrdinal(claim.InsSubNum, _listPatPlans) != proc.PlanOrdinal)
                    {
                        isPlanMatch = false;
                    }
                }
                if (isBasicMatch && isPlanMatch)
                {
                    //Highlight row
                    gridClaims.ListGridRows[i].ColorText = Color.Red;
                    gridClaims.ListGridRows[i].Bold      = true;
                    rowsHighlightCount++;
                    lastHighlightIndex = i;
                }
            }
            gridClaims.EndUpdate();
            if (rowsHighlightCount == 1)
            {
                gridClaims.SetSelected(lastHighlightIndex, true);
                FillClaimDetails(lastHighlightIndex);
            }
        }