healthdatalayer 1.6.3__tar.gz → 1.7.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.6.3 → healthdatalayer-1.7.0}/PKG-INFO +1 -1
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/dtos/__init__.py +2 -1
- healthdatalayer-1.7.0/healthdatalayer/dtos/medical_visit/recipe_dto.py +16 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/px.py +7 -2
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/medical_visit/medical_drug.py +2 -6
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/medical_visit/medical_drug_recipe.py +10 -3
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/medical_visit/medical_recipe_visit.py +3 -3
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/client_repositories/px_repository.py +25 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/medical_visit_repositories/medical_recipe_visit_repository.py +58 -6
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/medical_visit_repositories/medical_visit_repository.py +11 -11
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer.egg-info/PKG-INFO +1 -1
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer.egg-info/SOURCES.txt +1 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/setup.py +1 -1
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/README.md +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/config/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/config/config.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/config/db.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/config/vault.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/dtos/collaborator/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/dtos/collaborator/schedule_collaborator.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/dtos/medical_visit/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/dtos/medical_visit/medical_certificate.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/bridge_area_floor_branch/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/bridge_area_floor_branch/area.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/bridge_area_floor_branch/branch.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/bridge_area_floor_branch/bridge_area_floor_branch.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/bridge_area_floor_branch/floor.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/bridge_area_floor_branch/room.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/bridge_area_floor_branch/system.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/address.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/city.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/client.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/client_type.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/education.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/emergency_contact.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/gender.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/marriage_status.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/nationality.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/pathological_history.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/pet.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/profession.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/state.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/collaborator/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/collaborator/collaborator.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/collaborator/collaborator_speciality.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/collaborator/collaborator_type.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/collaborator/speciality.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/lab/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/lab/client_lab.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/lab/measure_lab.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/lab/medical_lab.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/medical_visit/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/medical_visit/medical_diagnosis.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/medical_visit/medical_diagnosis_visit.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/medical_visit/medical_visit.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/medical_visit/organ_system_review.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/medical_visit/physical_exam.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/medical_visit/status_visit_enum.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/medical_visit/visit_triage.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/user/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/user/permission.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/user/permission_user.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/user/role.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/user/role_permission.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/user/role_user.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/user/user.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/client_repositories/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/client_repositories/address_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/client_repositories/client_type_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/client_repositories/education_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/client_repositories/emergency_contact_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/client_repositories/gender_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/client_repositories/marriage_status_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/client_repositories/nationality_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/client_repositories/pathological_history_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/client_repositories/pet_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/client_repositories/profession_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/collaborator_repositories/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/collaborator_repositories/collaborator_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/collaborator_repositories/collaborator_type_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/collaborator_repositories/speciality_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/infraestructure_repositories/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/infraestructure_repositories/area_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/infraestructure_repositories/branch_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/infraestructure_repositories/bridge_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/infraestructure_repositories/floor_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/infraestructure_repositories/room_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/infraestructure_repositories/system_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/lab_repositories/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/lab_repositories/measure_lab_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/lab_repositories/medical_lab_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/medical_visit_repositories/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/medical_visit_repositories/medical_diagnosis_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/medical_visit_repositories/medical_diagnosis_visit_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/medical_visit_repositories/medical_drug_recipe_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/medical_visit_repositories/medical_drug_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/medical_visit_repositories/organ_system_review_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/medical_visit_repositories/physical_exam_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/medical_visit_repositories/visit_triage_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/user_repositories/__init__.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/user_repositories/permission_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/user_repositories/role_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/repositories/user_repositories/user_repository.py +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer.egg-info/dependency_links.txt +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer.egg-info/requires.txt +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer.egg-info/top_level.txt +0 -0
- {healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/setup.cfg +0 -0
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
from .collaborator.schedule_collaborator import ScheduleCollaboratorDTO
|
|
2
|
-
from .medical_visit.medical_certificate import MedicalCertificateDTO, DiagnosisDTO, MedicalDiagnosesDTO
|
|
2
|
+
from .medical_visit.medical_certificate import MedicalCertificateDTO, DiagnosisDTO, MedicalDiagnosesDTO
|
|
3
|
+
from .medical_visit.recipe_dto import HeaderRecipe, RecipeMedicalDrugData
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
|
+
from typing import List, Optional
|
|
3
|
+
from datetime import date, datetime, time
|
|
4
|
+
|
|
5
|
+
class HeaderRecipe(BaseModel):
|
|
6
|
+
visit_date : Optional[datetime] = None
|
|
7
|
+
name_doctor : Optional[str] = None
|
|
8
|
+
ruc : Optional[str] = None
|
|
9
|
+
code : Optional[str] = None
|
|
10
|
+
first_name_px : Optional[str] = None
|
|
11
|
+
last_name_px : Optional[str] = None
|
|
12
|
+
|
|
13
|
+
class RecipeMedicalDrugData(BaseModel):
|
|
14
|
+
drug_name : Optional[str] = None
|
|
15
|
+
comment: Optional[str] = None
|
|
16
|
+
quantity :Optional[int] = None
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Optional, TYPE_CHECKING
|
|
1
|
+
from typing import Optional, TYPE_CHECKING, List
|
|
2
2
|
from sqlmodel import Field, Relationship
|
|
3
3
|
import uuid
|
|
4
4
|
|
|
@@ -7,6 +7,7 @@ from healthdatalayer.models import Client
|
|
|
7
7
|
|
|
8
8
|
if TYPE_CHECKING:
|
|
9
9
|
from healthdatalayer.models import ClientLab
|
|
10
|
+
from healthdatalayer.models import PathologicalHistory
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class Px(Client, table=True):
|
|
@@ -21,10 +22,14 @@ class Px(Client, table=True):
|
|
|
21
22
|
education_id: Optional[uuid.UUID] = Field(default=None, foreign_key="education.education_id")
|
|
22
23
|
user_id: Optional[uuid.UUID] = Field(default=None, foreign_key="user.user_id")
|
|
23
24
|
nationality_id: Optional[uuid.UUID] = Field(default=None, foreign_key="nationality.nationality_id")
|
|
25
|
+
pathological_histories: List["PathologicalHistory"] = Relationship(
|
|
26
|
+
back_populates="client",
|
|
27
|
+
sa_relationship_kwargs={"lazy": "selectin"}
|
|
28
|
+
)
|
|
24
29
|
|
|
25
30
|
Px.marriage_status = Relationship()
|
|
26
31
|
Px.profession = Relationship()
|
|
27
32
|
Px.education = Relationship()
|
|
28
33
|
Px.user = Relationship()
|
|
29
34
|
Px.nationality = Relationship()
|
|
30
|
-
Px.medical_labs = Relationship(back_populates="pxs", link_model="ClientLab")
|
|
35
|
+
Px.medical_labs = Relationship(back_populates="pxs", link_model="ClientLab")
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/medical_visit/medical_drug.py
RENAMED
|
@@ -5,8 +5,7 @@ from sqlmodel import SQLModel, Field, Relationship
|
|
|
5
5
|
|
|
6
6
|
from healthdatalayer.models.medical_visit.medical_drug_recipe import MedicalDrugRecipe
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
from healthdatalayer.models.medical_visit.medical_recipe_visit import MedicalRecipeVisit
|
|
8
|
+
|
|
10
9
|
|
|
11
10
|
class MedicalDrug(SQLModel, table=True):
|
|
12
11
|
__tablename__ = "medical_drug"
|
|
@@ -21,7 +20,4 @@ class MedicalDrug(SQLModel, table=True):
|
|
|
21
20
|
|
|
22
21
|
is_active: bool = Field(default=True)
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
back_populates="medical_drugs",
|
|
26
|
-
link_model=MedicalDrugRecipe
|
|
27
|
-
)
|
|
23
|
+
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import uuid
|
|
2
2
|
from datetime import datetime
|
|
3
|
-
from typing import Optional
|
|
4
|
-
from sqlmodel import SQLModel, Field
|
|
3
|
+
from typing import Optional, TYPE_CHECKING
|
|
4
|
+
from sqlmodel import SQLModel, Field, Relationship
|
|
5
|
+
|
|
6
|
+
#from healthdatalayer.models import MedicalDrug
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from healthdatalayer.models import MedicalRecipeVisit,MedicalDrug
|
|
5
9
|
|
|
6
10
|
class MedicalDrugRecipe(SQLModel, table=True):
|
|
7
11
|
__tablename__ = "medical_drug_recipe"
|
|
@@ -9,10 +13,13 @@ class MedicalDrugRecipe(SQLModel, table=True):
|
|
|
9
13
|
medical_drug_recipe_id:uuid.UUID=Field(default_factory=uuid.uuid4,primary_key=True)
|
|
10
14
|
|
|
11
15
|
medical_drug_id: uuid.UUID = Field(foreign_key="medical_drug.medical_drug_id", primary_key=True)
|
|
16
|
+
medical_drug: Optional["MedicalDrug"] = Relationship()
|
|
12
17
|
medical_recipe_visit_id: uuid.UUID = Field(foreign_key="medical_recipe_visit.medical_recipe_visit_id", primary_key=True)
|
|
18
|
+
medical_recipe_visit: Optional["MedicalRecipeVisit"] = Relationship()
|
|
13
19
|
|
|
14
20
|
quantity:int
|
|
15
21
|
suplied:bool
|
|
22
|
+
comment:Optional[str] = Field(default=None)
|
|
16
23
|
suplied_date: Optional[datetime] = Field(default=None)
|
|
17
|
-
|
|
24
|
+
|
|
18
25
|
is_active: bool = Field(default=True)
|
|
@@ -22,7 +22,7 @@ class MedicalRecipeVisit(SQLModel, table=True):
|
|
|
22
22
|
|
|
23
23
|
is_active: bool = Field(default=True)
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
back_populates="
|
|
27
|
-
|
|
25
|
+
medical_drug_recipes: List["MedicalDrugRecipe"] = Relationship(
|
|
26
|
+
back_populates="medical_recipe_visit",
|
|
27
|
+
sa_relationship_kwargs={"lazy": "selectin"}
|
|
28
28
|
)
|
|
@@ -57,6 +57,12 @@ class PxRepository:
|
|
|
57
57
|
from healthdatalayer.models.client.nationality import Nationality
|
|
58
58
|
user_obj = session.get(Nationality, px.nationality_id)
|
|
59
59
|
object.__setattr__(px, 'nationality', user_obj)
|
|
60
|
+
|
|
61
|
+
from healthdatalayer.models.client.pathological_history import PathologicalHistory
|
|
62
|
+
statement = select(PathologicalHistory).where(PathologicalHistory.client_id == px_id)
|
|
63
|
+
pathological_his = session.exec(statement).all()
|
|
64
|
+
if pathological_his:
|
|
65
|
+
object.__setattr__(px, 'pathological_histories',pathological_his)
|
|
60
66
|
|
|
61
67
|
return px
|
|
62
68
|
|
|
@@ -100,6 +106,13 @@ class PxRepository:
|
|
|
100
106
|
from healthdatalayer.models.client.nationality import Nationality
|
|
101
107
|
user_obj = session.get(Nationality, px.nationality_id)
|
|
102
108
|
object.__setattr__(px, 'nationality', user_obj)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
from healthdatalayer.models.client.pathological_history import PathologicalHistory
|
|
112
|
+
statement = select(PathologicalHistory).where(PathologicalHistory.client_id == px.client_id)
|
|
113
|
+
pathological_his = session.exec(statement).all()
|
|
114
|
+
if pathological_his:
|
|
115
|
+
object.__setattr__(px, 'pathological_histories',pathological_his)
|
|
103
116
|
|
|
104
117
|
|
|
105
118
|
return px
|
|
@@ -149,6 +162,12 @@ class PxRepository:
|
|
|
149
162
|
from healthdatalayer.models.client.nationality import Nationality
|
|
150
163
|
user_obj = session.get(Nationality, px.nationality_id)
|
|
151
164
|
object.__setattr__(px, 'nationality', user_obj)
|
|
165
|
+
|
|
166
|
+
from healthdatalayer.models.client.pathological_history import PathologicalHistory
|
|
167
|
+
statement = select(PathologicalHistory).where(PathologicalHistory.client_id == px.client_id)
|
|
168
|
+
pathological_his = session.exec(statement).all()
|
|
169
|
+
if pathological_his:
|
|
170
|
+
object.__setattr__(px, 'pathological_histories',pathological_his)
|
|
152
171
|
|
|
153
172
|
|
|
154
173
|
return results
|
|
@@ -198,6 +217,12 @@ class PxRepository:
|
|
|
198
217
|
from healthdatalayer.models.client.nationality import Nationality
|
|
199
218
|
user_obj = session.get(Nationality, px.nationality_id)
|
|
200
219
|
object.__setattr__(px, 'nationality', user_obj)
|
|
220
|
+
|
|
221
|
+
from healthdatalayer.models.client.pathological_history import PathologicalHistory
|
|
222
|
+
statement = select(PathologicalHistory).where(PathologicalHistory.client_id == px.client_id)
|
|
223
|
+
pathological_his = session.exec(statement).all()
|
|
224
|
+
if pathological_his:
|
|
225
|
+
object.__setattr__(px, 'pathological_histories',pathological_his)
|
|
201
226
|
|
|
202
227
|
|
|
203
228
|
return results
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
from typing import Optional, List
|
|
2
2
|
from uuid import UUID
|
|
3
|
-
from sqlmodel import select, or_
|
|
3
|
+
from sqlmodel import select, or_, text
|
|
4
4
|
from sqlalchemy.orm import selectinload,joinedload
|
|
5
|
-
from healthdatalayer.models import MedicalRecipeVisit
|
|
5
|
+
from healthdatalayer.models import MedicalRecipeVisit, MedicalDrugRecipe, MedicalDrug
|
|
6
|
+
from healthdatalayer.dtos import HeaderRecipe, RecipeMedicalDrugData
|
|
6
7
|
from healthdatalayer.config.db import engines, get_session
|
|
7
8
|
|
|
8
9
|
class MedicalRecipeVisitRepository:
|
|
@@ -24,7 +25,7 @@ class MedicalRecipeVisitRepository:
|
|
|
24
25
|
if load_relations:
|
|
25
26
|
statement = select(MedicalRecipeVisit).where(MedicalRecipeVisit.medical_recipe_visit_id == medical_recipe_visit_id).options(
|
|
26
27
|
joinedload(MedicalRecipeVisit.medical_visit),
|
|
27
|
-
|
|
28
|
+
selectinload(MedicalRecipeVisit.medical_drug_recipes).selectinload(MedicalDrugRecipe.medical_drug)
|
|
28
29
|
)
|
|
29
30
|
medical_recipe_visit = session.exec(statement).first()
|
|
30
31
|
|
|
@@ -38,7 +39,7 @@ class MedicalRecipeVisitRepository:
|
|
|
38
39
|
if load_relations:
|
|
39
40
|
statement = statement.options(
|
|
40
41
|
selectinload(MedicalRecipeVisit.medical_visit),
|
|
41
|
-
selectinload(MedicalRecipeVisit.
|
|
42
|
+
selectinload(MedicalRecipeVisit.medical_drug_recipes).selectinload(MedicalDrugRecipe.medical_drug)
|
|
42
43
|
)
|
|
43
44
|
medical_recipe_visit = session.exec(statement).first()
|
|
44
45
|
|
|
@@ -52,7 +53,7 @@ class MedicalRecipeVisitRepository:
|
|
|
52
53
|
|
|
53
54
|
statement = select(MedicalRecipeVisit).options(
|
|
54
55
|
selectinload(MedicalRecipeVisit.medical_visit),
|
|
55
|
-
selectinload(MedicalRecipeVisit.
|
|
56
|
+
selectinload(MedicalRecipeVisit.medical_drug_recipes).selectinload(MedicalDrugRecipe.medical_drug)
|
|
56
57
|
)
|
|
57
58
|
if active_only:
|
|
58
59
|
statement = statement.where(MedicalRecipeVisit.is_active == True)
|
|
@@ -90,4 +91,55 @@ class MedicalRecipeVisitRepository:
|
|
|
90
91
|
session.delete(existing_medical_recipe_visit)
|
|
91
92
|
|
|
92
93
|
session.commit()
|
|
93
|
-
|
|
94
|
+
|
|
95
|
+
def get_header_recipe_data(self, med_recipe_visit_id : str) ->Optional[HeaderRecipe]:
|
|
96
|
+
with get_session(self.tenant) as session:
|
|
97
|
+
query= text("""
|
|
98
|
+
select mv.visit_date, c."name" as name_doctor,
|
|
99
|
+
c.ruc, c.code,
|
|
100
|
+
px.first_name as first_name_px , px.last_name as last_name_px
|
|
101
|
+
from medical_recipe_visit mrv
|
|
102
|
+
join medical_visit mv on mv.medical_visit_id = mrv.medical_visit_id
|
|
103
|
+
join collaborator c on c.collaborator_id = mv.collaborator_id
|
|
104
|
+
join px on px.client_id = mv.client_id
|
|
105
|
+
where mrv.medical_recipe_visit_id = :med_recipe_visit_id
|
|
106
|
+
""")
|
|
107
|
+
result = session.exec(query, params={"med_recipe_visit_id": med_recipe_visit_id})
|
|
108
|
+
|
|
109
|
+
row = result.fetchone()
|
|
110
|
+
|
|
111
|
+
if not row:
|
|
112
|
+
raise ValueError(f"No se encontró la visita médica con ID: {med_recipe_visit_id}")
|
|
113
|
+
|
|
114
|
+
return HeaderRecipe(
|
|
115
|
+
visit_date=row[0],
|
|
116
|
+
name_doctor=row[1],
|
|
117
|
+
ruc=row[2],
|
|
118
|
+
code=row[3],
|
|
119
|
+
first_name_px=row[4],
|
|
120
|
+
last_name_px=row[5]
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
def get_recipe_drugs_data(self, med_recipe_visit_id : str) ->List[RecipeMedicalDrugData]:
|
|
124
|
+
with get_session(self.tenant) as session:
|
|
125
|
+
query = text("""
|
|
126
|
+
select md.drug_name, mdr."comment", mdr.quantity from medical_recipe_visit mrv
|
|
127
|
+
left join medical_drug_recipe mdr on mrv.medical_recipe_visit_id = mdr.medical_recipe_visit_id
|
|
128
|
+
left join medical_drug md on md.medical_drug_id = mdr.medical_drug_id
|
|
129
|
+
where mrv.medical_recipe_visit_id = :med_recipe_visit_id
|
|
130
|
+
""")
|
|
131
|
+
|
|
132
|
+
result = session.exec(query, params={"med_recipe_visit_id": med_recipe_visit_id})
|
|
133
|
+
rows = result.fetchall()
|
|
134
|
+
|
|
135
|
+
# Convertir cada fila a DiagnosisDTO
|
|
136
|
+
recipe_list = []
|
|
137
|
+
for row in rows:
|
|
138
|
+
diagnosis = RecipeMedicalDrugData(
|
|
139
|
+
drug_name=row[0],
|
|
140
|
+
comment=row[1],
|
|
141
|
+
quantity=row[2]
|
|
142
|
+
)
|
|
143
|
+
recipe_list.append(diagnosis)
|
|
144
|
+
|
|
145
|
+
return recipe_list
|
|
@@ -3,7 +3,7 @@ from datetime import datetime, date, time
|
|
|
3
3
|
from uuid import UUID
|
|
4
4
|
from sqlmodel import select, text
|
|
5
5
|
from sqlalchemy.orm import selectinload,joinedload
|
|
6
|
-
from healthdatalayer.models import MedicalVisit
|
|
6
|
+
from healthdatalayer.models import MedicalVisit,MedicalDiagnosisVisit
|
|
7
7
|
from healthdatalayer.dtos import MedicalCertificateDTO, DiagnosisDTO, MedicalDiagnosesDTO
|
|
8
8
|
from healthdatalayer.config.db import engines, get_session
|
|
9
9
|
|
|
@@ -28,7 +28,7 @@ class MedicalVisitRepository:
|
|
|
28
28
|
joinedload(MedicalVisit.client),
|
|
29
29
|
joinedload(MedicalVisit.collaborator),
|
|
30
30
|
joinedload(MedicalVisit.speciality),
|
|
31
|
-
selectinload(MedicalVisit.medical_diagnosis_visits),
|
|
31
|
+
selectinload(MedicalVisit.medical_diagnosis_visits).selectinload(MedicalDiagnosisVisit.medical_diagnosis),
|
|
32
32
|
selectinload(MedicalVisit.medical_recipe_visits),
|
|
33
33
|
selectinload(MedicalVisit.organ_system_reviews),
|
|
34
34
|
selectinload(MedicalVisit.physical_exams)
|
|
@@ -73,7 +73,7 @@ class MedicalVisitRepository:
|
|
|
73
73
|
joinedload(MedicalVisit.client),
|
|
74
74
|
joinedload(MedicalVisit.collaborator),
|
|
75
75
|
joinedload(MedicalVisit.speciality),
|
|
76
|
-
selectinload(MedicalVisit.medical_diagnosis_visits),
|
|
76
|
+
selectinload(MedicalVisit.medical_diagnosis_visits).selectinload(MedicalDiagnosisVisit.medical_diagnosis),
|
|
77
77
|
selectinload(MedicalVisit.medical_recipe_visits),
|
|
78
78
|
selectinload(MedicalVisit.organ_system_reviews),
|
|
79
79
|
selectinload(MedicalVisit.physical_exams)
|
|
@@ -93,7 +93,7 @@ class MedicalVisitRepository:
|
|
|
93
93
|
joinedload(MedicalVisit.client),
|
|
94
94
|
joinedload(MedicalVisit.collaborator),
|
|
95
95
|
joinedload(MedicalVisit.speciality),
|
|
96
|
-
selectinload(MedicalVisit.medical_diagnosis_visits),
|
|
96
|
+
selectinload(MedicalVisit.medical_diagnosis_visits).selectinload(MedicalDiagnosisVisit.medical_diagnosis),
|
|
97
97
|
selectinload(MedicalVisit.medical_recipe_visits),
|
|
98
98
|
selectinload(MedicalVisit.organ_system_reviews),
|
|
99
99
|
selectinload(MedicalVisit.physical_exams)
|
|
@@ -137,7 +137,7 @@ class MedicalVisitRepository:
|
|
|
137
137
|
joinedload(MedicalVisit.client),
|
|
138
138
|
joinedload(MedicalVisit.collaborator),
|
|
139
139
|
joinedload(MedicalVisit.speciality),
|
|
140
|
-
selectinload(MedicalVisit.medical_diagnosis_visits),
|
|
140
|
+
selectinload(MedicalVisit.medical_diagnosis_visits).selectinload(MedicalDiagnosisVisit.medical_diagnosis),
|
|
141
141
|
selectinload(MedicalVisit.medical_recipe_visits),
|
|
142
142
|
selectinload(MedicalVisit.organ_system_reviews),
|
|
143
143
|
selectinload(MedicalVisit.physical_exams)
|
|
@@ -173,7 +173,7 @@ class MedicalVisitRepository:
|
|
|
173
173
|
joinedload(MedicalVisit.client),
|
|
174
174
|
joinedload(MedicalVisit.collaborator),
|
|
175
175
|
joinedload(MedicalVisit.speciality),
|
|
176
|
-
selectinload(MedicalVisit.medical_diagnosis_visits),
|
|
176
|
+
selectinload(MedicalVisit.medical_diagnosis_visits).selectinload(MedicalDiagnosisVisit.medical_diagnosis),
|
|
177
177
|
selectinload(MedicalVisit.medical_recipe_visits),
|
|
178
178
|
selectinload(MedicalVisit.organ_system_reviews),
|
|
179
179
|
selectinload(MedicalVisit.physical_exams)
|
|
@@ -198,7 +198,7 @@ class MedicalVisitRepository:
|
|
|
198
198
|
joinedload(MedicalVisit.client),
|
|
199
199
|
joinedload(MedicalVisit.collaborator),
|
|
200
200
|
joinedload(MedicalVisit.speciality),
|
|
201
|
-
selectinload(MedicalVisit.medical_diagnosis_visits),
|
|
201
|
+
selectinload(MedicalVisit.medical_diagnosis_visits).selectinload(MedicalDiagnosisVisit.medical_diagnosis),
|
|
202
202
|
selectinload(MedicalVisit.medical_recipe_visits),
|
|
203
203
|
selectinload(MedicalVisit.organ_system_reviews),
|
|
204
204
|
selectinload(MedicalVisit.physical_exams)
|
|
@@ -235,7 +235,7 @@ class MedicalVisitRepository:
|
|
|
235
235
|
joinedload(MedicalVisit.client),
|
|
236
236
|
joinedload(MedicalVisit.collaborator),
|
|
237
237
|
joinedload(MedicalVisit.speciality),
|
|
238
|
-
selectinload(MedicalVisit.medical_diagnosis_visits),
|
|
238
|
+
selectinload(MedicalVisit.medical_diagnosis_visits).selectinload(MedicalDiagnosisVisit.medical_diagnosis),
|
|
239
239
|
selectinload(MedicalVisit.medical_recipe_visits),
|
|
240
240
|
selectinload(MedicalVisit.organ_system_reviews),
|
|
241
241
|
selectinload(MedicalVisit.physical_exams)
|
|
@@ -259,7 +259,7 @@ class MedicalVisitRepository:
|
|
|
259
259
|
joinedload(MedicalVisit.client),
|
|
260
260
|
joinedload(MedicalVisit.collaborator),
|
|
261
261
|
joinedload(MedicalVisit.speciality),
|
|
262
|
-
selectinload(MedicalVisit.medical_diagnosis_visits),
|
|
262
|
+
selectinload(MedicalVisit.medical_diagnosis_visits).selectinload(MedicalDiagnosisVisit.medical_diagnosis),
|
|
263
263
|
selectinload(MedicalVisit.medical_recipe_visits),
|
|
264
264
|
selectinload(MedicalVisit.organ_system_reviews),
|
|
265
265
|
selectinload(MedicalVisit.physical_exams)
|
|
@@ -280,7 +280,7 @@ class MedicalVisitRepository:
|
|
|
280
280
|
joinedload(MedicalVisit.client),
|
|
281
281
|
joinedload(MedicalVisit.collaborator),
|
|
282
282
|
joinedload(MedicalVisit.speciality),
|
|
283
|
-
selectinload(MedicalVisit.medical_diagnosis_visits),
|
|
283
|
+
selectinload(MedicalVisit.medical_diagnosis_visits).selectinload(MedicalDiagnosisVisit.medical_diagnosis),
|
|
284
284
|
selectinload(MedicalVisit.medical_recipe_visits),
|
|
285
285
|
selectinload(MedicalVisit.organ_system_reviews),
|
|
286
286
|
selectinload(MedicalVisit.physical_exams)
|
|
@@ -301,7 +301,7 @@ class MedicalVisitRepository:
|
|
|
301
301
|
joinedload(MedicalVisit.client),
|
|
302
302
|
joinedload(MedicalVisit.collaborator),
|
|
303
303
|
joinedload(MedicalVisit.speciality),
|
|
304
|
-
selectinload(MedicalVisit.medical_diagnosis_visits),
|
|
304
|
+
selectinload(MedicalVisit.medical_diagnosis_visits).selectinload(MedicalDiagnosisVisit.medical_diagnosis),
|
|
305
305
|
selectinload(MedicalVisit.medical_recipe_visits),
|
|
306
306
|
selectinload(MedicalVisit.organ_system_reviews),
|
|
307
307
|
selectinload(MedicalVisit.physical_exams)
|
|
@@ -15,6 +15,7 @@ healthdatalayer/dtos/collaborator/__init__.py
|
|
|
15
15
|
healthdatalayer/dtos/collaborator/schedule_collaborator.py
|
|
16
16
|
healthdatalayer/dtos/medical_visit/__init__.py
|
|
17
17
|
healthdatalayer/dtos/medical_visit/medical_certificate.py
|
|
18
|
+
healthdatalayer/dtos/medical_visit/recipe_dto.py
|
|
18
19
|
healthdatalayer/models/__init__.py
|
|
19
20
|
healthdatalayer/models/bridge_area_floor_branch/__init__.py
|
|
20
21
|
healthdatalayer/models/bridge_area_floor_branch/area.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/dtos/collaborator/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/dtos/medical_visit/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/client_type.py
RENAMED
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/emergency_contact.py
RENAMED
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/marriage_status.py
RENAMED
|
File without changes
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/client/nationality.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/collaborator/__init__.py
RENAMED
|
File without changes
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/collaborator/collaborator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/collaborator/speciality.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/medical_visit/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/medical_visit/visit_triage.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/user/permission_user.py
RENAMED
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer/models/user/role_permission.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.3 → healthdatalayer-1.7.0}/healthdatalayer.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|