From 028937aa72f62840a3be093837b6af9e81fb02fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=91=D0=B0=D0=BA=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Wed, 1 May 2024 23:29:56 +0400 Subject: [PATCH 1/7] =?UTF-8?q?=D0=BE=D0=B1=D1=89=D0=B0=D1=8F=20BindingMod?= =?UTF-8?q?el=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D1=82=D1=87=D0=B5=D1=82=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=B2=20=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=B0=D0=BA?= =?UTF-8?q?=D1=82=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/ReportBindingModel.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Polyclinic/PolyclinicContracts/BindingModels/ReportBindingModel.cs diff --git a/Polyclinic/PolyclinicContracts/BindingModels/ReportBindingModel.cs b/Polyclinic/PolyclinicContracts/BindingModels/ReportBindingModel.cs new file mode 100644 index 0000000..76607a0 --- /dev/null +++ b/Polyclinic/PolyclinicContracts/BindingModels/ReportBindingModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PolyclinicContracts.BindingModels +{ + public class ReportBindingModel + { + public string FileName { get; set; } = string.Empty; + public DateTime? DateFrom { get; set; } + public DateTime? DateTo { get; set; } + } +} -- 2.25.1 From 63fc491029eaff776cf9e2f302b7e65629cbe12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=91=D0=B0=D0=BA=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Thu, 2 May 2024 00:03:06 +0400 Subject: [PATCH 2/7] =?UTF-8?q?=D0=BE=D1=85=20=D0=BC=D0=B0=D0=BC=D0=BE?= =?UTF-8?q?=D1=87=D0=BA=D0=B8...=20=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB?= =?UTF-8?q?=D0=B0=20=D0=B2=D1=8C=D1=8E=D1=85=D1=83=20=D0=BE=D1=82=D1=87?= =?UTF-8?q?=D0=B5=D1=82=D0=BE=D0=B2=20=D0=BF=D0=BE=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D1=86=D0=B5=D0=B4=D1=83=D1=80=D0=B0=D0=BC=20=D0=B2=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D1=82=D1=80=D0=B0=D0=BA=D1=82=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/ReportCoursesByProcedures.cs | 12 ++++++++++++ .../ViewModels/ReportProceduresViewModel.cs | 17 +++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Polyclinic/PolyclinicContracts/ViewModels/ReportCoursesByProcedures.cs create mode 100644 Polyclinic/PolyclinicContracts/ViewModels/ReportProceduresViewModel.cs diff --git a/Polyclinic/PolyclinicContracts/ViewModels/ReportCoursesByProcedures.cs b/Polyclinic/PolyclinicContracts/ViewModels/ReportCoursesByProcedures.cs new file mode 100644 index 0000000..171f262 --- /dev/null +++ b/Polyclinic/PolyclinicContracts/ViewModels/ReportCoursesByProcedures.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PolyclinicContracts.ViewModels +{ + public class ReportCoursesByProcedures + { + } +} diff --git a/Polyclinic/PolyclinicContracts/ViewModels/ReportProceduresViewModel.cs b/Polyclinic/PolyclinicContracts/ViewModels/ReportProceduresViewModel.cs new file mode 100644 index 0000000..07ba83c --- /dev/null +++ b/Polyclinic/PolyclinicContracts/ViewModels/ReportProceduresViewModel.cs @@ -0,0 +1,17 @@ +using PolyclinicDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PolyclinicContracts.ViewModels +{ + public class ReportProceduresViewModel + { + public int Procedure { get; set; } + public DateTime DateStartProcedure { get; set; } + public DateTime DateStopProcedure { get; set;} + public List<(string, string)> MedicamentSymptom { get; set; } = new(); + } +} -- 2.25.1 From 9e662c26084671469f2b9deb341a603859bd14ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=91=D0=B0=D0=BA=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Thu, 2 May 2024 00:46:07 +0400 Subject: [PATCH 3/7] =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB?= =?UTF-8?q?=D0=B0=20=D1=84=D0=BE=D1=80=D0=BC=D1=83=20=D0=BF=D0=BE=D0=B4=20?= =?UTF-8?q?=D0=BE=D1=82=D1=87=D0=B5=D1=82=20=D0=B2=20=D0=B4=D0=BE=D0=BA=20?= =?UTF-8?q?=D0=B8=D0=BB=D0=B8=20=D1=8D=D0=BA=D1=81=D0=B5=D0=BB=D1=8C=20?= =?UTF-8?q?=D0=BF=D0=BE=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D0=B4=D1=83=D1=80?= =?UTF-8?q?=D0=B0=D0=BC=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BB=D0=B0=20?= =?UTF-8?q?=D0=B2=D1=8C=D1=8E=D1=88=D0=BA=D1=83=20=D0=BF=D0=BE=D0=B4=20?= =?UTF-8?q?=D0=BE=D1=82=D1=87=D0=B5=D1=82=20=D0=B2=20=D0=B4=D0=BE=D0=BA=20?= =?UTF-8?q?=D0=B8=D0=BB=D0=B8=20=D1=8D=D0=BA=D1=81=D0=B5=D0=BB=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/ReportCoursesByProcedures.cs | 2 ++ .../ViewModels/ReportProceduresViewModel.cs | 2 +- .../Views/Home/ListCoursesByProcedures.cshtml | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Polyclinic/PolyclinicContracts/ViewModels/ReportCoursesByProcedures.cs b/Polyclinic/PolyclinicContracts/ViewModels/ReportCoursesByProcedures.cs index 171f262..ed74567 100644 --- a/Polyclinic/PolyclinicContracts/ViewModels/ReportCoursesByProcedures.cs +++ b/Polyclinic/PolyclinicContracts/ViewModels/ReportCoursesByProcedures.cs @@ -8,5 +8,7 @@ namespace PolyclinicContracts.ViewModels { public class ReportCoursesByProcedures { + public string Name { get; set; } = string.Empty; + public List<(int countDays, int pillsPerDay, string comment)> Courses = new(); } } diff --git a/Polyclinic/PolyclinicContracts/ViewModels/ReportProceduresViewModel.cs b/Polyclinic/PolyclinicContracts/ViewModels/ReportProceduresViewModel.cs index 07ba83c..0baba92 100644 --- a/Polyclinic/PolyclinicContracts/ViewModels/ReportProceduresViewModel.cs +++ b/Polyclinic/PolyclinicContracts/ViewModels/ReportProceduresViewModel.cs @@ -12,6 +12,6 @@ namespace PolyclinicContracts.ViewModels public int Procedure { get; set; } public DateTime DateStartProcedure { get; set; } public DateTime DateStopProcedure { get; set;} - public List<(string, string)> MedicamentSymptom { get; set; } = new(); + public List<(string medicamentName, string symptomName)> MedicamentSymptom { get; set; } = new(); } } diff --git a/Polyclinic/PolyclinicWebAppSuretor/Views/Home/ListCoursesByProcedures.cshtml b/Polyclinic/PolyclinicWebAppSuretor/Views/Home/ListCoursesByProcedures.cshtml index b6a68f1..5d23885 100644 --- a/Polyclinic/PolyclinicWebAppSuretor/Views/Home/ListCoursesByProcedures.cshtml +++ b/Polyclinic/PolyclinicWebAppSuretor/Views/Home/ListCoursesByProcedures.cshtml @@ -10,7 +10,7 @@

- Выберите процедуры из списка + Выберите процедуру из списка

    @@ -19,7 +19,7 @@ for (int i = 1; i <= count; i++) {
  • - +
  • } -- 2.25.1 From c349a091178456e4fe6174450b97af9a1352fe70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=91=D0=B0=D0=BA=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Thu, 2 May 2024 01:00:43 +0400 Subject: [PATCH 4/7] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B8=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=B0=D0=BB=D0=B0=20=D0=BA=D0=BB=D0=B0=D1=81?= =?UTF-8?q?=D1=81=20=D0=B2=D1=8C=D1=8E=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D0=B8=20=D0=B8=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BB=D0=B0=20?= =?UTF-8?q?=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D1=84=D0=B5=D0=B9=D1=81=20=D0=BB?= =?UTF-8?q?=D0=BE=D0=B3=D0=B8=D0=BA=D0=B8=20=D0=BE=D1=82=D1=87=D0=B5=D1=82?= =?UTF-8?q?=D0=BE=D0=B2=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=BE=D1=80=D1=83?= =?UTF-8?q?=D1=87=D0=B8=D1=82=D0=B5=D0=BB=D1=8F=20>:/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ISuretorReportLogic.cs | 40 +++++++++++++++++++ ...s => ReportCoursesByProcedureViewModel.cs} | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 Polyclinic/PolyclinicContracts/BusinessLogicsContracts/ISuretorReportLogic.cs rename Polyclinic/PolyclinicContracts/ViewModels/{ReportCoursesByProcedures.cs => ReportCoursesByProcedureViewModel.cs} (86%) diff --git a/Polyclinic/PolyclinicContracts/BusinessLogicsContracts/ISuretorReportLogic.cs b/Polyclinic/PolyclinicContracts/BusinessLogicsContracts/ISuretorReportLogic.cs new file mode 100644 index 0000000..affce17 --- /dev/null +++ b/Polyclinic/PolyclinicContracts/BusinessLogicsContracts/ISuretorReportLogic.cs @@ -0,0 +1,40 @@ +using PolyclinicContracts.BindingModels; +using PolyclinicContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PolyclinicContracts.BusinessLogicsContracts +{ + public interface ISuretorReportLogic + { + /// + /// Получение списка компонент с указанием, в каких изделиях используются + /// + /// + List GetProcedureCourses(); + /// + /// Получение списка заказов за определенный период + /// + /// + /// + List GetProcedures(ReportBindingModel model); + /// + /// Сохранение компонент в файл-Word + /// + /// + void SaveCoursesByProcedureToWordFile(ReportBindingModel model); + /// + /// Сохранение компонент с указаеним продуктов в файл-Excel + /// + /// + void SaveCoursesByProcedureToExcelFile(ReportBindingModel model); + /// + /// Сохранение заказов в файл-Pdf + /// + /// + void SaveOrdersToPdfFile(ReportBindingModel model); + } +} diff --git a/Polyclinic/PolyclinicContracts/ViewModels/ReportCoursesByProcedures.cs b/Polyclinic/PolyclinicContracts/ViewModels/ReportCoursesByProcedureViewModel.cs similarity index 86% rename from Polyclinic/PolyclinicContracts/ViewModels/ReportCoursesByProcedures.cs rename to Polyclinic/PolyclinicContracts/ViewModels/ReportCoursesByProcedureViewModel.cs index ed74567..7362ded 100644 --- a/Polyclinic/PolyclinicContracts/ViewModels/ReportCoursesByProcedures.cs +++ b/Polyclinic/PolyclinicContracts/ViewModels/ReportCoursesByProcedureViewModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace PolyclinicContracts.ViewModels { - public class ReportCoursesByProcedures + public class ReportCoursesByProcedureViewModel { public string Name { get; set; } = string.Empty; public List<(int countDays, int pillsPerDay, string comment)> Courses = new(); -- 2.25.1 From c73e54da8ebe26763ca6641f1713a70133063cb5 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Thu, 2 May 2024 02:08:08 +0400 Subject: [PATCH 5/7] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BD=D0=B5=D0=BE=D0=B1=D1=85=D0=BE=D0=B4=D0=B8?= =?UTF-8?q?=D0=BC=D1=8B=D0=B5=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=BE=D1=82=D1=87=D0=B5=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=BE=D1=82=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8?= =?UTF-8?q?=D1=82=D0=B5=D0=BB=D1=8F,=20=D0=BE=D1=81=D1=82=D0=B0=D0=BB?= =?UTF-8?q?=D0=BE=D1=81=D1=8C=20=D1=80=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D1=82=D1=8C=20=D0=B5=D1=89=D0=B5=20=D0=BE=D0=B4?= =?UTF-8?q?=D0=BD=D1=83=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8E=20?= =?UTF-8?q?=D0=B2=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B5=20=D0=BE=D1=82?= =?UTF-8?q?=D1=87=D0=B5=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogics/ImplementerReportLogic.cs | 84 +++++++++++++++++++ .../IImplementerReportLogic.cs | 14 ++++ .../SearchModels/DiagnoseSearchModel.cs | 4 +- ...iagnoseWithCoursesAndSymptomesViewModel.cs | 13 +++ .../ReportMedicamentsByDiagnoseViewModel.cs | 12 +++ 5 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 Polyclinic/PolyclinicBusinessLogic/BusinessLogics/ImplementerReportLogic.cs create mode 100644 Polyclinic/PolyclinicContracts/BusinessLogicsContracts/IImplementerReportLogic.cs create mode 100644 Polyclinic/PolyclinicContracts/ViewModels/ReportDiagnoseWithCoursesAndSymptomesViewModel.cs create mode 100644 Polyclinic/PolyclinicContracts/ViewModels/ReportMedicamentsByDiagnoseViewModel.cs diff --git a/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/ImplementerReportLogic.cs b/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/ImplementerReportLogic.cs new file mode 100644 index 0000000..8f2c76c --- /dev/null +++ b/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/ImplementerReportLogic.cs @@ -0,0 +1,84 @@ +using PolyclinicContracts.BindingModels; +using PolyclinicContracts.BusinessLogicsContracts; +using PolyclinicContracts.SearchModels; +using PolyclinicContracts.StoragesContracts; +using PolyclinicContracts.ViewModels; + +namespace PolyclinicBusinessLogic.BusinessLogics +{ + public class ImplementerReportLogic : IImplementerReportLogic + { + private readonly IDiagnoseStorage _diagnoseStorage; + private readonly IMedicamentStorage _medicamentStorage; + private readonly ICourseStorage _courseStorage; + private readonly ISymptomStorage _symptomStorage; + + public ImplementerReportLogic(IDiagnoseStorage diagnoseStorage, IMedicamentStorage medicamentStorage, ICourseStorage courseStorage, ISymptomStorage symptomStorage) + { + _diagnoseStorage = diagnoseStorage; + _medicamentStorage = medicamentStorage; + _courseStorage = courseStorage; + _symptomStorage = symptomStorage; + } + + public List GetDiagnoses() + { + throw new NotImplementedException(); + } + + public List GetMedicamentsByDiagnoses(ReportBindingModel model) + { + var diagnoses = _diagnoseStorage + .GetFilteredList(new DiagnoseSearchModel + { + From = model.DateFrom, + To = model.DateTo + }); + + var symptomes = _symptomStorage + .GetFullList(); + + var medicaments = _medicamentStorage.GetFullList(); + + List result = new(); + + foreach (var diagnose in diagnoses) + { + var diagnoseSymptomes = symptomes + .Where(x => x.SymptomDiagnoses.ContainsKey(diagnose.Id)) + .ToList(); + var diagnoseMedicaments = new List(); + foreach (var symptom in diagnoseSymptomes) + { + diagnoseMedicaments.AddRange(medicaments.Where(x => x.SymptomId == symptom.Id)); + } + diagnoseMedicaments.Distinct(); + var diagnoseReportModel = new ReportMedicamentsByDiagnoseViewModel { + DiagnoseId = diagnose.Id, + DiagnoseName = diagnose.Name, + DiagnoseComment = diagnose.Comment, + DiagnoseDateStart = diagnose.DateStartDiagnose, + DiagnoseDateStop = diagnose.DateStopDiagnose, + Medicaments = diagnoseMedicaments.Select(x => x.Name).ToList() + }; + result.Add(diagnoseReportModel); + } + return result; + } + + public void SaveOrdersToPdfFile(ReportBindingModel model) + { + throw new NotImplementedException(); + } + + public void SaveSecureComponentToExcelFile(ReportBindingModel model) + { + throw new NotImplementedException(); + } + + public void SaveSecuresToWordFile(ReportBindingModel model) + { + throw new NotImplementedException(); + } + } +} diff --git a/Polyclinic/PolyclinicContracts/BusinessLogicsContracts/IImplementerReportLogic.cs b/Polyclinic/PolyclinicContracts/BusinessLogicsContracts/IImplementerReportLogic.cs new file mode 100644 index 0000000..c046a8a --- /dev/null +++ b/Polyclinic/PolyclinicContracts/BusinessLogicsContracts/IImplementerReportLogic.cs @@ -0,0 +1,14 @@ +using PolyclinicContracts.BindingModels; +using PolyclinicContracts.ViewModels; + +namespace PolyclinicContracts.BusinessLogicsContracts +{ + public interface IImplementerReportLogic + { + List GetDiagnoses(); + List GetMedicamentsByDiagnoses(ReportBindingModel model); + void SaveSecuresToWordFile(ReportBindingModel model); + void SaveSecureComponentToExcelFile(ReportBindingModel model); + void SaveOrdersToPdfFile(ReportBindingModel model); + } +} diff --git a/Polyclinic/PolyclinicContracts/SearchModels/DiagnoseSearchModel.cs b/Polyclinic/PolyclinicContracts/SearchModels/DiagnoseSearchModel.cs index 1ccfb4c..7921c20 100644 --- a/Polyclinic/PolyclinicContracts/SearchModels/DiagnoseSearchModel.cs +++ b/Polyclinic/PolyclinicContracts/SearchModels/DiagnoseSearchModel.cs @@ -5,7 +5,7 @@ public int? Id { get; set; } public string? Name { get; set; } public int? UserId { get; set; } - public DateTime? From { get; } - public DateTime? To { get; } + public DateTime? From { get; set; } + public DateTime? To { get; set; } } } diff --git a/Polyclinic/PolyclinicContracts/ViewModels/ReportDiagnoseWithCoursesAndSymptomesViewModel.cs b/Polyclinic/PolyclinicContracts/ViewModels/ReportDiagnoseWithCoursesAndSymptomesViewModel.cs new file mode 100644 index 0000000..df52d06 --- /dev/null +++ b/Polyclinic/PolyclinicContracts/ViewModels/ReportDiagnoseWithCoursesAndSymptomesViewModel.cs @@ -0,0 +1,13 @@ +namespace PolyclinicContracts.ViewModels +{ + public class ReportDiagnoseWithCoursesAndSymptomesViewModel + { + public int DiagnoseId { get; set; } + public string DiagnoseName { get; set; } = string.Empty; + public string DiagnoseComment { get; set; } = string.Empty; + public DateTime DiagnoseDateStart { get; set; } + public DateTime? DiagnoseDateStop { get; set; } = null; + public List Symptomes { get; set; } = new(); + public List<(int DaysCount, int PillsPerDay)> Courses = new(); + } +} diff --git a/Polyclinic/PolyclinicContracts/ViewModels/ReportMedicamentsByDiagnoseViewModel.cs b/Polyclinic/PolyclinicContracts/ViewModels/ReportMedicamentsByDiagnoseViewModel.cs new file mode 100644 index 0000000..e9b3bf6 --- /dev/null +++ b/Polyclinic/PolyclinicContracts/ViewModels/ReportMedicamentsByDiagnoseViewModel.cs @@ -0,0 +1,12 @@ +namespace PolyclinicContracts.ViewModels +{ + public class ReportMedicamentsByDiagnoseViewModel + { + public int DiagnoseId { get; set; } + public string DiagnoseName { get; set; } = string.Empty; + public string DiagnoseComment { get; set; } = string.Empty; + public DateTime DiagnoseDateStart { get; set; } + public DateTime? DiagnoseDateStop { get; set; } = null; + public List Medicaments = new(); + } +} -- 2.25.1 From 68329a744415b89edfbec2f1b70407cdb57b8e70 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Thu, 2 May 2024 02:10:30 +0400 Subject: [PATCH 6/7] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D1=84=D1=83?= =?UTF-8?q?=D0=BD=D0=BA=D1=86=D0=B8=D0=B8=20=D0=B2=20=D0=BB=D0=BE=D0=B3?= =?UTF-8?q?=D0=B8=D0=BA=D0=B5=20=D0=BE=D1=82=D1=87=D0=B5=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8=D1=82=D0=B5=D0=BB?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogics/ImplementerReportLogic.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/ImplementerReportLogic.cs b/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/ImplementerReportLogic.cs index 8f2c76c..f4745c1 100644 --- a/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/ImplementerReportLogic.cs +++ b/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/ImplementerReportLogic.cs @@ -52,14 +52,13 @@ namespace PolyclinicBusinessLogic.BusinessLogics { diagnoseMedicaments.AddRange(medicaments.Where(x => x.SymptomId == symptom.Id)); } - diagnoseMedicaments.Distinct(); var diagnoseReportModel = new ReportMedicamentsByDiagnoseViewModel { DiagnoseId = diagnose.Id, DiagnoseName = diagnose.Name, DiagnoseComment = diagnose.Comment, DiagnoseDateStart = diagnose.DateStartDiagnose, DiagnoseDateStop = diagnose.DateStopDiagnose, - Medicaments = diagnoseMedicaments.Select(x => x.Name).ToList() + Medicaments = diagnoseMedicaments.Distinct().Select(x => x.Name).ToList() }; result.Add(diagnoseReportModel); } -- 2.25.1 From c3a43503f8448983426253e5764f30f0d8c6d388 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Thu, 2 May 2024 02:19:56 +0400 Subject: [PATCH 7/7] =?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) -- 2.25.1