Compare commits

..

2 Commits

Author SHA1 Message Date
85a4ee7940 mission complete 2024-05-01 12:34:48 +04:00
5bd3381f7b удаление забытых комментариев 2024-05-01 12:22:38 +04:00
9 changed files with 4 additions and 159 deletions

View File

@ -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<ReportPatientViewModel> GetPatients(ReportBindingModel model, PatientBindingModel patientModel)
{
var list = new List<ReportPatientViewModel>();
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<string>(),
Diseases = new List<string>()
};
var allRecipes = _recipeStorage.GetFullList();
var patientRecipes = new List<RecipeViewModel>();
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<ReportProcedureRecipeViewModel> 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();
}
}
}

View File

@ -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; }
}
}

View File

@ -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<ReportProcedureRecipeViewModel> GetProcedureRecipes();
List<ReportPatientViewModel> GetPatients(ReportBindingModel model, PatientBindingModel patientModel);
void SaveProcedureRecipesToWordFile(ReportBindingModel model);
void SaveProcedureRecipesToExcelFile(ReportBindingModel model);
void SavePatientsToPdfFile(ReportBindingModel model);
}
}

View File

@ -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<string> Medicines { get; set; } = new();
public List<string> Diseases { get; set; } = new();
}
}

View File

@ -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;
}
}

View File

@ -40,7 +40,7 @@ namespace HospitalDatabaseImplement.Models
}
return new Disease()
{
//Id = model.Id,
Id = model.Id,
Name = model.Name,
Description = model.Description,
DoctorId = model.DoctorId

View File

@ -53,7 +53,7 @@ namespace HospitalDatabaseImplement.Models
}
return new Doctor()
{
//Id = model.Id,
Id = model.Id,
Login = model.Login,
PhoneNumber = model.PhoneNumber,
Password = model.Password,

View File

@ -72,7 +72,7 @@ namespace HospitalDatabaseImplement.Models
{
return new Patient()
{
// Id = model.Id,
Id = model.Id,
FIO = model.FIO,
Address = model.Address,

View File

@ -52,7 +52,7 @@ namespace HospitalDatabaseImplement.Modelss
{
return new Recipe()
{
//Id = model.Id,
Id = model.Id,
IssueDate = model.IssueDate,
Description = model.Description,
DiseaseId = model.DiseaseId,