private void butOK_Click(object sender, EventArgs e) { DataTable tablePats = KPINoShowAppt.GetNoShowAppt(dtpStart.Value, dtpEnd.Value); ReportComplex report = new ReportComplex(true, false); report.ReportName = Lan.g(this, "Patients who missed their appointment"); report.AddTitle("Title", Lan.g(this, "Patients who missed their appointment")); 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("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.AddGroupSummaryField("Patient Count:", "Name", "Provider", SummaryOperation.Count); report.AddPageNum(); if (!report.SubmitQueries()) { return; } FormReportComplex FormR = new FormReportComplex(report); FormR.ShowDialog(); //DialogResult=DialogResult.OK; }
public void GetPatientsNoShow() { DataTable real_dt = KPINoShowAppt.GetNoShowAppt(Convert.ToDateTime("2016-03-20"), Convert.ToDateTime("2017-03-20")); DataTable expected_dt = new DataTable(); expected_dt.Clear(); expected_dt.Columns.Add("Name"); expected_dt.Columns.Add("Gender"); expected_dt.Columns.Add("Age"); expected_dt.Columns.Add("Postal Code"); expected_dt.Columns.Add("Date of Service"); expected_dt.Columns.Add("Primary Provider"); expected_dt.Columns.Add("Procedure Description"); DataRow _testPat = expected_dt.NewRow(); _testPat["Name"] = "Test, Patient 1"; _testPat["Gender"] = "F"; var birthdate = Convert.ToDateTime("1990-07-21"); var age = DateTime.UtcNow.Year - birthdate.Year; if (birthdate > DateTime.UtcNow.AddYears(-age)) { age--; } _testPat["Age"] = age.ToString(); _testPat["Postal Code"] = "T6E1R1"; _testPat["Primary Provider"] = "DOC"; _testPat["Procedure Description"] = "fix teeth"; expected_dt.Rows.Add(_testPat); Assert.IsNotNull(real_dt); Assert.AreEqual(1, real_dt.Rows.Count); Assert.AreEqual(real_dt.Rows[0]["Name"], expected_dt.Rows[0]["Name"]); }