diff --git a/Polyclinic/PolyclinicDatabaseImplement/Implements/DiagnoseStorage.cs b/Polyclinic/PolyclinicDatabaseImplement/Implements/DiagnoseStorage.cs index ebb936d..bf0c673 100644 --- a/Polyclinic/PolyclinicDatabaseImplement/Implements/DiagnoseStorage.cs +++ b/Polyclinic/PolyclinicDatabaseImplement/Implements/DiagnoseStorage.cs @@ -50,7 +50,11 @@ namespace PolyclinicDatabaseImplement.Implements } if (model.To != null) { - elements = elements.Where(x => x.DateStopDiagnose <= model.To.Value).ToList(); + elements = elements + .Where(x => x.DateStartDiagnose <= model.To.Value) + .Where(x => x.DateStopDiagnose != null) + .Where(x => x.DateStopDiagnose <= model.To.Value) + .ToList(); } return elements; }