Пример #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);
        }
Пример #2
0
        private void FillGrid()
        {
            PtTableSearchParams ptTableSearchParams = new PtTableSearchParams(false, textLName.Text, textFName.Text, "", "", false, "", "", "", "", "", 0, false, false,
                                                                              DateTime.MinValue, 0, "", "", "", "", "", "", "");

            table = Patients.GetPtDataTable(ptTableSearchParams);
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col;

            col = new GridColumn("PatNum", 70);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("LName", 120);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("FName", 120);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                row = new GridRow();
                row.Cells.Add(table.Rows[i]["PatNum"].ToString());
                row.Cells.Add(table.Rows[i]["LName"].ToString());
                row.Cells.Add(table.Rows[i]["FName"].ToString());
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
        private void GetDataTablePatForConn(ODThread odThread)
        {
            CentralConnection connection = (CentralConnection)odThread.Parameters[0];
            //Filter the threads by their connection name
            string connName = "";

            if (connection.DatabaseName == "")           //uri
            {
                connName = connection.ServiceURI;
            }
            else
            {
                connName = connection.ServerName + ", " + connection.DatabaseName;
            }
            if (!CentralConnectionHelper.SetCentralConnection(connection, false))
            {
                lock (_lockObj) {
                    _invalidConnsLog += "\r\n" + connName;
                    _complConnCount++;
                }
                connection.ConnectionStatus = "OFFLINE";
                BeginInvoke((Action)FillGridPats);
                return;
            }
            List <DisplayField> fields = DisplayFields.GetForCategory(DisplayFieldCategory.CEMTSearchPatients);
            bool      hasNextLastVisit = fields.Any(x => x.InternalName.In("NextVisit", "LastVisit"));
            DataTable table            = new DataTable();

            try {
                PtTableSearchParams ptTableSearchParams = new PtTableSearchParams(checkLimit.Checked, textLName.Text, textFName.Text, textPhone.Text,
                                                                                  textAddress.Text, checkHideInactive.Checked, textCity.Text, textState.Text, textSSN.Text, textPatNum.Text, textChartNumber.Text, 0,
                                                                                  checkGuarantors.Checked, !checkHideArchived.Checked,//checkHideArchived is opposite label for what this function expects, but hideArchived makes more sense
                                                                                  SIn.DateT(textBirthdate.Text), 0, textSubscriberID.Text, textEmail.Text, textCountry.Text, "", "", "", "", hasNextLastVisit: hasNextLastVisit);
                table = Patients.GetPtDataTable(ptTableSearchParams);
            }
            catch (ThreadAbortException tae) {
                throw tae;                //ODThread needs to clean up after an abort exception is thrown.
            }
            catch (Exception) {
                //This can happen if the connection to the server was severed somehow during the execution of the query.
                lock (_lockObj) {
                    _invalidConnsLog += "\r\n" + connName + "  -GetPtDataTable";
                    _complConnCount++;
                }
                BeginInvoke((Action)FillGridPats);                //Pops up a message box if this was the last thread to finish.
                return;
            }
            table.TableName = connName;
            odThread.Tag    = table;
            lock (_lockObj) {
                _complConnCount++;
                _dataSetPats.Tables.Add((DataTable)odThread.Tag);
            }
            BeginInvoke((Action)FillGridPats);
        }
Пример #4
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
        }