Ejemplo n.º 1
0
        /// <summary>
        /// This function returns alert messsage depending upon the validation of the vitals values of a particular patient
        /// </summary>
        /// <param name="patientId"></param>
        /// <returns>AlertMessage</returns>

        public string PatientVitalsAlertUponValidation(string patientId)
        {
            PatientVitalsAlerter patientVitalsAlerter = new PatientVitalsAlerter();
            string           alertMessage             = "";
            PatientVitals    patientVitals            = _dataAccessComponent.ReadPatientVitalsData(patientId);
            List <VitalSign> enabledVitalsList        = _dataAccessComponent.GetEnabledVitalsList(patientId);

            foreach (var item in enabledVitalsList)
            {
                alertMessage += patientVitalsAlerter.SendAlert(item, patientVitals);
            }
            if (alertMessage == "")
            {
                alertMessage = "Healthy";
            }
            return(alertMessage);
        }
        public string PatientVitalsAlert(string patientId)
        {
            IDataAccessComponent dataAccess        = InstanceCreator.Create_Instance("DataAccess", "") as IDataAccessComponent;
            PatientVitals        patientVitals     = dataAccess.ReadPatientVitalsData(patientId);
            List <VitalSign>     enabledVitalsList = dataAccess.GetEnabledVitalsList(patientId);

            foreach (var item in enabledVitalsList)
            {
                if (item.IsEnabled)
                {
                    PropertyInfo property        = typeof(PatientVitals).GetProperty(item.Type.ToString());
                    var          vitalsValidator = InstanceCreator.Create_Instance(property.Name, "Validator") as IPatientVitalsValidate;
                    if (!vitalsValidator.Validate((double)property.GetValue(patientVitals)))
                    {
                        alertMessage += property.Name + "Alert ";
                    }
                }
            }

            return(alertMessage);
        }