public static IPatientSeries ToModel(this antigenSupportingDataSeries series) { return(new PatientSeries() { Series = series, Status = PatientSeriesStatus.NotComplete, TargetDoses = series.seriesDose.Select(x => (ITargetDose) new TargetDose() { Status = TargetDoseStatus.NotSatisfied, SeriesDose = x }).ToList() }); }
public bool IsValidSeries(DateTime assessmentDate, PatientProfile profile, antigenSupportingDataSeries series) { switch (series.seriesType) { case "Standard": var seriesGender = series.requiredGender[0]; seriesGender = string.IsNullOrWhiteSpace(seriesGender) ? "F" : seriesGender; return(seriesGender == profile.Gender); case "Risk": // TODO Add date checks to the select call. return(series.indication .Select(x => x.observationCode.code == profile.MedHistoryCode) .Aggregate(false, (x, y) => x || y)); default: throw new ArgumentException("Invalid series type.", "series"); } }
/// <summary> /// /// </summary> /// <param name="series"></param> /// <param name="gender"></param> /// <returns></returns> /// <remarks>TABLE 5-4 IS THE SERIES RELEVANT FOR THE PATIENT?</remarks> public static bool IsRequiredGender(this antigenSupportingDataSeries series, Gender gender) { return(string.IsNullOrWhiteSpace(series.requiredGender[0]) || series.requiredGender.Where(x => x == gender.ToString()).Any()); }
public static bool IsRelevantSeries(this antigenSupportingDataSeries series, IEnv env) { return(series.IsRequiredGender(env.Patient.Gender) && (Enum.TryParse <PatientSeriesType>(series.seriesType) == PatientSeriesType.Standard || series.IsIndicated(env))); }
/// <summary> /// The series is indicated for the patient if any of the series indications are indicated. /// </summary> /// <param name="series"></param> /// <param name="patient"></param> /// <returns></returns> public static bool IsIndicated(this antigenSupportingDataSeries series, IEnv env) { return(series.indication.Select(x => x.IsIndicated(env)).Aggregate(false, (x, y) => x || y)); }