From c3a43503f8448983426253e5764f30f0d8c6d388 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Thu, 2 May 2024 02:19:56 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=20=D0=B2=D1=82=D0=BE=D1=80=D1=83=D1=8E=20?= =?UTF-8?q?=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8E=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D0=BE=D1=82=D1=87=D0=B5=D1=82=D0=B0=20=D0=B8=D1=81=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D0=BD=D0=B8=D1=82=D0=B5=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogics/ImplementerReportLogic.cs | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/ImplementerReportLogic.cs b/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/ImplementerReportLogic.cs index f4745c1..9995140 100644 --- a/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/ImplementerReportLogic.cs +++ b/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/ImplementerReportLogic.cs @@ -23,7 +23,31 @@ namespace PolyclinicBusinessLogic.BusinessLogics public List GetDiagnoses() { - throw new NotImplementedException(); + var diagnoses = _diagnoseStorage.GetFullList(); + var courses = _courseStorage.GetFullList(); + var symptomes = _symptomStorage.GetFullList(); + + var result = new List(); + + foreach (var diagnose in diagnoses) + { + var diagnoseCourses = courses.Where(x => x.CourseDiagnoses.ContainsKey(diagnose.Id)).ToList(); + var diagnoseSymptomes = symptomes.Where(x => x.SymptomDiagnoses.ContainsKey(diagnose.Id)).ToList(); + if (diagnoseCourses.Count > 0 && diagnoseSymptomes.Count > 0) + { + var dianoseReportModel = new ReportDiagnoseWithCoursesAndSymptomesViewModel { + DiagnoseId = diagnose.Id, + DiagnoseName = diagnose.Name, + DiagnoseComment = diagnose.Comment, + DiagnoseDateStart = diagnose.DateStartDiagnose, + DiagnoseDateStop = diagnose.DateStopDiagnose, + Courses = diagnoseCourses.Select(x => (x.DaysCount, x.PillsPerDay)).ToList(), + Symptomes = diagnoseSymptomes.Select(x => x.Name).ToList() + }; + result.Add(dianoseReportModel); + } + } + return result; } public List GetMedicamentsByDiagnoses(ReportBindingModel model)