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
#
region
Navigations
public
ICollection
<
PatientDisease
>
Patients
{
get
;
set
;
}
=
[];
#
region
Patients
private
readonly
List
<
PatientDisease
>
_patients
=
[];
public
IReadOnlyCollection
<
PatientDisease
>
Patients
=>
_patients
;
#
endregion
#
endregion
...
...
Clinics.Backend/Domain/Entities/Medicals/Medicines/Medicine.cs
View file @
fe7a2b72
...
...
@@ -34,7 +34,12 @@ public sealed class Medicine : Entity
#
region
Navigations
public
ICollection
<
PatientMedicine
>
Patients
{
get
;
set
;
}
=
[];
#
region
Patients
private
readonly
List
<
PatientMedicine
>
_patients
=
[];
public
IReadOnlyCollection
<
PatientMedicine
>
Patients
=>
_patients
;
#
endregion
#
endregion
...
...
Clinics.Backend/Domain/Entities/People/Doctors/Doctor.cs
View file @
fe7a2b72
...
...
@@ -28,7 +28,11 @@ public sealed class Doctor : Entity
#
region
Navigations
public
ICollection
<
DoctorPhone
>
Phones
{
get
;
set
;
}
=
[];
#
region
Phones
private
readonly
List
<
DoctorPhone
>
_phones
=
[];
public
IReadOnlyCollection
<
DoctorPhone
>
Phones
=>
_phones
;
#
endregion
#
endregion
...
...
@@ -66,10 +70,7 @@ public sealed class Doctor : Entity
throw
;
}
if
(
Phones
is
null
)
Phones
=
[];
Phones
.
Add
(
doctorPhone
);
_phones
.
Add
(
doctorPhone
);
}
#
endregion
...
...
Clinics.Backend/Domain/Entities/People/Employees/Employee.cs
View file @
fe7a2b72
...
...
@@ -42,11 +42,21 @@ public sealed class Employee : Entity
#
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
...
...
@@ -115,26 +125,14 @@ public sealed class Employee : Entity
throw
;
}
if
(
FamilyMembers
is
null
)
FamilyMembers
=
[];
FamilyMembers
.
Add
(
employeeFamilyMember
);
_familyMembers
.
Add
(
employeeFamilyMember
);
}
#
endregion
#
region
Add
related
employee
public
void
AddRelatedEmployee
(
Employee
employee
)
public
void
AddRelatedEmployee
(
Employee
employee
)
{
// Add new employee to related
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
);
_relatedEmployees
.
Add
(
employee
);
}
#
endregion
...
...
Clinics.Backend/Domain/Entities/People/Patients/Patient.cs
View file @
fe7a2b72
...
...
@@ -22,10 +22,6 @@ public sealed class Patient : Entity
PersonalInfo
=
personalInfo
;
DateOfBirth
=
dateOfBirth
;
Gender
=
gender
;
Diseases
=
[];
Medicines
=
[];
Visits
=
[];
}
#
endregion
...
...
@@ -54,11 +50,23 @@ public sealed class Patient : Entity
#
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
...
...
@@ -122,9 +130,8 @@ public sealed class Patient : Entity
{
throw
;
}
if
(
Medicines
is
null
)
Medicines
=
[];
Medicines
.
Add
(
entry
);
_medicines
.
Add
(
entry
);
}
#
endregion
...
...
@@ -141,11 +148,7 @@ public sealed class Patient : Entity
throw
;
}
if
(
Diseases
is
null
)
Diseases
=
[];
Diseases
.
Add
(
entry
);
_diseases
.
Add
(
entry
);
}
#
endregion
...
...
Clinics.Backend/Domain/Entities/Visits/Visit.cs
View file @
fe7a2b72
...
...
@@ -63,9 +63,23 @@ public sealed class Visit : Entity
#
region
Navigations
public
ICollection
<
VisitMedicalImage
>
MedicalImages
{
get
;
set
;
}
=
[];
public
ICollection
<
VisitMedicalTest
>
MedicalTests
{
get
;
set
;
}
=
[];
public
ICollection
<
VisitMedicine
>
Medicines
{
get
;
set
;
}
=
[];
#
region
Medical
images
private
readonly
List
<
VisitMedicalImage
>
_medicalImages
=
[];
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
...
...
@@ -96,10 +110,7 @@ public sealed class Visit : Entity
throw
;
}
if
(
MedicalImages
is
null
)
MedicalImages
=
[];
MedicalImages
.
Add
(
entry
);
_medicalImages
.
Add
(
entry
);
}
#
endregion
...
...
@@ -115,9 +126,8 @@ public sealed class Visit : Entity
{
throw
;
}
if
(
MedicalTests
is
null
)
MedicalTests
=
[];
MedicalTests
.
Add
(
entry
);
_medicalTests
.
Add
(
entry
);
}
#
endregion
...
...
@@ -133,9 +143,8 @@ public sealed class Visit : Entity
{
throw
;
}
if
(
Medicines
is
null
)
Medicines
=
[];
Medicines
.
Add
(
entry
);
_medicines
.
Add
(
entry
);
}
#
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