public void GetNNY() { DataTable real_dt = KPIRecTreatment.GetRecTreatmentNNY("01202"); DataTable expected_dt = new DataTable(); expected_dt.Clear(); expected_dt.Columns.Add("Date of Service"); expected_dt.Columns.Add("Name"); expected_dt.Columns.Add("Procedure"); expected_dt.Columns.Add("Priority"); expected_dt.Columns.Add("Status of Pre-Authorization"); DataRow _testPat = expected_dt.NewRow(); _testPat["Procedure"] = "01202"; DataRow _testPat2 = expected_dt.NewRow(); _testPat2["Procedure"] = "01202"; DataRow _testPat3 = expected_dt.NewRow(); _testPat3["Procedure"] = "01202"; DataRow _testPat4 = expected_dt.NewRow(); _testPat4["Procedure"] = "01202"; DataRow _testPat5 = expected_dt.NewRow(); _testPat5["Procedure"] = "01202"; DataRow _testPat6 = expected_dt.NewRow(); _testPat6["Procedure"] = "01202"; expected_dt.Rows.Add(_testPat); expected_dt.Rows.Add(_testPat2); expected_dt.Rows.Add(_testPat3); expected_dt.Rows.Add(_testPat4); expected_dt.Rows.Add(_testPat5); expected_dt.Rows.Add(_testPat6); Assert.IsNotNull(real_dt); Assert.AreEqual(6, real_dt.Rows.Count); Assert.AreEqual(real_dt.Rows[0]["Procedure"], expected_dt.Rows[0]["Procedure"]); }
private void butOK_Click(object sender, System.EventArgs e) { DataTable tablePats = new DataTable(); System.Diagnostics.Debug.WriteLine("SelectedPatNum is : " + SelectedPatNum); if (DateRangeCheck.Checked == false) { System.Diagnostics.Debug.WriteLine("No Date"); if (SelectedPatNum != 0) { System.Diagnostics.Debug.WriteLine("Using PatNum"); System.Diagnostics.Debug.WriteLine("SelectedPatNum is NOT zero : " + SelectedPatNum); if (pc != "") { //NYY System.Diagnostics.Debug.WriteLine("Using ProcCode"); tablePats = KPIRecTreatment.GetRecTreatmentNYY(SelectedPatNum, pc); } else if (pc == "") { //NYN System.Diagnostics.Debug.WriteLine("No ProcCode"); tablePats = KPIRecTreatment.GetRecTreatmentNYN(SelectedPatNum); } } else if (SelectedPatNum == 0) { System.Diagnostics.Debug.WriteLine("No PatNum"); System.Diagnostics.Debug.WriteLine("SelectedPatNum is zero : " + SelectedPatNum); if (pc != "") { // NNY System.Diagnostics.Debug.WriteLine("Using ProcCode"); tablePats = KPIRecTreatment.GetRecTreatmentNNY(pc); } else if (pc == "") { // NNN System.Diagnostics.Debug.WriteLine("Nothing"); tablePats = KPIRecTreatment.GetRecTreatmentNNN(); } } } else { System.Diagnostics.Debug.WriteLine("Using Date"); System.Diagnostics.Debug.WriteLine("SelectedPatNum is : " + SelectedPatNum); if (SelectedPatNum != 0) { System.Diagnostics.Debug.WriteLine("Using PatNum"); System.Diagnostics.Debug.WriteLine("SelectedPatNum is NOT zero : " + SelectedPatNum); if (pc != "") { // YYY System.Diagnostics.Debug.WriteLine("Using ProcCode"); System.Diagnostics.Debug.WriteLine("SelectedPatNum is : " + SelectedPatNum); tablePats = KPIRecTreatment.GetRecTreatmentYYY(dateStartPick.Value.Date, dateEndPick.Value.Date, SelectedPatNum, pc); } else if (pc == "") { // YYN System.Diagnostics.Debug.WriteLine("No ProcCode"); tablePats = KPIRecTreatment.GetRecTreatmentYYN(dateStartPick.Value.Date, dateEndPick.Value.Date, SelectedPatNum); } } else if (SelectedPatNum == 0) { System.Diagnostics.Debug.WriteLine("No PatNum"); System.Diagnostics.Debug.WriteLine("SelectedPatNum is zero : " + SelectedPatNum); if (pc != "") { // YNY System.Diagnostics.Debug.WriteLine("Using ProcCode"); tablePats = KPIRecTreatment.GetRecTreatmentYNY(dateStartPick.Value.Date, dateEndPick.Value.Date, pc); } else if (pc == "") { // YNN System.Diagnostics.Debug.WriteLine("No ProcCode"); tablePats = KPIRecTreatment.GetRecTreatmentYNN(dateStartPick.Value.Date, dateEndPick.Value.Date); } } } ReportComplex report = new ReportComplex(true, false); report.ReportName = Lan.g(this, "Types of Treatment Prescribed/Recommended"); report.AddTitle("Title", Lan.g(this, "Types of Treatment Prescribed/Recommended")); if (DateRangeCheck.Checked == false) { report.AddSubTitle("No Date Selected", "ALL DATES"); } else if (DateRangeCheck.Checked == true) { report.AddSubTitle("Date", SELECTDATE.Text); } if (SelectedPatNum != 0) { report.AddSubTitle("Name", SELECTNAME.Text); } else if (SelectedPatNum == 0) { report.AddSubTitle("Name", "ALL PATIENTS"); } if (pc != "") { report.AddSubTitle("ProcedureCode", SELECTPROC.Text); } else if (pc == "") { report.AddSubTitle("ProcedureCode", "ALL PROCEDURES"); } QueryObject query; query = report.AddQuery(tablePats, "", "", SplitByKind.None, 0); query.AddColumn("Date of Service", 100, FieldValueType.String); query.AddColumn("Name", 150, FieldValueType.String); query.AddColumn("Procedure", 40, FieldValueType.String); query.AddColumn("Priority", 90, FieldValueType.String); query.AddColumn("Status of Pre-Authorization", 80, FieldValueType.String); report.AddPageNum(); if (!report.SubmitQueries()) { return; } FormReportComplex FormR = new FormReportComplex(report); FormR.ShowDialog(); DialogResult = DialogResult.OK; }