Exemplo n.º 1
0
        ///<summary>If given claim!=null, attempts to open the patient select and claim select windows.
        ///Sets isAttachNeeded to true if user went through full patient and claim selection logic, claim was not null when provided.
        ///Returns false if user does not select a claim.</summary>
        private Claim ClaimSelectionHelper(Hx835_Claim claimPaid)
        {
            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
            long      selectedPatNum = 0;

            if (ptTable.Rows.Count == 1)
            {
                selectedPatNum = PIn.Long(ptTable.Rows[0]["PatNum"].ToString());
            }
            FormEtrans835ClaimSelect eTransClaimSelect = new FormEtrans835ClaimSelect(selectedPatNum, claimPaid);

            eTransClaimSelect.ShowDialog();
            if (eTransClaimSelect.DialogResult != DialogResult.OK)
            {
                return(null);
            }
            Claim claim = eTransClaimSelect.ClaimSelected;                                                    //Set claim so below we can act if a claim was already linked.

            if (!String.IsNullOrEmpty(claimPaid.ClaimTrackingNumber) && claimPaid.ClaimTrackingNumber != "0") //Claim was not printed, it is an eclaim.
            {
                claim.ClaimIdentifier = claimPaid.ClaimTrackingNumber;                                        //Already checked DOS and ClaimFee, update claim identifier to link claims.
                Claims.UpdateClaimIdentifier(claim.ClaimNum, claim.ClaimIdentifier);                          //Update DB
            }
            return(claim);
        }
Exemplo n.º 2
0
 ///<summary>Set x835 to view all x835.ListClaims info. Otherwise set claimPaid to a specific Hx835_Claim to view.</summary>
 public FormEtrans835Print(X835 x835, Hx835_Claim claimPaid = null)
 {
     InitializeComponent();
     Lan.F(this);
     _x835      = x835;
     _claimPaid = claimPaid;
 }
        ///<summary>PatNum used to get claims to fill grid.  x835Claim used to fill default text for date and claim fee filters and disallow OK click if
        ///claim details do not match.</summary>
        public FormEtrans835ClaimSelect(long patNum, Hx835_Claim x835Claim)
        {
            InitializeComponent();
            Lan.F(this);
            _x835Claim = x835Claim;
            _patNum    = patNum;
            if (_x835Claim.IsReversal)
            {
                this.Text += " - " + Lans.g(this, "Pick Original Claim for this Claim Reversal");
            }
            else if (_x835Claim.IsSplitClaim)
            {
                this.Text += " - " + Lans.g(this, "Pick Original Claim for this Split Claim");
                labelSplitClaims.Visible = true;
            }
            textPatient.Text = Patients.GetLim(_patNum).GetNameLF();
            decimal claimFee = x835Claim.ClaimFee;

            if (_x835Claim.IsReversal)
            {
                //Claim reversals have an exact negation of the original claimFee.
                claimFee = Math.Abs(claimFee);
            }
            textClaimFee.Text = claimFee.ToString();
            textDateFrom.Text = x835Claim.DateServiceStart.ToShortDateString();
            textDateTo.Text   = x835Claim.DateServiceEnd.ToShortDateString();
        }
        ///<summary>PatNum used to get claims to fill grid.  x835Claim used to fill default text for date and claim fee filters and disallow OK click if
        ///claim details do not match.</summary>
        public FormEtrans835ClaimSelect(long patNum, Hx835_Claim x835Claim)
        {
            InitializeComponent();
            Lan.F(this);
            _x835Claim = x835Claim;
            _patNum    = patNum;
            if (_patNum == 0)
            {
                _errorProvider.SetError(butPatFind, Lans.g(this, "Patient not found"));
            }
            if (_x835Claim.IsReversal)
            {
                this.Text += " - " + Lans.g(this, "Pick Original Claim for this Claim Reversal");
            }
            else if (_x835Claim.IsSplitClaim)
            {
                this.Text += " - " + Lans.g(this, "Pick Original Claim for this Split Claim");
                labelSplitClaims.Visible = true;
            }
            if (_patNum != 0)           //Otherwise a comma and period would show.
            {
                textPatient.Text = Patients.GetLim(_patNum).GetNameLF();
            }
            decimal claimFee = x835Claim.ClaimFee;

            if (_x835Claim.IsReversal)
            {
                //Claim reversals have an exact negation of the original claimFee.
                claimFee = Math.Abs(claimFee);
            }
            textClaimFee.Text = claimFee.ToString();
            textDateFrom.Text = x835Claim.DateServiceStart.ToShortDateString();
            textDateTo.Text   = x835Claim.DateServiceEnd.ToShortDateString();
        }
Exemplo n.º 5
0
 ///<summary>Returns if given claim is already recieved. Currently ERA test do not consider supplemental.</summary>
 public static void TryEnterPayment(X835 x835, Hx835_Claim claimPaid, Claim claim, bool isAutomatic)
 {
     if (claim.ClaimStatus == "R")           //Currently we do not have test for supplemental payments.
     {
         return;
     }
     EtransL.ImportEraClaimData(x835, claimPaid, claim, isAutomatic);
 }
Exemplo n.º 6
0
        public void SetupTest()
        {
            #region Create Patient and claim: Justin Smith
            Patient patJustinSmith = PatientT.CreatePatient(lName: "Smith", fName: "Justin");
            List <EraTestProcCodeData> listProcData = new List <EraTestProcCodeData>();
            listProcData.Add(new EraTestProcCodeData("D0120", ProcStat.TP, 43, new DateTime(2017, 09, 26)));
            listProcData.Add(new EraTestProcCodeData("D1110", ProcStat.TP, 110, new DateTime(2017, 09, 26)));
            listProcData.Add(new EraTestProcCodeData("D0602", ProcStat.TP, 5, new DateTime(2017, 09, 26)));
            _claimPrimaryJustinSmith = EtransT.SetupEraClaim(patJustinSmith, listProcData, "P", "217308827", out List <InsuranceInfo> _listJustinSmithInsuranceInfo);
            #endregion
            #region Create Patient and claim: Jacob Jones
            Patient patJacobJones = PatientT.CreatePatient(lName: "Jones", fName: "Jacob");
            listProcData.Clear();
            listProcData.Add(new EraTestProcCodeData("D0120", ProcStat.TP, 43, new DateTime(2017, 09, 26)));
            listProcData.Add(new EraTestProcCodeData("D1110", ProcStat.TP, 110, new DateTime(2017, 09, 26)));
            listProcData.Add(new EraTestProcCodeData("D1206", ProcStat.TP, 68, new DateTime(2017, 09, 26)));
            _claimPrimaryJacobJones = EtransT.SetupEraClaim(patJacobJones, listProcData, "P", "217180995", out List <InsuranceInfo> _listJacobJonesInsuranceInfo);
            #endregion
            #region Create Patient and claim: Stephanie Mayer
            Patient patStephanieMayer = PatientT.CreatePatient(lName: "Mayer", fName: "Stephanie");
            listProcData.Clear();
            listProcData.Add(new EraTestProcCodeData("D0120", ProcStat.TP, 43, new DateTime(2017, 09, 26)));
            listProcData.Add(new EraTestProcCodeData("D1110", ProcStat.TP, 110, new DateTime(2017, 09, 26)));
            listProcData.Add(new EraTestProcCodeData("D0602", ProcStat.TP, 5, new DateTime(2017, 09, 26)));
            listProcData.Add(new EraTestProcCodeData("D1206", ProcStat.TP, 68, new DateTime(2017, 09, 26)));
            _claimPrimaryStephanieMayer = EtransT.SetupEraClaim(patStephanieMayer, listProcData, "P", "217439125", out List <InsuranceInfo> _listStephanieMayerInsuranceInfo);
            #endregion
            //Create and insert etrans entry
            Etrans etrans835 = EtransT.Insert835Etrans(Properties.Resources.JustinSmithERA, new DateTime(2017, 09, 30));       //Spoof etrans imported 4 days after claim sent.
            List <ODTuple <Patient, long> > listPats = new List <ODTuple <Patient, long> >()
            {
                new ODTuple <Patient, long>(patJustinSmith, _claimPrimaryJustinSmith.ClaimNum),
                new ODTuple <Patient, long>(patJacobJones, _claimPrimaryJacobJones.ClaimNum),
                new ODTuple <Patient, long>(patStephanieMayer, _claimPrimaryStephanieMayer.ClaimNum)
            };
            _x835 = EtransT.Construct835(etrans835, Properties.Resources.JustinSmithERA, listPats, out _listEtrans835Attaches);
            foreach (Hx835_Claim eraClaim in _x835.ListClaimsPaid)
            {
                switch (eraClaim.PatientName.Fname.ToLower())
                {
                case "justin":
                    _eraJustinSmithClaim = eraClaim;
                    break;

                case "jacob":
                    _eraJacobJonesClaim = eraClaim;
                    break;

                case "stephanie":
                    _eraStephanieMayerClaim = eraClaim;
                    break;
                }
            }
        }
Exemplo n.º 7
0
        private void butClaimDetails_Click(object sender, EventArgs e)
        {
            if (gridClaimDetails.SelectedIndices.Length == 0)
            {
                MsgBox.Show(this, "Choose a claim paid before viewing details.");
                return;
            }
            Hx835_Claim            claimPaid = (Hx835_Claim)gridClaimDetails.ListGridRows[gridClaimDetails.SelectedIndices[0]].Tag;
            FormEtrans835ClaimEdit formE     = new FormEtrans835ClaimEdit(_x835, claimPaid);

            formE.Show(this);            //This window is just used to display information.
        }
Exemplo n.º 8
0
        public static void DetachEraClaim(Hx835_Claim claimPaid)
        {
            Etrans835Attaches.DeleteMany(claimPaid.ClpSegmentIndex, claimPaid.Era.EtransSource.EtransNum);
            Etrans835Attach attach = new Etrans835Attach();

            attach.EtransNum       = claimPaid.Era.EtransSource.EtransNum;
            attach.ClaimNum        = 0;
            attach.ClpSegmentIndex = claimPaid.ClpSegmentIndex;
            Etrans835Attaches.Insert(attach);
            claimPaid.IsAttachedToClaim = true;
            claimPaid.ClaimNum          = 0;
        }
Exemplo n.º 9
0
        ///<summary>Reads the X12 835 text in the MessageText variable and displays the information from Table 2 (Detail).</summary>
        private void FillClaimDetails()
        {
            gridClaimDetails.BeginUpdate();
            gridClaimDetails.ListGridColumns.Clear();
            gridClaimDetails.ListGridColumns.Add(new GridColumn(Lan.g(this, "Recd"), 32, HorizontalAlignment.Center));
            gridClaimDetails.ListGridColumns.Add(new GridColumn(Lan.g(this, "Patient"), 0, HorizontalAlignment.Left));
            gridClaimDetails.ListGridColumns.Add(new GridColumn(Lan.g(this, "DateService"), 80, HorizontalAlignment.Center));
            gridClaimDetails.ListGridColumns.Add(new GridColumn(Lan.g(this, "Claim\r\nIdentifier"), 50, HorizontalAlignment.Left));
            gridClaimDetails.ListGridColumns.Add(new GridColumn(Lan.g(this, "Payor\r\nControl#"), 56, HorizontalAlignment.Center)); //Payer Claim Control Number (CLP07)
            gridClaimDetails.ListGridColumns.Add(new GridColumn(Lan.g(this, "Status"), 0, HorizontalAlignment.Left));               //Claim Status Code Description (CLP02)
            gridClaimDetails.ListGridColumns.Add(new GridColumn(Lan.g(this, "ClaimFee"), 70, HorizontalAlignment.Right));           //Total Claim Charge Amount (CLP03)
            gridClaimDetails.ListGridColumns.Add(new GridColumn(Lan.g(this, "InsPaid"), 70, HorizontalAlignment.Right));            //Claim Payment Amount (CLP04)
            gridClaimDetails.ListGridColumns.Add(new GridColumn(Lan.g(this, "PatPort"), 70, HorizontalAlignment.Right));            //Patient Portion
            gridClaimDetails.ListGridColumns.Add(new GridColumn(Lan.g(this, "Deduct"), 70, HorizontalAlignment.Right));             //Deductible
            gridClaimDetails.ListGridColumns.Add(new GridColumn(Lan.g(this, "Writeoff"), 70, HorizontalAlignment.Right));           //Writeoff
            gridClaimDetails.ListGridRows.Clear();
            _claimInsPaidSum = 0;
            List <int>         listMatchedRows = new List <int>();
            List <Hx835_Claim> listClaimsPaid  = _x835.ListClaimsPaid;

            for (int i = 0; i < listClaimsPaid.Count; i++)
            {
                Hx835_Claim claimPaid = listClaimsPaid[i];
                GridRow     row       = new GridRow();
                SetClaimDetailRows(new List <GridRow>()
                {
                    row
                }, new List <Hx835_Claim>()
                {
                    claimPaid
                });
                _claimInsPaidSum += claimPaid.InsPaid;
                gridClaimDetails.ListGridRows.Add(row);
                if (!_hasPrintPreviewOnLoad &&            //Only show print prevew once.
                    claimPaid.ClaimNum != 0 && claimPaid.ClaimNum == _preLoadedPrintPreviewClaimNum)                   //Specific claim num provided for auto selecting and print preview.
                {
                    listMatchedRows.Add(i);
                }
            }
            gridClaimDetails.EndUpdate();
            if (listMatchedRows.Count > 0)
            {
                _hasPrintPreviewOnLoad = true;
                listMatchedRows.ForEach(x => gridClaimDetails.SetSelected(x, true));
            }
        }
Exemplo n.º 10
0
 private void DetachClaimHelper(List <int> listGridIndices)
 {
     gridClaimDetails.BeginUpdate();
     for (int i = 0; i < listGridIndices.Count; i++)
     {
         GridRow     row       = gridClaimDetails.ListGridRows[listGridIndices[i]];
         Hx835_Claim claimPaid = (Hx835_Claim)row.Tag;
         Etrans835Attaches.DetachEraClaim(claimPaid);
         SetClaimDetailRows(new List <GridRow>()
         {
             row
         }, new List <Hx835_Claim>()
         {
             claimPaid
         }, true);
     }
     gridClaimDetails.EndUpdate();
 }
Exemplo n.º 11
0
        ///<summary>Builds the X835 for given etrans835 and etransMessageText.
        ///Also attempts to create attaches for patients in listPatients using their first/last name and the claim num in their tuple entry.</summary>
        public static X835 Construct835(Etrans etrans835, string etransMessageText, List <ODTuple <Patient, long> > listPatients, out List <Etrans835Attach> listEtrans835Attaches)
        {
            listEtrans835Attaches = new List <Etrans835Attach>();
            //Construct the inital X835 so that we can find the ERA claim we are testing against, needed for attach information.
            X835 x835 = new X835(etrans835, etransMessageText, etrans835.TranSetId835);

            foreach (ODTuple <Patient, long> data in listPatients)
            {
                Patient pat      = data.Item1;
                long    claimNum = data.Item2;
                //Then using that ERA claim we will spoof the Etrans835Attach logic that would run when associating an OD claim to the ERA claim.
                Hx835_Claim eraClaim = x835.ListClaimsPaid.First(x => x.PatientName.Fname.ToLower() == pat.FName.ToLower() && x.PatientName.Lname.ToLower() == pat.LName.ToLower());
                //Spoof ERA claim attachement.
                Etrans835Attach attach = Insert835Attach(etrans835.EtransNum, claimNum, eraClaim.ClpSegmentIndex, etrans835.DateTimeTrans);
                listEtrans835Attaches.Add(attach);
            }
            //Finally we must reconstruct the X835 with the new spoofed attach.
            return(new X835(etrans835, etransMessageText, etrans835.TranSetId835, listEtrans835Attaches));
        }
Exemplo n.º 12
0
 ///<summary>ListRows and ListClaimsPaid must be 1:1 and in the same order.</summary>
 private void SetClaimDetailRows(List <GridRow> listRows, List <Hx835_Claim> listClaimsPaid, bool isRefreshNeeded = false)
 {
     if (isRefreshNeeded)
     {
         RefreshFromDb();
     }
     for (int i = 0; i < listRows.Count; i++)
     {
         UI.GridRow  row       = listRows[i];
         Hx835_Claim claimPaid = listClaimsPaid[i];
         row.Tag = claimPaid;
         row.Cells.Clear();
         string claimStatus = "";
         if (claimPaid.IsProcessed(_listClaimProcs, _listAttaches))
         {
             claimStatus = "X";
         }
         else if (claimPaid.IsAttachedToClaim && claimPaid.ClaimNum == 0)
         {
             claimStatus = "N/A";                  //User detached claim manually.
         }
         row.Cells.Add(claimStatus);
         row.Cells.Add(new UI.GridCell(claimPaid.PatientName.ToString()));                //Patient
         string strDateService = claimPaid.DateServiceStart.ToShortDateString();
         if (claimPaid.DateServiceEnd > claimPaid.DateServiceStart)
         {
             strDateService += " to " + claimPaid.DateServiceEnd.ToShortDateString();
         }
         row.Cells.Add(new UI.GridCell(strDateService));                             //DateService
         row.Cells.Add(new UI.GridCell(claimPaid.ClaimTrackingNumber));              //Claim Identfier
         row.Cells.Add(new UI.GridCell(claimPaid.PayerControlNumber));               //PayorControlNum
         row.Cells.Add(new UI.GridCell(claimPaid.StatusCodeDescript));               //Status
         row.Cells.Add(new UI.GridCell(claimPaid.ClaimFee.ToString("f2")));          //ClaimFee
         row.Cells.Add(new UI.GridCell(claimPaid.InsPaid.ToString("f2")));           //InsPaid
         row.Cells.Add(new UI.GridCell(claimPaid.PatientPortionAmt.ToString("f2"))); //PatPort
         row.Cells.Add(new UI.GridCell(claimPaid.PatientDeductAmt.ToString("f2")));  //Deduct
         row.Cells.Add(new UI.GridCell(claimPaid.WriteoffAmt.ToString("f2")));       //Writeoff
     }
 }
Exemplo n.º 13
0
        ///<summary>Inserts new Etrans835Attach for given claimPaid and claim.
        ///Deletes any existing Etrans835Attach prior to inserting new one.
        ///Sets claimPaid.ClaimNum and claimPaid.IsAttachedToClaim.</summary>
        private void CreateAttachForClaim(Hx835_Claim claimPaid, long claimNum, bool isNewAttachNeeded)
        {
            if (!isNewAttachNeeded &&
                _listAttaches.Exists(
                    x => x.ClaimNum == claimNum &&
                    x.EtransNum == _x835.EtransSource.EtransNum &&
                    x.ClpSegmentIndex == claimPaid.ClpSegmentIndex)
                )
            {
                //Not forcing a new attach and one already exists.
                return;
            }
            //Create a hard link between the selected claim and the claim info on the 835.
            Etrans835Attaches.DeleteMany(claimPaid.ClpSegmentIndex, EtransCur.EtransNum);           //Detach existing if any.
            Etrans835Attach attach = new Etrans835Attach();

            attach.EtransNum       = EtransCur.EtransNum;
            attach.ClaimNum        = claimNum;
            attach.ClpSegmentIndex = claimPaid.ClpSegmentIndex;
            Etrans835Attaches.Insert(attach);
            claimPaid.ClaimNum          = claimNum;
            claimPaid.IsAttachedToClaim = true;
        }
Exemplo n.º 14
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
        }
Exemplo n.º 15
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();
            }
        }
Exemplo n.º 16
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();
        }