Ejemplo n.º 1
0
        public void GetNewToRecall()
        {
            DataTable real_dt     = KPINewToRecall.GetNewToRecall(Convert.ToDateTime("2016-03-26"), Convert.ToDateTime("2017-03-26"));
            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("Type of Recall");

            DataRow _testPat = expected_dt.NewRow();

            _testPat["Name"]   = "Test, Patient 1";
            _testPat["Gender"] = "M";
            var birthdate = Convert.ToDateTime("1988-07-21");
            var age       = DateTime.UtcNow.Year - birthdate.Year;

            if (birthdate > DateTime.UtcNow.AddYears(-age))
            {
                age--;
            }
            _testPat["Age"]            = age.ToString();
            _testPat["Type of Recall"] = "Prophy";

            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"]);
            Assert.AreEqual(real_dt.Rows[0]["Type of Recall"], expected_dt.Rows[0]["Type of Recall"]);
        }
Ejemplo n.º 2
0
        private void butOK_Click(object sender, EventArgs e)
        {
            DataTable tablePats;

            tablePats = KPINewToRecall.GetNewToRecall(dtpStart.Value, dtpEnd.Value);

            ReportComplex report = new ReportComplex(true, false);

            report.ReportName = Lan.g(this, "New to Recall Patients");
            report.AddTitle("Title", Lan.g(this, "New to Recall 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("Type of Recall", 100, FieldValueType.String);
            query.AddGroupSummaryField("Patient Count:", "Name", "Type of Recall", SummaryOperation.Count);
            report.AddPageNum();
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

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