Esempio n. 1
0
        public Alert VitalIsOk(AlertVitals av, string vital_name, int value)
        {
            Alert       alrt = new Alert();
            VitalsCheck vc   = new VitalsCheck();

            if (av.lower_limit.ContainsKey(vital_name) == false)
            {
                //Console.WriteLine("Please check entered Vitals / WRONG vital is entered");
                alrt.status  = false;
                alrt.Message = vital_name + " vital is not present in list / WRONG vital is entered.. !";
            }
            else
            {
                alrt = vc.VitalAreOk(av, vital_name, alrt, value);
            }
            return(alrt);
        }
Esempio n. 2
0
        public Alert VitalAreOk(AlertVitals av, string vital_name, Alert alrt, int value)
        {
            if (av.lower_limit[vital_name] > value)
            {
                alrt.status  = false;
                alrt.Message = vital_name + " is Low..!!";
                return(alrt);
            }

            else if (av.upper_limit[vital_name] < value)
            {
                alrt.status  = false;
                alrt.Message = vital_name + " is High..!!";
                return(alrt);
            }

            alrt.status  = true;
            alrt.Message = vital_name + " status is good..";
            return(alrt);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            alertPrint     p   = new alertPrint();
            VitalsCheck    vc  = new VitalsCheck();
            AlertVitals    av  = new AlertVitals();
            abnormalVitals abv = new abnormalVitals();


            p.printAlert(abv.VitalIsOk(av, "SPO2", 95));
            p.printAlert(abv.VitalIsOk(av, "SPO2", 88));
            p.printAlert(abv.VitalIsOk(av, "BPM", 160));
            p.printAlert(abv.VitalIsOk(av, "RespRate", 40));
            p.printAlert(abv.VitalIsOk(av, "BPM", 111));

            p.printAlert(abv.VitalIsOk(av, "Sugar", 111)); //handelling Unknown vital

            ExpectTrue(abv.VitalIsOk(av, "RespRate", 50));
            ExpectFalse(abv.VitalIsOk(av, "RespRate", 100));
            Console.WriteLine("All ok");
        }