Add Contracts

This commit is contained in:
parent 0c3276d1c2
commit 4870dbb8b5
32 changed files with 1374 additions and 0 deletions

View File

@ -5,6 +5,8 @@ VisualStudioVersion = 17.8.34525.116
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HospitalDataModels", "HospitalDataModels\HospitalDataModels.csproj", "{DEC0CC7C-0315-4D11-B383-F5CD19DA7E15}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HospitalDataModels", "HospitalDataModels\HospitalDataModels.csproj", "{DEC0CC7C-0315-4D11-B383-F5CD19DA7E15}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HospitalContracts", "HospitalContracts\HospitalContracts.csproj", "{435124E0-E0A5-4EB8-A46C-C093C47A65F7}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -15,6 +17,10 @@ Global
{DEC0CC7C-0315-4D11-B383-F5CD19DA7E15}.Debug|Any CPU.Build.0 = Debug|Any CPU {DEC0CC7C-0315-4D11-B383-F5CD19DA7E15}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DEC0CC7C-0315-4D11-B383-F5CD19DA7E15}.Release|Any CPU.ActiveCfg = Release|Any CPU {DEC0CC7C-0315-4D11-B383-F5CD19DA7E15}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DEC0CC7C-0315-4D11-B383-F5CD19DA7E15}.Release|Any CPU.Build.0 = Release|Any CPU {DEC0CC7C-0315-4D11-B383-F5CD19DA7E15}.Release|Any CPU.Build.0 = Release|Any CPU
{435124E0-E0A5-4EB8-A46C-C093C47A65F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{435124E0-E0A5-4EB8-A46C-C093C47A65F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{435124E0-E0A5-4EB8-A46C-C093C47A65F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{435124E0-E0A5-4EB8-A46C-C093C47A65F7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -0,0 +1,35 @@
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BindingModels
{
/// <summary>
/// Модель привязки для сущности "Болезнь"
/// </summary>
public class DiseaseBindingModel : IDiseaseModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int Id { get; set; }
/// <summary>
/// Название болезни
/// </summary>
public string Name { get; set; } = string.Empty;
/// <summary>
/// Симптомы заболевания
/// </summary>
public string? Symptoms { get; set; }
/// <summary>
/// Идентификатор рецепта
/// </summary>
public int RecipeId { get; set; }
}
}

View File

@ -0,0 +1,41 @@
using HospitalDataModels.Enums;
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BindingModels
{
/// <summary>
/// Модель привязки для сущности "Доктор"
/// </summary>
public class DoctorBindingModel : IDoctorModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int Id { get; set; }
/// <summary>
/// ФИО доктора
/// </summary>
public string FullName { get; set; } = string.Empty;
/// <summary>
/// Должность доктора
/// </summary>
public DoctorPost Post { get; set; }
/// <summary>
/// Логин (электронная почта)
/// </summary>
public string Email { get; set; } = string.Empty;
/// <summary>
/// Пароль
/// </summary>
public string Password { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,30 @@
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BindingModels
{
/// <summary>
/// Модель привязки для сущности "Лекарство"
/// </summary>
public class MedicineBindingModel : IMedicineModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int Id { get; set; }
/// <summary>
/// Название лекарства
/// </summary>
public string Name { get; set; } = string.Empty;
/// <summary>
/// Описание лекарства
/// </summary>
public string? Description { get; set; }
}
}

View File

@ -0,0 +1,58 @@
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BindingModels
{
/// <summary>
/// Модель привязки для сущности "Пациент"
/// </summary>
public class PatientBindingModel : IPatientModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int Id { get; set; }
/// <summary>
/// ФИО пациента
/// </summary>
public string FullName { get; set; } = string.Empty;
/// <summary>
/// Дата рождения пациента
/// </summary>
public DateTime BirthDate { get; set; }
/// <summary>
/// Номер телефона пациента
/// </summary>
public string Phone { get; set; } = string.Empty;
/// <summary>
/// Идентификатор лечащего врача
/// </summary>
public int DoctorId { get; set; }
/// <summary>
/// Список рецептов пациента
/// </summary>
public Dictionary<int, IRecipeModel> PatientRecipes
{
get;
set;
} = new();
/// <summary>
/// Список процедур пациента
/// </summary>
public Dictionary<int, IProcedureModel> PatientProcedures
{
get;
set;
} = new();
}
}

View File

@ -0,0 +1,39 @@
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BindingModels
{
/// <summary>
/// Модель привязки для сущности "Процедура"
/// </summary>
public class ProcedureBindingModel : IProcedureModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int Id { get; set; }
/// <summary>
/// Название процедуры
/// </summary>
public string Name { get; set; } = string.Empty;
/// <summary>
/// Описание процедуры
/// </summary>
public string? Description { get; set; }
/// <summary>
/// Список лекарств для процедуры
/// </summary>
public Dictionary<int, IMedicineModel> ProcedureMedicines
{
get;
set;
} = new();
}
}

View File

@ -0,0 +1,39 @@
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BindingModels
{
/// <summary>
/// Модель привязки для сущности "Рецепт"
/// </summary>
public class RecipeBindingModel : IRecipeModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int Id { get; set; }
/// <summary>
/// Дата выписки рецепта
/// </summary>
public DateTime IssueDate { get; set; }
/// <summary>
/// Идентификатор доктора
/// </summary>
public int DoctorId { get; set; }
/// <summary>
/// Список лекарств в рецепте
/// </summary>
public Dictionary<int, IMedicineModel> RecipeMedicines
{
get;
set;
} = new();
}
}

View File

@ -0,0 +1,52 @@
using HospitalContracts.BindingModels;
using HospitalContracts.SearchModels;
using HospitalContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BusinessLogicsContracts
{
/// <summary>
/// Интерфейс для описания работы бизнес-логики для сущности "Болезнь"
/// </summary>
public interface IDiseaseLogic
{
/// <summary>
/// Получение списка
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
List<DiseaseViewModel>? ReadList(DiseaseSearchModel? model);
/// <summary>
/// Получение отдельной записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
DiseaseViewModel? ReadElement(DiseaseSearchModel model);
/// <summary>
/// Создание записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Create(DiseaseBindingModel model);
/// <summary>
/// Изменение записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Update(DiseaseBindingModel model);
/// <summary>
/// Удаление записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Delete(DiseaseBindingModel model);
}
}

View File

@ -0,0 +1,52 @@
using HospitalContracts.BindingModels;
using HospitalContracts.SearchModels;
using HospitalContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BusinessLogicsContracts
{
/// <summary>
/// Интерфейс для описания работы бизнес-логики для сущности "Доктор"
/// </summary>
public interface IDoctorLogic
{
/// <summary>
/// Получение списка
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
List<DoctorViewModel>? ReadList(DoctorSearchModel? model);
/// <summary>
/// Получение отдельной записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
DoctorViewModel? ReadElement(DoctorSearchModel model);
/// <summary>
/// Создание записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Create(DoctorBindingModel model);
/// <summary>
/// Изменение записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Update(DoctorBindingModel model);
/// <summary>
/// Удаление записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Delete(DoctorBindingModel model);
}
}

View File

@ -0,0 +1,52 @@
using HospitalContracts.BindingModels;
using HospitalContracts.SearchModels;
using HospitalContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BusinessLogicsContracts
{
/// <summary>
/// Интерфейс для описания работы бизнес-логики для сущности "Лекарство"
/// </summary>
public interface IMedicineLogic
{
/// <summary>
/// Получение списка
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
List<MedicineViewModel>? ReadList(MedicineSearchModel? model);
/// <summary>
/// Получение отдельной записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
MedicineViewModel? ReadElement(MedicineSearchModel model);
/// <summary>
/// Создание записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Create(MedicineBindingModel model);
/// <summary>
/// Изменение записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Update(MedicineBindingModel model);
/// <summary>
/// Удаление записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Delete(MedicineBindingModel model);
}
}

View File

@ -0,0 +1,52 @@
using HospitalContracts.BindingModels;
using HospitalContracts.SearchModels;
using HospitalContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BusinessLogicsContracts
{
/// <summary>
/// Интерфейс для описания работы бизнес-логики для сущности "Пациент"
/// </summary>
public interface IPatientLogic
{
/// <summary>
/// Получение списка
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
List<PatientViewModel>? ReadList(PatientSearchModel? model);
/// <summary>
/// Получение отдельной записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
PatientViewModel? ReadElement(PatientSearchModel model);
/// <summary>
/// Создание записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Create(PatientBindingModel model);
/// <summary>
/// Изменение записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Update(PatientBindingModel model);
/// <summary>
/// Удаление записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Delete(PatientBindingModel model);
}
}

View File

@ -0,0 +1,52 @@
using HospitalContracts.BindingModels;
using HospitalContracts.SearchModels;
using HospitalContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BusinessLogicsContracts
{
/// <summary>
/// Интерфейс для описания работы бизнес-логики для сущности "Процедура"
/// </summary>
public interface IProcedureLogic
{
/// <summary>
/// Получение списка
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
List<ProcedureViewModel>? ReadList(ProcedureSearchModel? model);
/// <summary>
/// Получение отдельной записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
ProcedureViewModel? ReadElement(ProcedureSearchModel model);
/// <summary>
/// Создание записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Create(ProcedureBindingModel model);
/// <summary>
/// Изменение записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Update(ProcedureBindingModel model);
/// <summary>
/// Удаление записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Delete(ProcedureBindingModel model);
}
}

View File

@ -0,0 +1,52 @@
using HospitalContracts.BindingModels;
using HospitalContracts.SearchModels;
using HospitalContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BusinessLogicsContracts
{
/// <summary>
/// Интерфейс для описания работы бизнес-логики для сущности "Рецепт"
/// </summary>
public interface IRecipeLogic
{
/// <summary>
/// Получение списка
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
List<RecipeViewModel>? ReadList(RecipeSearchModel? model);
/// <summary>
/// Получение отдельной записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
RecipeViewModel? ReadElement(RecipeSearchModel model);
/// <summary>
/// Создание записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Create(RecipeBindingModel model);
/// <summary>
/// Изменение записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Update(RecipeBindingModel model);
/// <summary>
/// Удаление записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Delete(RecipeBindingModel model);
}
}

View File

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\HospitalDataModels\HospitalDataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.SearchModels
{
/// <summary>
/// Модель поиска для сущности "Болезнь"
/// </summary>
public class DiseaseSearchModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int? Id { get; set; }
/// <summary>
/// Название болезни
/// </summary>
public string? Name { get; set; }
/// <summary>
/// Идентификатор рецепта
/// </summary>
public int? RecipeId { get; set; }
}
}

View File

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.SearchModels
{
/// <summary>
/// Модель поиска для сущности "Доктор"
/// </summary>
public class DoctorSearchModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int? Id { get; set; }
/// <summary>
/// ФИО доктора
/// </summary>
public string? FullName { get; set; }
/// <summary>
/// Логин (электронная почта)
/// </summary>
public string? Email { get; set; }
/// <summary>
/// Пароль
/// </summary>
public string? Password { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.SearchModels
{
/// <summary>
/// Модель поиска для сущности "Лекарство"
/// </summary>
public class MedicineSearchModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int? Id { get; set; }
/// <summary>
/// Название лекарства
/// </summary>
public string? Name { get; set; }
}
}

View File

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.SearchModels
{
/// <summary>
/// Модель поиска для сущности "Пациент"
/// </summary>
public class PatientSearchModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int? Id { get; set; }
/// <summary>
/// ФИО пациента
/// </summary>
public string? FullName { get; set; }
/// <summary>
/// Номер телефона пациента
/// </summary>
public string? Phone { get; set; }
/// <summary>
/// Идентификатор лечащего врача
/// </summary>
public int? DoctorId { get; set; }
/// <summary>
/// Начало периода выборки данных для отчета
/// </summary>
public DateTime? DateFrom { get; set; }
/// <summary>
/// Конец периода выборки данных для отчета
/// </summary>
public DateTime? DateTo { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.SearchModels
{
/// <summary>
/// Модель поиска для сущности "Процедура"
/// </summary>
public class ProcedureSearchModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int? Id { get; set; }
/// <summary>
/// Название процедуры
/// </summary>
public string? Name { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.SearchModels
{
/// <summary>
/// Модель поиска для сущности "Рецепт"
/// </summary>
public class RecipeSearchModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int? Id { get; set; }
/// <summary>
/// Идентификатор доктора
/// </summary>
public int? DoctorId { get; set; }
}
}

View File

@ -0,0 +1,58 @@
using HospitalContracts.BindingModels;
using HospitalContracts.SearchModels;
using HospitalContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.StoragesContracts
{
/// <summary>
/// Интерфейс для описания работы с хранилищем для сущности "Болезнь"
/// </summary>
public interface IDiseaseStorage
{
/// <summary>
/// Получение полного списка
/// </summary>
/// <returns></returns>
List<DiseaseViewModel> GetFullList();
/// <summary>
/// Получение фильтрованного списка
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
List<DiseaseViewModel> GetFilteredList(DiseaseSearchModel model);
/// <summary>
/// Получение элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
DiseaseViewModel? GetElement(DiseaseSearchModel model);
/// <summary>
/// Добавление элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
DiseaseViewModel? Insert(DiseaseBindingModel model);
/// <summary>
/// Редактирование элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
DiseaseViewModel? Update(DiseaseBindingModel model);
/// <summary>
/// Удаление элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
DiseaseViewModel? Delete(DiseaseBindingModel model);
}
}

View File

@ -0,0 +1,58 @@
using HospitalContracts.BindingModels;
using HospitalContracts.SearchModels;
using HospitalContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.StoragesContracts
{
/// <summary>
/// Интерфейс для описания работы с хранилищем для сущности "Доктор"
/// </summary>
public interface IDoctorStorage
{
/// <summary>
/// Получение полного списка
/// </summary>
/// <returns></returns>
List<DoctorViewModel> GetFullList();
/// <summary>
/// Получение фильтрованного списка
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
List<DoctorViewModel> GetFilteredList(DoctorSearchModel model);
/// <summary>
/// Получение элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
DoctorViewModel? GetElement(DoctorSearchModel model);
/// <summary>
/// Добавление элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
DoctorViewModel? Insert(DoctorBindingModel model);
/// <summary>
/// Редактирование элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
DoctorViewModel? Update(DoctorBindingModel model);
/// <summary>
/// Удаление элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
DoctorViewModel? Delete(DoctorBindingModel model);
}
}

View File

@ -0,0 +1,58 @@
using HospitalContracts.BindingModels;
using HospitalContracts.SearchModels;
using HospitalContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.StoragesContracts
{
/// <summary>
/// Интерфейс для описания работы с хранилищем для сущности "Лекарство"
/// </summary>
public interface IMedicineStorage
{
/// <summary>
/// Получение полного списка
/// </summary>
/// <returns></returns>
List<MedicineViewModel> GetFullList();
/// <summary>
/// Получение фильтрованного списка
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
List<MedicineViewModel> GetFilteredList(MedicineSearchModel model);
/// <summary>
/// Получение элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
MedicineViewModel? GetElement(MedicineSearchModel model);
/// <summary>
/// Добавление элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
MedicineViewModel? Insert(MedicineBindingModel model);
/// <summary>
/// Редактирование элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
MedicineViewModel? Update(MedicineBindingModel model);
/// <summary>
/// Удаление элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
MedicineViewModel? Delete(MedicineBindingModel model);
}
}

View File

@ -0,0 +1,58 @@
using HospitalContracts.BindingModels;
using HospitalContracts.SearchModels;
using HospitalContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.StoragesContracts
{
/// <summary>
/// Интерфейс для описания работы с хранилищем для сущности "Пациент"
/// </summary>
public interface IPatientStorage
{
/// <summary>
/// Получение полного списка
/// </summary>
/// <returns></returns>
List<PatientViewModel> GetFullList();
/// <summary>
/// Получение фильтрованного списка
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
List<PatientViewModel> GetFilteredList(PatientSearchModel model);
/// <summary>
/// Получение элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
PatientViewModel? GetElement(PatientSearchModel model);
/// <summary>
/// Добавление элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
PatientViewModel? Insert(PatientBindingModel model);
/// <summary>
/// Редактирование элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
PatientViewModel? Update(PatientBindingModel model);
/// <summary>
/// Удаление элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
PatientViewModel? Delete(PatientBindingModel model);
}
}

View File

@ -0,0 +1,58 @@
using HospitalContracts.BindingModels;
using HospitalContracts.SearchModels;
using HospitalContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.StoragesContracts
{
/// <summary>
/// Интерфейс для описания работы с хранилищем для сущности "Процедура"
/// </summary>
public interface IProcedureStrorage
{
/// <summary>
/// Получение полного списка
/// </summary>
/// <returns></returns>
List<ProcedureViewModel> GetFullList();
/// <summary>
/// Получение фильтрованного списка
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
List<ProcedureViewModel> GetFilteredList(ProcedureSearchModel model);
/// <summary>
/// Получение элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
ProcedureViewModel? GetElement(ProcedureSearchModel model);
/// <summary>
/// Добавление элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
ProcedureViewModel? Insert(ProcedureBindingModel model);
/// <summary>
/// Редактирование элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
ProcedureViewModel? Update(ProcedureBindingModel model);
/// <summary>
/// Удаление элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
ProcedureViewModel? Delete(ProcedureBindingModel model);
}
}

View File

@ -0,0 +1,58 @@
using HospitalContracts.BindingModels;
using HospitalContracts.SearchModels;
using HospitalContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.StoragesContracts
{
/// <summary>
/// Интерфейс для описания работы с хранилищем для сущности "Рецепт"
/// </summary>
public interface IRecipeStorage
{
/// <summary>
/// Получение полного списка
/// </summary>
/// <returns></returns>
List<RecipeViewModel> GetFullList();
/// <summary>
/// Получение фильтрованного списка
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
List<RecipeViewModel> GetFilteredList(RecipeSearchModel model);
/// <summary>
/// Получение элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
RecipeViewModel? GetElement(RecipeSearchModel model);
/// <summary>
/// Добавление элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
RecipeViewModel? Insert(RecipeBindingModel model);
/// <summary>
/// Редактирование элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
RecipeViewModel? Update(RecipeBindingModel model);
/// <summary>
/// Удаление элемента
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
RecipeViewModel? Delete(RecipeBindingModel model);
}
}

View File

@ -0,0 +1,38 @@
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.ViewModels
{
/// <summary>
/// Модель представления для сущности "Болезнь"
/// </summary>
public class DiseaseViewModel : IDiseaseModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int Id { get; set; }
/// <summary>
/// Название болезни
/// </summary>
[DisplayName("Название болезни")]
public string Name { get; set; } = string.Empty;
/// <summary>
/// Симптомы заболевания
/// </summary>
[DisplayName("Симптомы")]
public string? Symptoms { get; set; }
/// <summary>
/// Идентификатор рецепта
/// </summary>
public int RecipeId { get; set; }
}
}

View File

@ -0,0 +1,46 @@
using HospitalDataModels.Enums;
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.ViewModels
{
/// <summary>
/// Модель представления для сущности "Доктор"
/// </summary>
public class DoctorViewModel : IDoctorModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int Id { get; set; }
/// <summary>
/// ФИО доктора
/// </summary>
[DisplayName("ФИО доктора")]
public string FullName { get; set; } = string.Empty;
/// <summary>
/// Должность доктора
/// </summary>
[DisplayName("Должность")]
public DoctorPost Post { get; set; }
/// <summary>
/// Логин (электронная почта)
/// </summary>
[DisplayName("Логин")]
public string Email { get; set; } = string.Empty;
/// <summary>
/// Пароль
/// </summary>
[DisplayName("Пароль")]
public string Password { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,33 @@
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.ViewModels
{
/// <summary>
/// Модель представления для сущности "Лекарство"
/// </summary>
public class MedicineViewModel : IMedicineModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int Id { get; set; }
/// <summary>
/// Название лекарства
/// </summary>
[DisplayName("Название лекарства")]
public string Name { get; set; } = string.Empty;
/// <summary>
/// Описание лекарства
/// </summary>
[DisplayName("Описание лекарства")]
public string? Description { get; set; }
}
}

View File

@ -0,0 +1,68 @@
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.ViewModels
{
/// <summary>
/// Модель представления для сущности "Пациент"
/// </summary>
public class PatientViewModel : IPatientModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int Id { get; set; }
/// <summary>
/// ФИО пациента
/// </summary>
[DisplayName("ФИО пациента")]
public string FullName { get; set; } = string.Empty;
/// <summary>
/// Дата рождения пациента
/// </summary>
[DisplayName("Дата рождения")]
public DateTime BirthDate { get; set; }
/// <summary>
/// Номер телефона пациента
/// </summary>
[DisplayName("Номер телефона")]
public string Phone { get; set; } = string.Empty;
/// <summary>
/// Идентификатор лечащего врача
/// </summary>
public int DoctorId { get; set; }
/// <summary>
/// ФИО лечащего врача
/// </summary>
[DisplayName("ФИО лечащего врача")]
public string DoctorFullName { get; set; } = string.Empty;
/// <summary>
/// Список рецептов пациента
/// </summary>
public Dictionary<int, IRecipeModel> PatientRecipes
{
get;
set;
} = new();
/// <summary>
/// Список процедур пациента
/// </summary>
public Dictionary<int, IProcedureModel> PatientProcedures
{
get;
set;
} = new();
}
}

View File

@ -0,0 +1,42 @@
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.ViewModels
{
/// <summary>
/// Модель представления для сущности "Процедура"
/// </summary>
public class ProcedureViewModel : IProcedureModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int Id { get; set; }
/// <summary>
/// Название процедуры
/// </summary>
[DisplayName("Название процедуры")]
public string Name { get; set; } = string.Empty;
/// <summary>
/// Описание процедуры
/// </summary>
[DisplayName("Описание процедуры")]
public string? Description { get; set; }
/// <summary>
/// Список лекарств для процедуры
/// </summary>
public Dictionary<int, IMedicineModel> ProcedureMedicines
{
get;
set;
} = new();
}
}

View File

@ -0,0 +1,47 @@
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.ViewModels
{
/// <summary>
/// Модель представления для сущности "Рецепт"
/// </summary>
public class RecipeViewModel : IRecipeModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int Id { get; set; }
/// <summary>
/// Дата выписки рецепта
/// </summary>
[DisplayName("Дата выписки рецепта")]
public DateTime IssueDate { get; set; }
/// <summary>
/// Идентификатор доктора
/// </summary>
public int DoctorId { get; set; }
/// <summary>
/// ФИО доктора
/// </summary>
[DisplayName("ФИО доктора")]
public string DoctorFullName { get; set; } = string.Empty;
/// <summary>
/// Список лекарств в рецепте
/// </summary>
public Dictionary<int, IMedicineModel> RecipeMedicines
{
get;
set;
} = new();
}
}