From ee58b404cc0132c7e7bbd8bb5361e56c30f354b6 Mon Sep 17 00:00:00 2001 From: Bulat Date: Wed, 30 Oct 2024 21:21:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=BE=D0=B4=D0=B5=D0=BB=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/Doctor.cs | 30 ++++++++++++++++ .../Entities/DoctorPayments.cs | 33 +++++++++++++++++ .../Entities/Enums/Diagnosis.cs | 25 +++++++++++++ .../Entities/Enums/DoctorPost.cs | 18 ++++++++++ .../Entities/Enums/Status.cs | 16 +++++++++ .../Entities/MedicalHistory.cs | 36 +++++++++++++++++++ .../Entities/Patient.cs | 32 +++++++++++++++++ 7 files changed, 190 insertions(+) create mode 100644 RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Doctor.cs create mode 100644 RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/DoctorPayments.cs create mode 100644 RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Enums/Diagnosis.cs create mode 100644 RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Enums/DoctorPost.cs create mode 100644 RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Enums/Status.cs create mode 100644 RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/MedicalHistory.cs create mode 100644 RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Patient.cs diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Doctor.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Doctor.cs new file mode 100644 index 0000000..52411f0 --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Doctor.cs @@ -0,0 +1,30 @@ +using RegistrationPatientsPolyclinic.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Entities; + +public class Doctor +{ + public int Id { get; private set; } + + public string First_Name { get; private set; } = string.Empty; + + public string Last_Name { get; private set; } = string.Empty; + + public DoctorPost DoctorPost { get; private set; } // объявляется свойство DoctorPost, которое имеет тип DoctorPost + + public static Doctor CreateEntity(int id, string first_Name, string last_Name, DoctorPost doctorPost) + { + return new Doctor + { + Id = id, + First_Name = first_Name, + Last_Name = last_Name, + DoctorPost = doctorPost + }; + } +} diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/DoctorPayments.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/DoctorPayments.cs new file mode 100644 index 0000000..0661ccd --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/DoctorPayments.cs @@ -0,0 +1,33 @@ +using RegistrationPatientsPolyclinic.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Entities; + +public class DoctorPayments +{ + public int Id { get; private set; } + + public int IdDoctor { get; private set; } + + public string Month { get; private set; } = string.Empty; + + public int Count_Patient { get; private set; } + + public int Payment { get; private set; } + + public static DoctorPayments CreateElement(int id, int idDoctor, string month, int count_patient, int payment) + { + return new DoctorPayments + { + Id = id, + IdDoctor = idDoctor, + Month = month, + Count_Patient = count_patient, + Payment = payment + }; + } +} diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Enums/Diagnosis.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Enums/Diagnosis.cs new file mode 100644 index 0000000..cfe2c06 --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Enums/Diagnosis.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Entities.Enums; + +[Flags] // Flag - атрибут, его значения будут комбинироваться, например, если мы создадим объект от соотрудника, +// то его поле DoctorPost, то мы в него занесем только один из возможных вариантов(None, Junior, Senior, Head) +// а по атрибуту Flags позволяет хранить несколько записей +// ВАЖНО!!! Чтобы в перечеслении значения были степени двойки + +public enum Diagnosis +{ + None = 0, + + Flu = 1, + + Quinsy = 2, + + Callous = 4, + + Bronchitis = 8 +} diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Enums/DoctorPost.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Enums/DoctorPost.cs new file mode 100644 index 0000000..ea9b313 --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Enums/DoctorPost.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Entities.Enums; + +public enum DoctorPost +{ + None = 0, + + Junior = 1, + + Senior = 2, + + Head = 3 +} diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Enums/Status.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Enums/Status.cs new file mode 100644 index 0000000..8ec307c --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Enums/Status.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Entities.Enums; + +public enum Status +{ + None = 0, + + Sick = 1, + + Recovered = 2 +} diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/MedicalHistory.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/MedicalHistory.cs new file mode 100644 index 0000000..175c7e1 --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/MedicalHistory.cs @@ -0,0 +1,36 @@ +using RegistrationPatientsPolyclinic.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Entities; + +public class MedicalHistory +{ + public int Id { get; private set; } + + public int PatientId { get; private set; } + + public int DoctorId { get; private set; } + + public Diagnosis Diagnosis { get; private set; } + + public DateTime VisitDate { get; private set; } + + public Status Status { get; private set; } + + public static MedicalHistory CreateEntity(int id, int patientId,int doctorId,Diagnosis diagnosis, int visitData, Status status) + { + return new MedicalHistory + { + Id = id, + PatientId = patientId, + DoctorId = doctorId, + Diagnosis = diagnosis, + VisitDate = DateTime.Now, + Status = status + }; + } +} diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Patient.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Patient.cs new file mode 100644 index 0000000..32bf9b3 --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Patient.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Entities; + +public class Patient +{ + public int Id { get; private set; } + + public string Firts_Name { get; private set; } = string .Empty; // string.Empty - означает, что по умолчанию это свойство будет содержать пустую строку, а не null(то же самое "") + + public string Last_Name { get; private set; } = string.Empty; + + public int ContactNumber { get; private set; } + + + // ТУТ СДЕЛАЕМ СТАТИСТИЧЕСКИЙ МЕТОД + + public static Patient CreatePatient(int id, string firts_Name, string last_Name, int contactNumber) + { + return new Patient + { + Id = id, + Firts_Name = firts_Name, + Last_Name = last_Name, + ContactNumber = contactNumber + }; + } +}