예제 #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);
        }
예제 #2
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");
        }