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; }
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; }
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; }
//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>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; }
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; }
private void butOK_Click(object sender, System.EventArgs e) { if (PrefC.HasClinicsEnabled) { if (!checkAllClin.Checked && listClin.SelectedIndices.Count == 0) { MsgBox.Show(this, "At least one clinic must be selected."); return; } } ReportComplex report = new ReportComplex(true, false); Cursor = Cursors.WaitCursor; 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 tableOverpaid = RpInsOverpaid.GetInsuranceOverpaid(dateStart.SelectionStart, dateEnd.SelectionStart, listClinicNums, radioGroupByProc.Checked); Cursor = Cursors.Default; string subtitleClinics = ""; if (PrefC.HasClinicsEnabled) { if (checkAllClin.Checked) { 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 } } } } } report.ReportName = Lan.g(this, "Insurance Overpaid"); report.AddTitle("Title", Lan.g(this, "Insurance Overpaid")); report.AddSubTitle("Practice Name", PrefC.GetString(PrefName.PracticeTitle)); if (PrefC.HasClinicsEnabled) { report.AddSubTitle("Clinics", subtitleClinics); } QueryObject query = report.AddQuery(tableOverpaid, DateTimeOD.Today.ToShortDateString()); query.AddColumn("Pat Name", 200, FieldValueType.String); query.AddColumn("Date", 90, FieldValueType.Date); query.GetColumnDetail("Date").StringFormat = "d"; query.AddColumn("Fee", 100, FieldValueType.Number); query.AddColumn("InsPaid+W/O", 120, FieldValueType.Number); report.AddPageNum(); if (!report.SubmitQueries()) { return; } FormReportComplex FormR = new FormReportComplex(report); FormR.ShowDialog(); DialogResult = DialogResult.OK; }
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; }
private void butOK_Click(object sender, System.EventArgs e) { if (textDateFrom.errorProvider1.GetError(textDateFrom) != "" || textDateTo.errorProvider1.GetError(textDateTo) != "" ) { MessageBox.Show(Lan.g(this, "Please fix data entry errors first.")); return; } if (listProv.SelectedIndices.Count == 0) { MsgBox.Show(this, "At least one provider must be selected."); return; } if (listProv.SelectedIndices[0] == 0 && listProv.SelectedIndices.Count > 1) { MsgBox.Show(this, "You cannot select 'All' providers as well as specific providers."); return; } DateTime dateFrom = PIn.Date(textDateFrom.Text); DateTime dateTo = PIn.Date(textDateTo.Text); if (dateTo < dateFrom) { MsgBox.Show(this, "To date cannot be before From date."); return; } bool hasAllProvs = (listProv.SelectedIndices[0] == 0); List <long> listProvNums = new List <long>(); List <string> listProvNames = new List <string>(); if (hasAllProvs) { listProv.ClearSelected(); for (int i = 1; i < listProv.Items.Count; i++) //Start i at 1 due to the 'All' option. { listProv.SetSelected(i, true); } } for (int i = 0; i < listProv.SelectedIndices.Count; i++) { //Minus 1 due to the 'All' option. listProvNums.Add(_listProviders[listProv.SelectedIndices[i] - 1].ProvNum); listProvNames.Add(_listProviders[listProv.SelectedIndices[i] - 1].Abbr); } ReportComplex report; if (checkLandscape.Checked) { report = new ReportComplex(true, true); } else { report = new ReportComplex(true, false); } DataTable table = RpReferralAnalysis.GetReferralTable(dateFrom, dateTo, listProvNums, checkAddress.Checked, checkNewPat.Checked); 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, "Referral Analysis"); report.AddTitle("Title", Lan.g(this, "Referral Analysis"), fontTitle); report.AddSubTitle("PracticeTitle", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle); report.AddSubTitle("Date SubTitle", dateFrom.ToString("d") + " - " + dateTo.ToString("d"), fontSubTitle); if (hasAllProvs) { report.AddSubTitle("Provider Subtitle", Lan.g(this, "All Providers")); } else if (listProv.SelectedIndices.Count == 1) { report.AddSubTitle("Provider SubTitle", Lan.g(this, "Prov:") + " " + _listProviders[listProv.SelectedIndices[0] - 1].GetLongDesc()); } else { report.AddSubTitle("Provider SubTitle", string.Join(", ", listProvNames)); } QueryObject query = report.AddQuery(table, Lan.g(this, "Date") + ": " + DateTimeOD.Today.ToString("d")); query.AddColumn("Last Name", 100, FieldValueType.String); query.AddColumn("First Name", 100, FieldValueType.String); query.AddColumn("Count", 40, FieldValueType.Integer); query.AddColumn("Production", 75, FieldValueType.Number); query.GetColumnDetail("Production").ContentAlignment = ContentAlignment.MiddleRight; if (checkAddress.Checked) { query.AddColumn("Title", 40); if (checkLandscape.Checked) { query.AddColumn("Address", 160, FieldValueType.String); query.AddColumn("Add2", 140, FieldValueType.String); query.AddColumn("City", 90, FieldValueType.String); } else { query.AddColumn("Address", 140, FieldValueType.String); query.AddColumn("Add2", 80, FieldValueType.String); query.AddColumn("City", 70, FieldValueType.String); } query.AddColumn("State", 40, FieldValueType.String); query.AddColumn("Zip", 70, FieldValueType.String); if (checkLandscape.Checked) { query.AddColumn("Specialty", 90, FieldValueType.String); } else { query.AddColumn("Specialty", 60, FieldValueType.String); } } report.AddPageNum(font); if (!report.SubmitQueries()) { return; } FormReportComplex FormR = new FormReportComplex(report); FormR.ShowDialog(); DialogResult = DialogResult.OK; }
//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; } }
private void butUnearnedAllocationOK_Click(object sender, EventArgs e) { if (PrefC.HasClinicsEnabled) { if (!checkUnearnedAllocationAllClins.Checked && listUnearnedAllocationClins.SelectedIndices.Count == 0) { MsgBox.Show(this, "At least one clinic must be selected."); return; } } if (!checkUnearnedAllocationAllProvs.Checked && listUnearnedAllocationProvs.SelectedIndices.Count == 0) { MsgBox.Show(this, "At least one provider must be selected."); return; } if (!checkUnearnedAllocationAllTypes.Checked && listUnearnedAllocationTypes.SelectedIndices.Count == 0) { MsgBox.Show(this, "At least one unearned type must be selected."); return; } List <long> listClinicNums = listUnearnedAllocationClins.SelectedItems.OfType <ODBoxItem <Clinic> >().Select(x => x.Tag.ClinicNum).ToList(); List <long> listProvNums = listUnearnedAllocationProvs.SelectedItems.OfType <ODBoxItem <Provider> >().Select(x => x.Tag.ProvNum).ToList(); List <long> listUnearnedTypeNums = listUnearnedAllocationTypes.SelectedItems.OfType <ODBoxItem <Def> >().Select(x => x.Tag.DefNum).ToList(); ReportComplex report = new ReportComplex(true, true); DataTable table = RpUnearnedIncome.GetUnearnedAllocationData(listClinicNums, listProvNums, listUnearnedTypeNums, checkUnearnedAllocationExcludeZero.Checked); report.ReportName = "Unearned Allocation Report"; QueryObject query = report.AddQuery(table, "Unearned Allocation Report"); query.AddColumn("Guar", 150, FieldValueType.String); query.GetColumnDetail("Guar").Font = new Font(query.GetColumnDetail("Guar").Font, FontStyle.Bold); query.AddColumn("FamBal", 100, FieldValueType.String); query.GetColumnDetail("FamBal").Font = new Font(query.GetColumnDetail("FamBal").Font, FontStyle.Bold); query.AddColumn("FamUnearned", 100, FieldValueType.String); query.GetColumnDetail("FamUnearned").Font = new Font(query.GetColumnDetail("FamUnearned").Font, FontStyle.Bold); query.AddColumn("FamRemAmt", 100, FieldValueType.String); query.GetColumnDetail("FamRemAmt").Font = new Font(query.GetColumnDetail("FamRemAmt").Font, FontStyle.Bold); query.AddColumn("Pat", 150, FieldValueType.String); query.AddColumn("Code", 80, FieldValueType.String); query.AddColumn("Date", 100, FieldValueType.String); query.AddColumn("Fee", 100, FieldValueType.String); query.AddColumn("RemAmt", 100, FieldValueType.String); report.AddTitle("Title", "Unearned Allocation Report"); report.AddSubTitle("Practice Title", PrefC.GetString(PrefName.PracticeTitle)); if (checkUnearnedAllocationAllTypes.Checked) { report.AddSubTitle("UnearnedTypes", "All Unearned Types"); } else { string unearnedTypes = string.Join(", ", listUnearnedAllocationTypes.SelectedItems.OfType <ODBoxItem <Def> >().Select(x => x.Tag.ItemName)); report.AddSubTitle("UnearnedTypes", unearnedTypes); } if (checkUnearnedAllocationAllProvs.Checked) { report.AddSubTitle("Provs", Lan.g(this, "All Providers")); } else { string provNames = string.Join(", ", listUnearnedAllocationProvs.SelectedItems.OfType <ODBoxItem <Provider> >().Select(x => x.Tag.Abbr)); report.AddSubTitle("ProvNames", provNames); } if (PrefC.HasClinicsEnabled) //show sub titles if clinics are enabled. { if (checkUnearnedAllocationAllClins.Checked) { report.AddSubTitle("Clinics", Lan.g(this, "All Clinics")); } else { string clinNames = string.Join(", ", listUnearnedAllocationClins.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; }
private void butOK_Click(object sender, System.EventArgs e) { if (listProv.SelectedIndices.Count == 0) { MsgBox.Show(this, "Please select at least one provider."); return; } if (PrefC.HasClinicsEnabled) //Using clinics { if (listClin.SelectedIndices.Count == 0) { MsgBox.Show(this, "Please select at least one clinic."); return; } } if (dateStart.Value > dateEnd.Value) { MsgBox.Show(this, "Start date cannot be greater than the end date."); return; } ReportComplex report = new ReportComplex(true, true); List <long> listProvNums = new List <long>(); List <long> listClinicNums = new List <long>(); for (int i = 0; i < listProv.SelectedIndices.Count; i++) { listProvNums.Add(_listProviders[listProv.SelectedIndices[i]].ProvNum); } if (checkAllProv.Checked) { for (int i = 0; i < _listProviders.Count; i++) { listProvNums.Add(_listProviders[i].ProvNum); } } 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 } } } } DisplayPayPlanType displayPayPlanType; if (radioInsurance.Checked) { displayPayPlanType = DisplayPayPlanType.Insurance; } else if (radioPatient.Checked) { displayPayPlanType = DisplayPayPlanType.Patient; } else { displayPayPlanType = DisplayPayPlanType.Both; } bool isPayPlanV2 = (PrefC.GetInt(PrefName.PayPlansVersion) == 2); DataSet ds = RpPayPlan.GetPayPlanTable(dateStart.Value, dateEnd.Value, listProvNums, listClinicNums, checkAllProv.Checked , displayPayPlanType, checkHideCompletePlans.Checked, checkShowFamilyBalance.Checked, checkHasDateRange.Checked, isPayPlanV2); DataTable table = ds.Tables["Clinic"]; DataTable tableTotal = ds.Tables["Total"]; 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, "PaymentPlans"); report.AddTitle("Title", Lan.g(this, "Payment Plans"), fontTitle); report.AddSubTitle("PracticeTitle", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle); if (checkHasDateRange.Checked) { report.AddSubTitle("Date SubTitle", dateStart.Value.ToShortDateString() + " - " + dateEnd.Value.ToShortDateString(), fontSubTitle); } else { report.AddSubTitle("Date SubTitle", DateTimeOD.Today.ToShortDateString(), fontSubTitle); } QueryObject query; if (PrefC.HasClinicsEnabled) { query = report.AddQuery(table, "", "clinicName", SplitByKind.Value, 1, true); } else { query = report.AddQuery(table, "", "", SplitByKind.None, 1, true); } query.AddColumn("Provider", 160, FieldValueType.String, font); query.AddColumn("Guarantor", 160, FieldValueType.String, font); query.AddColumn("Ins", 40, FieldValueType.String, font); query.GetColumnHeader("Ins").ContentAlignment = ContentAlignment.MiddleCenter; query.GetColumnDetail("Ins").ContentAlignment = ContentAlignment.MiddleCenter; query.AddColumn("Princ", 100, FieldValueType.Number, font); query.GetColumnHeader("Princ").ContentAlignment = ContentAlignment.MiddleRight; query.GetColumnDetail("Princ").ContentAlignment = ContentAlignment.MiddleRight; query.AddColumn("Accum Int", 100, FieldValueType.Number, font); query.GetColumnHeader("Accum Int").ContentAlignment = ContentAlignment.MiddleRight; query.GetColumnDetail("Accum Int").ContentAlignment = ContentAlignment.MiddleRight; query.AddColumn("Paid", 100, FieldValueType.Number, font); query.GetColumnHeader("Paid").ContentAlignment = ContentAlignment.MiddleRight; query.GetColumnDetail("Paid").ContentAlignment = ContentAlignment.MiddleRight; query.AddColumn("Balance", 100, FieldValueType.Number, font); query.GetColumnHeader("Balance").ContentAlignment = ContentAlignment.MiddleRight; query.GetColumnDetail("Balance").ContentAlignment = ContentAlignment.MiddleRight; query.AddColumn("Due Now", 100, FieldValueType.Number, font); query.GetColumnHeader("Due Now").ContentAlignment = ContentAlignment.MiddleRight; query.GetColumnDetail("Due Now").ContentAlignment = ContentAlignment.MiddleRight; if (isPayPlanV2) { query.AddColumn("Bal Not Due", 100, FieldValueType.Number, font); query.GetColumnHeader("Bal Not Due").ContentAlignment = ContentAlignment.MiddleRight; query.GetColumnDetail("Bal Not Due").ContentAlignment = ContentAlignment.MiddleRight; } if (checkShowFamilyBalance.Checked) { query.AddColumn("Fam Balance", 100, FieldValueType.String, font); query.GetColumnHeader("Fam Balance").ContentAlignment = ContentAlignment.MiddleRight; query.GetColumnDetail("Fam Balance").ContentAlignment = ContentAlignment.MiddleRight; query.GetColumnDetail("Fam Balance").SuppressIfDuplicate = true; } if (PrefC.HasClinicsEnabled) { QueryObject queryTotals = report.AddQuery(tableTotal, "Totals"); queryTotals.AddColumn("Clinic", 360, FieldValueType.String, font); queryTotals.AddColumn("Princ", 100, FieldValueType.Number, font); queryTotals.GetColumnHeader("Princ").ContentAlignment = ContentAlignment.MiddleRight; queryTotals.GetColumnDetail("Princ").ContentAlignment = ContentAlignment.MiddleRight; queryTotals.AddColumn("Accum Int", 100, FieldValueType.Number, font); queryTotals.GetColumnHeader("Accum Int").ContentAlignment = ContentAlignment.MiddleRight; queryTotals.GetColumnDetail("Accum Int").ContentAlignment = ContentAlignment.MiddleRight; queryTotals.AddColumn("Paid", 100, FieldValueType.Number, font); queryTotals.GetColumnHeader("Paid").ContentAlignment = ContentAlignment.MiddleRight; queryTotals.GetColumnDetail("Paid").ContentAlignment = ContentAlignment.MiddleRight; queryTotals.AddColumn("Balance", 100, FieldValueType.Number, font); queryTotals.GetColumnHeader("Balance").ContentAlignment = ContentAlignment.MiddleRight; queryTotals.GetColumnDetail("Balance").ContentAlignment = ContentAlignment.MiddleRight; queryTotals.AddColumn("Due Now", 100, FieldValueType.Number, font); queryTotals.GetColumnHeader("Due Now").ContentAlignment = ContentAlignment.MiddleRight; queryTotals.GetColumnDetail("Due Now").ContentAlignment = ContentAlignment.MiddleRight; if (isPayPlanV2) { queryTotals.AddColumn("Bal Not Due", 100, FieldValueType.Number, font); queryTotals.GetColumnHeader("Bal Not Due").ContentAlignment = ContentAlignment.MiddleRight; queryTotals.GetColumnDetail("Bal Not Due").ContentAlignment = ContentAlignment.MiddleRight; } if (checkShowFamilyBalance.Checked) { queryTotals.AddColumn("Fam Balance", 100, FieldValueType.String, font); queryTotals.GetColumnHeader("Fam Balance").ContentAlignment = ContentAlignment.MiddleRight; queryTotals.GetColumnDetail("Fam Balance").ContentAlignment = ContentAlignment.MiddleRight; queryTotals.GetColumnDetail("Fam Balance").SuppressIfDuplicate = true; } } if (!report.SubmitQueries()) { return; } FormReportComplex FormR = new FormReportComplex(report); FormR.ShowDialog(); DialogResult = DialogResult.OK; }
private void ExecuteReport() { DateTime dateStart; DateTime dateEnd; bool isMedOrClinic; if (!DateTime.TryParse(textDateStart.Text, out dateStart)) { MsgBox.Show(this, "Please input a valid date."); return; } if (!DateTime.TryParse(textDateEnd.Text, out dateEnd)) { MsgBox.Show(this, "Please input a valid date."); return; } if (String.IsNullOrWhiteSpace(textCarrier.Text)) { MsgBox.Show(this, "Carrier can not be blank. Please input a value for carrier."); return; } ReportComplex report = new ReportComplex(true, true); if (Clinics.IsMedicalPracticeOrClinic(Clinics.ClinicNum)) { isMedOrClinic = true; } else { isMedOrClinic = false; } Font font = new Font("Tahoma", 9); Font fontTitle = new Font("Tahoma", 17, FontStyle.Bold); Font fontSubTitle = new Font("Tahoma", 10, FontStyle.Bold); report.AddTitle("Title", Lan.g(this, "Capitation Utilization"), fontTitle); report.AddSubTitle("PracTitle", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle); report.AddSubTitle("Date", textDateStart.Text + " - " + textDateEnd.Text, fontSubTitle); DataTable table = RpCapitation.GetCapitationTable(dateStart, dateEnd, textCarrier.Text, isMedOrClinic); QueryObject query = report.AddQuery(table, "", "", SplitByKind.None, 1, true); query.AddColumn("Carrier", 150, FieldValueType.String, font); query.GetColumnDetail("Carrier").SuppressIfDuplicate = true; query.AddColumn("Subscriber", 120, FieldValueType.String, font); query.GetColumnDetail("Subscriber").SuppressIfDuplicate = true; query.AddColumn("Subsc SSN", 70, FieldValueType.String, font); query.GetColumnDetail("Subsc SSN").SuppressIfDuplicate = true; query.AddColumn("Patient", 120, FieldValueType.String, font); query.AddColumn("Pat DOB", 80, FieldValueType.Date, font); if (Clinics.IsMedicalPracticeOrClinic(Clinics.ClinicNum)) { query.AddColumn("Code", 140, FieldValueType.String, font); query.AddColumn("Proc Description", 120, FieldValueType.String, font); query.AddColumn("Date", 80, FieldValueType.Date, font); query.AddColumn("UCR Fee", 60, FieldValueType.Number, font); query.AddColumn("Co-Pay", 60, FieldValueType.Number, font); } else { query.AddColumn("Code", 50, FieldValueType.String, font); query.AddColumn("Proc Description", 120, FieldValueType.String, font); query.AddColumn("Tth", 30, FieldValueType.String, font); query.AddColumn("Surf", 40, FieldValueType.String, font); query.AddColumn("Date", 80, FieldValueType.Date, font); query.AddColumn("UCR Fee", 70, FieldValueType.Number, font); query.AddColumn("Co-Pay", 70, FieldValueType.Number, font); } if (!report.SubmitQueries()) { //DialogResult=DialogResult.Cancel; return; } FormReportComplex FormR = new FormReportComplex(report); FormR.ShowDialog(); DialogResult = DialogResult.OK; }
///<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; }
private void butOK_Click(object sender, System.EventArgs e) { int payPlanVersion = PrefC.GetInt(PrefName.PayPlansVersion); string bDate; string eDate; decimal rcvStart = 0; decimal rcvCharge = 0; decimal rcvPayPlanCredit = 0; decimal rcvProd = 0; decimal rcvPayPlanCharges = 0; decimal rcvAdj = 0; decimal rcvWriteoff = 0; decimal rcvPayment = 0; decimal rcvInsPayment = 0; decimal runningRcv = 0; decimal rcvDaily = 0; decimal[] colTotals = new decimal[11]; string wMonth; string wYear; string wDay = "01"; string wDate; // Get the year / month and instert the 1st of the month for stop point for calculated running balance wYear = date1.SelectionStart.Year.ToString(); wMonth = date1.SelectionStart.Month.ToString(); if (wMonth.Length < 2) { wMonth = "0" + wMonth; } wDate = wYear + "-" + wMonth + "-" + wDay; List <long> listProvNums = new List <long>(); bool hasAllProvs = (listProv.SelectedIndices[0] == 0); if (!hasAllProvs) { for (int i = 0; i < listProv.SelectedIndices.Count; i++) { //Minus 1 due to the 'Practice' option. listProvNums.Add(_listProvs[listProv.SelectedIndices[i] - 1].ProvNum); } } bool isPayPlan2; if (payPlanVersion == 2) { isPayPlan2 = true; } else { isPayPlan2 = false; } ReportComplex report = new ReportComplex(true, isPayPlan2); //Landscape if using PayPlan Version 2 DataTable TableProduction = new DataTable(); //Production DataTable TablePayPlanCredit = new DataTable(); //PayPlanCredits DataTable TableCharge = new DataTable(); //charges(Production-PayPlanCredits) DataTable TablePayPlanCharge = new DataTable(); //PayPlanCharges DataTable TableCapWriteoff = new DataTable(); //capComplete writeoffs DataTable TableInsWriteoff = new DataTable(); //ins writeoffs DataTable TablePay = new DataTable(); //payments - Patient DataTable TableIns = new DataTable(); //payments - Ins, added SPK DataTable TableAdj = new DataTable(); //adjustments // // Main Loop: This will loop twice 1st loop gets running balance to start of month selected // 2nd will break the numbers down by day and calculate the running balances // for (int j = 0; j <= 1; j++) { if (j == 0) { bDate = "0001-01-01"; eDate = wDate; } else { bDate = wDate; eDate = POut.Date(date1.SelectionStart.AddDays(1)).Substring(1, 10); // Needed because all Queries are < end date to get correct Starting AR } TableProduction = RpReceivablesBreakdown.GetRecvBreakdownTable(date1.SelectionStart, listProvNums, radioWriteoffPay.Checked, isPayPlan2, wDate, eDate, bDate, "TableProduction"); if (isPayPlan2) { TablePayPlanCredit = RpReceivablesBreakdown.GetRecvBreakdownTable(date1.SelectionStart, listProvNums, radioWriteoffPay.Checked, isPayPlan2, wDate, eDate, bDate, "TablePayPlanCredit"); TableCharge = RpReceivablesBreakdown.GetRecvBreakdownTable(date1.SelectionStart, listProvNums, radioWriteoffPay.Checked, isPayPlan2, wDate, eDate, bDate, "TableCharge"); TablePayPlanCharge = RpReceivablesBreakdown.GetRecvBreakdownTable(date1.SelectionStart, listProvNums, radioWriteoffPay.Checked, isPayPlan2, wDate, eDate, bDate, "TablePayPlanCharge"); } TableCapWriteoff = RpReceivablesBreakdown.GetRecvBreakdownTable(date1.SelectionStart, listProvNums, radioWriteoffPay.Checked, isPayPlan2, wDate, eDate, bDate, "TableCapWriteoff"); TableInsWriteoff = RpReceivablesBreakdown.GetRecvBreakdownTable(date1.SelectionStart, listProvNums, radioWriteoffPay.Checked, isPayPlan2, wDate, eDate, bDate, "TableInsWriteoff"); TablePay = RpReceivablesBreakdown.GetRecvBreakdownTable(date1.SelectionStart, listProvNums, radioWriteoffPay.Checked, isPayPlan2, wDate, eDate, bDate, "TablePay"); TableIns = RpReceivablesBreakdown.GetRecvBreakdownTable(date1.SelectionStart, listProvNums, radioWriteoffPay.Checked, isPayPlan2, wDate, eDate, bDate, "TableIns"); TableAdj = RpReceivablesBreakdown.GetRecvBreakdownTable(date1.SelectionStart, listProvNums, radioWriteoffPay.Checked, isPayPlan2, wDate, eDate, bDate, "TableAdj"); //Sum up all the transactions grouped by date. Dictionary <DateTime, decimal> dictPayPlanCharges = TablePayPlanCharge.Select().GroupBy(x => PIn.Date(x["ChargeDate"].ToString())) .ToDictionary(y => y.Key, y => y.ToList().Sum(z => PIn.Decimal(z["Amt"].ToString()))); //1st Loop Calculate running Accounts Receivable upto the 1st of the Month Selected //2nd Loop Calculate the Daily Accounts Receivable upto the Date Selected //Finaly Generate Report showing the breakdown upto the date specified with totals for what is on the report if (j == 0) { for (int k = 0; k < TableCharge.Rows.Count; k++) { rcvCharge += PIn.Decimal(TableCharge.Rows[k][1].ToString()); //Production-PayPlanCredits } rcvPayPlanCharges += dictPayPlanCharges.Sum(x => x.Value); for (int k = 0; k < TableCapWriteoff.Rows.Count; k++) { rcvWriteoff += PIn.Decimal(TableCapWriteoff.Rows[k][1].ToString()); } for (int k = 0; k < TableInsWriteoff.Rows.Count; k++) { rcvWriteoff += PIn.Decimal(TableInsWriteoff.Rows[k][1].ToString()); } for (int k = 0; k < TablePay.Rows.Count; k++) { rcvPayment += PIn.Decimal(TablePay.Rows[k][1].ToString()); } for (int k = 0; k < TableIns.Rows.Count; k++) { rcvInsPayment += PIn.Decimal(TableIns.Rows[k][1].ToString()); } for (int k = 0; k < TableAdj.Rows.Count; k++) { rcvAdj += PIn.Decimal(TableAdj.Rows[k][1].ToString()); } for (int k = 0; k < TableProduction.Rows.Count; k++) { rcvProd += PIn.Decimal(TableProduction.Rows[k][1].ToString()); } for (int k = 0; k < TablePayPlanCredit.Rows.Count; k++) { rcvPayPlanCredit += PIn.Decimal(TablePayPlanCredit.Rows[k][1].ToString()); } TableProduction.Clear(); TablePayPlanCredit.Clear(); TableCharge.Clear(); TablePayPlanCharge.Clear(); TableCapWriteoff.Clear(); TableInsWriteoff.Clear(); TablePay.Clear(); TableIns.Clear(); TableAdj.Clear(); rcvStart = (rcvProd - rcvPayPlanCredit + rcvPayPlanCharges + rcvAdj - rcvWriteoff) - (rcvPayment + rcvInsPayment); } else { rcvCharge = 0; rcvPayPlanCredit = 0; rcvAdj = 0; rcvInsPayment = 0; rcvPayment = 0; rcvProd = 0; rcvPayPlanCharges = 0; rcvWriteoff = 0; rcvDaily = 0; runningRcv = rcvStart; DataTable TableQ = new DataTable(); TableQ.Columns.Add("Date"); TableQ.Columns.Add("Production"); TableQ.Columns.Add("PayPlanCredits"); TableQ.Columns.Add("Charges"); TableQ.Columns.Add("PayPlanCharges"); TableQ.Columns.Add("Adjustments"); TableQ.Columns.Add("Writeoffs"); TableQ.Columns.Add("Payment"); TableQ.Columns.Add("InsPayment"); TableQ.Columns.Add("Daily"); TableQ.Columns.Add("Running"); eDate = POut.Date(date1.SelectionStart).Substring(1, 10); // Reset EndDate to Selected Date DateTime[] dates = new DateTime[(PIn.Date(eDate) - PIn.Date(bDate)).Days + 1]; for (int i = 0; i < dates.Length; i++) //usually 31 days in loop { dates[i] = PIn.Date(bDate).AddDays(i); //create new row called 'row' based on structure of TableQ DataRow row = TableQ.NewRow(); row[0] = dates[i].ToShortDateString(); for (int k = 0; k < TableProduction.Rows.Count; k++) { if (dates[i] == (PIn.Date(TableProduction.Rows[k][0].ToString()))) { rcvProd += PIn.Decimal(TableProduction.Rows[k][1].ToString()); } } for (int k = 0; k < TablePayPlanCredit.Rows.Count; k++) { if (dates[i] == (PIn.Date(TablePayPlanCredit.Rows[k][0].ToString()))) { rcvPayPlanCredit += PIn.Decimal(TablePayPlanCredit.Rows[k][1].ToString()); } } for (int k = 0; k < TableCharge.Rows.Count; k++) { if (dates[i] == (PIn.Date(TableCharge.Rows[k][0].ToString()))) { rcvCharge += PIn.Decimal(TableCharge.Rows[k][1].ToString()); } } decimal rcvPayPlanChargesForDay = 0; if (dictPayPlanCharges.TryGetValue(dates[i], out rcvPayPlanChargesForDay)) { rcvPayPlanCharges += rcvPayPlanChargesForDay; } for (int k = 0; k < TableCapWriteoff.Rows.Count; k++) { if (dates[i] == (PIn.Date(TableCapWriteoff.Rows[k][0].ToString()))) { rcvWriteoff += PIn.Decimal(TableCapWriteoff.Rows[k][1].ToString()); } } for (int k = 0; k < TableAdj.Rows.Count; k++) { if (dates[i] == (PIn.Date(TableAdj.Rows[k][0].ToString()))) { rcvAdj += PIn.Decimal(TableAdj.Rows[k][1].ToString()); } } for (int k = 0; k < TableInsWriteoff.Rows.Count; k++) { if (dates[i] == (PIn.Date(TableInsWriteoff.Rows[k][0].ToString()))) { rcvWriteoff += PIn.Decimal(TableInsWriteoff.Rows[k][1].ToString()); } } for (int k = 0; k < TablePay.Rows.Count; k++) { if (dates[i] == (PIn.Date(TablePay.Rows[k][0].ToString()))) { rcvPayment += PIn.Decimal(TablePay.Rows[k][1].ToString()); } } for (int k = 0; k < TableIns.Rows.Count; k++) { if (dates[i] == (PIn.Date(TableIns.Rows[k][0].ToString()))) { rcvInsPayment += PIn.Decimal(TableIns.Rows[k][1].ToString()); } } //rcvPayPlanCharges and rcvPayPlanCredit will be 0 if not on version 2. rcvDaily = (rcvProd - rcvPayPlanCredit + rcvPayPlanCharges + rcvAdj - rcvWriteoff) - (rcvPayment + rcvInsPayment); runningRcv += (rcvProd - rcvPayPlanCredit + rcvPayPlanCharges + rcvAdj - rcvWriteoff) - (rcvPayment + rcvInsPayment); row["Production"] = rcvProd.ToString("n"); row["PayPlanCredits"] = rcvPayPlanCredit.ToString("n"); row["Charges"] = rcvCharge.ToString("n"); row["PayPlanCharges"] = rcvPayPlanCharges.ToString("n"); row["Adjustments"] = rcvAdj.ToString("n"); row["Writeoffs"] = rcvWriteoff.ToString("n"); row["Payment"] = rcvPayment.ToString("n"); row["InsPayment"] = rcvInsPayment.ToString("n"); row["Daily"] = rcvDaily.ToString("n"); row["Running"] = runningRcv.ToString("n"); colTotals[1] += rcvProd; colTotals[2] += rcvPayPlanCredit; colTotals[3] += rcvCharge; colTotals[4] += rcvPayPlanCharges; colTotals[5] += rcvAdj; colTotals[6] += rcvWriteoff; colTotals[7] += rcvPayment; colTotals[8] += rcvInsPayment; colTotals[9] += rcvDaily; colTotals[10] = runningRcv; TableQ.Rows.Add(row); //adds row to table Q rcvAdj = 0; rcvInsPayment = 0; rcvPayment = 0; rcvProd = 0; rcvPayPlanCharges = 0; rcvWriteoff = 0; rcvCharge = 0; rcvPayPlanCredit = 0; } //Drop the PayPlan columns if not version 2 if (!isPayPlan2) { TableQ.Columns.RemoveAt(2); //PayPlanCredits TableQ.Columns.RemoveAt(2); //Production - PayPlanCredits TableQ.Columns.RemoveAt(2); //PayPlanCharges } ////columnCount will get incremented on the second ColTotal call so we can use it in this way //if(payPlanVersion==2) { // report.ColTotal[1]=PIn.Decimal(colTotals[1].ToString("n")); //prod // report.ColTotal[2]=PIn.Decimal(colTotals[2].ToString("n")); //payplancharges // report.ColTotal[3]=PIn.Decimal(colTotals[3].ToString("n")); //adjustment // report.ColTotal[4]=PIn.Decimal(colTotals[4].ToString("n")); //writeoffs // report.ColTotal[5]=PIn.Decimal(colTotals[5].ToString("n")); //payment // report.ColTotal[6]=PIn.Decimal(colTotals[6].ToString("n")); //inspayment // report.ColTotal[7]=PIn.Decimal(colTotals[7].ToString("n")); //daily // report.ColTotal[8]=PIn.Decimal(colTotals[8].ToString("n")); //running //} //else { // report.ColTotal[1]=PIn.Decimal(colTotals[1].ToString("n")); //prod // report.ColTotal[2]=PIn.Decimal(colTotals[3].ToString("n")); //adjustment // report.ColTotal[3]=PIn.Decimal(colTotals[4].ToString("n")); //writeoffs // report.ColTotal[4]=PIn.Decimal(colTotals[5].ToString("n")); //payment // report.ColTotal[5]=PIn.Decimal(colTotals[6].ToString("n")); //inspayment // report.ColTotal[6]=PIn.Decimal(colTotals[7].ToString("n")); //daily // report.ColTotal[7]=PIn.Decimal(colTotals[8].ToString("n")); //running //} Font font = new Font("Tahoma", 9); Font boldFont = 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, "Receivables Breakdown"); report.AddTitle("Title", Lan.g(this, "Receivables Breakdown"), fontTitle); report.AddSubTitle("PracticeTitle", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle); report.AddSubTitle("Date SubTitle", date1.SelectionStart.ToString("d"), fontSubTitle); string provNames = ""; for (int i = 0; i < listProv.SelectedIndices.Count; i++) { if (hasAllProvs) { provNames = "All Providers"; break; } if (i > 0) { provNames += ", "; } provNames += _listProvs[listProv.SelectedIndices[i] - 1].Abbr; } report.AddSubTitle("Provider SubTitle", provNames); int[] summaryGroups1 = { 1 }; QueryObject query = report.AddQuery(TableQ, Lan.g(this, "Date") + ": " + DateTimeOD.Today.ToString("d")); query.AddColumn("Date", 72, FieldValueType.Date); query.AddColumn("Production", 80, FieldValueType.Number); query.GetColumnDetail("Production").ContentAlignment = ContentAlignment.MiddleRight; if (isPayPlan2) { query.AddColumn("PayPlanCredits", 90, FieldValueType.Number); query.GetColumnDetail("PayPlanCredits").ContentAlignment = ContentAlignment.MiddleRight; query.AddColumn("Prod - PPCred", 85, FieldValueType.Number); query.GetColumnDetail("Prod - PPCred").ContentAlignment = ContentAlignment.MiddleRight; query.AddColumn("PayPlanCharges", 100, FieldValueType.Number); query.GetColumnDetail("PayPlanCharges").ContentAlignment = ContentAlignment.MiddleRight; } query.AddColumn("Adjustment", 80, FieldValueType.Number); query.GetColumnDetail("Adjustment").ContentAlignment = ContentAlignment.MiddleRight; query.AddColumn("Writeoff", 80, FieldValueType.Number); query.GetColumnDetail("Writeoff").ContentAlignment = ContentAlignment.MiddleRight; query.AddColumn("Payment", 80, FieldValueType.Number); query.GetColumnDetail("Payment").ContentAlignment = ContentAlignment.MiddleRight; query.AddColumn("InsPayment", 80, FieldValueType.Number); query.GetColumnDetail("InsPayment").ContentAlignment = ContentAlignment.MiddleRight; query.AddColumn("Daily A/R", 100, FieldValueType.Number); query.GetColumnDetail("Daily A/R").ContentAlignment = ContentAlignment.MiddleRight; query.AddColumn("Ending A/R", 100); query.GetColumnDetail("Ending A/R").ContentAlignment = ContentAlignment.MiddleRight; query.GetColumnDetail("Ending A/R").Font = boldFont; if (isPayPlan2) { report.AddFooterText("Desc", "Receivables Calculation: (Production - PayPlanCredits + PayPlanCharges + Adjustments - Writeoffs) " + "- (Payments + Insurance Payments)", font, 0, ContentAlignment.MiddleCenter); } else { report.AddFooterText("Desc", "Receivables Calculation: (Production + Adjustments - Writeoffs) - (Payments + Insurance Payments)", font, 0, ContentAlignment.MiddleCenter); } //report.AddText("EndingAR","Final Ending A/R: "+runningRcv.ToString(),boldFont,0,ContentAlignment.MiddleLeft); report.AddPageNum(font); if (!report.SubmitQueries()) { return; } FormReportComplex FormR = new FormReportComplex(report); FormR.ShowDialog(); DialogResult = DialogResult.OK; } //END If } // END For Loop } //END OK button Clicked
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; } } if (!checkAllAdjs.Checked && listType.SelectedIndices.Count == 0) { MsgBox.Show(this, "At least one type 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 <long> listProvNums = new List <long>(); if (checkAllProv.Checked) { for (int i = 0; i < _listProviders.Count; i++) { listProvNums.Add(_listProviders[i].ProvNum); } } else { for (int i = 0; i < listProv.SelectedIndices.Count; i++) { listProvNums.Add(_listProviders[listProv.SelectedIndices[i]].ProvNum); } } List <string> listAdjType = new List <string>(); if (checkAllAdjs.Checked) { //add all adjustment types, including hidden listAdjType = Defs.GetDefsForCategory(DefCat.AdjTypes).Select(x => POut.Long(x.DefNum)).ToList(); } else { for (int i = 0; i < listType.SelectedIndices.Count; i++) //1:1 { listAdjType.Add(POut.Long(_listAdjTypeDefs[listType.SelectedIndices[i]].DefNum)); } } ReportComplex report = new ReportComplex(true, false); DataTable table = RpAdjSheet.GetAdjTable(date1.SelectionStart, date2.SelectionStart, listProvNums, listClinicNums, listAdjType, checkAllClin.Checked, _hasClinicsEnabled); 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 Adjustments"); report.AddTitle("Title", Lan.g(this, "Daily Adjustments"), 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("Provider SubTitle", Lan.g(this, "All Providers")); } else { string provNames = ""; for (int i = 0; i < listProv.SelectedIndices.Count; i++) { if (i > 0) { provNames += ", "; } provNames += _listProviders[listProv.SelectedIndices[i]].Abbr; } report.AddSubTitle("Provider SubTitle", provNames); } if (_hasClinicsEnabled) { if (checkAllClin.Checked) { report.AddSubTitle("Clinic SubTitle", 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("Clinic SubTitle", clinNames); } } QueryObject query = report.AddQuery(table, Lan.g(this, "Date") + ": " + DateTimeOD.Today.ToString("d")); query.AddColumn("Date", 90, FieldValueType.Date); query.AddColumn("Patient Name", 130, FieldValueType.String); query.AddColumn("Prov", 60, FieldValueType.String); if (_hasClinicsEnabled) { query.AddColumn("Clinic", 70, FieldValueType.String); } query.AddColumn("AdjustmentType", 150, FieldValueType.String); query.AddColumn("Note", 180, FieldValueType.String); 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; }
private void RefreshReport() { bool hasValidationPassed = ValidateFields(); DataTable tableOverpaidProcs = new DataTable(); if (hasValidationPassed) { ODProgress.ShowAction( () => { tableOverpaidProcs = RpProcOverpaid.GetOverPaidProcs(_patNum, _listSelectedProvNums, comboBoxMultiClinics.ListSelectedClinicNums, _myReportDateFrom, _myReportDateTo); }, startingMessage: "Refreshing the Grid Data...", actionException: e => this.Invoke(() => { FriendlyException.Show(Lan.g(this, "Error filling the Procedures Overpaid grid."), e); }) ); } string subTitleProviders = Lan.g(this, "All Providers"); if (_listSelectedProvNums.Count > 0) { subTitleProviders = Lan.g(this, "For Providers:") + " " + string.Join(",", _listSelectedProvNums.Select(x => Providers.GetFormalName(x))); } string subtitleClinics = comboBoxMultiClinics.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, "Overpaid Procedures"); _myReport.AddTitle("Title", Lan.g(this, "Overpaid Procedures")); _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 (_patNum > 0) { _myReport.AddSubTitle("Patient", Patients.GetLim(_patNum).GetNameFL()); } _myReport.AddSubTitle("Providers", subTitleProviders); if (PrefC.HasClinicsEnabled) { _myReport.AddSubTitle("Clinics", subtitleClinics); } QueryObject query = _myReport.AddQuery(tableOverpaidProcs, DateTimeOD.Today.ToShortDateString()); query.AddColumn("Patient Name", _colWidthPatName, FieldValueType.String); query.AddColumn("Date", _colWidthProcDate, FieldValueType.Date); query.GetColumnDetail("Date").StringFormat = "d"; query.AddColumn("Code", _colWidthProcCode, FieldValueType.String); query.AddColumn("Tth", _colWidthProcTth, FieldValueType.String); query.AddColumn("Prov", _colWidthProv, FieldValueType.String); query.AddColumn("Fee", _colWidthFee, FieldValueType.Number); query.AddColumn("Ins Paid", _colWidthInsPay, FieldValueType.Number); query.AddColumn("Write-off", _colWidthWO, FieldValueType.Number); query.AddColumn("Pt Paid", _colWidthPtPaid, FieldValueType.Number); query.AddColumn("Adjust", _colWidthAdj, FieldValueType.Number); query.AddColumn("Overpayment", _colWidthOverpay, FieldValueType.Number); _myReport.AddPageNum(); _myReport.SubmitQueries(false); }
private void CreateIndividual() { ReportComplex report = new ReportComplex(true, false); bool isAnyClinicMedical = false; //Used to determine whether or not to display 'Tooth' column if (AnyClinicSelectedIsMedical()) { isAnyClinicMedical = true; } DataTable table = new DataTable(); try { table = RpProcSheet.GetIndividualTable(date1.SelectionStart, date2.SelectionStart, _listProvNums, _listClinicNums, textCode.Text, isAnyClinicMedical, checkAllProv.Checked, PrefC.HasClinicsEnabled); } catch (Exception ex) { report.CloseProgressBar(); string text = Lan.g(this, "Error getting report data:") + " " + ex.Message + "\r\n\r\n" + ex.StackTrace; MsgBoxCopyPaste msgBox = new MsgBoxCopyPaste(text); msgBox.ShowDialog(); return; } if (table.Columns.Contains("ToothNum")) { foreach (DataRow row in table.Rows) { row["ToothNum"] = Tooth.GetToothLabel(row["ToothNum"].ToString()); } } 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, "Daily Procedures"); report.AddTitle("Title", Lan.g(this, "Daily Procedures"), 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, "Date"), 90, FieldValueType.Date, font); query.GetColumnDetail(Lan.g(this, "Date")).StringFormat = "d"; query.AddColumn(Lan.g(this, "Patient Name"), 150, FieldValueType.String, font); if (isAnyClinicMedical) { query.AddColumn(Lan.g(this, "Code"), 140, FieldValueType.String, font); } else { query.AddColumn(Lan.g(this, "Code"), 70, FieldValueType.String, font); query.AddColumn("Tooth", 40, FieldValueType.String, font); } query.AddColumn(Lan.g(this, "Description"), 140, FieldValueType.String, font); query.AddColumn(Lan.g(this, "Provider"), 80, FieldValueType.String, font); if (PrefC.HasClinicsEnabled) { query.AddColumn(Lan.g(this, "Clinic"), 100, FieldValueType.String, font); } query.AddColumn(Lan.g(this, "Fee"), 80, FieldValueType.Number, font); report.AddPageNum(font); if (!report.SubmitQueries()) { return; } FormReportComplex FormR = new FormReportComplex(report); FormR.ShowDialog(); DialogResult = DialogResult.OK; }
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; }
private void butOK_Click(object sender, System.EventArgs e) { if (textDateFrom.errorProvider1.GetError(textDateFrom) != "" || textDateTo.errorProvider1.GetError(textDateTo) != "") { MsgBox.Show(this, "Please fix data entry errors first."); return; } DateTime dateFrom = PIn.Date(textDateFrom.Text); DateTime dateTo = PIn.Date(textDateTo.Text); if (dateTo < dateFrom) { MsgBox.Show(this, "To date cannot be before From date."); return; } ReportComplex report = new ReportComplex(true, false); List <long> listProvNums = new List <long>(); if (!checkAllProv.Checked) { listProvNums.AddRange(listProv.SelectedIndices.OfType <int>().Select(x => _listProviders[x].ProvNum).ToList()); } List <long> listBillingDefNums = new List <long>(); if (!checkAllBilling.Checked) { listBillingDefNums.AddRange(listBillingType.SelectedIndices.OfType <int>().Select(x => _listBillingTypeDefs[x].DefNum).ToList()); } DataTable table = RpFinanceCharge.GetFinanceChargeTable(dateFrom, dateTo, PrefC.GetLong(PrefName.FinanceChargeAdjustmentType), listProvNums, listBillingDefNums); 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, "Finance Charge Report"); report.AddTitle("Title", Lan.g(this, "Finance Charge Report"), fontTitle); report.AddSubTitle("PracticeTitle", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle); report.AddSubTitle("Date SubTitle", dateFrom.ToString("d") + " - " + dateTo.ToString("d"), fontSubTitle); string subtitleProvs = ""; if (listProvNums.Count > 0) { subtitleProvs += string.Join(", ", listProv.SelectedIndices.OfType <int>().ToList().Select(x => _listProviders[x].Abbr)); } else { subtitleProvs = Lan.g(this, "All Providers"); } report.AddSubTitle("Provider Subtitle", subtitleProvs); string subtBillingTypes = ""; if (listBillingDefNums.Count > 0) { subtBillingTypes += string.Join(", ", listBillingType.SelectedIndices.OfType <int>().Select(x => _listBillingTypeDefs[x].ItemName)); } else { subtBillingTypes = Lan.g(this, "All Billing Types"); } report.AddSubTitle("Billing Subtitle", subtBillingTypes); QueryObject query = report.AddQuery(table, Lan.g(this, "Date") + ": " + DateTimeOD.Today.ToString("d")); query.AddColumn("PatNum", 75); query.AddColumn("Patient Name", 180); query.AddColumn("Preferred Name", 130); query.AddColumn("Amount", 100, 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; }