Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
HIAST-Clinics
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
almohanad.hafez
HIAST-Clinics
Commits
fe7a2b72
Commit
fe7a2b72
authored
Aug 17, 2024
by
Almouhannad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(B) Edit collections implementation
parent
051a3ae6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
53 deletions
+73
-53
Disease.cs
Clinics.Backend/Domain/Entities/Medicals/Diseases/Disease.cs
+5
-1
Medicine.cs
...cs.Backend/Domain/Entities/Medicals/Medicines/Medicine.cs
+6
-1
Doctor.cs
Clinics.Backend/Domain/Entities/People/Doctors/Doctor.cs
+6
-5
Employee.cs
Clinics.Backend/Domain/Entities/People/Employees/Employee.cs
+16
-18
Patient.cs
Clinics.Backend/Domain/Entities/People/Patients/Patient.cs
+18
-15
Visit.cs
Clinics.Backend/Domain/Entities/Visits/Visit.cs
+22
-13
No files found.
Clinics.Backend/Domain/Entities/Medicals/Diseases/Disease.cs
View file @
fe7a2b72
...
@@ -22,7 +22,11 @@ public sealed class Disease : Entity
...
@@ -22,7 +22,11 @@ public sealed class Disease : Entity
#
region
Navigations
#
region
Navigations
public
ICollection
<
PatientDisease
>
Patients
{
get
;
set
;
}
=
[];
#
region
Patients
private
readonly
List
<
PatientDisease
>
_patients
=
[];
public
IReadOnlyCollection
<
PatientDisease
>
Patients
=>
_patients
;
#
endregion
#
endregion
#
endregion
...
...
Clinics.Backend/Domain/Entities/Medicals/Medicines/Medicine.cs
View file @
fe7a2b72
...
@@ -34,7 +34,12 @@ public sealed class Medicine : Entity
...
@@ -34,7 +34,12 @@ public sealed class Medicine : Entity
#
region
Navigations
#
region
Navigations
public
ICollection
<
PatientMedicine
>
Patients
{
get
;
set
;
}
=
[];
#
region
Patients
private
readonly
List
<
PatientMedicine
>
_patients
=
[];
public
IReadOnlyCollection
<
PatientMedicine
>
Patients
=>
_patients
;
#
endregion
#
endregion
#
endregion
...
...
Clinics.Backend/Domain/Entities/People/Doctors/Doctor.cs
View file @
fe7a2b72
...
@@ -28,7 +28,11 @@ public sealed class Doctor : Entity
...
@@ -28,7 +28,11 @@ public sealed class Doctor : Entity
#
region
Navigations
#
region
Navigations
public
ICollection
<
DoctorPhone
>
Phones
{
get
;
set
;
}
=
[];
#
region
Phones
private
readonly
List
<
DoctorPhone
>
_phones
=
[];
public
IReadOnlyCollection
<
DoctorPhone
>
Phones
=>
_phones
;
#
endregion
#
endregion
#
endregion
...
@@ -66,10 +70,7 @@ public sealed class Doctor : Entity
...
@@ -66,10 +70,7 @@ public sealed class Doctor : Entity
throw
;
throw
;
}
}
if
(
Phones
is
null
)
_phones
.
Add
(
doctorPhone
);
Phones
=
[];
Phones
.
Add
(
doctorPhone
);
}
}
#
endregion
#
endregion
...
...
Clinics.Backend/Domain/Entities/People/Employees/Employee.cs
View file @
fe7a2b72
...
@@ -42,11 +42,21 @@ public sealed class Employee : Entity
...
@@ -42,11 +42,21 @@ public sealed class Employee : Entity
#
region
Navigations
#
region
Navigations
public
ICollection
<
EmployeeFamilyMember
>
FamilyMembers
{
get
;
set
;
}
=
[];
#
region
Family
members
private
readonly
List
<
EmployeeFamilyMember
>
_familyMembers
=
[];
public
IReadOnlyCollection
<
EmployeeFamilyMember
>
FamilyMembers
=>
_familyMembers
;
public
ICollection
<
Employee
>
RelatedEmployees
{
get
;
set
;
}
=
[];
#
endregion
#
region
Related
employees
private
readonly
List
<
Employee
>
_relatedEmployees
=
[];
public
IReadOnlyCollection
<
Employee
>
RelatedEmployees
=>
_relatedEmployees
;
private
readonly
List
<
Employee
>
_relatedTo
=
[];
public
IReadOnlyCollection
<
Employee
>
RelatedTo
=>
_relatedTo
;
#
endregion
public
ICollection
<
Employee
>
RelatedTo
{
get
;
set
;
}
=
[];
#
endregion
#
endregion
...
@@ -115,26 +125,14 @@ public sealed class Employee : Entity
...
@@ -115,26 +125,14 @@ public sealed class Employee : Entity
throw
;
throw
;
}
}
if
(
FamilyMembers
is
null
)
_familyMembers
.
Add
(
employeeFamilyMember
);
FamilyMembers
=
[];
FamilyMembers
.
Add
(
employeeFamilyMember
);
}
}
#
endregion
#
endregion
#
region
Add
related
employee
#
region
Add
related
employee
public
void
AddRelatedEmployee
(
Employee
employee
)
public
void
AddRelatedEmployee
(
Employee
employee
)
{
{
// Add new employee to related
_relatedEmployees
.
Add
(
employee
);
if
(
RelatedEmployees
is
null
)
RelatedEmployees
=
[];
RelatedEmployees
.
Add
(
employee
);
// Make this related to new employee
if
(
employee
.
RelatedTo
is
null
)
employee
.
RelatedTo
=
[];
employee
.
RelatedTo
.
Add
(
this
);
}
}
#
endregion
#
endregion
...
...
Clinics.Backend/Domain/Entities/People/Patients/Patient.cs
View file @
fe7a2b72
...
@@ -22,10 +22,6 @@ public sealed class Patient : Entity
...
@@ -22,10 +22,6 @@ public sealed class Patient : Entity
PersonalInfo
=
personalInfo
;
PersonalInfo
=
personalInfo
;
DateOfBirth
=
dateOfBirth
;
DateOfBirth
=
dateOfBirth
;
Gender
=
gender
;
Gender
=
gender
;
Diseases
=
[];
Medicines
=
[];
Visits
=
[];
}
}
#
endregion
#
endregion
...
@@ -54,11 +50,23 @@ public sealed class Patient : Entity
...
@@ -54,11 +50,23 @@ public sealed class Patient : Entity
#
region
Navigations
#
region
Navigations
public
ICollection
<
PatientDisease
>
Diseases
{
get
;
set
;
}
#
region
Diseases
private
readonly
List
<
PatientDisease
>
_diseases
=
[];
public
IReadOnlyCollection
<
PatientDisease
>
Diseases
=>
_diseases
;
#
endregion
#
region
Medicines
private
readonly
List
<
PatientMedicine
>
_medicines
=
[];
public
IReadOnlyCollection
<
PatientMedicine
>
Medicines
=>
_medicines
;
#
endregion
public
ICollection
<
PatientMedicine
>
Medicines
{
get
;
set
;
}
#
region
Visits
private
readonly
List
<
Visit
>
_visits
=
[];
public
IReadOnlyCollection
<
Visit
>
Visits
=>
_visits
;
public
ICollection
<
Visit
>
Visits
{
get
;
set
;
}
#
endregion
#
endregion
#
endregion
...
@@ -122,9 +130,8 @@ public sealed class Patient : Entity
...
@@ -122,9 +130,8 @@ public sealed class Patient : Entity
{
{
throw
;
throw
;
}
}
if
(
Medicines
is
null
)
Medicines
=
[];
_medicines
.
Add
(
entry
);
Medicines
.
Add
(
entry
);
}
}
#
endregion
#
endregion
...
@@ -141,11 +148,7 @@ public sealed class Patient : Entity
...
@@ -141,11 +148,7 @@ public sealed class Patient : Entity
throw
;
throw
;
}
}
if
(
Diseases
is
null
)
_diseases
.
Add
(
entry
);
Diseases
=
[];
Diseases
.
Add
(
entry
);
}
}
#
endregion
#
endregion
...
...
Clinics.Backend/Domain/Entities/Visits/Visit.cs
View file @
fe7a2b72
...
@@ -63,9 +63,23 @@ public sealed class Visit : Entity
...
@@ -63,9 +63,23 @@ public sealed class Visit : Entity
#
region
Navigations
#
region
Navigations
public
ICollection
<
VisitMedicalImage
>
MedicalImages
{
get
;
set
;
}
=
[];
#
region
Medical
images
public
ICollection
<
VisitMedicalTest
>
MedicalTests
{
get
;
set
;
}
=
[];
private
readonly
List
<
VisitMedicalImage
>
_medicalImages
=
[];
public
ICollection
<
VisitMedicine
>
Medicines
{
get
;
set
;
}
=
[];
public
IReadOnlyCollection
<
VisitMedicalImage
>
MedicalImages
=>
_medicalImages
;
#
endregion
#
region
Medical
tests
private
readonly
List
<
VisitMedicalTest
>
_medicalTests
=
[];
public
IReadOnlyCollection
<
VisitMedicalTest
>
MedicalTests
=>
_medicalTests
;
#
endregion
#
region
Medicines
private
readonly
List
<
VisitMedicine
>
_medicines
=
[];
public
IReadOnlyCollection
<
VisitMedicine
>
Medicines
=>
_medicines
;
#
endregion
#
endregion
#
endregion
...
@@ -96,10 +110,7 @@ public sealed class Visit : Entity
...
@@ -96,10 +110,7 @@ public sealed class Visit : Entity
throw
;
throw
;
}
}
if
(
MedicalImages
is
null
)
_medicalImages
.
Add
(
entry
);
MedicalImages
=
[];
MedicalImages
.
Add
(
entry
);
}
}
#
endregion
#
endregion
...
@@ -115,9 +126,8 @@ public sealed class Visit : Entity
...
@@ -115,9 +126,8 @@ public sealed class Visit : Entity
{
{
throw
;
throw
;
}
}
if
(
MedicalTests
is
null
)
MedicalTests
=
[];
_medicalTests
.
Add
(
entry
);
MedicalTests
.
Add
(
entry
);
}
}
#
endregion
#
endregion
...
@@ -133,9 +143,8 @@ public sealed class Visit : Entity
...
@@ -133,9 +143,8 @@ public sealed class Visit : Entity
{
{
throw
;
throw
;
}
}
if
(
Medicines
is
null
)
Medicines
=
[];
_medicines
.
Add
(
entry
);
Medicines
.
Add
(
entry
);
}
}
#
endregion
#
endregion
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment