示例#1
0
        public Patient GetDashBoardDataByPerson(int numPatient, float height, float weight)
        {
            Patient p = new Patient();

            laboratoryTests = new LaboratoryTests();
            foodReport      = new FoodReport();
            DBservices ds = new DBservices();
            //List<Patient> patients = ds.GetPatients();



            List <LaboratoryTests> labratoryTestList = laboratoryTests.GetLab(numPatient);
            List <FoodReport>      foodReportList    = foodReport.GetFoodReportByPatienty(numPatient);
            double bmi = weight / (height * height);

            bmi   = Math.Round(bmi, 4);
            p.BMI = bmi;

            CalcUserStatus(labratoryTestList.FirstOrDefault(), foodReportList, p.BMI, p);


            //DashBoardVM dvm = new DashBoardVM();
            //dvm.Patients = patients;
            return(p);
        }
示例#2
0
        public DashBoardVM GetDashBoardData()
        {
            laboratoryTests = new LaboratoryTests();
            foodReport      = new FoodReport();
            DBservices ds = new DBservices();
            //List<Patient> patients = ds.GetPatients();
            List <Patient> patients = ds.GetPatientsforSmart();

            foreach (Patient p in patients)
            {
                List <LaboratoryTests> labratoryTestList = laboratoryTests.GetLab(p.NumPatient);
                List <FoodReport>      foodReportList    = foodReport.GetFoodReportByPatienty(p.NumPatient);
                double bmi = p.Weight / (p.Height * p.Height);
                bmi   = Math.Round(bmi, 4);
                p.BMI = bmi;

                CalcUserStatus(labratoryTestList.FirstOrDefault(), foodReportList, p.BMI, p);
            }

            DashBoardVM dvm = new DashBoardVM();

            dvm.Patients = patients;
            return(dvm);
        }