private void PopulateDailyEpicCurve(List <FlagTimeModel> flagTimes, DateTime date) { foreach (FlagTimeModel flag in flagTimes) { _logger.LogDebug("PatientLocation - Query Paramters: PatientID: {PatientID} \r Datum: {Date}", flag.PatientID, flag.Datum.ToString()); List <PatientLocation> patientLocations = _restData.AQLQuery <PatientLocation>(AQLCatalog.PatientLocation(flag.Datum, flag.PatientID)); PatientLocation patientLocation = null; if (patientLocations == null) { _logger.LogDebug("PatientLocation - Query Response Count: {LocationCount}", null); patientLocation = new PatientLocation() { Ward = "ohne Stationsangabe", Departement = "0000" }; } else { patientLocation = patientLocations[0]; } SetBasicDailyEpiCurveEntries(flag, patientLocation, date); AggregateFlagInformation(flag, patientLocation); } GetMovingAverages(); }
private void AggregateFlagInformation(FlagTimeModel flag, PatientLocation patientLocation) { if (infections.ContainsKey(flag.PatientID)) { PatientInfectionModel patientInfections = infections[flag.PatientID]; if (patientInfections.IsInfected && !patientInfections.HasFirstNegativeTest && !flag.HasFlag()) { patientInfections.HasFirstNegativeTest = true; } else if (patientInfections.IsInfected && patientInfections.HasFirstNegativeTest && !flag.HasFlag()) { DecrementOverallCount(patientInfections.InfectionWard); DecrementOverallCount(COMPLETE_CLINIC); } } else { InitializeNewInfectiousPatient(flag, patientLocation); if (flag.HasFlag()) { IncrementCounts(patientLocation.Ward); IncrementCounts(COMPLETE_CLINIC); } } }
private void InitializeNewInfectiousPatient(FlagTimeModel flag, PatientLocation loc) { infections.Add(flag.PatientID, new PatientInfectionModel { PatientID = flag.PatientID, IsInfected = flag.HasFlag(), InfectionWard = loc.Ward }); }
private void SetBasicDailyEpiCurveEntries(FlagTimeModel flag, PatientLocation patientLocation, DateTime date) { if (!EpiCurveEntryByWard.ContainsKey(COMPLETE_CLINIC)) { EpiCurveEntryByWard.Add(COMPLETE_CLINIC, InitializeNewEpiCurveModel(flag, COMPLETE_CLINIC, date)); } if (!EpiCurveEntryByWard.ContainsKey(patientLocation.Ward) && flag.HasFlag()) { EpiCurveEntryByWard.Add(patientLocation.Ward, InitializeNewEpiCurveModel(flag, patientLocation.Ward, date)); } if (!mavg28.ContainsKey(patientLocation.Ward) && !mavg7.ContainsKey(patientLocation.Ward)) { mavg7.Add(patientLocation.Ward, new List <int>()); mavg28.Add(patientLocation.Ward, new List <int>()); } }