From 85a4ee7940248b9f90f2c2fca5bb7f26d3d11093 Mon Sep 17 00:00:00 2001 From: ValAnn Date: Wed, 1 May 2024 12:34:48 +0400 Subject: [PATCH] mission complete --- .../BusinessLogics/DoctorReportLogic.cs | 85 ------------------- .../BindingModels/ReportBindingModel.cs | 19 ----- .../IDoctorReportLogic.cs | 19 ----- .../ViewModels/ReportPatientViewModel.cs | 16 ---- .../ReportProcedureRecipeViewModel.cs | 16 ---- 5 files changed, 155 deletions(-) delete mode 100644 Hospital/HospitalBusinessLogic/BusinessLogics/DoctorReportLogic.cs delete mode 100644 Hospital/HospitalContracts/BindingModels/ReportBindingModel.cs delete mode 100644 Hospital/HospitalContracts/BusinessLogicContracts/IDoctorReportLogic.cs delete mode 100644 Hospital/HospitalContracts/ViewModels/ReportPatientViewModel.cs delete mode 100644 Hospital/HospitalContracts/ViewModels/ReportProcedureRecipeViewModel.cs diff --git a/Hospital/HospitalBusinessLogic/BusinessLogics/DoctorReportLogic.cs b/Hospital/HospitalBusinessLogic/BusinessLogics/DoctorReportLogic.cs deleted file mode 100644 index b0135e0..0000000 --- a/Hospital/HospitalBusinessLogic/BusinessLogics/DoctorReportLogic.cs +++ /dev/null @@ -1,85 +0,0 @@ -using HospitalContracts.BindingModels; -using HospitalContracts.BusinessLogicContracts; -using HospitalContracts.SearchModels; -using HospitalContracts.StoragesContracts; -using HospitalContracts.ViewModels; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; - -namespace HospitalBusinessLogic.BusinessLogics -{ - public class DoctorReportLogic : IDoctorReportLogic - { - - private readonly IPatientStorage _patientStorage; - private readonly IMedicineStorage _medicineStorage; - private readonly IProcedureStorage _procedureStorage; - private readonly IRecipeStorage _recipeStorage; - private readonly IDiseaseStorage _diseaseStorage; - - public DoctorReportLogic(IPatientStorage patientStorage, IMedicineStorage medicineStorage, IProcedureStorage procedureStorage, IRecipeStorage recipeStorage, IDiseaseStorage diseaseStorage) - { - - _patientStorage = patientStorage; - _medicineStorage = medicineStorage; - _procedureStorage = procedureStorage; - _recipeStorage = recipeStorage; - _diseaseStorage = diseaseStorage; - } - - public List GetPatients(ReportBindingModel model, PatientBindingModel patientModel) - { - var list = new List(); - var patients = _patientStorage.GetFilteredList(new PatientSearchModel { DateFrom = model.DateFrom, DateTo = model.DateTo, Id = patientModel.Id }); - - foreach (var patient in patients) - { - var record = new ReportPatientViewModel - { - Id = patient.Id, - Medicines = new List(), - Diseases = new List() - }; - - var allRecipes = _recipeStorage.GetFullList(); - var patientRecipes = new List(); - - foreach (var recipe in allRecipes) - { - if (recipe.Id == patient.Id) - { - record.Diseases.Add(_diseaseStorage.GetElement(new DiseaseSearchModel { Id = recipe.DiseaseId }).Description); - } - } - - list.Add(record); - } - return list; - } - - public List GetProcedureRecipes() - { - throw new NotImplementedException(); - } - - public void SavePatientsToPdfFile(ReportBindingModel model) - { - throw new NotImplementedException(); - } - - public void SaveProcedureRecipesToExcelFile(ReportBindingModel model) - { - throw new NotImplementedException(); - } - - public void SaveProcedureRecipesToWordFile(ReportBindingModel model) - { - throw new NotImplementedException(); - } - } -} diff --git a/Hospital/HospitalContracts/BindingModels/ReportBindingModel.cs b/Hospital/HospitalContracts/BindingModels/ReportBindingModel.cs deleted file mode 100644 index 9b54576..0000000 --- a/Hospital/HospitalContracts/BindingModels/ReportBindingModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HospitalContracts.BindingModels -{ - public class ReportBindingModel - { - public string FileName { get; set; } = string.Empty; - - public DateTime? DateFrom { get; set; } - - public DateTime? DateTo { get; set; } - - public int? PatientId { get; set; } - } -} diff --git a/Hospital/HospitalContracts/BusinessLogicContracts/IDoctorReportLogic.cs b/Hospital/HospitalContracts/BusinessLogicContracts/IDoctorReportLogic.cs deleted file mode 100644 index 7b1927d..0000000 --- a/Hospital/HospitalContracts/BusinessLogicContracts/IDoctorReportLogic.cs +++ /dev/null @@ -1,19 +0,0 @@ -using HospitalContracts.BindingModels; -using HospitalContracts.ViewModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HospitalContracts.BusinessLogicContracts -{ - public interface IDoctorReportLogic - { - List GetProcedureRecipes(); - List GetPatients(ReportBindingModel model, PatientBindingModel patientModel); - void SaveProcedureRecipesToWordFile(ReportBindingModel model); - void SaveProcedureRecipesToExcelFile(ReportBindingModel model); - void SavePatientsToPdfFile(ReportBindingModel model); - } -} diff --git a/Hospital/HospitalContracts/ViewModels/ReportPatientViewModel.cs b/Hospital/HospitalContracts/ViewModels/ReportPatientViewModel.cs deleted file mode 100644 index 94ea181..0000000 --- a/Hospital/HospitalContracts/ViewModels/ReportPatientViewModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HospitalContracts.ViewModels -{ - public class ReportPatientViewModel - { - public int Id { get; set; } - public string FIO { get; set; } = string.Empty; - public List Medicines { get; set; } = new(); - public List Diseases { get; set; } = new(); - } -} diff --git a/Hospital/HospitalContracts/ViewModels/ReportProcedureRecipeViewModel.cs b/Hospital/HospitalContracts/ViewModels/ReportProcedureRecipeViewModel.cs deleted file mode 100644 index fbeb0ab..0000000 --- a/Hospital/HospitalContracts/ViewModels/ReportProcedureRecipeViewModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HospitalContracts.ViewModels -{ - public class ReportProcedureRecipeViewModel - { - public DateTime DateCreate { get; set; } - public string MedicineName { get; set; } = string.Empty; - public int Number { get; set; } - public string ProcedureName { get; set; } = string.Empty; - } -}