healthdatalayer 1.2.0__tar.gz → 1.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of healthdatalayer might be problematic. Click here for more details.
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/PKG-INFO +1 -1
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/bridge_area_floor_branch/branch.py +1 -1
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/client/emergency_contact.py +1 -1
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/client/pathological_history.py +1 -1
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/client/pet.py +1 -1
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/client/px.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/collaborator/collaborator.py +4 -4
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/lab/client_lab.py +1 -1
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/medical_visit/medical_diagnosis_visit.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/medical_visit/medical_drug.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/medical_visit/medical_recipe_visit.py +3 -3
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/medical_visit/medical_visit.py +8 -8
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/medical_visit/organ_system_review.py +1 -1
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/medical_visit/physical_exam.py +1 -1
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/medical_visit/visit_triage.py +1 -1
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/user/permission.py +4 -4
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/user/role.py +4 -4
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/user/user.py +4 -4
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/__init__.py +3 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/client_repositories/address_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/client_repositories/client_type_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/client_repositories/education_repository.py +2 -2
- healthdatalayer-1.4.0/healthdatalayer/repositories/client_repositories/emergency_contact_repository.py +78 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/client_repositories/gender_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/client_repositories/marriage_status_repository.py +2 -2
- healthdatalayer-1.4.0/healthdatalayer/repositories/client_repositories/nationality_repository.py +69 -0
- healthdatalayer-1.4.0/healthdatalayer/repositories/client_repositories/pathological_history_repository.py +73 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/client_repositories/pet_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/client_repositories/profession_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/client_repositories/px_repository.py +28 -27
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/collaborator_repositories/collaborator_repository.py +7 -7
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/collaborator_repositories/collaborator_type_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/collaborator_repositories/speciality_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/infraestructure_repositories/area_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/infraestructure_repositories/branch_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/infraestructure_repositories/bridge_repository.py +3 -3
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/infraestructure_repositories/floor_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/infraestructure_repositories/room_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/infraestructure_repositories/system_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/lab_repositories/measure_lab_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/lab_repositories/medical_lab_repository.py +15 -15
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/medical_visit_repositories/medical_diagnosis_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/medical_visit_repositories/medical_diagnosis_visit_repository.py +3 -3
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/medical_visit_repositories/medical_drug_recipe_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/medical_visit_repositories/medical_drug_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/medical_visit_repositories/medical_recipe_visit_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/medical_visit_repositories/medical_visit_repository.py +2 -2
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/medical_visit_repositories/organ_system_review_repository.py +3 -3
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/medical_visit_repositories/physical_exam_repository.py +3 -3
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/medical_visit_repositories/visit_triage_repository.py +3 -3
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/user_repositories/permission_repository.py +4 -4
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/user_repositories/role_repository.py +4 -4
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/user_repositories/user_repository.py +4 -4
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer.egg-info/PKG-INFO +1 -1
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer.egg-info/SOURCES.txt +3 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/setup.py +1 -1
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/README.md +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/config/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/config/config.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/config/db.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/config/vault.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/bridge_area_floor_branch/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/bridge_area_floor_branch/area.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/bridge_area_floor_branch/bridge_area_floor_branch.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/bridge_area_floor_branch/floor.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/bridge_area_floor_branch/room.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/bridge_area_floor_branch/system.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/client/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/client/address.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/client/client.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/client/client_type.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/client/education.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/client/gender.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/client/marriage_status.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/client/nationality.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/client/profession.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/collaborator/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/collaborator/collaborator_speciality.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/collaborator/collaborator_type.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/collaborator/speciality.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/lab/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/lab/measure_lab.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/lab/medical_lab.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/medical_visit/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/medical_visit/medical_diagnosis.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/medical_visit/medical_drug_recipe.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/user/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/user/permission_user.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/user/role_permission.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/user/role_user.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/client_repositories/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/collaborator_repositories/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/infraestructure_repositories/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/lab_repositories/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/medical_visit_repositories/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/repositories/user_repositories/__init__.py +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer.egg-info/dependency_links.txt +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer.egg-info/requires.txt +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer.egg-info/top_level.txt +0 -0
- {healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/setup.cfg +0 -0
|
@@ -2,7 +2,7 @@ import uuid
|
|
|
2
2
|
from sqlmodel import SQLModel,Field,Relationship
|
|
3
3
|
from typing import Optional
|
|
4
4
|
|
|
5
|
-
from models.client.px import Px
|
|
5
|
+
from healthdatalayer.models.client.px import Px
|
|
6
6
|
|
|
7
7
|
class PathologicalHistory(SQLModel,table=True):
|
|
8
8
|
__tablename__ = "pathological_history"
|
|
@@ -2,11 +2,11 @@ from typing import Optional, TYPE_CHECKING
|
|
|
2
2
|
from sqlmodel import Field, Relationship
|
|
3
3
|
import uuid
|
|
4
4
|
|
|
5
|
-
from models import Client
|
|
5
|
+
from healthdatalayer.models import Client
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
if TYPE_CHECKING:
|
|
9
|
-
from models import ClientLab
|
|
9
|
+
from healthdatalayer.models import ClientLab
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class Px(Client, table=True):
|
{healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/collaborator/collaborator.py
RENAMED
|
@@ -2,13 +2,13 @@ import uuid
|
|
|
2
2
|
from typing import Optional, List, TYPE_CHECKING
|
|
3
3
|
from sqlmodel import SQLModel, Field, Relationship
|
|
4
4
|
|
|
5
|
-
from models import User
|
|
6
|
-
from models import CollaboratorSpeciality
|
|
5
|
+
from healthdatalayer.models import User
|
|
6
|
+
from healthdatalayer.models import CollaboratorSpeciality
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
if TYPE_CHECKING:
|
|
10
|
-
from models import Speciality
|
|
11
|
-
from models import CollaboratorType
|
|
10
|
+
from healthdatalayer.models import Speciality
|
|
11
|
+
from healthdatalayer.models import CollaboratorType
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class Collaborator(SQLModel, table=True):
|
|
@@ -3,7 +3,7 @@ from sqlmodel import SQLModel,Field,Relationship
|
|
|
3
3
|
from typing import Optional, TYPE_CHECKING
|
|
4
4
|
|
|
5
5
|
if TYPE_CHECKING:
|
|
6
|
-
from models.client.px import Px
|
|
6
|
+
from healthdatalayer.models.client.px import Px
|
|
7
7
|
|
|
8
8
|
class ClientLab(SQLModel,table=True):
|
|
9
9
|
__tablename__ = "client_lab"
|
|
@@ -2,10 +2,10 @@ import uuid
|
|
|
2
2
|
from datetime import datetime
|
|
3
3
|
from typing import Optional, TYPE_CHECKING
|
|
4
4
|
from sqlmodel import SQLModel, Field, Relationship
|
|
5
|
-
from models import MedicalDiagnosis
|
|
5
|
+
from healthdatalayer.models import MedicalDiagnosis
|
|
6
6
|
|
|
7
7
|
if TYPE_CHECKING:
|
|
8
|
-
from models import MedicalVisit
|
|
8
|
+
from healthdatalayer.models import MedicalVisit
|
|
9
9
|
|
|
10
10
|
class MedicalDiagnosisVisit(SQLModel, table=True):
|
|
11
11
|
__tablename__ = "medical_diagnosis_visit"
|
{healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/medical_visit/medical_drug.py
RENAMED
|
@@ -3,10 +3,10 @@ from datetime import datetime
|
|
|
3
3
|
from typing import Optional, List, TYPE_CHECKING
|
|
4
4
|
from sqlmodel import SQLModel, Field, Relationship
|
|
5
5
|
|
|
6
|
-
from models.medical_visit.medical_drug_recipe import MedicalDrugRecipe
|
|
6
|
+
from healthdatalayer.models.medical_visit.medical_drug_recipe import MedicalDrugRecipe
|
|
7
7
|
|
|
8
8
|
if TYPE_CHECKING:
|
|
9
|
-
from models.medical_visit.medical_recipe_visit import MedicalRecipeVisit
|
|
9
|
+
from healthdatalayer.models.medical_visit.medical_recipe_visit import MedicalRecipeVisit
|
|
10
10
|
|
|
11
11
|
class MedicalDrug(SQLModel, table=True):
|
|
12
12
|
__tablename__ = "medical_drug"
|
|
@@ -4,11 +4,11 @@ from typing import Optional, List, TYPE_CHECKING
|
|
|
4
4
|
from sqlmodel import SQLModel, Field, Relationship
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
from models import MedicalDrugRecipe
|
|
7
|
+
from healthdatalayer.models import MedicalDrugRecipe
|
|
8
8
|
|
|
9
9
|
if TYPE_CHECKING:
|
|
10
|
-
from models.medical_visit.medical_drug import MedicalDrug
|
|
11
|
-
from models import MedicalVisit
|
|
10
|
+
from healthdatalayer.models.medical_visit.medical_drug import MedicalDrug
|
|
11
|
+
from healthdatalayer.models import MedicalVisit
|
|
12
12
|
|
|
13
13
|
class MedicalRecipeVisit(SQLModel, table=True):
|
|
14
14
|
__tablename__ = "medical_recipe_visit"
|
|
@@ -3,16 +3,16 @@ from datetime import datetime
|
|
|
3
3
|
from typing import Optional, List, TYPE_CHECKING
|
|
4
4
|
from sqlmodel import SQLModel, Field, Relationship
|
|
5
5
|
|
|
6
|
-
from models import Collaborator
|
|
6
|
+
from healthdatalayer.models import Collaborator
|
|
7
7
|
|
|
8
|
-
from models import Speciality
|
|
9
|
-
from models import BridgeAreaFloorBranch
|
|
8
|
+
from healthdatalayer.models import Speciality
|
|
9
|
+
from healthdatalayer.models import BridgeAreaFloorBranch
|
|
10
10
|
if TYPE_CHECKING:
|
|
11
|
-
from models import Px
|
|
12
|
-
from models import MedicalDiagnosisVisit
|
|
13
|
-
from models import MedicalRecipeVisit
|
|
14
|
-
from models import OrganSystemReview
|
|
15
|
-
from models import PhysicalExam
|
|
11
|
+
from healthdatalayer.models import Px
|
|
12
|
+
from healthdatalayer.models import MedicalDiagnosisVisit
|
|
13
|
+
from healthdatalayer.models import MedicalRecipeVisit
|
|
14
|
+
from healthdatalayer.models import OrganSystemReview
|
|
15
|
+
from healthdatalayer.models import PhysicalExam
|
|
16
16
|
class MedicalVisit(SQLModel, table=True):
|
|
17
17
|
__tablename__ = "medical_visit"
|
|
18
18
|
|
|
@@ -2,7 +2,7 @@ import uuid
|
|
|
2
2
|
from typing import Optional,TYPE_CHECKING
|
|
3
3
|
from sqlmodel import SQLModel, Field, Relationship
|
|
4
4
|
if TYPE_CHECKING:
|
|
5
|
-
from models import MedicalVisit
|
|
5
|
+
from healthdatalayer.models import MedicalVisit
|
|
6
6
|
|
|
7
7
|
class OrganSystemReview(SQLModel, table=True):
|
|
8
8
|
__tablename__ = "organ_system_review"
|
|
@@ -3,7 +3,7 @@ from typing import Optional,TYPE_CHECKING
|
|
|
3
3
|
from sqlmodel import SQLModel, Field, Relationship
|
|
4
4
|
|
|
5
5
|
if TYPE_CHECKING:
|
|
6
|
-
from models import MedicalVisit
|
|
6
|
+
from healthdatalayer.models import MedicalVisit
|
|
7
7
|
|
|
8
8
|
class PhysicalExam(SQLModel, table=True):
|
|
9
9
|
__tablename__ = "physical_exam"
|
{healthdatalayer-1.2.0 → healthdatalayer-1.4.0}/healthdatalayer/models/medical_visit/visit_triage.py
RENAMED
|
@@ -4,7 +4,7 @@ from sqlmodel import SQLModel, Field, Relationship
|
|
|
4
4
|
from decimal import Decimal
|
|
5
5
|
|
|
6
6
|
if TYPE_CHECKING:
|
|
7
|
-
from models.medical_visit.medical_visit import MedicalVisit
|
|
7
|
+
from healthdatalayer.models.medical_visit.medical_visit import MedicalVisit
|
|
8
8
|
|
|
9
9
|
class VisitTriage(SQLModel, table=True):
|
|
10
10
|
__tablename__ = "visit_triage"
|
|
@@ -2,12 +2,12 @@ import uuid
|
|
|
2
2
|
from sqlmodel import SQLModel, Field, Relationship
|
|
3
3
|
from typing import List, TYPE_CHECKING
|
|
4
4
|
|
|
5
|
-
from models.user.role_permission import RolePermission
|
|
6
|
-
from models.user.permission_user import PermissionUser
|
|
5
|
+
from healthdatalayer.models.user.role_permission import RolePermission
|
|
6
|
+
from healthdatalayer.models.user.permission_user import PermissionUser
|
|
7
7
|
|
|
8
8
|
if TYPE_CHECKING:
|
|
9
|
-
from models.user.user import User
|
|
10
|
-
from models.user.role import Role
|
|
9
|
+
from healthdatalayer.models.user.user import User
|
|
10
|
+
from healthdatalayer.models.user.role import Role
|
|
11
11
|
|
|
12
12
|
class Permission(SQLModel, table=True):
|
|
13
13
|
__tablename__ = "permission"
|
|
@@ -2,12 +2,12 @@ import uuid
|
|
|
2
2
|
from sqlmodel import SQLModel, Field, Relationship
|
|
3
3
|
from typing import List, TYPE_CHECKING
|
|
4
4
|
|
|
5
|
-
from models.user.role_user import RoleUser
|
|
6
|
-
from models.user.role_permission import RolePermission
|
|
5
|
+
from healthdatalayer.models.user.role_user import RoleUser
|
|
6
|
+
from healthdatalayer.models.user.role_permission import RolePermission
|
|
7
7
|
|
|
8
8
|
if TYPE_CHECKING:
|
|
9
|
-
from models.user.user import User
|
|
10
|
-
from models.user.permission import Permission
|
|
9
|
+
from healthdatalayer.models.user.user import User
|
|
10
|
+
from healthdatalayer.models.user.permission import Permission
|
|
11
11
|
|
|
12
12
|
class Role(SQLModel, table=True):
|
|
13
13
|
__tablename__ = "role"
|
|
@@ -3,11 +3,11 @@ from sqlmodel import SQLModel,Field, Relationship
|
|
|
3
3
|
from datetime import datetime
|
|
4
4
|
from typing import Optional, List, TYPE_CHECKING
|
|
5
5
|
|
|
6
|
-
from models.user.role_user import RoleUser
|
|
7
|
-
from models.user.permission_user import PermissionUser
|
|
6
|
+
from healthdatalayer.models.user.role_user import RoleUser
|
|
7
|
+
from healthdatalayer.models.user.permission_user import PermissionUser
|
|
8
8
|
|
|
9
|
-
from models.user.role import Role
|
|
10
|
-
from models.user.permission import Permission
|
|
9
|
+
from healthdatalayer.models.user.role import Role
|
|
10
|
+
from healthdatalayer.models.user.permission import Permission
|
|
11
11
|
|
|
12
12
|
class User(SQLModel,table=True):
|
|
13
13
|
__tablename__ = "user"
|
|
@@ -6,6 +6,9 @@ from .client_repositories.marriage_status_repository import MarriageStatusReposi
|
|
|
6
6
|
from .client_repositories.pet_repository import PetRepository
|
|
7
7
|
from .client_repositories.profession_repository import ProfessionRepository
|
|
8
8
|
from .client_repositories.px_repository import PxRepository
|
|
9
|
+
from .client_repositories.emergency_contact_repository import EmergencyContactRepository
|
|
10
|
+
from .client_repositories.nationality_repository import NationalityRepository
|
|
11
|
+
from .client_repositories.pathological_history_repository import PathologicalHistoryRepository
|
|
9
12
|
|
|
10
13
|
from .collaborator_repositories.collaborator_repository import CollaboratorRepository
|
|
11
14
|
from .collaborator_repositories.collaborator_type_repository import CollaboratorTypeRepository
|
|
@@ -2,8 +2,8 @@ from typing import Optional, List
|
|
|
2
2
|
from uuid import UUID
|
|
3
3
|
from sqlmodel import select
|
|
4
4
|
|
|
5
|
-
from models import Address
|
|
6
|
-
from config.db import engines, get_session
|
|
5
|
+
from healthdatalayer.models import Address
|
|
6
|
+
from healthdatalayer.config.db import engines, get_session
|
|
7
7
|
|
|
8
8
|
class AddressRepository:
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@ from typing import Optional, List
|
|
|
2
2
|
from uuid import UUID
|
|
3
3
|
from sqlmodel import select
|
|
4
4
|
|
|
5
|
-
from models import ClientType
|
|
6
|
-
from config.db import engines, get_session
|
|
5
|
+
from healthdatalayer.models import ClientType
|
|
6
|
+
from healthdatalayer.config.db import engines, get_session
|
|
7
7
|
|
|
8
8
|
class ClientTypeRepository:
|
|
9
9
|
def __init__(self, tenant: str):
|
|
@@ -2,8 +2,8 @@ from typing import Optional, List
|
|
|
2
2
|
from uuid import UUID
|
|
3
3
|
from sqlmodel import select
|
|
4
4
|
|
|
5
|
-
from models import Education
|
|
6
|
-
from config.db import engines, get_session
|
|
5
|
+
from healthdatalayer.models import Education
|
|
6
|
+
from healthdatalayer.config.db import engines, get_session
|
|
7
7
|
|
|
8
8
|
class EducationRepository:
|
|
9
9
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
from typing import Optional, List
|
|
2
|
+
from uuid import UUID
|
|
3
|
+
from sqlmodel import select
|
|
4
|
+
|
|
5
|
+
from healthdatalayer.models import EmergencyContact
|
|
6
|
+
from healthdatalayer.config.db import engines, get_session
|
|
7
|
+
|
|
8
|
+
class EmergencyContactRepository:
|
|
9
|
+
def __init__(self, tenant: str):
|
|
10
|
+
self.tenant = tenant
|
|
11
|
+
if tenant not in engines:
|
|
12
|
+
raise ValueError(f"Tenant {tenant} is not configured")
|
|
13
|
+
|
|
14
|
+
def create_command(self, emergency_contact: EmergencyContact) -> EmergencyContact:
|
|
15
|
+
with get_session(self.tenant) as session:
|
|
16
|
+
session.add(emergency_contact)
|
|
17
|
+
session.commit()
|
|
18
|
+
session.refresh(emergency_contact)
|
|
19
|
+
return emergency_contact
|
|
20
|
+
|
|
21
|
+
def get_by_id_command(self, emergency_contact_id: UUID) -> Optional[EmergencyContact]:
|
|
22
|
+
with get_session(self.tenant) as session:
|
|
23
|
+
return session.get(EmergencyContact, emergency_contact_id)
|
|
24
|
+
|
|
25
|
+
def get_by_client_id_command(self, client_id: UUID) -> List[EmergencyContact]:
|
|
26
|
+
with get_session(self.tenant) as session:
|
|
27
|
+
statement = select(EmergencyContact).where(
|
|
28
|
+
EmergencyContact.client_id == client_id,
|
|
29
|
+
EmergencyContact.is_active == True
|
|
30
|
+
)
|
|
31
|
+
results = session.exec(statement)
|
|
32
|
+
return results.all()
|
|
33
|
+
|
|
34
|
+
def get_by_name_command(self, name: str) -> Optional[EmergencyContact]:
|
|
35
|
+
with get_session(self.tenant) as session:
|
|
36
|
+
statement = select(EmergencyContact).where(EmergencyContact.name == name)
|
|
37
|
+
result = session.exec(statement).first()
|
|
38
|
+
return result
|
|
39
|
+
|
|
40
|
+
def list_all_command(self, active_only: bool = True) -> List[EmergencyContact]:
|
|
41
|
+
with get_session(self.tenant) as session:
|
|
42
|
+
statement = select(EmergencyContact)
|
|
43
|
+
|
|
44
|
+
if active_only:
|
|
45
|
+
statement = statement.where(EmergencyContact.is_active == True)
|
|
46
|
+
|
|
47
|
+
results = session.exec(statement)
|
|
48
|
+
return results.all()
|
|
49
|
+
|
|
50
|
+
def update_command(self, emergency_contact_id: UUID, **kwargs) -> Optional[EmergencyContact]:
|
|
51
|
+
with get_session(self.tenant) as session:
|
|
52
|
+
db_emergency_contact = session.get(EmergencyContact, emergency_contact_id)
|
|
53
|
+
if not db_emergency_contact:
|
|
54
|
+
return None
|
|
55
|
+
|
|
56
|
+
for key, value in kwargs.items():
|
|
57
|
+
if hasattr(db_emergency_contact, key):
|
|
58
|
+
setattr(db_emergency_contact, key, value)
|
|
59
|
+
|
|
60
|
+
session.add(db_emergency_contact)
|
|
61
|
+
session.commit()
|
|
62
|
+
session.refresh(db_emergency_contact)
|
|
63
|
+
return db_emergency_contact
|
|
64
|
+
|
|
65
|
+
def delete_command(self, emergency_contact_id: UUID, soft_delete: bool = True) -> bool:
|
|
66
|
+
with get_session(self.tenant) as session:
|
|
67
|
+
db_emergency_contact = session.get(EmergencyContact, emergency_contact_id)
|
|
68
|
+
if not db_emergency_contact:
|
|
69
|
+
return False
|
|
70
|
+
|
|
71
|
+
if soft_delete:
|
|
72
|
+
db_emergency_contact.is_active = False
|
|
73
|
+
session.add(db_emergency_contact)
|
|
74
|
+
else:
|
|
75
|
+
session.delete(db_emergency_contact)
|
|
76
|
+
|
|
77
|
+
session.commit()
|
|
78
|
+
return True
|
|
@@ -2,8 +2,8 @@ from typing import Optional, List
|
|
|
2
2
|
from uuid import UUID
|
|
3
3
|
from sqlmodel import select
|
|
4
4
|
|
|
5
|
-
from models import Gender
|
|
6
|
-
from config.db import engines, get_session
|
|
5
|
+
from healthdatalayer.models import Gender
|
|
6
|
+
from healthdatalayer.config.db import engines, get_session
|
|
7
7
|
|
|
8
8
|
class GenderRepository:
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@ from typing import Optional, List
|
|
|
2
2
|
from uuid import UUID
|
|
3
3
|
from sqlmodel import select
|
|
4
4
|
|
|
5
|
-
from models import MarriageStatus
|
|
6
|
-
from config.db import engines, get_session
|
|
5
|
+
from healthdatalayer.models import MarriageStatus
|
|
6
|
+
from healthdatalayer.config.db import engines, get_session
|
|
7
7
|
|
|
8
8
|
class MarriageStatusRepository:
|
|
9
9
|
|
healthdatalayer-1.4.0/healthdatalayer/repositories/client_repositories/nationality_repository.py
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from typing import Optional, List
|
|
2
|
+
from uuid import UUID
|
|
3
|
+
from sqlmodel import select
|
|
4
|
+
|
|
5
|
+
from healthdatalayer.models import Nationality
|
|
6
|
+
from healthdatalayer.config.db import engines, get_session
|
|
7
|
+
|
|
8
|
+
class NationalityRepository:
|
|
9
|
+
def __init__(self, tenant: str):
|
|
10
|
+
self.tenant = tenant
|
|
11
|
+
if tenant not in engines:
|
|
12
|
+
raise ValueError(f"Tenant {tenant} is not configured")
|
|
13
|
+
|
|
14
|
+
def create_command(self, nationality: Nationality) -> Nationality:
|
|
15
|
+
with get_session(self.tenant) as session:
|
|
16
|
+
session.add(nationality)
|
|
17
|
+
session.commit()
|
|
18
|
+
session.refresh(nationality)
|
|
19
|
+
return nationality
|
|
20
|
+
|
|
21
|
+
def get_by_id_command(self, nationality_id: UUID) -> Optional[Nationality]:
|
|
22
|
+
with get_session(self.tenant) as session:
|
|
23
|
+
return session.get(Nationality, nationality_id)
|
|
24
|
+
|
|
25
|
+
def get_by_name_command(self, name: str) -> Optional[Nationality]:
|
|
26
|
+
with get_session(self.tenant) as session:
|
|
27
|
+
statement = select(Nationality).where(Nationality.name.ilike(f"%{name}%"), Nationality.is_active == True)
|
|
28
|
+
result = session.exec(statement).first()
|
|
29
|
+
return result
|
|
30
|
+
|
|
31
|
+
def list_all_command(self, active_only: bool = True) -> List[Nationality]:
|
|
32
|
+
with get_session(self.tenant) as session:
|
|
33
|
+
statement = select(Nationality)
|
|
34
|
+
|
|
35
|
+
if active_only:
|
|
36
|
+
statement = statement.where(Nationality.is_active == True)
|
|
37
|
+
|
|
38
|
+
results = session.exec(statement)
|
|
39
|
+
return results.all()
|
|
40
|
+
|
|
41
|
+
def update_command(self, nationality_id: UUID, **kwargs) -> Optional[Nationality]:
|
|
42
|
+
with get_session(self.tenant) as session:
|
|
43
|
+
db_nationality = session.get(Nationality, nationality_id)
|
|
44
|
+
if not db_nationality:
|
|
45
|
+
return None
|
|
46
|
+
|
|
47
|
+
for key, value in kwargs.items():
|
|
48
|
+
if hasattr(db_nationality, key):
|
|
49
|
+
setattr(db_nationality, key, value)
|
|
50
|
+
|
|
51
|
+
session.add(db_nationality)
|
|
52
|
+
session.commit()
|
|
53
|
+
session.refresh(db_nationality)
|
|
54
|
+
return db_nationality
|
|
55
|
+
|
|
56
|
+
def delete_command(self, nationality_id: UUID, soft_delete: bool = True) -> bool:
|
|
57
|
+
with get_session(self.tenant) as session:
|
|
58
|
+
db_nationality = session.get(Nationality, nationality_id)
|
|
59
|
+
if not db_nationality:
|
|
60
|
+
return False
|
|
61
|
+
|
|
62
|
+
if soft_delete:
|
|
63
|
+
db_nationality.is_active = False
|
|
64
|
+
session.add(db_nationality)
|
|
65
|
+
else:
|
|
66
|
+
session.delete(db_nationality)
|
|
67
|
+
|
|
68
|
+
session.commit()
|
|
69
|
+
return True
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
from typing import Optional, List
|
|
2
|
+
from uuid import UUID
|
|
3
|
+
from sqlmodel import select
|
|
4
|
+
|
|
5
|
+
from healthdatalayer.models import PathologicalHistory
|
|
6
|
+
from healthdatalayer.config.db import engines, get_session
|
|
7
|
+
|
|
8
|
+
class PathologicalHistoryRepository:
|
|
9
|
+
def __init__(self, tenant: str):
|
|
10
|
+
self.tenant = tenant
|
|
11
|
+
if tenant not in engines:
|
|
12
|
+
raise ValueError(f"Tenant {tenant} is not configured")
|
|
13
|
+
|
|
14
|
+
def create_command(self, pathological_history: PathologicalHistory) -> PathologicalHistory:
|
|
15
|
+
with get_session(self.tenant) as session:
|
|
16
|
+
session.add(pathological_history)
|
|
17
|
+
session.commit()
|
|
18
|
+
session.refresh(pathological_history)
|
|
19
|
+
return pathological_history
|
|
20
|
+
|
|
21
|
+
def get_by_id_command(self, pathological_history_id: UUID) -> Optional[PathologicalHistory]:
|
|
22
|
+
with get_session(self.tenant) as session:
|
|
23
|
+
return session.get(PathologicalHistory, pathological_history_id)
|
|
24
|
+
|
|
25
|
+
def get_by_client_id_command(self, client_id: UUID) -> List[PathologicalHistory]:
|
|
26
|
+
with get_session(self.tenant) as session:
|
|
27
|
+
statement = select(PathologicalHistory).where(
|
|
28
|
+
PathologicalHistory.client_id == client_id,
|
|
29
|
+
PathologicalHistory.is_active == True
|
|
30
|
+
)
|
|
31
|
+
results = session.exec(statement)
|
|
32
|
+
return results.all()
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def list_all_command(self, active_only: bool = True) -> List[PathologicalHistory]:
|
|
36
|
+
with get_session(self.tenant) as session:
|
|
37
|
+
statement = select(PathologicalHistory)
|
|
38
|
+
|
|
39
|
+
if active_only:
|
|
40
|
+
statement = statement.where(PathologicalHistory.is_active == True)
|
|
41
|
+
|
|
42
|
+
results = session.exec(statement)
|
|
43
|
+
return results.all()
|
|
44
|
+
|
|
45
|
+
def update_command(self, pathological_history_id: UUID, **kwargs) -> Optional[PathologicalHistory]:
|
|
46
|
+
with get_session(self.tenant) as session:
|
|
47
|
+
db_pathological_history = session.get(PathologicalHistory, pathological_history_id)
|
|
48
|
+
if not db_pathological_history:
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
for key, value in kwargs.items():
|
|
52
|
+
if hasattr(db_pathological_history, key):
|
|
53
|
+
setattr(db_pathological_history, key, value)
|
|
54
|
+
|
|
55
|
+
session.add(db_pathological_history)
|
|
56
|
+
session.commit()
|
|
57
|
+
session.refresh(db_pathological_history)
|
|
58
|
+
return db_pathological_history
|
|
59
|
+
|
|
60
|
+
def delete_command(self, pathological_history_id: UUID, soft_delete: bool = True) -> bool:
|
|
61
|
+
with get_session(self.tenant) as session:
|
|
62
|
+
db_pathological_history = session.get(PathologicalHistory, pathological_history_id)
|
|
63
|
+
if not db_pathological_history:
|
|
64
|
+
return False
|
|
65
|
+
|
|
66
|
+
if soft_delete:
|
|
67
|
+
db_pathological_history.is_active = False
|
|
68
|
+
session.add(db_pathological_history)
|
|
69
|
+
else:
|
|
70
|
+
session.delete(db_pathological_history)
|
|
71
|
+
|
|
72
|
+
session.commit()
|
|
73
|
+
return True
|
|
@@ -3,8 +3,8 @@ from uuid import UUID
|
|
|
3
3
|
from sqlmodel import select
|
|
4
4
|
from sqlalchemy.orm import selectinload
|
|
5
5
|
|
|
6
|
-
from models import Pet
|
|
7
|
-
from config.db import engines, get_session
|
|
6
|
+
from healthdatalayer.models import Pet
|
|
7
|
+
from healthdatalayer.config.db import engines, get_session
|
|
8
8
|
|
|
9
9
|
class PetRepository:
|
|
10
10
|
def __init__(self, tenant: str):
|
|
@@ -2,8 +2,8 @@ from typing import Optional, List
|
|
|
2
2
|
from uuid import UUID
|
|
3
3
|
from sqlmodel import select
|
|
4
4
|
|
|
5
|
-
from models import Profession
|
|
6
|
-
from config.db import engines, get_session
|
|
5
|
+
from healthdatalayer.models import Profession
|
|
6
|
+
from healthdatalayer.config.db import engines, get_session
|
|
7
7
|
|
|
8
8
|
class ProfessionRepository:
|
|
9
9
|
|