-
Notifications
You must be signed in to change notification settings - Fork 80
Лаб. 1 6413 Гололобова Полина #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: .NET Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main", "master" ] | ||
| pull_request: | ||
| branches: [ "main", "master" ] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: 8.0.x | ||
|
|
||
| - name: Restore dependencies | ||
| run: dotnet restore Polyclinic/Polyclinic.sln | ||
|
|
||
| - name: Build | ||
| run: dotnet build Polyclinic/Polyclinic.sln --no-restore --configuration Release | ||
|
|
||
| - name: Test | ||
| run: dotnet test Polyclinic/Polyclinic.sln --no-build --configuration Release --verbosity normal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| namespace Polyclinic.Domain.Entities; | ||
|
|
||
| /// <summary> | ||
| /// Запись пациента на прием к врачу | ||
| /// </summary> | ||
| public class Appointment | ||
| { | ||
| /// <summary> | ||
| /// Уникальный идентификатор записи | ||
| /// </summary> | ||
| public int Id { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Дата и время приема | ||
| /// </summary> | ||
| public DateTime AppointmentDateTime { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Номер кабинета | ||
| /// </summary> | ||
| public required string RoomNumber { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Флаг повторного приема | ||
| /// </summary> | ||
| public bool IsRepeat { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Идентификатор пациента | ||
| /// </summary> | ||
| public int PatientId { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Идентификатор врача | ||
| /// </summary> | ||
| public int DoctorId { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Навигационное свойство: пациент | ||
| /// </summary> | ||
| public Patient? Patient { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Навигационное свойство: врач | ||
| /// </summary> | ||
| public Doctor? Doctor { get; set; } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| namespace Polyclinic.Domain.Entities; | ||
|
|
||
| /// <summary> | ||
| /// Врач поликлиники | ||
| /// </summary> | ||
| public class Doctor | ||
| { | ||
| /// <summary> | ||
| /// Уникальный идентификатор врача | ||
| /// </summary> | ||
| public int Id { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Номер паспорта (уникальный) | ||
| /// </summary> | ||
| public required string PassportNumber { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// ФИО врача | ||
| /// </summary> | ||
| public required string FullName { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Дата рождения | ||
| /// </summary> | ||
| public DateTime BirthDate { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Идентификатор специализации | ||
| /// </summary> | ||
| public int SpecializationId { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Стаж работы (в годах) | ||
| /// </summary> | ||
| public int ExperienceYears { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Навигационное свойство: специализация | ||
| /// </summary> | ||
| public Specialization? Specialization { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Список приемов у этого врача | ||
| /// </summary> | ||
| public List<Appointment> Appointments { get; set; } = []; | ||
|
|
||
| /// <summary> | ||
| /// Вычисление возраста врача на указанную дату | ||
| /// </summary> | ||
| public int GetAge(DateTime onDate) | ||
| { | ||
| var age = onDate.Year - BirthDate.Year; | ||
| if (BirthDate.Date > onDate.AddYears(-age)) age--; | ||
| return age; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| using Polyclinic.Domain.Enums; | ||
|
|
||
| namespace Polyclinic.Domain.Entities; | ||
|
|
||
| /// <summary> | ||
| /// Пациент поликлиники | ||
| /// </summary> | ||
| public class Patient | ||
| { | ||
| /// <summary> | ||
| /// Уникальный идентификатор пациента | ||
| /// </summary> | ||
| public int Id { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Номер паспорта (уникальный) | ||
| /// </summary> | ||
| public required string PassportNumber { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// ФИО пациента | ||
| /// </summary> | ||
| public required string FullName { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Пол пациента | ||
| /// </summary> | ||
| public Gender Gender { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Дата рождения | ||
| /// </summary> | ||
| public DateTime BirthDate { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Адрес проживания | ||
| /// </summary> | ||
| public required string Address { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Группа крови | ||
| /// </summary> | ||
| public BloodGroup BloodGroup { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Резус-фактор | ||
| /// </summary> | ||
| public RhFactor RhFactor { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Контактный телефон | ||
| /// </summary> | ||
| public required string PhoneNumber { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Список записей на прием этого пациента | ||
| /// </summary> | ||
| public List<Appointment> Appointments { get; set; } = []; | ||
|
|
||
| /// <summary> | ||
| /// Вычисление возраста пациента на указанную дату | ||
| /// </summary> | ||
| public int GetAge(DateTime onDate) | ||
| { | ||
| var age = onDate.Year - BirthDate.Year; | ||
| if (BirthDate.Date > onDate.AddYears(-age)) age--; | ||
| return age; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| namespace Polyclinic.Domain.Entities; | ||
|
|
||
| /// <summary> | ||
| /// Специализация врача (справочник) | ||
| /// </summary> | ||
| public class Specialization | ||
| { | ||
| /// <summary> | ||
| /// Уникальный идентификатор специализации | ||
| /// </summary> | ||
| public int Id { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Название специализации | ||
| /// </summary> | ||
| public required string Name { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Описание специализации | ||
| /// </summary> | ||
| public required string Description { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Код специализации | ||
| /// </summary> | ||
| public required string Code { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Список врачей с этой специализацией | ||
| /// </summary> | ||
| public List<Doctor> Doctors { get; set; } = []; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| namespace Polyclinic.Domain.Enums; | ||
|
|
||
| /// <summary> | ||
| /// Группа крови пациента | ||
| /// </summary> | ||
| public enum BloodGroup | ||
| { | ||
| /// <summary> | ||
| /// Первая (0) | ||
| /// </summary> | ||
| O, | ||
|
|
||
| /// <summary> | ||
| /// Вторая (A) | ||
| /// </summary> | ||
| A, | ||
|
|
||
| /// <summary> | ||
| /// Третья (B) | ||
| /// </summary> | ||
| B, | ||
|
|
||
| /// <summary> | ||
| /// Четвертая (AB) | ||
| /// </summary> | ||
| Ab | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| namespace Polyclinic.Domain.Enums; | ||
|
|
||
| /// <summary> | ||
| /// Пол пациента | ||
| /// </summary> | ||
| public enum Gender | ||
| { | ||
| /// <summary> | ||
| /// Не указано | ||
| /// </summary> | ||
| NotSet, | ||
|
|
||
| /// <summary> | ||
| /// Мужской | ||
| /// </summary> | ||
| Male, | ||
|
|
||
| /// <summary> | ||
| /// Женский | ||
| /// </summary> | ||
| Female | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| namespace Polyclinic.Domain.Enums; | ||
|
|
||
| /// <summary> | ||
| /// Резус-фактор пациента | ||
| /// </summary> | ||
| public enum RhFactor | ||
| { | ||
| /// <summary> | ||
| /// Положительный | ||
| /// </summary> | ||
| Positive, | ||
|
|
||
| /// <summary> | ||
| /// Отрицательный | ||
| /// </summary> | ||
| Negative | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
|
|
||
| <IsPackable>false</IsPackable> | ||
| <IsTestProject>true</IsTestProject> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="coverlet.collector" Version="6.0.0" /> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" /> | ||
| <PackageReference Include="xunit" Version="2.9.2" /> | ||
| <PackageReference Include="xunit.runner.visualstudio" Version="3.1.5"> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| </PackageReference> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\Polyclinic.Domain\Polyclinic.Domain.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Using Include="Xunit" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вот тут у вас как раз дата, это правильнее. Сделайте также для доктора.