mission complete
This commit is contained in:
parent
5bd3381f7b
commit
85a4ee7940
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
@ -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; }
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user