예제 #1
0
        public List <public_lineitem> GetActivePatientsConvert(int hid, string rundate, string interval)
        {
            List <public_lineitem> lst = new List <public_lineitem>();
            DataTable dtResult         = GetActivePatients(hid, rundate, interval);

            for (var i = 0; i < dtResult.Rows.Count; i++)
            {
                public_lineitem pb = new public_lineitem();
                pb.client_id  = Convert.ToInt32(dtResult.Rows[i]["client_id"]);
                pb.patient_id = Convert.ToInt32(dtResult.Rows[i]["patient_id"]);
                pb.hid        = Convert.ToInt32(dtResult.Rows[i]["hid"]);
                lst.Add(pb);
            }
            return(lst);
        }
        public void GetActivePatients()
        {
            int    hid         = 2882;
            string my_run_date = "2018-09-17";
            string myinterval  = "1 day";
            //DateTime dt = new DateTime();
            BeginTestCases     obj         = new BeginTestCases();
            BusinessLogicLayer objBusiness = new BusinessLogicLayer();

            /*
             * 1. GET SCHEMA -
             * 2. INSERT WITH DUMMY DATA
             * 3. EXECUTE FUNCTION
             * 4. ASSERT THE RESULT
             */
            //Insert dummy data to sample table
            obj.InsertDatatoLineItem();
            // Executing function and Asserting the result
            List <public_lineitem> lstResult = obj.GetActivePatientsConvert(hid, my_run_date, myinterval);

            List <public_lineitem> lstExpected = new List <public_lineitem>();
            public_lineitem        pl          = new public_lineitem();

            pl.client_id  = 96772283;
            pl.patient_id = 164445456;
            pl.hid        = 2882;
            lstExpected.Add(pl);

            pl            = new public_lineitem();
            pl.client_id  = 96772284;
            pl.patient_id = 164445457;
            pl.hid        = 2882;
            lstExpected.Add(pl);
            var dtExpected = objBusiness.CreateDataTable(lstExpected);
            var dtResult   = objBusiness.CreateDataTable(lstResult);

            Assert.AreEqual(true, obj.GetDifferentRecords(dtExpected, dtResult));
        }
예제 #3
0
        public List <public_lineitem> GenerateLineItem()
        {
            List <public_lineitem> lstLineItem = new List <public_lineitem>();
            public_lineitem        pl          = null;

            // GENERATE DATA
            #region LINEITEM 1
            pl                 = new public_lineitem();
            pl.id              = 1;
            pl.hid             = 2882;
            pl.pms_id          = "753:6779";
            pl.client_id       = 96772283;
            pl.patient_id      = 164445456;
            pl.date            = "2018-09-17";//TODAY
            pl.invoice_number  = "";
            pl.pms_provider_id = 719307;
            pl.pms_service_id  = 114811090;
            pl.occurance       = 1;
            pl.quantity        = 1;
            pl.cost            = 35;
            pl.description     = "desc";
            pl.date_modified   = "2018-09-17";
            lstLineItem.Add(pl);
            #endregion

            #region LINEITEM 2
            pl                 = new public_lineitem();
            pl.id              = 2;
            pl.hid             = 2882;
            pl.pms_id          = "753:6779";
            pl.client_id       = 96772284;
            pl.patient_id      = 164445457;
            pl.date            = "2018-09-16";//TODAY
            pl.invoice_number  = "";
            pl.pms_provider_id = 719307;
            pl.pms_service_id  = 114811090;
            pl.occurance       = 1;
            pl.quantity        = 1;
            pl.cost            = 35;
            pl.description     = "desc";
            pl.date_modified   = "2018-09-17";
            lstLineItem.Add(pl);
            #endregion

            #region LINEITEM 3
            pl                 = new public_lineitem();
            pl.id              = 3;
            pl.hid             = 2882;
            pl.pms_id          = "753:6779";
            pl.client_id       = 96772285;
            pl.patient_id      = 164445458;
            pl.date            = "2018-09-15";//TODAY
            pl.invoice_number  = "";
            pl.pms_provider_id = 719307;
            pl.pms_service_id  = 114811090;
            pl.occurance       = 1;
            pl.quantity        = 1;
            pl.cost            = 35;
            pl.description     = "desc";
            pl.date_modified   = "2018-09-17";
            lstLineItem.Add(pl);
            #endregion

            #region LINEITEM 4
            pl                 = new public_lineitem();
            pl.id              = 4;
            pl.hid             = 1074;
            pl.pms_id          = "753:6779";
            pl.client_id       = 96772286;
            pl.patient_id      = 164445459;
            pl.date            = "2018-09-14";//TODAY
            pl.invoice_number  = "";
            pl.pms_provider_id = 719307;
            pl.pms_service_id  = 114811090;
            pl.occurance       = 1;
            pl.quantity        = 1;
            pl.cost            = 35;
            pl.description     = "desc";
            pl.date_modified   = "2018-09-17";
            lstLineItem.Add(pl);
            #endregion

            return(lstLineItem);
        }