Esempio n. 1
0
        private void butOK_Click(object sender, EventArgs e)
        {
            ReportComplex report       = new ReportComplex(true, false);
            DataTable     table        = RpDiscountPlan.GetTable(textDescription.Text);
            Font          font         = new Font("Tahoma", 8);
            Font          fontTitle    = new Font("Tahoma", 15, FontStyle.Bold);
            Font          fontSubTitle = new Font("Tahoma", 10, FontStyle.Bold);

            report.ReportName = Lan.g(this, "Discount Plan List");
            report.AddTitle("Title", Lan.g(this, "Discount Plan List"), fontTitle);
            report.AddSubTitle("Practice Title", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle);
            QueryObject query = report.AddQuery(table, Lan.g(this, "Date") + ": " + DateTimeOD.Today.ToString("d"));

            query.AddColumn("Description", 230, font);
            query.AddColumn("FeeSched", 175, font);
            query.AddColumn("AdjType", 175, font);
            query.AddColumn("Patient", 165, font);
            report.AddPageNum(font);
            if (!report.SubmitQueries())
            {
                return;
            }
            report.AddFooterText("Total", "Total: " + report.TotalRows.ToString(), font, 10, ContentAlignment.MiddleRight);
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 2
0
        private void butOK_Click(object sender, EventArgs e)
        {
            DataTable tablePats = KPINewPatients.GetNewPatients(dtpStart.Value, dtpEnd.Value);

            ReportComplex report = new ReportComplex(true, false);

            report.ReportName = Lan.g(this, "New Patients");
            report.AddTitle("Title", Lan.g(this, "New Patients"));
            report.AddSubTitle("Date", dtpStart.Value.ToShortDateString() + " - " + dtpEnd.Value.ToShortDateString());
            QueryObject query;

            query = report.AddQuery(tablePats, "", "", SplitByKind.None, 0);
            query.AddColumn("Name", 150, FieldValueType.String);
            query.AddColumn("Gender", 60, FieldValueType.String);
            query.AddColumn("Age", 40, FieldValueType.String);
            query.AddColumn("Date of Service", 100, FieldValueType.String);
            query.AddGroupSummaryField("Patient Count:", "Name", "Date of Service", SummaryOperation.Count);
            report.AddPageNum();
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            //DialogResult=DialogResult.OK;
        }
Esempio n. 3
0
        private void butUnearnedAcctOk_Click(object sender, EventArgs e)
        {
            if (PrefC.HasClinicsEnabled)
            {
                if (!checkUnearnedAcctAllClins.Checked && listUnearnedAcctClins.SelectedIndices.Count == 0)
                {
                    MsgBox.Show(this, "At least one clinic must be selected.");
                    return;
                }
            }
            List <long> listClinicNums = new List <long>();                                                                           //stores clinicNums of the selected indices

            listClinicNums.AddRange(listUnearnedAcctClins.SelectedItems.OfType <ODBoxItem <Clinic> >().Select(x => x.Tag.ClinicNum)); //empty if "All" is checked.
            ReportComplex report = new ReportComplex(true, false);
            DataTable     table  = RpUnearnedIncome.GetUnearnedAccountData(listClinicNums);

            report.ReportName = "Unearned Accounts Report";
            report.AddTitle("Title", "Unearned Accounts");
            report.AddSubTitle("Practice Title", PrefC.GetString(PrefName.PracticeTitle));
            if (PrefC.HasClinicsEnabled)             //show sub titles if clinics are enabled.
            {
                if (checkUnearnedAcctAllClins.Checked)
                {
                    report.AddSubTitle("Clinics", Lan.g(this, "All Clinics"));
                }
                else
                {
                    string clinNames = string.Join(",", listUnearnedAcctClins.SelectedItems.OfType <ODBoxItem <Clinic> >().Select(x => x.Tag.Abbr));
                    report.AddSubTitle("Clinics", clinNames);
                }
            }
            QueryObject query;

            if (PrefC.HasClinicsEnabled)
            {
                query = report.AddQuery(table, "", "", SplitByKind.None, 1, true);
                query.AddColumn("Guarantor", 280, FieldValueType.String);
                query.AddColumn("Type", 120, FieldValueType.String);
                query.AddColumn("Clinic", 80, FieldValueType.String);
                query.AddColumn("Amount", 100, FieldValueType.Number);
            }
            else
            {
                query = report.AddQuery(table, "", "", SplitByKind.None, 1, true);
                query.AddColumn("Guarantor", 360, FieldValueType.String);
                query.AddColumn("Type", 120, FieldValueType.String);
                query.AddColumn("Amount", 100, FieldValueType.Number);
            }
            report.AddPageNum();
            report.AddGridLines();
            if (!report.SubmitQueries())
            {
                return;
            }
            //Display report
            FormReportComplex FormRC = new FormReportComplex(report);

            FormRC.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 4
0
        private void but_OK_Click(object sender, EventArgs e)
        {
            List <object> tableProvs = KPINonProductivePracticeTime.GetNonProductivePracticeTime(dateStart.Value, dateEnd.Value);
            DataTable     queryToAdd = (DataTable)tableProvs[0];
            string        total      = (string)tableProvs[1];

            ReportComplex report = new ReportComplex(true, false);

            report.ReportName = Lan.g(this, "Non-Productive Practice Time");
            report.AddTitle("Title", Lan.g(this, "Non-Productive Practice Time"));
            report.AddSubTitle("Date", dateStart.Value.ToShortDateString() + " - " + dateEnd.Value.ToShortDateString());
            report.AddSubTitle("Total time", "TOTAL TIME = " + total);
            QueryObject query;

            query = report.AddQuery(queryToAdd, "", "", SplitByKind.None, 0);
            query.AddColumn("Name", 150, FieldValueType.String);
            query.AddColumn("Gender", 60, FieldValueType.String);
            query.AddColumn("Age", 40, FieldValueType.String);
            query.AddColumn("Postal Code", 90, FieldValueType.String);
            query.AddColumn("Date of Service", 100, FieldValueType.String);
            query.AddColumn("Primary Provider", 80, FieldValueType.String);
            query.AddColumn("Procedure Description", 100, FieldValueType.String);
            query.AddColumn("Time (Hours:Min:Seconds)", 100, FieldValueType.String);
            report.AddPageNum();
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
        }
Esempio n. 5
0
        private void butOK_Click(object sender, EventArgs e)
        {
            DataTable tablePats = KPIRecallBacklog.GetRecallBacklog(dtpStart.Value, dtpEnd.Value);

            ReportComplex report = new ReportComplex(true, false);

            report.ReportName = Lan.g(this, "Backlog of Recall Patients");
            report.AddTitle("Title", Lan.g(this, "Backlog of Recall Patients"));
            report.AddSubTitle("Date", dtpStart.Value.ToShortDateString() + " - " + dtpEnd.Value.ToShortDateString());
            QueryObject query;

            query = report.AddQuery(tablePats, "", "", SplitByKind.None, 0);
            query.AddColumn("Name", 90, FieldValueType.String);
            query.AddColumn("Gender", 60, FieldValueType.String);
            query.AddColumn("Contact Method", 100, FieldValueType.String);
            query.AddColumn("Phone", 100, FieldValueType.String);
            query.AddColumn("Email", 120, FieldValueType.String);
            query.AddColumn("Hygienist ID (Last Appt)", 60, FieldValueType.String);
            query.AddColumn("Date of Last Recall", 90, FieldValueType.String);
            query.AddColumn("Due Date", 90, FieldValueType.String);
            query.AddGroupSummaryField("Patient Count", "Gender", "Name", SummaryOperation.Count);
            report.AddPageNum();
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            //DialogResult=DialogResult.OK;
        }
Esempio n. 6
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            carrier = PIn.String(textBoxCarrier.Text);
            ReportComplex report       = new ReportComplex(true, false);
            DataTable     table        = RpInsCo.GetInsCoTable(carrier);
            Font          font         = new Font("Tahoma", 8);
            Font          fontTitle    = new Font("Tahoma", 15, FontStyle.Bold);
            Font          fontSubTitle = new Font("Tahoma", 10, FontStyle.Bold);

            report.ReportName = Lan.g(this, "Insurance Plan List");
            report.AddTitle("Title", Lan.g(this, "Insurance Plan List"), fontTitle);
            report.AddSubTitle("PracticeTitle", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle);
            QueryObject query = report.AddQuery(table, Lan.g(this, "Date") + ": " + DateTimeOD.Today.ToString("d"));

            query.AddColumn("Carrier Name", 230, font);
            query.AddColumn("Subscriber Name", 175, font);
            query.AddColumn("Carrier Phone#", 175, font);
            query.AddColumn("Group Name", 165, font);
            report.AddPageNum(font);
            if (!report.SubmitQueries())
            {
                return;
            }
            report.AddFooterText("Total", "Total: " + report.TotalRows.ToString(), font, 10, ContentAlignment.MiddleRight);
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 7
0
        private void butOK_Click(object sender, EventArgs e)
        {
            DataTable tablePats = KPIPerioRecall.GetPerioRecall(dateStart.Value, dateEnd.Value);

            ReportComplex report = new ReportComplex(true, false);

            report.ReportName = Lan.g(this, "Patients on Perio Recall");
            report.AddTitle("Title", Lan.g(this, "Patients on Perio Recall"));
            report.AddSubTitle("Date", dateStart.Value.ToShortDateString() + " - " + dateEnd.Value.ToShortDateString());
            QueryObject query;

            query = report.AddQuery(tablePats, "", "", SplitByKind.None, 0);
            query.AddColumn("Name", 90, FieldValueType.String);
            query.AddColumn("Gender", 60, FieldValueType.String);
            query.AddColumn("Age", 40, FieldValueType.String);
            query.AddColumn("Postal Code", 90, FieldValueType.String);
            query.AddColumn("Date of Next Appointment", 70, FieldValueType.String);
            query.AddColumn("Frequency", 100, FieldValueType.String);
            query.AddColumn("HygienistID", 60, FieldValueType.String);
            query.AddColumn("Primary Provider", 80, FieldValueType.String);
            query.AddGroupSummaryField("Patient Count:", "Name", "Provider", SummaryOperation.Count);
            report.AddPageNum();
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            //DialogResult=DialogResult.OK;
        }
Esempio n. 8
0
        private void butReport_Click(object sender, System.EventArgs e)
        {
            if (!validDateFrom.IsValid || !validDateTo.IsValid)
            {
                MsgBox.Show(this, "Please fix data entry errors first.");
                return;
            }

            DateTime dateFrom = PIn.Date(validDateFrom.Text);
            DateTime dateTo   = PIn.Date(validDateTo.Text);

            if (dateTo < dateFrom)
            {
                MsgBox.Show(this, "To date cannot be before From date.");
                return;
            }
            if (dateFrom.AddYears(1) <= dateTo)
            {
                MsgBox.Show(this, "Date range must not exceed 1 year.");
                return;
            }
            ReportComplex report       = new ReportComplex(true, false);
            Font          font         = new Font("Tahoma", 9);
            Font          fontTitle    = new Font("Tahoma", 17, FontStyle.Bold);
            Font          fontSubTitle = new Font("Tahoma", 10, FontStyle.Bold);

            report.ReportName = Lan.g(this, "Birthdays");
            report.AddTitle("Title", Lan.g(this, "Birthdays"), fontTitle);
            report.AddSubTitle("PracTitle", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle);
            report.AddSubTitle("Date", dateFrom.ToShortDateString() + " - " + dateTo.ToShortDateString(), fontSubTitle);
            QueryObject query = report.AddQuery(RpBirthday.GetBirthdayTable(dateFrom, dateTo), "", "", SplitByKind.None, 1, true);

            query.AddColumn("LName", 90, FieldValueType.String, font);
            query.AddColumn("FName", 90, FieldValueType.String, font);
            query.AddColumn("Preferred", 90, FieldValueType.String, font);
            query.AddColumn("Address", 90, FieldValueType.String, font);
            query.AddColumn("Address2", 90, FieldValueType.String, font);
            query.AddColumn("City", 75, FieldValueType.String, font);
            query.AddColumn("State", 60, FieldValueType.String, font);
            query.AddColumn("Zip", 75, FieldValueType.String, font);
            query.AddColumn("Birthdate", 75, FieldValueType.Date, font);
            query.GetColumnDetail("Birthdate").StringFormat = "d";
            query.AddColumn("Age", 45, FieldValueType.Integer, font);
            report.AddPageNum(font);
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 9
0
        ///<summary>This report has never worked for Oracle.</summary>
        private void butOK_Click(object sender, System.EventArgs e)
        {
            //create the report
            ReportComplex report           = new ReportComplex(true, false);
            Font          font             = new Font("Tahoma", 9);
            Font          fontBold         = new Font("Tahoma", 9, FontStyle.Bold);
            Font          fontTitle        = new Font("Tahoma", 17, FontStyle.Bold);
            Font          fontSubTitle     = new Font("Tahoma", 10, FontStyle.Bold);
            DataTable     tableAssets      = Accounts.GetAssetTable(date1.SelectionStart);
            DataTable     tableLiabilities = Accounts.GetLiabilityTable(date1.SelectionStart);
            DataTable     tableEquity      = Accounts.GetEquityTable(date1.SelectionStart);

            //Add two new rows to the equity data table to show Retained Earnings (Auto) and NetIncomeThisYear
            tableEquity.LoadDataRow(new object[] { "Retained Earnings (Auto)", Accounts.RetainedEarningsAuto(date1.SelectionStart) }, LoadOption.OverwriteChanges);
            tableEquity.LoadDataRow(new object[] { "NetIncomeThisYear", Accounts.NetIncomeThisYear(date1.SelectionStart) }, LoadOption.OverwriteChanges);
            report.ReportName = "Balance Sheet";
            report.AddTitle("Title", Lan.g(this, "Balance Sheet"), fontTitle);
            report.AddSubTitle("PracName", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle);
            report.AddSubTitle("Date", date1.SelectionStart.ToShortDateString(), fontSubTitle);
            //setup query
            QueryObject query;

            query = report.AddQuery(tableAssets, "Assets", "", SplitByKind.None, 0, true);
            // add columns to report
            query.AddColumn("Description", 300, FieldValueType.String, font);
            query.AddColumn("Amount", 150, FieldValueType.Number, font);
            query.AddSummaryLabel("Amount", "Total Assets", SummaryOrientation.West, false, fontBold);
            query = report.AddQuery(tableLiabilities, "Liabilities", "", SplitByKind.None, 0, true);
            query.IsNegativeSummary = true;
            // add columns to report
            query.AddColumn("Description", 300, FieldValueType.String, font);
            query.AddColumn("Amount", 150, FieldValueType.Number, font);
            query.AddSummaryLabel("Amount", "Total Liabilities", SummaryOrientation.West, false, fontBold);
            query.AddGroupSummaryField("Net Assets:", "Amount", "SumTotal", SummaryOperation.Sum, Color.Black, fontBold, 0, 10);
            query = report.AddQuery(tableEquity, "Equity", "", SplitByKind.None, 1, true);
            query.AddLine("EquityLine", AreaSectionType.GroupHeader, LineOrientation.Horizontal, LinePosition.North, Color.Black, 2, 90, 0, -30);
            // add columns to report
            query.AddColumn("Description", 300, FieldValueType.String, font);
            query.AddColumn("Amount", 150, FieldValueType.Number, font);
            query.AddSummaryLabel("Amount", "Total Equity", SummaryOrientation.West, false, fontBold);
            report.AddPageNum(font);
            // execute query
            if (!report.SubmitQueries())
            {
                return;
            }
            // display report
            FormReportComplex FormR = new FormReportComplex(report);

            //FormR.MyReport=report;
            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 10
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            ReportComplex report    = new ReportComplex(true, true);
            FeeSched      feeSched  = _listFeeScheds[listBoxFeeSched.SelectedIndex];
            long          clinicNum = 0;

            if (listBoxClinics.SelectedIndex > 0)
            {
                clinicNum = _listClinics[listBoxClinics.SelectedIndex - 1].ClinicNum;
            }
            long provNum = 0;

            if (listBoxProviders.SelectedIndex > 0)
            {
                provNum = _listProviders[listBoxProviders.SelectedIndex - 1].ProvNum;
            }
            DataTable dataTable = RpProcCodes.GetData(feeSched.FeeSchedNum, clinicNum, provNum, radioCategories.Checked, checkShowBlankFees.Checked);

            report.ReportName = "Procedure Codes - Fee Schedules";
            report.AddTitle("Title", Lan.g(this, "Procedure Codes - Fee Schedules"));
            report.AddSubTitle("Fee Schedule", feeSched.Description);
            report.AddSubTitle("Clinic", listBoxClinics.Items[listBoxClinics.SelectedIndex].ToString());
            report.AddSubTitle("Provider", listBoxProviders.Items[listBoxProviders.SelectedIndex].ToString());
            report.AddSubTitle("Date", DateTime.Now.ToShortDateString());
            QueryObject queryObject = new QueryObject();

            queryObject = report.AddQuery(dataTable, "", "", SplitByKind.None, 1, true);
            if (radioCategories.Checked)
            {
                queryObject.AddColumn("Category", 100, FieldValueType.String);
                queryObject.GetColumnDetail("Category").SuppressIfDuplicate = true;
            }
            queryObject.AddColumn("Code", 100, FieldValueType.String);
            queryObject.AddColumn("Desc", 600, FieldValueType.String);
            queryObject.AddColumn("Abbr", 100, FieldValueType.String);
            queryObject.AddColumn("Fee", 100, FieldValueType.String);
            queryObject.GetColumnDetail("Fee").ContentAlignment = ContentAlignment.MiddleRight;
            queryObject.GetColumnDetail("Fee").StringFormat     = "C";       //This isn't working...
            report.AddPageNum();
            // execute query
            if (!report.SubmitQueries())
            {
                return;
            }
            // display report
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
        //Only called in FillGrid().
        private void RefreshReport()
        {
            bool hasValidationPassed = ValidateFields();
            //Above line also sets "All" clinics option if no items are selected.
            DataTable tableNotBilled = new DataTable();

            if (hasValidationPassed)
            {
                //not truly all clinics; just the ones user has permission for
                tableNotBilled = RpProcNotBilledIns.GetProcsNotBilled(comboClinics.ListSelectedClinicNums, checkMedical.Checked, _myReportDateFrom, _myReportDateTo,
                                                                      checkShowProcsNoIns.Checked, checkShowProcsInProcess.Checked);
            }
            string subtitleClinics = "";

            if (PrefC.HasClinicsEnabled)
            {
                subtitleClinics = Lan.g(this, "Clinics: ") + comboClinics.GetStringSelectedClinics();
            }
            //This report will never show progress for printing.  This is because the report is being rebuilt whenever the grid is refreshed.
            _myReport            = new ReportComplex(true, false, false);
            _myReport.ReportName = Lan.g(this, "Procedures Not Billed to Insurance");
            _myReport.AddTitle("Title", Lan.g(this, "Procedures Not Billed to Insurance"));
            _myReport.AddSubTitle("Practice Name", PrefC.GetString(PrefName.PracticeTitle));
            if (_myReportDateFrom == _myReportDateTo)
            {
                _myReport.AddSubTitle("Report Dates", _myReportDateFrom.ToShortDateString());
            }
            else
            {
                _myReport.AddSubTitle("Report Dates", _myReportDateFrom.ToShortDateString() + " - " + _myReportDateTo.ToShortDateString());
            }
            if (PrefC.HasClinicsEnabled)
            {
                _myReport.AddSubTitle("Clinics", subtitleClinics);
            }
            QueryObject query = _myReport.AddQuery(tableNotBilled, DateTimeOD.Today.ToShortDateString());

            query.AddColumn("Patient Name", _colWidthPatName, FieldValueType.String);
            query.AddColumn("Stat", _colWidthStat, FieldValueType.String);
            query.AddColumn("Procedure Date", _colWidthProcDate, FieldValueType.Date);
            query.GetColumnDetail("Procedure Date").StringFormat = "d";
            query.AddColumn("Procedure Description", 300, FieldValueType.String);
            query.AddColumn("Amount", _colWidthAmount, FieldValueType.Number);
            _myReport.AddPageNum();
            if (!_myReport.SubmitQueries(false))             //If we are loading and there are no results for _myReport do not show msgbox found in SubmitQueryies(...).
            {
                return;
            }
        }
        ///<summary>This report has never worked for Oracle.</summary>
        private void butOK_Click(object sender, System.EventArgs e)
        {
            //create the report
            ReportComplex report = new ReportComplex(true, false);
            DataTable     data   = Accounts.GetGeneralLedger(date1.SelectionStart, date2.SelectionStart);

            for (int i = 0; i < data.Rows.Count; i++)
            {
                data.Rows[i]["Balance"] = ODR.Aggregate.RunningSumForAccounts(data.Rows[i]["AccountNum"], data.Rows[i]["DebitAmt"], data.Rows[i]["CreditAmt"], data.Rows[i]["AcctType"]);
            }
            Font font         = new Font("Tahoma", 7);
            Font fontTitle    = new Font("Tahoma", 9);
            Font fontSubTitle = new Font("Tahoma", 8);

            report.ReportName = "General Ledger";
            report.AddTitle("Title", "Detail of General Ledger", fontTitle);
            report.AddSubTitle("PracName", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle);
            report.AddSubTitle("Date", date1.SelectionStart.ToShortDateString() + " - " + date2.SelectionStart.ToShortDateString(), fontSubTitle);
            report.Sections[AreaSectionType.ReportHeader].Height -= 20;
            //setup query
            QueryObject query;

            query = report.AddQuery(data, "Accounts", "Description", SplitByKind.Value, 1, true);
            query.GetGroupTitle().Font = new Font("Tahoma", 8);
            // add columns to report
            query.AddColumn("Date", 75, FieldValueType.Date, font);
            //query.GetColumnDetail("Date").SuppressIfDuplicate = true;
            query.GetColumnDetail("Date").StringFormat = "d";
            query.AddColumn("Memo", 175, FieldValueType.String, font);
            query.AddColumn("Splits", 175, FieldValueType.String, font);
            query.AddColumn("Check", 45, FieldValueType.String, font);
            query.AddColumn("Debit", 70, FieldValueType.String, font);
            query.AddColumn("Credit", 70, FieldValueType.String, font);
            query.AddColumn("Balance", 70, FieldValueType.String, font);
            report.AddPageNum(font);
            report.AddGridLines();
            // execute query
            if (!report.SubmitQueries())
            {
                return;
            }
            // display report
            FormReportComplex FormR = new FormReportComplex(report);

            //FormR.MyReport=report;
            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 13
0
        ///<summary>Uses the report complex pattern to print the same report generated by FillGrid()</summary>
        private void butRunReport_Click(object sender, EventArgs e)
        {
            if (!ValidateFilters())
            {
                return;
            }
            ReportComplex report          = new ReportComplex(true, false);
            List <long>   listClinicNums  = comboClinicMulti.ListSelectedClinicNums;
            DataTable     table           = RpClaimNotSent.GetClaimsNotSent(_startDate, _endDate, listClinicNums, true, (ClaimNotSentStatuses)comboBoxInsFilter.SelectedItem);
            string        subtitleClinics = "";

            subtitleClinics   = comboClinicMulti.GetStringSelectedClinics();
            report.ReportName = Lan.g(this, "Claims Not Sent");
            report.AddTitle("Title", Lan.g(this, "Claims Not Sent"));
            if (PrefC.HasClinicsEnabled)
            {
                report.AddSubTitle("Clinics", subtitleClinics);
            }
            QueryObject query = report.AddQuery(table, "Date: " + DateTimeOD.Today.ToShortDateString());

            if (PrefC.HasClinicsEnabled)
            {
                query.AddColumn("Clinic", 60, FieldValueType.String);
            }
            query.AddColumn("Date", 85, FieldValueType.Date);
            query.GetColumnDetail("Date").StringFormat = "d";
            query.AddColumn("Type", 90, FieldValueType.String);
            query.AddColumn("Claim Status", 100, FieldValueType.String);
            query.AddColumn("Patient Name", 150, FieldValueType.String);
            query.AddColumn("Insurance Carrier", 150, FieldValueType.String);
            query.AddColumn("Amount", 90, FieldValueType.Number);
            query.AddColumn("Proc Codes", 90);
            report.AddPageNum();
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 14
0
        private void CreateGrouped()
        {
            ReportComplex report          = new ReportComplex(true, false);
            DataTable     table           = RpProcSheet.GetGroupedTable(date1.SelectionStart, date2.SelectionStart, _listProvNums, _listClinicNums, textCode.Text, checkAllProv.Checked);
            string        subtitleProvs   = ConstructProviderSubtitle();
            string        subtitleClinics = ConstructClinicSubtitle();
            Font          font            = new Font("Tahoma", 9);
            Font          fontBold        = new Font("Tahoma", 9, FontStyle.Bold);
            Font          fontTitle       = new Font("Tahoma", 17, FontStyle.Bold);
            Font          fontSubTitle    = new Font("Tahoma", 10, FontStyle.Bold);

            report.ReportName = Lan.g(this, "Procedures By Procedure Code");
            report.AddTitle("Title", Lan.g(this, "Procedures By Procedure Code"), fontTitle);
            report.AddSubTitle("Practice Title", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle);
            report.AddSubTitle("Dates of Report", date1.SelectionStart.ToString("d") + " - " + date2.SelectionStart.ToString("d"), fontSubTitle);
            report.AddSubTitle("Providers", subtitleProvs, fontSubTitle);
            if (PrefC.HasClinicsEnabled)
            {
                report.AddSubTitle("Clinics", subtitleClinics, fontSubTitle);
            }
            QueryObject query = report.AddQuery(table, Lan.g(this, "Date") + ": " + DateTimeOD.Today.ToString("d"));

            query.AddColumn(Lan.g(this, "Category"), 150, FieldValueType.String, font);
            query.AddColumn(Lan.g(this, "Code"), 130, FieldValueType.String, font);
            query.AddColumn(Lan.g(this, "Description"), 140, FieldValueType.String, font);
            query.AddColumn(Lan.g(this, "Quantity"), 60, FieldValueType.Integer, font);
            query.GetColumnDetail(Lan.g(this, "Quantity")).ContentAlignment = ContentAlignment.MiddleRight;
            query.AddColumn(Lan.g(this, "Average Fee"), 110, FieldValueType.String, font);
            query.GetColumnDetail(Lan.g(this, "Average Fee")).ContentAlignment = ContentAlignment.MiddleRight;
            query.AddColumn(Lan.g(this, "Total Fees"), 110, FieldValueType.Number, font);
            report.AddPageNum(font);
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 15
0
        private void ExecuteIndividual()
        {
            Font          font         = new Font("Tahoma", 9);
            Font          fontBold     = new Font("Tahoma", 9, FontStyle.Bold);
            Font          fontTitle    = new Font("Tahoma", 17, FontStyle.Bold);
            Font          fontSubTitle = new Font("Tahoma", 10, FontStyle.Bold);
            ReportComplex report       = new ReportComplex(true, false);

            report.AddTitle("Title", Lan.g(this, "PPO Writeoffs"), fontTitle);
            report.AddSubTitle("PracTitle", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle);
            report.AddSubTitle("Date SubTitle", date1.SelectionStart.ToShortDateString() + " - " + date2.SelectionStart.ToShortDateString(), fontSubTitle);
            report.AddSubTitle("Claims", Lan.g(this, "Individual Claims"), fontSubTitle);
            if (textCarrier.Text != "")
            {
                report.AddSubTitle("Carrier", Lan.g(this, "Carrier like: ") + textCarrier.Text, fontSubTitle);
            }
            DataTable table = new DataTable();

            table = RpPPOwriteoff.GetWriteoffTable(date1.SelectionStart, date2.SelectionStart, radioIndividual.Checked, textCarrier.Text, GetWriteoffType());
            QueryObject query = report.AddQuery(table, "", "", SplitByKind.None, 1, true);

            query.AddColumn("Date", 80, FieldValueType.Date, font);
            query.AddColumn("Patient", 120, FieldValueType.String, font);
            query.AddColumn("Carrier", 150, FieldValueType.String, font);
            query.AddColumn("Provider", 60, FieldValueType.String, font);
            query.AddColumn("Stand Fee", 80, FieldValueType.Number, font);
            query.AddColumn("PPO Fee", 80, FieldValueType.Number, font);
            query.AddColumn("Writeoff", 80, FieldValueType.Number, font);
            query.AddSummaryLabel("Stand Fee", "Totals:", SummaryOrientation.West, false, fontBold);
            if (!report.SubmitQueries())
            {
                DialogResult = DialogResult.Cancel;
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 16
0
        private void butOK_Click(object sender, EventArgs e)
        {
            DataTable tableProvs = KPIDowntime.GetDowntime(dtpStart.Value, dtpEnd.Value);

            ReportComplex report = new ReportComplex(true, false);

            report.ReportName = Lan.g(this, "Provider Down-times");
            report.AddTitle("Title", Lan.g(this, "Provider Down-times"));
            report.AddSubTitle("Date", dtpStart.Value.ToShortDateString() + " - " + dtpEnd.Value.ToShortDateString());
            QueryObject query;

            query = report.AddQuery(tableProvs, "", "", SplitByKind.None, 0);
            query.AddColumn("Provider Number", 90, FieldValueType.String);
            query.AddColumn("Total Down-time", 100, FieldValueType.String);
            report.AddPageNum();
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
        }
Esempio n. 17
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            ReportComplex report       = new ReportComplex(true, false);
            DataTable     table        = RpPrescriptions.GetPrescriptionTable(radioPatient.Checked, textBoxInput.Text);
            Font          font         = new Font("Tahoma", 9);
            Font          fontTitle    = new Font("Tahoma", 17, FontStyle.Bold);
            Font          fontSubTitle = new Font("Tahoma", 10, FontStyle.Bold);

            report.ReportName = Lan.g(this, "Prescriptions");
            report.AddTitle("Title", Lan.g(this, "Prescriptions"), fontTitle);
            report.AddSubTitle("PracticeTitle", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle);
            if (radioPatient.Checked)
            {
                report.AddSubTitle("By Patient", "By Patient");
            }
            else
            {
                report.AddSubTitle("By Drug", "By Drug");
            }
            QueryObject query = report.AddQuery(table, Lan.g(this, "Date") + ": " + DateTimeOD.Today.ToString("d"));

            query.AddColumn("Patient Name", 120, FieldValueType.String);
            query.AddColumn("Date", 95, FieldValueType.Date);
            query.AddColumn("Drug Name", 100, FieldValueType.String);
            query.AddColumn("Directions", 300);
            query.AddColumn("Dispense", 100);
            query.AddColumn("Prov Name", 100, FieldValueType.String);
            report.AddPageNum(font);
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 18
0
        private void ExecuteGroup()
        {
            Font          font         = new Font("Tahoma", 9);
            Font          fontTitle    = new Font("Tahoma", 17, FontStyle.Bold);
            Font          fontSubTitle = new Font("Tahoma", 10, FontStyle.Bold);
            ReportComplex report       = new ReportComplex(true, false);

            report.AddTitle("Title", Lan.g(this, "PPO Writeoffs"), fontTitle);
            report.AddSubTitle("PracTitle", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle);
            report.AddSubTitle("Date SubTitle", date1.SelectionStart.ToShortDateString() + " - " + date2.SelectionStart.ToShortDateString(), fontSubTitle);
            report.AddSubTitle("Claims", Lan.g(this, "Individual Claims"), fontSubTitle);
            if (textCarrier.Text != "")
            {
                report.AddSubTitle("Carrier", Lan.g(this, "Carrier like: ") + textCarrier.Text, fontSubTitle);
            }
            if (textCarrier.Text != "")
            {
                report.AddSubTitle("Carrier", Lan.g(this, "Carrier like: ") + textCarrier.Text, fontSubTitle);
            }
            DataTable   table = RpPPOwriteoff.GetWriteoffTable(date1.SelectionStart, date2.SelectionStart, radioIndividual.Checked, textCarrier.Text, radioWriteoffPay.Checked);
            QueryObject query = report.AddQuery(table, Lan.g(this, "Date") + ": " + DateTimeOD.Today.ToString("d"), "", SplitByKind.None, 1, true);

            query.AddColumn("Carrier", 180, FieldValueType.String, font);
            query.AddColumn("Stand Fee", 80, FieldValueType.Number, font);
            query.AddColumn("PPO Fee", 80, FieldValueType.Number, font);
            query.AddColumn("Writeoff", 80, FieldValueType.Number, font);
            report.AddPageNum(font);
            if (!report.SubmitQueries())
            {
                DialogResult = DialogResult.Cancel;
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 19
0
        private void butMissing_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            Font          font         = new Font("Tahoma", 9);
            Font          fontTitle    = new Font("Tahoma", 17, FontStyle.Bold);
            Font          fontSubTitle = new Font("Tahoma", 10, FontStyle.Bold);
            ReportComplex report       = new ReportComplex(true, false);

            report.ReportName = "Missing";
            report.AddTitle("Title", "XCharge Transactions From " + date1.SelectionStart.ToShortDateString() + " To " + date2.SelectionStart.ToShortDateString(), fontTitle);
            report.GetTitle("Title").IsUnderlined = true;
            report.AddSubTitle("SubTitle", "No Matching Transaction Found in Open Dental", fontSubTitle);
            QueryObject query;
            DataTable   dt = XChargeTransactions.GetMissingPaymentsTable(date1.SelectionStart, date2.SelectionStart);

            query = report.AddQuery(dt, "Missing Payments", "", SplitByKind.None, 1, true);     //Valid entries to count have result code 0
            query.AddColumn("Transaction Date/Time", 170, FieldValueType.String, font);
            query.AddColumn("Transaction Type", 120, FieldValueType.String, font);
            query.AddColumn("Clerk ID", 80, FieldValueType.String, font);
            query.AddColumn("Item#", 50, FieldValueType.String, font);
            query.AddColumn("Pat", 50, FieldValueType.String, font);
            query.AddColumn("Credit Card Num", 140, FieldValueType.String, font);
            query.AddColumn("Exp", 50, FieldValueType.String, font);
            query.AddColumn("Result", 50, FieldValueType.String, font);
            query.AddColumn("Amount", 60, FieldValueType.Number, font);
            query.GetColumnHeader("Amount").ContentAlignment = ContentAlignment.MiddleRight;
            Cursor = Cursors.Default;
            if (!report.SubmitQueries(true))
            {
                return;
            }
            // display report
            FormReportComplex FormR = new FormReportComplex(report);

            //FormR.MyReport=report;
            FormR.ShowDialog();
        }
Esempio n. 20
0
        private void butExtra_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            Font          font         = new Font("Tahoma", 9);
            Font          fontTitle    = new Font("Tahoma", 17, FontStyle.Bold);
            Font          fontSubTitle = new Font("Tahoma", 10, FontStyle.Bold);
            ReportComplex report       = new ReportComplex(true, false);

            report.ReportName = "Extra Payments";
            report.AddTitle("Title", "Payments From " + date1.SelectionStart.ToShortDateString() + " To " + date2.SelectionStart.ToShortDateString(), fontTitle);
            report.GetTitle("Title").IsUnderlined = true;
            report.AddSubTitle("SubTitle", "No Matching X-Charge Transactions for these Payments", fontSubTitle);
            QueryObject query;
            DataTable   dt = XChargeTransactions.GetMissingXTransTable(date1.SelectionStart, date2.SelectionStart);

            query = report.AddQuery(dt, "Extra Payments", "", SplitByKind.None, 1, true);
            query.AddColumn("Pat", 50, FieldValueType.String, font);
            query.AddColumn("LName", 100, FieldValueType.String, font);
            query.AddColumn("FName", 100, FieldValueType.String, font);
            query.AddColumn("DateEntry", 90, FieldValueType.Date, font);
            query.AddColumn("PayDate", 90, FieldValueType.Date, font);
            query.AddColumn("PayNote", 210, FieldValueType.String, font);
            query.AddColumn("PayAmt", 70, FieldValueType.Number, font);
            query.GetColumnHeader("PayAmt").ContentAlignment = ContentAlignment.MiddleRight;
            query.GetColumnDetail("PayAmt").ContentAlignment = ContentAlignment.MiddleRight;
            Cursor = Cursors.Default;
            if (!report.SubmitQueries(true))
            {
                return;
            }
            // display report
            FormReportComplex FormR = new FormReportComplex(report);

            //FormR.MyReport=report;
            FormR.ShowDialog();
        }
Esempio n. 21
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (PrefC.HasClinicsEnabled && !checkAllClin.Checked && listClin.SelectedIndices.Count == 0)
            {
                MsgBox.Show(this, "At least one clinic must be selected.");
                return;
            }
            ReportComplex report         = new ReportComplex(true, false);
            List <long>   listClinicNums = new List <long>();

            if (PrefC.HasClinicsEnabled)
            {
                for (int i = 0; i < listClin.SelectedIndices.Count; i++)
                {
                    if (Security.CurUser.ClinicIsRestricted)
                    {
                        listClinicNums.Add(_listClinics[listClin.SelectedIndices[i]].ClinicNum);                        //we know that the list is a 1:1 to _listClinics
                    }
                    else
                    {
                        if (listClin.SelectedIndices[i] == 0)
                        {
                            listClinicNums.Add(0);
                        }
                        else
                        {
                            listClinicNums.Add(_listClinics[listClin.SelectedIndices[i] - 1].ClinicNum);                          //Minus 1 from the selected index
                        }
                    }
                }
            }
            DataTable table           = RpPatPortionUncollected.GetPatUncollected(date1.SelectionStart, date2.SelectionStart, listClinicNums);
            string    subtitleClinics = "";

            if (PrefC.HasClinicsEnabled)
            {
                if (checkAllClin.Checked && !Security.CurUser.ClinicIsRestricted)
                {
                    subtitleClinics = Lan.g(this, "All Clinics");
                }
                else
                {
                    for (int i = 0; i < listClin.SelectedIndices.Count; i++)
                    {
                        if (i > 0)
                        {
                            subtitleClinics += ", ";
                        }
                        if (Security.CurUser.ClinicIsRestricted)
                        {
                            subtitleClinics += _listClinics[listClin.SelectedIndices[i]].Abbr;
                        }
                        else
                        {
                            if (listClin.SelectedIndices[i] == 0)
                            {
                                subtitleClinics += Lan.g(this, "Unassigned");
                            }
                            else
                            {
                                subtitleClinics += _listClinics[listClin.SelectedIndices[i] - 1].Abbr;                            //Minus 1 from the selected index
                            }
                        }
                    }
                }
            }
            Font font         = new Font("Tahoma", 9);
            Font fontBold     = new Font("Tahoma", 9, FontStyle.Bold);
            Font fontTitle    = new Font("Tahoma", 17, FontStyle.Bold);
            Font fontSubTitle = new Font("Tahoma", 10, FontStyle.Bold);

            report.ReportName = Lan.g(this, "Patient Portion Uncollected");
            report.AddTitle("Title", Lan.g(this, "Patient Portion Uncollected"), fontTitle);
            report.AddSubTitle("Practice Title", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle);
            report.AddSubTitle("Dates of Report", date1.SelectionStart.ToString("d") + " - " + date2.SelectionStart.ToString("d"), fontSubTitle);
            if (PrefC.HasClinicsEnabled)
            {
                report.AddSubTitle("Clinics", subtitleClinics, fontSubTitle);
            }

            QueryObject query = report.AddQuery(table, "Patient Portion Uncollected");

            query.AddColumn("Date", 90, FieldValueType.Date, font);
            query.GetColumnDetail("Date").StringFormat = "d";
            query.AddColumn("Patient Name", 150, FieldValueType.String, font);
            query.AddColumn("Procedure", 80, FieldValueType.String, font);
            query.AddColumn("Fee", 60, FieldValueType.Number, font);
            query.AddColumn("Patient", 65, FieldValueType.Number, font);
            query.AddColumn("Adjustment", 75, FieldValueType.Number, font);
            query.AddColumn("Patient Paid", 90, FieldValueType.Number, font);
            query.AddColumn("Uncollected", 80, FieldValueType.Number, font);
            report.AddPageNum(font);
            report.AddGridLines();
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 22
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (!checkAllProv.Checked && listProv.SelectedIndices.Count == 0)
            {
                MsgBox.Show(this, "At least one provider must be selected.");
                return;
            }
            if (PrefC.HasClinicsEnabled && !checkAllClin.Checked && listClin.SelectedIndices.Count == 0)
            {
                MsgBox.Show(this, "At least one clinic must be selected.");
                return;
            }
            if (!checkPatientTypes.Checked && listPatientTypes.SelectedIndices.Count == 0 &&
                !checkInsuranceTypes.Checked && listInsuranceTypes.SelectedIndices.Count == 0)
            {
                MsgBox.Show(this, "At least one type must be selected.");
                return;
            }
            if (!checkAllClaimPayGroups.Checked && listClaimPayGroups.SelectedIndices.Count == 0)
            {
                MsgBox.Show(this, "At least one claim payment group must be selected.");
                return;
            }
            ReportComplex report         = new ReportComplex(true, false);
            List <long>   listProvNums   = new List <long>();
            List <long>   listClinicNums = new List <long>();
            List <long>   listInsTypes   = new List <long>();
            List <long>   listPatTypes   = new List <long>();
            List <long>   listSelectedClaimPayGroupNums = new List <long>();

            if (checkAllProv.Checked)
            {
                listProvNums = _listProviders.Select(x => x.ProvNum).ToList();
            }
            else
            {
                listProvNums = listProv.SelectedIndices.OfType <int>().ToList().Select(x => _listProviders[x].ProvNum).ToList();
            }
            if (!PrefC.GetBool(PrefName.EasyNoClinics))
            {
                for (int i = 0; i < listClin.SelectedIndices.Count; i++)
                {
                    if (Security.CurUser.ClinicIsRestricted)
                    {
                        listClinicNums.Add(_listClinics[listClin.SelectedIndices[i]].ClinicNum);                        //we know that the list is a 1:1 to _listClinics
                    }
                    else
                    {
                        if (listClin.SelectedIndices[i] == 0)
                        {
                            listClinicNums.Add(0);
                        }
                        else
                        {
                            listClinicNums.Add(_listClinics[listClin.SelectedIndices[i] - 1].ClinicNum);                          //Minus 1 from the selected index
                        }
                    }
                }
            }
            if (checkInsuranceTypes.Checked)
            {
                listInsTypes = _listInsDefs.Select(x => x.DefNum).ToList();
            }
            else
            {
                listInsTypes = listInsuranceTypes.SelectedIndices.OfType <int>().Select(x => _listInsDefs[x].DefNum).ToList();
            }
            if (checkPatientTypes.Checked)
            {
                listPatTypes = _listPayDefs.Select(x => x.DefNum).ToList();
            }
            else
            {
                listPatTypes = listPatientTypes.SelectedIndices.OfType <int>().Select(x => _listPayDefs[x].DefNum).ToList();
            }
            if (checkAllClaimPayGroups.Checked)
            {
                listSelectedClaimPayGroupNums = _listClaimPayGroupDefs.Select(x => x.DefNum).ToList();
            }
            else
            {
                listSelectedClaimPayGroupNums = listClaimPayGroups.SelectedIndices.OfType <int>().Select(x => _listClaimPayGroupDefs[x].DefNum).ToList();
            }
            DataTable tableIns = new DataTable();

            if (listProvNums.Count != 0)
            {
                tableIns = RpPaySheet.GetInsTable(date1.SelectionStart, date2.SelectionStart, listProvNums, listClinicNums, listInsTypes,
                                                  listSelectedClaimPayGroupNums, checkAllProv.Checked, checkAllClin.Checked, checkInsuranceTypes.Checked, radioPatient.Checked,
                                                  checkAllClaimPayGroups.Checked, checkShowProvSeparate.Checked);
            }
            DataTable tablePat = RpPaySheet.GetPatTable(date1.SelectionStart, date2.SelectionStart, listProvNums, listClinicNums, listPatTypes,
                                                        checkAllProv.Checked, checkAllClin.Checked, checkPatientTypes.Checked, radioPatient.Checked, checkUnearned.Checked, checkShowProvSeparate.Checked);
            string subtitleProvs   = "";
            string subtitleClinics = "";

            if (checkAllProv.Checked)
            {
                subtitleProvs = Lan.g(this, "All Providers");
            }
            else
            {
                subtitleProvs += string.Join(", ", listProv.SelectedIndices.OfType <int>().ToList().Select(x => _listProviders[x].Abbr));
            }
            if (!PrefC.GetBool(PrefName.EasyNoClinics))
            {
                if (checkAllClin.Checked && !Security.CurUser.ClinicIsRestricted)
                {
                    subtitleClinics = Lan.g(this, "All Clinics");
                }
                else
                {
                    for (int i = 0; i < listClin.SelectedIndices.Count; i++)
                    {
                        if (i > 0)
                        {
                            subtitleClinics += ", ";
                        }
                        if (Security.CurUser.ClinicIsRestricted)
                        {
                            subtitleClinics += _listClinics[listClin.SelectedIndices[i]].Abbr;
                        }
                        else
                        {
                            if (listClin.SelectedIndices[i] == 0)
                            {
                                subtitleClinics += Lan.g(this, "Unassigned");
                            }
                            else
                            {
                                subtitleClinics += _listClinics[listClin.SelectedIndices[i] - 1].Abbr;                            //Minus 1 from the selected index
                            }
                        }
                    }
                }
            }
            Font font         = new Font("Tahoma", 9);
            Font fontBold     = new Font("Tahoma", 9, FontStyle.Bold);
            Font fontTitle    = new Font("Tahoma", 17, FontStyle.Bold);
            Font fontSubTitle = new Font("Tahoma", 10, FontStyle.Bold);

            report.ReportName = Lan.g(this, "Daily Payments");
            report.AddTitle("Title", Lan.g(this, "Daily Payments"), fontTitle);
            report.AddSubTitle("PracTitle", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle);
            report.AddSubTitle("Providers", subtitleProvs, fontSubTitle);
            if (!PrefC.GetBool(PrefName.EasyNoClinics))
            {
                report.AddSubTitle("Clinics", subtitleClinics, fontSubTitle);
            }
            Dictionary <long, string> dictInsDefNames = new Dictionary <long, string>();
            Dictionary <long, string> dictPatDefNames = new Dictionary <long, string>();
            List <Def> insDefs = Defs.GetDefsForCategory(DefCat.InsurancePaymentType, true);
            List <Def> patDefs = Defs.GetDefsForCategory(DefCat.PaymentTypes, true);

            for (int i = 0; i < insDefs.Count; i++)
            {
                dictInsDefNames.Add(insDefs[i].DefNum, insDefs[i].ItemName);
            }
            for (int i = 0; i < patDefs.Count; i++)
            {
                dictPatDefNames.Add(patDefs[i].DefNum, patDefs[i].ItemName);
            }
            dictPatDefNames.Add(0, "Income Transfer");           //Otherwise income transfers show up with a payment type of "Undefined"
            int[] summaryGroups1 = { 1 };
            int[] summaryGroups2 = { 2 };
            int[] summaryGroups3 = { 1, 2 };
            //Insurance Payments Query-------------------------------------
            QueryObject query = report.AddQuery(tableIns, "Insurance Payments", "PayType", SplitByKind.Definition, 1, true, dictInsDefNames, fontSubTitle);

            query.AddColumn("Date", 90, FieldValueType.Date, font);
            //query.GetColumnDetail("Date").SuppressIfDuplicate = true;
            query.GetColumnDetail("Date").StringFormat = "d";
            query.AddColumn("Carrier", 150, FieldValueType.String, font);
            query.AddColumn("Patient Name", 150, FieldValueType.String, font);
            query.AddColumn("Provider", 90, FieldValueType.String, font);
            if (!PrefC.GetBool(PrefName.EasyNoClinics))
            {
                query.AddColumn("Clinic", 120, FieldValueType.String, font);
            }
            query.AddColumn("Check#", 75, FieldValueType.String, font);
            query.AddColumn("Amount", 90, FieldValueType.Number, font);
            query.AddGroupSummaryField("Total Insurance Payments:", "Amount", "amt", SummaryOperation.Sum, new List <int>(summaryGroups1), Color.Black, fontBold, 0, 10);
            //Patient Payments Query---------------------------------------
            query = report.AddQuery(tablePat, "Patient Payments", "PayType", SplitByKind.Definition, 2, true, dictPatDefNames, fontSubTitle);
            query.AddColumn("Date", 90, FieldValueType.Date, font);
            //query.GetColumnDetail("Date").SuppressIfDuplicate = true;
            query.GetColumnDetail("Date").StringFormat = "d";
            query.AddColumn("Paying Patient", 270, FieldValueType.String, font);
            query.AddColumn("Provider", 90, FieldValueType.String, font);
            if (!PrefC.GetBool(PrefName.EasyNoClinics))
            {
                query.AddColumn("Clinic", 120, FieldValueType.String, font);
            }
            query.AddColumn("Check#", 75, FieldValueType.String, font);
            query.AddColumn("Amount", 120, FieldValueType.Number, font);
            query.AddGroupSummaryField("Total Patient Payments:", "Amount", "amt", SummaryOperation.Sum, new List <int>(summaryGroups2), Color.Black, fontBold, 0, 10);
            query.AddGroupSummaryField("Total All Payments:", "Amount", "amt", SummaryOperation.Sum, new List <int>(summaryGroups3), Color.Black, fontBold, 0, 10);
            report.AddPageNum(font);
            report.AddGridLines();
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 23
0
        private void butLineItemOK_Click(object sender, EventArgs e)
        {
            if (dateLineItemTo.SelectionStart < dateLineItemFrom.SelectionStart)
            {
                MsgBox.Show(this, "End date cannot be before start date.");
                return;
            }
            if (PrefC.HasClinicsEnabled)
            {
                if (!checkLineItemAllClins.Checked && listLineItemClins.SelectedIndices.Count == 0)
                {
                    MsgBox.Show(this, "At least one clinic must be selected.");
                    return;
                }
            }
            List <long> listClinicNums = new List <long>();                                                                       //stores clinicNums of the selected indices

            listClinicNums.AddRange(listLineItemClins.SelectedItems.OfType <ODBoxItem <Clinic> >().Select(x => x.Tag.ClinicNum)); //empty if "All" is checked.
            ReportComplex report = new ReportComplex(true, false);
            DataTable     table  = RpUnearnedIncome.GetLineItemUnearnedData(listClinicNums, dateLineItemFrom.SelectionStart, dateLineItemTo.SelectionStart);

            report.ReportName = "Line Item Unearned Income Report";
            report.AddTitle("Title", "Line Item Unearned Income Activity");
            report.AddSubTitle("Practice Title", PrefC.GetString(PrefName.PracticeTitle));
            string dateRange = dateLineItemFrom.SelectionStart.ToShortDateString() + " - " + dateLineItemTo.SelectionStart.ToShortDateString();

            report.AddSubTitle("Date", dateRange);
            if (PrefC.HasClinicsEnabled)             //show sub titles if clinics are enabled.
            {
                if (checkLineItemAllClins.Checked)
                {
                    report.AddSubTitle("Clinics", Lan.g(this, "All Clinics"));
                }
                else
                {
                    string clinNames = string.Join(",", listLineItemClins.SelectedItems.OfType <ODBoxItem <Clinic> >().Select(x => x.Tag.Abbr));
                    report.AddSubTitle("Clinics", clinNames);
                }
            }
            QueryObject query;

            if (PrefC.HasClinicsEnabled)
            {
                query = report.AddQuery(table, "", "", SplitByKind.None, 1, true);
                query.AddColumn("Date", 100, FieldValueType.Date);
                query.AddColumn("Patient", 180, FieldValueType.String);
                query.AddColumn("Type", 120, FieldValueType.String);
                query.AddColumn("Clinic", 80, FieldValueType.String);
                query.AddColumn("Amount", 100, FieldValueType.Number);
            }
            else
            {
                query = report.AddQuery(table, "", "", SplitByKind.None, 1, true);
                query.AddColumn("Date", 100, FieldValueType.String);
                query.AddColumn("Patient", 260, FieldValueType.String);
                query.AddColumn("Type", 120, FieldValueType.String);
                query.AddColumn("Amount", 100, FieldValueType.Number);
            }
            report.AddPageNum();
            report.AddGridLines();
            if (!report.SubmitQueries())
            {
                return;
            }
            //Display report
            FormReportComplex FormRC = new FormReportComplex(report);

            FormRC.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 24
0
        private void butNetUnearnedOK_Click(object sender, EventArgs e)
        {
            if (PrefC.HasClinicsEnabled)
            {
                if (!checkNetUnearnedAllClins.Checked && listNetUnearnedClins.SelectedIndices.Count == 0)
                {
                    MsgBox.Show(this, "At least one clinic must be selected.");
                    return;
                }
            }
            if (!checkNetUnearnedAllProvs.Checked && listNetUnearnedProvs.SelectedIndices.Count == 0)
            {
                MsgBox.Show(this, "At least one provider must be selected.");
                return;
            }
            if (!checkNetUnearnedAllTypes.Checked && listNetUnearnedTypes.SelectedIndices.Count == 0)
            {
                MsgBox.Show(this, "At least one unearned type must be selected.");
                return;
            }
            List <long>   listClinicNums       = listNetUnearnedClins.SelectedItems.OfType <ODBoxItem <Clinic> >().Select(x => x.Tag.ClinicNum).ToList();
            List <long>   listProvNums         = listNetUnearnedProvs.SelectedItems.OfType <ODBoxItem <Provider> >().Select(x => x.Tag.ProvNum).ToList();
            List <long>   listUnearnedTypeNums = listNetUnearnedTypes.SelectedItems.OfType <ODBoxItem <Def> >().Select(x => x.Tag.DefNum).ToList();
            ReportComplex report = new ReportComplex(true, false);
            DataTable     table  = RpUnearnedIncome.GetNetUnearnedData(listClinicNums, listProvNums, listUnearnedTypeNums, checkNetUnearnedExcludeZero.Checked);

            report.ReportName = "Net Unearned Income Report";
            QueryObject query = report.AddQuery(table, "", "", SplitByKind.None, 1, true);

            query.AddColumn("Patient", 170, FieldValueType.String);
            query.AddColumn("Guarantor", 170, FieldValueType.String);
            query.AddColumn("Unearned Amt", 100, FieldValueType.Number);
            query.AddColumn("Fam Bal", 100, FieldValueType.String);
            report.AddTitle("Title", "Net Unearned Income");
            report.AddSubTitle("Practice Title", PrefC.GetString(PrefName.PracticeTitle));
            if (checkNetUnearnedAllTypes.Checked)
            {
                report.AddSubTitle("UnearnedTypes", "All Unearned Types");
            }
            else
            {
                string unearnedTypes = string.Join(", ", listNetUnearnedTypes.SelectedItems.OfType <ODBoxItem <Def> >().Select(x => x.Tag.ItemName));
                report.AddSubTitle("UnearnedTypes", unearnedTypes);
            }
            if (checkNetUnearnedAllProvs.Checked)
            {
                report.AddSubTitle("Provs", Lan.g(this, "All Providers"));
            }
            else
            {
                string provNames = string.Join(", ", listNetUnearnedProvs.SelectedItems.OfType <ODBoxItem <Provider> >().Select(x => x.Tag.Abbr));
                report.AddSubTitle("ProvNames", provNames);
            }
            if (PrefC.HasClinicsEnabled)             //show sub titles if clinics are enabled.
            {
                if (checkNetUnearnedAllClins.Checked)
                {
                    report.AddSubTitle("Clinics", Lan.g(this, "All Clinics"));
                }
                else
                {
                    string clinNames = string.Join(", ", listNetUnearnedClins.SelectedItems.OfType <ODBoxItem <Clinic> >().Select(x => x.Tag.Abbr));
                    report.AddSubTitle("Clinics", clinNames);
                }
            }
            report.AddPageNum();
            report.AddGridLines();
            if (!report.SubmitQueries())
            {
                return;
            }
            //Display report
            FormReportComplex FormRC = new FormReportComplex(report);

            FormRC.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 25
0
        //Only called in FillGrid().
        private void RefreshReport()
        {
            bool        hasValidationPassed = ValidateFields();
            List <long> listClinicNums      = new List <long>();

            if (PrefC.HasClinicsEnabled)
            {
                if (comboBoxMultiClinics.ListSelectedIndices.Contains(0))                 //All option selected
                {
                    for (int j = 0; j < _listClinics.Count; j++)
                    {
                        listClinicNums.Add(_listClinics[j].ClinicNum);                        //Add all clinics this person has access to.
                    }
                    if (!Security.CurUser.ClinicIsRestricted)
                    {
                        listClinicNums.Add(0);                        //Unassigned
                    }
                }
                else                  //All option not selected
                {
                    for (int i = 0; i < comboBoxMultiClinics.ListSelectedIndices.Count; i++)
                    {
                        if (Security.CurUser.ClinicIsRestricted)
                        {
                            listClinicNums.Add(_listClinics[comboBoxMultiClinics.ListSelectedIndices[i] - 1].ClinicNum); //Minus 1 to skip over the All.
                        }
                        else if (comboBoxMultiClinics.ListSelectedIndices[i] == 1)                                       //Not restricted and user selected Unassigned.
                        {
                            listClinicNums.Add(0);                                                                       //Unassigned
                        }
                        else                                                                                             //Not restricted and Unassigned option is not selected.
                        {
                            listClinicNums.Add(_listClinics[comboBoxMultiClinics.ListSelectedIndices[i] - 2].ClinicNum); //Minus 2 to skip over All and Unassigned.
                        }
                    }
                }
            }
            DataTable tableNotBilled = new DataTable();

            if (hasValidationPassed)
            {
                tableNotBilled = RpProcNotBilledIns.GetProcsNotBilled(listClinicNums, checkMedical.Checked, _myReportDateFrom, _myReportDateTo, checkShowProcsNoIns.Checked);
            }
            string subtitleClinics = "";

            if (PrefC.HasClinicsEnabled)
            {
                if (comboBoxMultiClinics.ListSelectedIndices.Contains(0))                 //All option selected
                {
                    subtitleClinics = Lan.g(this, "All Clinics");
                }
                else
                {
                    for (int i = 0; i < comboBoxMultiClinics.ListSelectedIndices.Count; i++)
                    {
                        if (i > 0)
                        {
                            subtitleClinics += ", ";
                        }
                        if (Security.CurUser.ClinicIsRestricted)
                        {
                            subtitleClinics += _listClinics[comboBoxMultiClinics.ListSelectedIndices[i] - 1].Abbr; //Minus 1 for All.
                        }
                        else                                                                                       //Not restricted
                        {
                            if (comboBoxMultiClinics.ListSelectedIndices[i] == 1)                                  //Unassigned option selected.
                            {
                                subtitleClinics += Lan.g(this, "Unassigned");
                            }
                            else
                            {
                                subtitleClinics += _listClinics[comboBoxMultiClinics.ListSelectedIndices[i] - 2].Abbr;                            //Minus 2 for All and Unassigned.
                            }
                        }
                    }
                }
            }
            //This report will never show progress for printing.  This is because the report is being rebuilt whenever the grid is refreshed.
            _myReport            = new ReportComplex(true, false, false);
            _myReport.ReportName = Lan.g(this, "Procedures Not Billed to Insurance");
            _myReport.AddTitle("Title", Lan.g(this, "Procedures Not Billed to Insurance"));
            _myReport.AddSubTitle("Practice Name", PrefC.GetString(PrefName.PracticeTitle));
            if (_myReportDateFrom == _myReportDateTo)
            {
                _myReport.AddSubTitle("Report Dates", _myReportDateFrom.ToShortDateString());
            }
            else
            {
                _myReport.AddSubTitle("Report Dates", _myReportDateFrom.ToShortDateString() + " - " + _myReportDateTo.ToShortDateString());
            }
            if (PrefC.HasClinicsEnabled)
            {
                _myReport.AddSubTitle("Clinics", subtitleClinics);
            }
            QueryObject query = _myReport.AddQuery(tableNotBilled, DateTimeOD.Today.ToShortDateString());

            query.AddColumn("Patient Name", _colWidthPatName, FieldValueType.String);
            query.AddColumn("Procedure Date", _colWidthProcDate, FieldValueType.Date);
            query.GetColumnDetail("Procedure Date").StringFormat = "d";
            query.AddColumn("Procedure Description", 300, FieldValueType.String);
            query.AddColumn("Amount", _colWidthAmount, FieldValueType.Number);
            _myReport.AddPageNum();
            if (!_myReport.SubmitQueries(false))             //If we are loading and there are no results for _myReport do not show msgbox found in SubmitQueryies(...).
            {
                return;
            }
        }
Esempio n. 26
0
        private void RunProdGoal()
        {
            //If adding the unearned column, need more space. Set report to landscape.
            if (checkAllProv.Checked)
            {
                for (int i = 0; i < listProv.Items.Count; i++)
                {
                    listProv.SetSelected(i, true);
                }
            }
            if (checkAllClin.Checked)
            {
                for (int i = 0; i < listClin.Items.Count; i++)
                {
                    listClin.SetSelected(i, true);
                }
            }
            _dateFrom = PIn.Date(textDateFrom.Text);
            _dateTo   = PIn.Date(textDateTo.Text);
            List <Provider> listProvs = checkAllProv.Checked?_listProviders:
                                        listProv.SelectedIndices.Count > 0?listProv.SelectedIndices.OfType <int>().Select(x => _listFilteredProviders[x]).ToList():new List <Provider>();
            List <Clinic> listClinics            = new List <Clinic>();
            List <long>   listSelectedClinicNums = new List <long>();

            if (PrefC.HasClinicsEnabled)
            {
                if (listClin.SelectedIndices.Count > 0)
                {
                    int offset = Security.CurUser.ClinicIsRestricted?0:1;
                    listClinics.AddRange(listClin.SelectedIndices.OfType <int>()
                                         .Select(x => offset == 1 && x == 0?new Clinic {
                        ClinicNum = 0, Abbr = Lan.g(this, "Unassigned")
                    }:_listClinics[x - offset]));
                }
                //Check here for multi clinic schedule overlap and give notification.
                listSelectedClinicNums = listClinics.Select(x => x.ClinicNum).ToList();
                var listConflicts = listProvs
                                    .Select(x => new { x.Abbr, listScheds = Schedules.GetClinicOverlapsForProv(_dateFrom, _dateTo, x.ProvNum, listSelectedClinicNums) })
                                    .Where(x => x.listScheds.Count > 0).ToList();
                if (listConflicts.Count > 0)
                {
                    string errorMsg = "This report is designed to show production goals by clinic and provider.  You have one or more providers during the "
                                      + "specified period that are scheduled in more than one clinic at the same time.  Due to this, production goals cannot be reported "
                                      + "accurately.\r\nTo run this report, please fix your scheduling so each provider is only scheduled at one clinic at a time, or select "
                                      + "different providers or clinics.\r\nIn the mean time, you can run regular production and income reports instead.\r\n\r\n"
                                      + "Conflicts:\r\n"
                                      + string.Join("\r\n", listConflicts
                                                    .SelectMany(x => x.listScheds
                                                                .Select(y => x.Abbr + " " + y.SchedDate.ToShortDateString() + " " + y.StartTime.ToShortTimeString() + " - " + y.StopTime.ToShortTimeString())));
                    MsgBoxCopyPaste msgBox = new MsgBoxCopyPaste(errorMsg);
                    msgBox.ShowDialog();
                    return;
                }
            }
            ReportComplex report        = new ReportComplex(true, false);
            bool          hasAllClinics = checkAllClin.Checked && listSelectedClinicNums.Contains(0) &&
                                          Clinics.GetDeepCopy().Select(x => x.ClinicNum).All(x => x.In(listSelectedClinicNums));

            using (DataSet ds = RpProdGoal.GetData(_dateFrom, _dateTo, listProvs, listClinics, checkAllProv.Checked, hasAllClinics, GetWriteoffType()))
                using (DataTable dt = ds.Tables["Total"])
                    using (DataTable dtClinic = PrefC.HasClinicsEnabled?ds.Tables["Clinic"]:new DataTable())
                        using (Font font = new Font("Tahoma", 8, FontStyle.Regular)) {
                            report.ReportName = "MonthlyP&IGoals";
                            report.AddTitle("Title", Lan.g(this, "Monthly Production Goal"));
                            report.AddSubTitle("PracName", PrefC.GetString(PrefName.PracticeTitle));
                            report.AddSubTitle("Date", _dateFrom.ToShortDateString() + " - " + _dateTo.ToShortDateString());
                            report.AddSubTitle("Providers", checkAllProv.Checked?Lan.g(this, "All Providers"):listProvs.Count == 0?"":string.Join(", ", listProvs.Select(x => x.Abbr)));
                            if (PrefC.HasClinicsEnabled)
                            {
                                report.AddSubTitle("Clinics", hasAllClinics?Lan.g(this, "All Clinics"):listClinics.Count == 0?"":string.Join(", ", listClinics.Select(x => x.Abbr)));
                            }
                            //setup query
                            QueryObject query;
                            if (PrefC.HasClinicsEnabled && checkClinicBreakdown.Checked)
                            {
                                query = report.AddQuery(dtClinic, "", "Clinic", SplitByKind.Value, 1, true);
                            }
                            else
                            {
                                query = report.AddQuery(dt, "", "", SplitByKind.None, 1, true);
                            }
                            // add columns to report
                            int dateWidth        = 70;
                            int weekdayWidth     = 65;
                            int prodWidth        = 90;
                            int prodGoalWidth    = 90;
                            int schedWidth       = 85;
                            int adjWidth         = 85;
                            int writeoffWidth    = 95;
                            int writeoffestwidth = 95;
                            int writeoffadjwidth = 70;
                            int totProdWidth     = 90;
                            int summaryOffSetY   = 30;
                            int groups           = 1;
                            if (PrefC.HasClinicsEnabled && listClin.SelectedIndices.Count > 1 && checkClinicBreakdown.Checked)
                            {
                                groups = 2;
                            }
                            for (int i = 0; i < groups; i++) //groups will be 1 or 2 if there are clinic breakdowns
                            {
                                if (i > 0)                   //If more than one clinic selected, we want to add a table to the end of the report that totals all the clinics together
                                {
                                    query = report.AddQuery(dt, "Totals", "", SplitByKind.None, 2, true);
                                }
                                query.AddColumn("Date", dateWidth, FieldValueType.String, font);
                                query.AddColumn("Weekday", weekdayWidth, FieldValueType.String, font);
                                query.AddColumn("Production", prodWidth, FieldValueType.Number, font);
                                query.AddColumn("Prod Goal", prodGoalWidth, FieldValueType.Number, font);
                                query.AddColumn("Scheduled", schedWidth, FieldValueType.Number, font);
                                query.AddColumn("Adjusts", adjWidth, FieldValueType.Number, font);
                                if (GetWriteoffType() == PPOWriteoffDateCalc.ClaimPayDate)
                                {
                                    query.AddColumn("Writeoff Est", writeoffestwidth, FieldValueType.Number, font);
                                    query.AddColumn("Writeoff Adj", writeoffadjwidth, FieldValueType.Number, font);
                                }
                                else
                                {
                                    query.AddColumn("Writeoff", writeoffWidth, FieldValueType.Number, font);
                                }
                                query.AddColumn("Tot Prod", totProdWidth, FieldValueType.Number, font);
                            }
                            string colNameAlign = "Writeoff" + (GetWriteoffType() == PPOWriteoffDateCalc.ClaimPayDate?" Est":"");//Column used to align the summary fields.
                            string summaryText  = "Total Production (Production + Scheduled + Adjustments - Writeoff"
                                                  + (GetWriteoffType() == PPOWriteoffDateCalc.ClaimPayDate?" Ests - Writeoff Adjs":"s") + "): ";
                            query.AddGroupSummaryField(summaryText, colNameAlign, "Tot Prod", SummaryOperation.Sum, new List <int> {
                                groups
                            }, Color.Black,
                                                       new Font("Tahoma", 9, FontStyle.Bold), 75, summaryOffSetY);
                            report.AddPageNum();
                            // execute query
                            if (!report.SubmitQueries())
                            {
                                return;
                            }
                            // display report
                            using (FormReportComplex FormR = new FormReportComplex(report)) {
                                FormR.ShowDialog();
                            }
                        }
        }
Esempio n. 27
0
        ///<summary>Uses the report complex pattern to print the same report generated by FillGrid()</summary>
        private void butRunReport_Click(object sender, EventArgs e)
        {
            if (!ValidateFilters())
            {
                return;
            }
            ReportComplex report          = new ReportComplex(true, false);
            List <long>   listClinicNums  = GetSelectedClinicNums();
            DataTable     table           = RpClaimNotSent.GetClaimsNotSent(_startDate, _endDate, listClinicNums, true, (ClaimNotSentStatuses)comboBoxInsFilter.SelectedItem);
            string        subtitleClinics = "";

            //the following logic could probably be simplified
            if (PrefC.HasClinicsEnabled)
            {
                if (comboBoxClinics.SelectedIndices.Contains(0))
                {
                    subtitleClinics = Lan.g(this, "All Clinics");
                }
                else
                {
                    for (int i = 0; i < comboBoxClinics.SelectedIndices.Count; i++)
                    {
                        if (i > 0)
                        {
                            subtitleClinics += ", ";
                        }
                        if (Security.CurUser.ClinicIsRestricted)
                        {
                            subtitleClinics += _listClinics[(int)comboBoxClinics.SelectedIndices[i] - 1].Abbr;
                        }
                        else
                        {
                            if ((int)comboBoxClinics.SelectedIndices[i] == 1)
                            {
                                subtitleClinics += Lan.g(this, "Unassigned");                             //start here
                            }
                            else
                            {
                                subtitleClinics += _listClinics[(int)comboBoxClinics.SelectedIndices[i] - 2].Abbr;                            //Minus 2 from the selected index
                            }
                        }
                    }
                }
            }
            report.ReportName = Lan.g(this, "Claims Not Sent");
            report.AddTitle("Title", Lan.g(this, "Claims Not Sent"));
            if (PrefC.HasClinicsEnabled)
            {
                report.AddSubTitle("Clinics", subtitleClinics);
            }
            QueryObject query = report.AddQuery(table, "Date: " + DateTimeOD.Today.ToShortDateString());

            if (PrefC.HasClinicsEnabled)
            {
                query.AddColumn("Clinic", 60, FieldValueType.String);
            }
            query.AddColumn("Date", 85, FieldValueType.Date);
            query.GetColumnDetail("Date").StringFormat = "d";
            query.AddColumn("Type", 90, FieldValueType.String);
            query.AddColumn("Claim Status", 100, FieldValueType.String);
            query.AddColumn("Patient Name", 150, FieldValueType.String);
            query.AddColumn("Insurance Carrier", 150, FieldValueType.String);
            query.AddColumn("Amount", 90, FieldValueType.Number);
            query.AddColumn("Proc Codes", 90);
            report.AddPageNum();
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 28
0
        private void RunProviderPayroll()
        {
            ReportComplex report = new ReportComplex(true, true);

            if (checkAllProv.Checked)
            {
                for (int i = 0; i < listProv.Items.Count; i++)
                {
                    listProv.SetSelected(i, true);
                }
            }
            if (checkAllClin.Checked)
            {
                for (int i = 0; i < listClin.Items.Count; i++)
                {
                    listClin.SetSelected(i, true);
                }
            }
            dateFrom = dtPickerFrom.Value;
            dateTo   = dtPickerTo.Value;
            List <Provider> listProvs = new List <Provider>();

            for (int i = 0; i < listProv.SelectedIndices.Count; i++)
            {
                listProvs.Add(_listProviders[listProv.SelectedIndices[i]]);
            }
            List <Clinic> listClinics = new List <Clinic>();

            if (PrefC.HasClinicsEnabled)
            {
                for (int i = 0; i < listClin.SelectedIndices.Count; i++)
                {
                    if (Security.CurUser.ClinicIsRestricted)
                    {
                        listClinics.Add(_listClinics[listClin.SelectedIndices[i]]);                        //we know that the list is a 1:1 to _listClinics
                    }
                    else
                    {
                        if (listClin.SelectedIndices[i] == 0)
                        {
                            Clinic unassigned = new Clinic();
                            unassigned.ClinicNum = 0;
                            unassigned.Abbr      = Lan.g(this, "Unassigned");
                            listClinics.Add(unassigned);
                        }
                        else
                        {
                            listClinics.Add(_listClinics[listClin.SelectedIndices[i] - 1]);                          //Minus 1 from the selected index
                        }
                    }
                }
            }
            DataSet ds = RpProdInc.GetProviderPayrollDataForClinics(dateFrom, dateTo, listProvs, listClinics
                                                                    , checkAllProv.Checked, checkAllClin.Checked, radioDetailedReport.Checked);

            report.ReportName = "Provider Payroll P&I";
            report.AddTitle("Title", Lan.g(this, "Provider Payroll Production and Income"));
            report.AddSubTitle("PracName", PrefC.GetString(PrefName.PracticeTitle));
            report.AddSubTitle("Date", dateFrom.ToShortDateString() + " - " + dateTo.ToShortDateString());
            if (checkAllProv.Checked)
            {
                report.AddSubTitle("Providers", Lan.g(this, "All Providers"));
            }
            else
            {
                string str = "";
                for (int i = 0; i < listProv.SelectedIndices.Count; i++)
                {
                    if (i > 0)
                    {
                        str += ", ";
                    }
                    str += _listProviders[listProv.SelectedIndices[i]].Abbr;
                }
                report.AddSubTitle("Providers", str);
            }
            if (PrefC.HasClinicsEnabled)
            {
                if (checkAllClin.Checked)
                {
                    report.AddSubTitle("Clinics", Lan.g(this, "All Clinics"));
                }
                else
                {
                    string clinNames = "";
                    for (int i = 0; i < listClin.SelectedIndices.Count; i++)
                    {
                        if (i > 0)
                        {
                            clinNames += ", ";
                        }
                        if (Security.CurUser.ClinicIsRestricted)
                        {
                            clinNames += _listClinics[listClin.SelectedIndices[i]].Abbr;
                        }
                        else
                        {
                            if (listClin.SelectedIndices[i] == 0)
                            {
                                clinNames += Lan.g(this, "Unassigned");
                            }
                            else
                            {
                                clinNames += _listClinics[listClin.SelectedIndices[i] - 1].Abbr;                            //Minus 1 from the selected index
                            }
                        }
                    }
                    report.AddSubTitle("Clinics", clinNames);
                }
            }
            //setup query
            QueryObject query;
            DataTable   dt = ds.Tables["Total"].Copy();

            query = report.AddQuery(dt, "", "", SplitByKind.None, 1, true);
            // add columns to report
            Font font = new Font("Tahoma", 8, FontStyle.Regular);

            query.AddColumn("Date", 70, FieldValueType.String, font);
            if (radioDetailedReport.Checked)
            {
                query.AddColumn("Patient", 160, FieldValueType.String, font);
            }
            else
            {
                query.AddColumn("Day", 70, FieldValueType.String, font);
            }
            query.AddColumn("UCR Production", 90, FieldValueType.Number, font);
            query.AddColumn("Est Writeoff", 80, FieldValueType.Number, font);
            query.AddColumn("Prod Adj", 80, FieldValueType.Number, font);
            query.AddColumn("Change in Writeoff", 100, FieldValueType.Number, font);
            query.AddColumn("Net Prod(NPR)", 80, FieldValueType.Number, font);
            query.AddColumn("Pat Inc Alloc", 80, FieldValueType.Number, font);
            query.AddColumn("Pat Inc Unalloc", 80, FieldValueType.Number, font);
            query.AddColumn("Ins Income", 80, FieldValueType.Number, font);
            query.AddColumn("Ins Not Final", 80, FieldValueType.Number, font);
            query.AddColumn("Net Income", 80, FieldValueType.Number, font);
            report.AddPageNum();
            // execute query
            if (!report.SubmitQueries())             //Does not actually submit queries because we use datatables in the central management tool.
            {
                return;
            }
            // display the report
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            //DialogResult=DialogResult.OK;//Allow running multiple reports.
        }
Esempio n. 29
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (!checkBillTypesAll.Checked && listBillType.SelectedIndices.Count == 0)
            {
                MsgBox.Show(this, "At least one billing type must be selected.");
                return;
            }
            if (!checkProvAll.Checked && listProv.SelectedIndices.Count == 0)
            {
                MsgBox.Show(this, "At least one provider must be selected.");
                return;
            }
            if (PrefC.HasClinicsEnabled && !checkAllClin.Checked && listClin.SelectedIndices.Count == 0)
            {
                MsgBox.Show(this, "At least one clinic must be selected.");
                return;
            }
            if (textDate.errorProvider1.GetError(textDate) != "")
            {
                MsgBox.Show(this, "Invalid date.");
                return;
            }
            DateTime    asOfDate               = PIn.Date(textDate.Text);
            List <long> listProvNums           = new List <long>();
            List <long> listClinicNums         = new List <long>();
            List <long> listBillingTypeDefNums = new List <long>();

            if (!checkProvAll.Checked)
            {
                listProvNums = listProv.SelectedIndices.OfType <int>().Select(x => _listProviders[x].ProvNum).ToList();
            }
            if (PrefC.HasClinicsEnabled)
            {
                if (checkAllClin.Checked)
                {
                    listClinicNums = listClin.Items.OfType <ODBoxItem <Clinic> >().Select(x => x.Tag.ClinicNum).ToList();
                }
                else
                {
                    listClinicNums = listClin.SelectedItems.OfType <ODBoxItem <Clinic> >().Select(x => x.Tag.ClinicNum).ToList();
                }
            }
            if (!checkBillTypesAll.Checked)
            {
                for (int i = 0; i < listBillType.SelectedIndices.Count; i++)
                {
                    listBillingTypeDefNums.Add(_listBillingTypeDefs[listBillType.SelectedIndices[i]].DefNum);
                }
            }
            AgeOfAccount accountAge = AgeOfAccount.Any;

            if (radioAny.Checked)
            {
                accountAge = AgeOfAccount.Any;
            }
            else if (radio30.Checked)
            {
                accountAge = AgeOfAccount.Over30;
            }
            else if (radio60.Checked)
            {
                accountAge = AgeOfAccount.Over60;
            }
            else if (radio90.Checked)
            {
                accountAge = AgeOfAccount.Over90;
            }
            ReportComplex report     = new ReportComplex(true, true);
            DataTable     tableAging = new DataTable();

            tableAging = RpInsAging.GetInsAgingTable
                             (asOfDate, radioGroupByFam.Checked, accountAge, checkBillTypesAll.Checked, checkProvAll.Checked, listProvNums, listClinicNums, listBillingTypeDefNums);
            report.ReportName = Lan.g(this, "Insurance Aging Report");
            report.AddTitle("InsAging", Lan.g(this, "Insurance Aging Report"));
            report.AddSubTitle("PracTitle", PrefC.GetString(PrefName.PracticeTitle));
            report.AddSubTitle("AsOf", Lan.g(this, "As of ") + textDate.Text);
            if (radioAny.Checked)
            {
                report.AddSubTitle("Balance", Lan.g(this, "Any Balance"));
            }
            else if (radio30.Checked)
            {
                report.AddSubTitle("Over30", Lan.g(this, "Over 30 Days"));
            }
            else if (radio60.Checked)
            {
                report.AddSubTitle("Over60", Lan.g(this, "Over 60 Days"));
            }
            else if (radio90.Checked)
            {
                report.AddSubTitle("Over90", Lan.g(this, "Over 90 Days"));
            }
            if (checkBillTypesAll.Checked)
            {
                report.AddSubTitle("AllBillingTypes", Lan.g(this, "All Billing Types"));
            }
            else
            {
                string subt = _listBillingTypeDefs[listBillType.SelectedIndices[0]].ItemName;
                for (int i = 1; i < listBillType.SelectedIndices.Count; i++)           //there must be at least one selected
                {
                    subt += ", " + _listBillingTypeDefs[listBillType.SelectedIndices[i]].ItemName;
                }
                report.AddSubTitle("", subt);
            }
            string subtitleProvs = "";

            if (checkProvAll.Checked)
            {
                subtitleProvs = Lan.g(this, "All Providers");
            }
            else
            {
                subtitleProvs += string.Join(", ", listProv.SelectedIndices.OfType <int>().ToList().Select(x => _listProviders[x].Abbr));
            }
            report.AddSubTitle("Providers", subtitleProvs);
            if (checkAllClin.Checked)
            {
                report.AddSubTitle("Clinics", Lan.g(this, "All Clinics"));
            }
            else
            {
                string subt = "";
                for (int i = 0; i < listClin.SelectedIndices.Count; i++)
                {
                    if (i != 0)
                    {
                        subt += ", ";
                    }
                    if (Security.CurUser.ClinicIsRestricted)
                    {
                        subt += _listClinics[listClin.SelectedIndices[i]].Abbr;
                    }
                    else
                    {
                        if (listClin.SelectedIndices[i] == 0)
                        {
                            subt += "Unassigned";
                            continue;
                        }
                        subt += _listClinics[listClin.SelectedIndices[i] - 1].Abbr;
                    }
                }
                report.AddSubTitle("Clinics", subt);
            }
            //Patient Account Aging Query-----------------------------------------------
            QueryObject query = report.AddQuery(tableAging, "Date " + DateTime.Today.ToShortDateString());

            query.AddColumn((radioGroupByFam.Checked?"GUARANTOR":"PATIENT"), 160, FieldValueType.String);
            query.AddColumn("INS PAY EST 0-30", 75, FieldValueType.Number);
            query.AddColumn("INS PAY EST 31-60", 75, FieldValueType.Number);
            query.AddColumn("INS PAY EST 61-90", 75, FieldValueType.Number);
            query.AddColumn("INS PAY EST >90", 75, FieldValueType.Number);
            query.AddColumn("INS EST TOTAL", 80, FieldValueType.Number);
            query.AddColumn("PAT EST  BAL 0-30", 75, FieldValueType.Number);
            query.AddColumn("PAT EST BAL 31-60", 75, FieldValueType.Number);
            query.AddColumn("PAT EST BAL 61-90", 75, FieldValueType.Number);
            query.AddColumn("PAT EST BAL >90", 75, FieldValueType.Number);
            query.AddColumn("PAT TOTAL", 80, FieldValueType.Number);
            report.AddPageNum();
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Esempio n. 30
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (date2.SelectionStart < date1.SelectionStart)
            {
                MsgBox.Show(this, "End date cannot be before start date.");
                return;
            }
            if (!checkAllProv.Checked && listProv.SelectedIndices.Count == 0)
            {
                MsgBox.Show(this, "At least one provider must be selected.");
                return;
            }
            if (_hasClinicsEnabled)
            {
                if (!checkAllClin.Checked && listClin.SelectedIndices.Count == 0)
                {
                    MsgBox.Show(this, "At least one clinic must be selected.");
                    return;
                }
            }
            List <long> listClinicNums = new List <long>();

            for (int i = 0; i < listClin.SelectedIndices.Count; i++)
            {
                if (Security.CurUser.ClinicIsRestricted)
                {
                    listClinicNums.Add(_listClinics[listClin.SelectedIndices[i]].ClinicNum);                    //we know that the list is a 1:1 to _listClinics
                }
                else
                {
                    if (listClin.SelectedIndices[i] == 0)
                    {
                        listClinicNums.Add(0);
                    }
                    else
                    {
                        listClinicNums.Add(_listClinics[listClin.SelectedIndices[i] - 1].ClinicNum);                      //Minus 1 from the selected index
                    }
                }
            }
            List <string> listProvNames = new List <string>();
            List <long>   listProvNums  = new List <long>();

            if (checkAllProv.Checked)
            {
                for (int i = 0; i < _listProviders.Count; i++)
                {
                    listProvNums.Add(_listProviders[i].ProvNum);
                    listProvNames.Add(_listProviders[i].Abbr);
                }
            }
            else
            {
                for (int i = 0; i < listProv.SelectedIndices.Count; i++)
                {
                    listProvNums.Add(_listProviders[listProv.SelectedIndices[i]].ProvNum);
                    listProvNames.Add(_listProviders[listProv.SelectedIndices[i]].Abbr);
                }
            }
            ReportComplex report = new ReportComplex(true, false);
            DataTable     table  = RpWriteoffSheet.GetWriteoffTable(date1.SelectionStart, date2.SelectionStart, listProvNums, listClinicNums
                                                                    , checkAllClin.Checked, _hasClinicsEnabled, GetWriteoffType());
            Font font         = new Font("Tahoma", 9);
            Font fontTitle    = new Font("Tahoma", 17, FontStyle.Bold);
            Font fontSubTitle = new Font("Tahoma", 10, FontStyle.Bold);

            report.ReportName = Lan.g(this, "Daily Writeoffs");
            report.AddTitle("Title", Lan.g(this, "Daily Writeoffs"), fontTitle);
            report.AddSubTitle("PracticeTitle", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle);
            report.AddSubTitle("Date SubTitle", date1.SelectionStart.ToString("d") + " - " + date2.SelectionStart.ToString("d"), fontSubTitle);
            if (checkAllProv.Checked)
            {
                report.AddSubTitle("Providers", Lan.g(this, "All Providers"));
            }
            else
            {
                report.AddSubTitle("Providers", string.Join(", ", listProvNames));
            }
            if (_hasClinicsEnabled)
            {
                if (checkAllClin.Checked)
                {
                    report.AddSubTitle("Clinics", Lan.g(this, "All Clinics"));
                }
                else
                {
                    string clinNames = "";
                    for (int i = 0; i < listClin.SelectedIndices.Count; i++)
                    {
                        if (i > 0)
                        {
                            clinNames += ", ";
                        }
                        if (Security.CurUser.ClinicIsRestricted)
                        {
                            clinNames += _listClinics[listClin.SelectedIndices[i]].Abbr;
                        }
                        else
                        {
                            if (listClin.SelectedIndices[i] == 0)
                            {
                                clinNames += Lan.g(this, "Unassigned");
                            }
                            else
                            {
                                clinNames += _listClinics[listClin.SelectedIndices[i] - 1].Abbr;                            //Minus 1 from the selected index
                            }
                        }
                    }
                    report.AddSubTitle("Clinics", clinNames);
                }
            }
            QueryObject query = report.AddQuery(table, Lan.g(this, "Date") + ": " + DateTimeOD.Today.ToString("d"));

            query.AddColumn("Date", 100, FieldValueType.Date);
            query.AddColumn("Patient Name", 150);
            query.AddColumn("Carrier", 225);
            query.AddColumn("Provider", 60);
            if (_hasClinicsEnabled)
            {
                query.AddColumn("Clinic", 80);
            }
            query.AddColumn("Amount", 75, FieldValueType.Number);
            query.GetColumnDetail("Amount").ContentAlignment = ContentAlignment.MiddleRight;
            report.AddPageNum(font);
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }