public static IValidateVitalSign GetVitalSignValidator(VitalSignType type) { IValidateVitalSign vitalSignValidator = null; switch (type) { case VitalSignContractLib.VitalSignType.SPO2: { vitalSignValidator = spo2Validator; } break; case VitalSignContractLib.VitalSignType.PulseRate: { vitalSignValidator = pulseRateValidator; } break; case VitalSignContractLib.VitalSignType.Temperature: { vitalSignValidator = temperatureValidator; } break; } return(vitalSignValidator); }
public string ValidateTemperature(string patientId, string m_temperature) { string strResult = string.Empty; IValidateVitalSign pulseRateValidator = GetVitalSignValidator(VitalSignType.Temperature); if (pulseRateValidator != null) { strResult = pulseRateValidator.ValidateVitalSign(patientId, m_temperature); } return(strResult); }
public string ValidateSpo2(string patientId, string m_spo2) { string strResult = string.Empty; IValidateVitalSign pulseRateValidator = GetVitalSignValidator(VitalSignType.SPO2); if (pulseRateValidator != null) { strResult = pulseRateValidator.ValidateVitalSign(patientId, m_spo2); } return(strResult); }
private IValidateVitalSign GetVitalSignValidator(VitalSignType vitalSignType) { IValidateVitalSign validateVitalSign = null; foreach (IValidateVitalSign tempVitalSignValidator in m_lstValidateVitalSign) { if (tempVitalSignValidator.VitalSignType == vitalSignType) { validateVitalSign = tempVitalSignValidator; break; } } return(validateVitalSign); }
private bool ValidateVitalSign(int index, IValidateVitalSign vitalSignValidator, string[] parsedJsonData, string patientId, out string alertMessage) { bool bValidateResult = false; alertMessage = string.Empty; if (index >= 0) { alertMessage = vitalSignValidator.ValidateVitalSign(patientId, parsedJsonData[index]); if (string.IsNullOrEmpty(alertMessage)) { bValidateResult = true; } } return(bValidateResult); }