public AscvdClassification(AscvdParameters ascvdParameters) { CheckForNullParameters(ascvdParameters); _smoker = _patient.Comorbidities.Contains(ChronicDisease.TobaccoSmoker); _isDiabetic = _patient.Comorbidities.Contains(ChronicDisease.Diabetes); _clinicialAscvdPresent = _patient.Comorbidities.Contains(ChronicDisease.DiagnosedCardiovascularDisease); _pooledCohortsEquation = new PooledCohortsEquation( PooledCohortEquationParameters.Build(_patient, _bloodPressure, _cholesterolTotal, _cholesterolHdlC)); }
private void CheckForNullParameters(AscvdParameters ascvdParameters) { _cholesterolHdlC = ascvdParameters.HdlCholesterol ?? throw new ArgumentNullException(nameof(ascvdParameters.HdlCholesterol)); _cholesterolTotal = ascvdParameters.TotalCholesterol ?? throw new ArgumentNullException(nameof(ascvdParameters.TotalCholesterol)); _ldlCholesterol = ascvdParameters.LdlCholesterol ?? throw new ArgumentNullException(nameof(ascvdParameters.LdlCholesterol)); _bloodPressure = ascvdParameters.BloodPressure ?? throw new ArgumentNullException(nameof(ascvdParameters.BloodPressure)); _patient = ascvdParameters.Patient ?? throw new ArgumentNullException(nameof(ascvdParameters.Patient)); }