diff --git a/RegistrationOfPatients/RegistrationOfPatients/Entities/Doctor.cs b/RegistrationOfPatients/RegistrationOfPatients/Entities/Doctor.cs new file mode 100644 index 0000000..574abfc --- /dev/null +++ b/RegistrationOfPatients/RegistrationOfPatients/Entities/Doctor.cs @@ -0,0 +1,16 @@ +namespace RegistrationOfPatients.Entities; + +public class Doctor +{ + public int Id { get; private set; } + public string Name { get; private set; } = string.Empty; + + public static Doctor CreateEntity(int id, string name) + { + return new Doctor + { + Id = id, + Name = name + }; + } +} diff --git a/RegistrationOfPatients/RegistrationOfPatients/Entities/DoctorPatient.cs b/RegistrationOfPatients/RegistrationOfPatients/Entities/DoctorPatient.cs new file mode 100644 index 0000000..76a37cb --- /dev/null +++ b/RegistrationOfPatients/RegistrationOfPatients/Entities/DoctorPatient.cs @@ -0,0 +1,21 @@ +namespace RegistrationOfPatients.Entities; + +public class DoctorPatient +{ + public int Id { get; private set; } + public int PatientId { get; private set; } + public int DoctorId { get; private set; } + public DateTime DateStart { get; private set; } + public DateTime? DateStop { get; private set; } + public static DoctorPatient CreateElement(int id, int patientId, int doctorId, DateTime? dateStop = null) + { + return new DoctorPatient + { + Id = id, + PatientId = patientId, + DoctorId = doctorId, + DateStart = DateTime.Now, + DateStop = dateStop + }; + } +} diff --git a/RegistrationOfPatients/RegistrationOfPatients/Entities/Enums/HealthStatus.cs b/RegistrationOfPatients/RegistrationOfPatients/Entities/Enums/HealthStatus.cs new file mode 100644 index 0000000..ca07025 --- /dev/null +++ b/RegistrationOfPatients/RegistrationOfPatients/Entities/Enums/HealthStatus.cs @@ -0,0 +1,7 @@ +namespace RegistrationOfPatients.Entities.Enums; + +public enum HealthStatus +{ + Ill = 0, + Healthy = 1 +} diff --git a/RegistrationOfPatients/RegistrationOfPatients/Entities/Patient.cs b/RegistrationOfPatients/RegistrationOfPatients/Entities/Patient.cs new file mode 100644 index 0000000..315d68e --- /dev/null +++ b/RegistrationOfPatients/RegistrationOfPatients/Entities/Patient.cs @@ -0,0 +1,17 @@ +namespace RegistrationOfPatients.Entities; + +public class Patient +{ + public int Id { get; private set; } + public string Name { get; private set; } = string.Empty; + public string Phone { get; private set; } = string.Empty; + public static Patient CreateEntity(int id, string Name, string Phone) + { + return new Patient + { + Id = id, + Name = Name ?? string.Empty, + Phone = Phone ?? string.Empty + }; + } +} diff --git a/RegistrationOfPatients/RegistrationOfPatients/Entities/Payment.cs b/RegistrationOfPatients/RegistrationOfPatients/Entities/Payment.cs new file mode 100644 index 0000000..f659723 --- /dev/null +++ b/RegistrationOfPatients/RegistrationOfPatients/Entities/Payment.cs @@ -0,0 +1,23 @@ +namespace RegistrationOfPatients.Entities; + +public class Payment +{ + public int Id { get; private set; } + public int Salary { get; private set; } + public int TotalPatients { get; private set; } + public DateTime Date { get; private set; } + public int PercentageOfRecoveries { get; private set; } + public int DoctorId { get; private set; } + public static Payment CreateOperation(int id, int salary, int totalPatients, int percentageOfRecoveries, int doctorId) + { + return new Payment + { + Id = id, + Salary = salary, + TotalPatients = totalPatients, + Date = DateTime.Now, + PercentageOfRecoveries = percentageOfRecoveries, + DoctorId = doctorId + }; + } +} diff --git a/RegistrationOfPatients/RegistrationOfPatients/Entities/Reception.cs b/RegistrationOfPatients/RegistrationOfPatients/Entities/Reception.cs new file mode 100644 index 0000000..f865805 --- /dev/null +++ b/RegistrationOfPatients/RegistrationOfPatients/Entities/Reception.cs @@ -0,0 +1,25 @@ +using RegistrationOfPatients.Entities.Enums; + +namespace RegistrationOfPatients.Entities; + +public class Reception +{ + public int Id { get; private set; } + public DateTime Date { get; private set; } + public HealthStatus HealthStatus { get; private set; } + public string Illness { get; private set; } = string.Empty; + public int PatientId { get; private set; } + public int DoctorId { get; private set; } + public static Reception CreateOperation(int id, HealthStatus healthStatus, string illness, int patientId, int doctorId) + { + return new Reception + { + Id = id, + Date = DateTime.Now, + HealthStatus = healthStatus, + Illness = illness ?? string.Empty, + PatientId = patientId, + DoctorId = doctorId + }; + } +} diff --git a/RegistrationOfPatients/RegistrationOfPatients/Repositories/IDoctorRepository.cs b/RegistrationOfPatients/RegistrationOfPatients/Repositories/IDoctorRepository.cs new file mode 100644 index 0000000..328b078 --- /dev/null +++ b/RegistrationOfPatients/RegistrationOfPatients/Repositories/IDoctorRepository.cs @@ -0,0 +1,21 @@ +using RegistrationOfPatients.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationOfPatients.Repositories; + +public interface IDoctorRepository +{ + IEnumerable ReadDoctor(); + + Doctor ReadDoctorById(int id); + + void CreateDoctor(Doctor doctor); + + void UpdateDoctor(Doctor doctor); + + void DeleteDoctor(int id); +} diff --git a/RegistrationOfPatients/RegistrationOfPatients/Repositories/IPatientRepository.cs b/RegistrationOfPatients/RegistrationOfPatients/Repositories/IPatientRepository.cs new file mode 100644 index 0000000..373b793 --- /dev/null +++ b/RegistrationOfPatients/RegistrationOfPatients/Repositories/IPatientRepository.cs @@ -0,0 +1,16 @@ +using RegistrationOfPatients.Entities; + +namespace RegistrationOfPatients.Repositories; + +public interface IPatientRepository +{ + IEnumerable ReadPatient(); + + Patient ReadPatientById(int id); + + void CreatePatient(Patient patient); + + void UpdatePatient(Patient patient); + + void DeletePatient(int id); +} diff --git a/RegistrationOfPatients/RegistrationOfPatients/Repositories/IPaymentRepository.cs b/RegistrationOfPatients/RegistrationOfPatients/Repositories/IPaymentRepository.cs new file mode 100644 index 0000000..2d12838 --- /dev/null +++ b/RegistrationOfPatients/RegistrationOfPatients/Repositories/IPaymentRepository.cs @@ -0,0 +1,17 @@ +using RegistrationOfPatients.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationOfPatients.Repositories; + +public interface IPaymentRepository +{ + IEnumerable ReadPayment(DateTime? dateForm = null, DateTime? dateTo = null, int? doctorId = null); + + void CreateReception(Payment payment); + + void DeletePayment(int id); +} diff --git a/RegistrationOfPatients/RegistrationOfPatients/Repositories/IReceptionRepository.cs b/RegistrationOfPatients/RegistrationOfPatients/Repositories/IReceptionRepository.cs new file mode 100644 index 0000000..9868442 --- /dev/null +++ b/RegistrationOfPatients/RegistrationOfPatients/Repositories/IReceptionRepository.cs @@ -0,0 +1,10 @@ +using RegistrationOfPatients.Entities; + +namespace RegistrationOfPatients.Repositories; + +public interface IReceptionRepository +{ + IEnumerable ReadReception(DateTime? dateForm = null, DateTime? dateTo = null, int? doctorId = null, int? patientId = null); + + void CreateReception(Reception reception); +} diff --git a/RegistrationOfPatients/RegistrationOfPatients/Repositories/Implementations/DoctorRepository.cs b/RegistrationOfPatients/RegistrationOfPatients/Repositories/Implementations/DoctorRepository.cs new file mode 100644 index 0000000..ec81141 --- /dev/null +++ b/RegistrationOfPatients/RegistrationOfPatients/Repositories/Implementations/DoctorRepository.cs @@ -0,0 +1,36 @@ +using RegistrationOfPatients.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationOfPatients.Repositories.Implementations; + +public class DoctorRepository : IDoctorRepository +{ + public void CreateDoctor(Doctor doctor) + { + + } + + public void DeleteDoctor(int id) + { + + } + + public IEnumerable ReadDoctor() + { + return Enumerable.Empty(); + } + + public Doctor ReadDoctorById(int id) + { + return Doctor.CreateEntity(0, string.Empty); + } + + public void UpdateDoctor(Doctor doctor) + { + + } +} diff --git a/RegistrationOfPatients/RegistrationOfPatients/Repositories/Implementations/PatientRepository.cs b/RegistrationOfPatients/RegistrationOfPatients/Repositories/Implementations/PatientRepository.cs new file mode 100644 index 0000000..caf5f45 --- /dev/null +++ b/RegistrationOfPatients/RegistrationOfPatients/Repositories/Implementations/PatientRepository.cs @@ -0,0 +1,36 @@ +using RegistrationOfPatients.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationOfPatients.Repositories.Implementations; + +internal class PatientRepository : IPatientRepository +{ + public void CreatePatient(Patient patient) + { + + } + + public void DeletePatient(int id) + { + + } + + public IEnumerable ReadPatient() + { + return Enumerable.Empty(); + } + + public Patient ReadPatientById(int id) + { + return Patient.CreateEntity(0, string.Empty, string.Empty); + } + + public void UpdatePatient(Patient patient) + { + + } +} diff --git a/RegistrationOfPatients/RegistrationOfPatients/Repositories/Implementations/PaymentRepository.cs b/RegistrationOfPatients/RegistrationOfPatients/Repositories/Implementations/PaymentRepository.cs new file mode 100644 index 0000000..8e7ba5a --- /dev/null +++ b/RegistrationOfPatients/RegistrationOfPatients/Repositories/Implementations/PaymentRepository.cs @@ -0,0 +1,26 @@ +using RegistrationOfPatients.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationOfPatients.Repositories.Implementations; + +public class PaymentRepository : IPaymentRepository +{ + public void CreateReception(Payment payment) + { + + } + + public void DeletePayment(int id) + { + + } + + public IEnumerable ReadPayment(DateTime? dateForm = null, DateTime? dateTo = null, int? doctorId = null) + { + return Enumerable.Empty(); + } +} diff --git a/RegistrationOfPatients/RegistrationOfPatients/Repositories/Implementations/ReceptionRepository.cs b/RegistrationOfPatients/RegistrationOfPatients/Repositories/Implementations/ReceptionRepository.cs new file mode 100644 index 0000000..ab777d6 --- /dev/null +++ b/RegistrationOfPatients/RegistrationOfPatients/Repositories/Implementations/ReceptionRepository.cs @@ -0,0 +1,21 @@ +using RegistrationOfPatients.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationOfPatients.Repositories.Implementations; + +public class ReceptionRepository : IReceptionRepository +{ + public void CreateReception(Reception reception) + { + + } + + public IEnumerable ReadReception(DateTime? dateForm = null, DateTime? dateTo = null, int? doctorId = null, int? patientId = null) + { + return Enumerable.Empty(); + } +}