private void butOK_Click(object sender, System.EventArgs e)
        {
            int    feeSched = DefB.Short[(int)DefCat.FeeSchedNames][listFeeSched.SelectedIndex].DefNum;
            string catName  = ""; //string to hold current category name
            Fees   fee      = new Fees();

            Queries.CurReport = new ReportOld();

            Queries.CurReport.Query = "SELECT procedurecode.ProcCode,fee.Amount,'     ',procedurecode.Descript,"
                                      + "procedurecode.AbbrDesc FROM procedurecode,fee "
                                      + "WHERE procedurecode.CodeNum=fee.CodeNum AND fee.FeeSched='" + feeSched.ToString()
                                      + "' ORDER BY procedurecode.ProcCode";
            FormQuery2          = new FormQuery();
            FormQuery2.IsReport = true;
            if (radioCode.Checked == true)
            {
                FormQuery2.SubmitReportQuery();
                Queries.CurReport.Title         = "Procedure Codes";
                Queries.CurReport.SubTitle      = new string[2];
                Queries.CurReport.SubTitle[0]   = ((Pref)PrefB.HList["PracticeTitle"]).ValueString;
                Queries.CurReport.SubTitle[1]   = DefB.GetName(DefCat.FeeSchedNames, feeSched);
                Queries.CurReport.ColPos        = new int[6];
                Queries.CurReport.ColCaption    = new string[5];
                Queries.CurReport.ColAlign      = new HorizontalAlignment[5];
                Queries.CurReport.ColPos[0]     = 60;
                Queries.CurReport.ColPos[1]     = 130;
                Queries.CurReport.ColPos[2]     = 200;
                Queries.CurReport.ColPos[3]     = 220;
                Queries.CurReport.ColPos[4]     = 420;
                Queries.CurReport.ColPos[5]     = 620;
                Queries.CurReport.ColCaption[0] = "Code";
                Queries.CurReport.ColCaption[1] = "Fee Amount";
                Queries.CurReport.ColCaption[2] = " ";              //otherwise, the amount gets bunched up next to the description.
                Queries.CurReport.ColCaption[3] = "Description";
                Queries.CurReport.ColCaption[4] = "Abbr Description";
                //Queries.CurReport.ColCaption[3]="Fee Amount";
                Queries.CurReport.ColAlign[1] = HorizontalAlignment.Right;
                Queries.CurReport.Summary     = new string[0];
                FormQuery2.ShowDialog();
                DialogResult = DialogResult.OK;
            }
            else                      //categories
            {
                Queries.SubmitTemp(); //create TableTemp which is not actually used
                ProcedureCode[] ProcList = ProcedureCodes.GetProcList();
                Queries.TableQ = new DataTable(null);
                for (int i = 0; i < 5; i++)                                   //add columns
                {
                    Queries.TableQ.Columns.Add(new System.Data.DataColumn()); //blank columns
                }
                Queries.CurReport.ColTotal = new double[Queries.TableQ.Columns.Count];
                DataRow row = Queries.TableQ.NewRow();//add first row by hand to get value for temp
                row[0]  = DefB.GetName(DefCat.ProcCodeCats, ProcList[0].ProcCat);
                catName = row[0].ToString();
                row[1]  = ProcList[0].ProcCode;
                row[2]  = ProcList[0].Descript;
                row[3]  = ProcList[0].AbbrDesc;
                row[4]  = ((double)Fees.GetAmount0(ProcList[0].CodeNum, feeSched)).ToString("F");
                Queries.CurReport.ColTotal[4] += PIn.PDouble(row[4].ToString());
                Queries.TableQ.Rows.Add(row);
                for (int i = 1; i < ProcList.Length; i++)          //loop through data rows
                {
                    row    = Queries.TableQ.NewRow();              //create new row called 'row' based on structure of TableQ
                    row[0] = DefB.GetName(DefCat.ProcCodeCats, ProcList[i].ProcCat);
                    if (catName == row[0].ToString())
                    {
                        row[0] = "";
                    }
                    else
                    {
                        catName = row[0].ToString();
                    }
                    row[1] = ProcList[i].ProcCode.ToString();
                    row[2] = ProcList[i].Descript;
                    row[3] = ProcList[i].AbbrDesc.ToString();
                    row[4] = ((double)Fees.GetAmount0(ProcList[i].CodeNum, feeSched)).ToString("F");
                    //Queries.CurReport.ColTotal[4]+=PIn.PDouble(row[4].ToString());
                    Queries.TableQ.Rows.Add(row);
                }
                Queries.CurReport.ColWidth   = new int[Queries.TableQ.Columns.Count];
                Queries.CurReport.ColPos     = new int[Queries.TableQ.Columns.Count + 1];
                Queries.CurReport.ColPos[0]  = 0;
                Queries.CurReport.ColCaption = new string[Queries.TableQ.Columns.Count];
                Queries.CurReport.ColAlign   = new HorizontalAlignment[Queries.TableQ.Columns.Count];
                FormQuery2.ResetGrid();                //this is a method in FormQuery2;

                Queries.CurReport.Title         = "Procedure Codes";
                Queries.CurReport.SubTitle      = new string[5];
                Queries.CurReport.SubTitle[0]   = ((Pref)PrefB.HList["PracticeTitle"]).ValueString;
                Queries.CurReport.SubTitle[1]   = DefB.GetName(DefCat.FeeSchedNames, feeSched);
                Queries.CurReport.ColPos[0]     = 20;
                Queries.CurReport.ColPos[1]     = 120;
                Queries.CurReport.ColPos[2]     = 270;
                Queries.CurReport.ColPos[3]     = 470;
                Queries.CurReport.ColPos[4]     = 620;
                Queries.CurReport.ColPos[5]     = 770;
                Queries.CurReport.ColCaption[0] = "Category";
                Queries.CurReport.ColCaption[1] = "Code";
                Queries.CurReport.ColCaption[2] = "Description";
                Queries.CurReport.ColCaption[3] = "Abbr Description";
                Queries.CurReport.ColCaption[4] = "Fee Amount";
                Queries.CurReport.ColAlign[4]   = HorizontalAlignment.Right;
                Queries.CurReport.Summary       = new string[5];
                FormQuery2.ShowDialog();
                DialogResult = DialogResult.OK;
            }
        }
Exemple #2
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            Queries.CurReport = new ReportOld();
            // replaced insplan.carrier by carrier.carrierName, SPK 7/15/04
            Queries.CurReport.Query = "SELECT claim.dateservice,claim.claimnum,claim.claimtype,claim.claimstatus,"
                                      + "CONCAT(CONCAT(CONCAT(CONCAT(patient.LName,', '),patient.FName),' '),patient.MiddleI),carrier.CarrierName,claim.claimfee "
                                      + "FROM patient,claim,insplan,carrier "
                                      + "WHERE patient.patnum=claim.patnum AND insplan.plannum=claim.plannum "
                                      + "AND insplan.CarrierNum=carrier.CarrierNum " // added SPK
                                      + "AND (claim.claimstatus = 'U' OR claim.claimstatus = 'H' OR  claim.claimstatus = 'W')";
            if (radioRange.Checked == true)                                          // added 'W', SPK 7/15/04
            {
                Queries.CurReport.Query
                    += " AND claim.dateservice >= '" + date1.SelectionStart.ToString("yyyy-MM-dd") + "' "
                       + "AND claim.dateservice <= '" + date2.SelectionStart.ToString("yyyy-MM-dd") + "'";
            }
            else
            {
                Queries.CurReport.Query
                    += " AND claim.dateservice = '" + date1.SelectionStart.ToString("yyyy-MM-dd") + "'";
            }
            FormQuery2          = new FormQuery();
            FormQuery2.IsReport = true;
            Queries.SubmitTemp();                                         //create TableTemp
            Queries.TableQ = new DataTable(null);                         //new table no name
            for (int i = 0; i < 6; i++)                                   //add columns
            {
                Queries.TableQ.Columns.Add(new System.Data.DataColumn()); //blank columns
            }
            Queries.CurReport.ColTotal = new double[Queries.TableQ.Columns.Count];
            for (int i = 0; i < Queries.TableTemp.Rows.Count; i++)                                 //loop through data rows
            {
                DataRow row = Queries.TableQ.NewRow();                                             //create new row called 'row' based on structure of TableQ
                row[0] = (PIn.PDate(Queries.TableTemp.Rows[i][0].ToString())).ToShortDateString(); //claim dateservice
                if (PIn.PString(Queries.TableTemp.Rows[i][2].ToString()) == "P")
                {
                    row[1] = "Primary";
                }
                if (PIn.PString(Queries.TableTemp.Rows[i][2].ToString()) == "S")
                {
                    row[1] = "Secondary";
                }
                if (PIn.PString(Queries.TableTemp.Rows[i][2].ToString()) == "PreAuth")
                {
                    row[1] = "PreAuth";
                }
                if (PIn.PString(Queries.TableTemp.Rows[i][2].ToString()) == "Other")
                {
                    row[1] = "Other";
                }
                if (Queries.TableTemp.Rows[i][3].ToString().Equals("H"))
                {
                    row[2] = "Holding";            //Claim Status
                }
                else if (Queries.TableTemp.Rows[i][3].ToString().Equals("W"))
                {
                    row[2] = "WaitQ";                  //Claim Status, added SPK 7/15/04
                }
                else
                {
                    row[2] = "Unsent";                                                       //Claim Status
                }
                row[3] = Queries.TableTemp.Rows[i][4];                                       //Patient name
                row[4] = Queries.TableTemp.Rows[i][5];                                       //Ins Carrier
                row[5] = PIn.PDouble(Queries.TableTemp.Rows[i][6].ToString()).ToString("F"); //claim fee
                Queries.CurReport.ColTotal[5] += PIn.PDouble(Queries.TableTemp.Rows[i][6].ToString());
                Queries.TableQ.Rows.Add(row);
            }
            Queries.CurReport.ColWidth   = new int[Queries.TableQ.Columns.Count];
            Queries.CurReport.ColPos     = new int[Queries.TableQ.Columns.Count + 1];
            Queries.CurReport.ColPos[0]  = 0;
            Queries.CurReport.ColCaption = new string[Queries.TableQ.Columns.Count];
            Queries.CurReport.ColAlign   = new HorizontalAlignment[Queries.TableQ.Columns.Count];
            FormQuery2.ResetGrid();            //this is a method in FormQuery2;

            Queries.CurReport.Title       = "Claims Not Sent";
            Queries.CurReport.SubTitle    = new string[3];
            Queries.CurReport.SubTitle[0] = ((Pref)PrefB.HList["PracticeTitle"]).ValueString;
            if (radioRange.Checked == true)
            {
                Queries.CurReport.SubTitle[1] = date1.SelectionStart.ToString("d") + " - " + date2.SelectionStart.ToString("d");
            }
            else
            {
                Queries.CurReport.SubTitle[1] = date1.SelectionStart.ToString("d");
            }
            Queries.CurReport.ColPos[0]     = 20;
            Queries.CurReport.ColPos[1]     = 145;
            Queries.CurReport.ColPos[2]     = 270;
            Queries.CurReport.ColPos[3]     = 395;
            Queries.CurReport.ColPos[4]     = 520;
            Queries.CurReport.ColPos[5]     = 645;
            Queries.CurReport.ColPos[6]     = 770;
            Queries.CurReport.ColCaption[0] = "Date";
            Queries.CurReport.ColCaption[1] = "Type";
            Queries.CurReport.ColCaption[2] = "Claim Status";
            Queries.CurReport.ColCaption[3] = "Patient Name";
            Queries.CurReport.ColCaption[4] = "Insurance Carrier";
            Queries.CurReport.ColCaption[5] = "Amount";
            Queries.CurReport.ColAlign[5]   = HorizontalAlignment.Right;
            Queries.CurReport.Summary       = new string[3];
            FormQuery2.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Exemple #3
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textDaysOld.errorProvider1.GetError(textDaysOld) != "")
            {
                MessageBox.Show(Lan.g("All", "Please correct data entry errors first."));
                return;
            }
            int daysOld = PIn.PInt(textDaysOld.Text);

            //FormQuery2.ResetGrid();//this is a method in FormQuery2;
            Queries.CurReport = new ReportOld();
            DateTime startQDate = DateTime.Today.AddDays(-daysOld);

            Queries.CurReport.Query = "SELECT carrier.CarrierName,claim.ClaimNum"
                                      + ",claim.ClaimType,claim.DateService,"
                                      + "CONCAT(CONCAT(CONCAT(CONCAT(patient.LName,', '),patient.FName),' '),patient.MiddleI), claim.DateSent"
                                      + ",claim.ClaimFee,carrier.Phone "
                                      + "FROM claim,insplan,patient,carrier "
                                      + "WHERE claim.PlanNum = insplan.PlanNum "
                                      + "AND claim.PatNum = patient.PatNum "
                                      + "AND carrier.CarrierNum = insplan.CarrierNum "
                                      + "AND claim.ClaimStatus='S' && claim.DateSent < " + POut.PDate(startQDate) + " "
                                      + "ORDER BY carrier.Phone,insplan.PlanNum";
            FormQuery2          = new FormQuery();
            FormQuery2.IsReport = true;

            Queries.SubmitTemp();                                         //create TableTemp
            Queries.TableQ = new DataTable(null);                         //new table no name
            for (int i = 0; i < 6; i++)                                   //add columns
            {
                Queries.TableQ.Columns.Add(new System.Data.DataColumn()); //blank columns
            }
            Queries.CurReport.ColTotal = new double[Queries.TableQ.Columns.Count];
            for (int i = 0; i < Queries.TableTemp.Rows.Count; i++)    //loop through data rows
            {
                DataRow row = Queries.TableQ.NewRow();                //create new row called 'row' based on structure of TableQ
                //start filling 'row'. First column is carrier:
                row[0] = Queries.TableTemp.Rows[i][0];
                row[1] = Queries.TableTemp.Rows[i][7];
                if (PIn.PString(Queries.TableTemp.Rows[i][2].ToString()) == "P")
                {
                    row[2] = "Primary";
                }
                if (PIn.PString(Queries.TableTemp.Rows[i][2].ToString()) == "S")
                {
                    row[2] = "Secondary";
                }
                if (PIn.PString(Queries.TableTemp.Rows[i][2].ToString()) == "PreAuth")
                {
                    row[2] = "PreAuth";
                }
                if (PIn.PString(Queries.TableTemp.Rows[i][2].ToString()) == "Other")
                {
                    row[2] = "Other";
                }
                row[3] = Queries.TableTemp.Rows[i][4];
                row[4] = (PIn.PDate(Queries.TableTemp.Rows[i][3].ToString())).ToString("d");
                row[5] = PIn.PDouble(Queries.TableTemp.Rows[i][6].ToString()).ToString("F");
                //TimeSpan d = DateTime.Today.Subtract((PIn.PDate(Queries.TableTemp.Rows[i][5].ToString())));
                //if(d.Days>5000)
                //	row[4]="";
                //else
                //	row[4]=d.Days.ToString();
                Queries.CurReport.ColTotal[5] += PIn.PDouble(Queries.TableTemp.Rows[i][6].ToString());
                Queries.TableQ.Rows.Add(row);
            }
            Queries.CurReport.ColWidth   = new int[Queries.TableQ.Columns.Count];
            Queries.CurReport.ColPos     = new int[Queries.TableQ.Columns.Count + 1];
            Queries.CurReport.ColPos[0]  = 0;
            Queries.CurReport.ColCaption = new string[Queries.TableQ.Columns.Count];
            Queries.CurReport.ColAlign   = new HorizontalAlignment[Queries.TableQ.Columns.Count];
            FormQuery2.ResetGrid();            //this is a method in FormQuery2;
            Queries.CurReport.Title         = "OUTSTANDING INSURANCE CLAIMS";
            Queries.CurReport.SubTitle      = new string[3];
            Queries.CurReport.SubTitle[0]   = ((Pref)PrefB.HList["PracticeTitle"]).ValueString;
            Queries.CurReport.SubTitle[1]   = "Days Outstanding: " + daysOld;
            Queries.CurReport.ColPos[0]     = 20;
            Queries.CurReport.ColPos[1]     = 210;
            Queries.CurReport.ColPos[2]     = 330;
            Queries.CurReport.ColPos[3]     = 430;
            Queries.CurReport.ColPos[4]     = 600;
            Queries.CurReport.ColPos[5]     = 690;
            Queries.CurReport.ColPos[6]     = 770;
            Queries.CurReport.ColCaption[0] = Lan.g(this, "Carrier");
            Queries.CurReport.ColCaption[1] = Lan.g(this, "Phone");
            Queries.CurReport.ColCaption[2] = Lan.g(this, "Type");
            Queries.CurReport.ColCaption[3] = Lan.g(this, "Patient Name");
            Queries.CurReport.ColCaption[4] = Lan.g(this, "Date of Service");
            Queries.CurReport.ColCaption[5] = Lan.g(this, "Amount");
            Queries.CurReport.ColAlign[5]   = HorizontalAlignment.Right;
            Queries.CurReport.Summary       = new string[3];
            FormQuery2.ShowDialog();
            DialogResult = DialogResult.OK;
        }