healthdatalayer 1.6.1__py3-none-any.whl → 1.6.3__py3-none-any.whl
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/dtos/__init__.py +1 -1
- healthdatalayer/dtos/medical_visit/medical_certificate.py +12 -1
- healthdatalayer/repositories/client_repositories/px_repository.py +23 -1
- healthdatalayer/repositories/medical_visit_repositories/medical_visit_repository.py +30 -2
- {healthdatalayer-1.6.1.dist-info → healthdatalayer-1.6.3.dist-info}/METADATA +1 -1
- {healthdatalayer-1.6.1.dist-info → healthdatalayer-1.6.3.dist-info}/RECORD +8 -8
- {healthdatalayer-1.6.1.dist-info → healthdatalayer-1.6.3.dist-info}/WHEEL +0 -0
- {healthdatalayer-1.6.1.dist-info → healthdatalayer-1.6.3.dist-info}/top_level.txt +0 -0
healthdatalayer/dtos/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
from .collaborator.schedule_collaborator import ScheduleCollaboratorDTO
|
|
2
|
-
from .medical_visit.medical_certificate import MedicalCertificateDTO
|
|
2
|
+
from .medical_visit.medical_certificate import MedicalCertificateDTO, DiagnosisDTO, MedicalDiagnosesDTO
|
|
@@ -48,4 +48,15 @@ class MedicalCertificateDTO(BaseModel):
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
doctor_name: Optional[str] = None
|
|
51
|
-
doctor_ruc: Optional[str] = None
|
|
51
|
+
doctor_ruc: Optional[str] = None
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class DiagnosisDTO(BaseModel):
|
|
55
|
+
name_diagnosis: str
|
|
56
|
+
cie_10_code: Optional[str] = None
|
|
57
|
+
|
|
58
|
+
class MedicalDiagnosesDTO(BaseModel):
|
|
59
|
+
diagnoses: List[DiagnosisDTO]
|
|
60
|
+
|
|
61
|
+
class Config:
|
|
62
|
+
from_attributes = True
|
|
@@ -52,6 +52,11 @@ class PxRepository:
|
|
|
52
52
|
from healthdatalayer.models.user.user import User
|
|
53
53
|
user_obj = session.get(User, px.user_id)
|
|
54
54
|
object.__setattr__(px, 'user', user_obj)
|
|
55
|
+
|
|
56
|
+
if px.nationality_id:
|
|
57
|
+
from healthdatalayer.models.client.nationality import Nationality
|
|
58
|
+
user_obj = session.get(Nationality, px.nationality_id)
|
|
59
|
+
object.__setattr__(px, 'nationality', user_obj)
|
|
55
60
|
|
|
56
61
|
return px
|
|
57
62
|
|
|
@@ -90,6 +95,12 @@ class PxRepository:
|
|
|
90
95
|
from healthdatalayer.models.user.user import User
|
|
91
96
|
user_obj = session.get(User, px.user_id)
|
|
92
97
|
object.__setattr__(px, 'user', user_obj)
|
|
98
|
+
|
|
99
|
+
if px.nationality_id:
|
|
100
|
+
from healthdatalayer.models.client.nationality import Nationality
|
|
101
|
+
user_obj = session.get(Nationality, px.nationality_id)
|
|
102
|
+
object.__setattr__(px, 'nationality', user_obj)
|
|
103
|
+
|
|
93
104
|
|
|
94
105
|
return px
|
|
95
106
|
|
|
@@ -134,7 +145,12 @@ class PxRepository:
|
|
|
134
145
|
from healthdatalayer.models.user.user import User
|
|
135
146
|
user_obj = session.get(User, px.user_id)
|
|
136
147
|
object.__setattr__(px, 'user', user_obj)
|
|
137
|
-
|
|
148
|
+
if px.nationality_id:
|
|
149
|
+
from healthdatalayer.models.client.nationality import Nationality
|
|
150
|
+
user_obj = session.get(Nationality, px.nationality_id)
|
|
151
|
+
object.__setattr__(px, 'nationality', user_obj)
|
|
152
|
+
|
|
153
|
+
|
|
138
154
|
return results
|
|
139
155
|
|
|
140
156
|
def list_all_command(self, active_only: bool = True, load_relations: bool = False) -> List[Px]:
|
|
@@ -177,6 +193,12 @@ class PxRepository:
|
|
|
177
193
|
from healthdatalayer.models.user.user import User
|
|
178
194
|
user_obj = session.get(User, px.user_id)
|
|
179
195
|
object.__setattr__(px, 'user', user_obj)
|
|
196
|
+
|
|
197
|
+
if px.nationality_id:
|
|
198
|
+
from healthdatalayer.models.client.nationality import Nationality
|
|
199
|
+
user_obj = session.get(Nationality, px.nationality_id)
|
|
200
|
+
object.__setattr__(px, 'nationality', user_obj)
|
|
201
|
+
|
|
180
202
|
|
|
181
203
|
return results
|
|
182
204
|
|
|
@@ -4,7 +4,7 @@ from uuid import UUID
|
|
|
4
4
|
from sqlmodel import select, text
|
|
5
5
|
from sqlalchemy.orm import selectinload,joinedload
|
|
6
6
|
from healthdatalayer.models import MedicalVisit
|
|
7
|
-
from healthdatalayer.dtos import MedicalCertificateDTO
|
|
7
|
+
from healthdatalayer.dtos import MedicalCertificateDTO, DiagnosisDTO, MedicalDiagnosesDTO
|
|
8
8
|
from healthdatalayer.config.db import engines, get_session
|
|
9
9
|
|
|
10
10
|
class MedicalVisitRepository:
|
|
@@ -478,4 +478,32 @@ class MedicalVisitRepository:
|
|
|
478
478
|
rest_date_end_spanish=row[27],
|
|
479
479
|
doctor_name=row[28],
|
|
480
480
|
doctor_ruc=row[29]
|
|
481
|
-
)
|
|
481
|
+
)
|
|
482
|
+
|
|
483
|
+
def get_medical_diagnoses_command(self, medical_visit_id: str) -> MedicalDiagnosesDTO:
|
|
484
|
+
|
|
485
|
+
with get_session(self.tenant) as session:
|
|
486
|
+
|
|
487
|
+
query = text("""
|
|
488
|
+
select md."name" as name_diagnosis,
|
|
489
|
+
md.cie_10_code
|
|
490
|
+
from medical_diagnosis md
|
|
491
|
+
join medical_diagnosis_visit mdv on mdv.medical_diagnosis_id = md.medical_diagnosis_id
|
|
492
|
+
where md.is_active = true
|
|
493
|
+
and mdv.is_active = true
|
|
494
|
+
and mdv.medical_visit_id = :medical_visit_id
|
|
495
|
+
""")
|
|
496
|
+
|
|
497
|
+
result = session.exec(query, params={"medical_visit_id": medical_visit_id})
|
|
498
|
+
rows = result.fetchall()
|
|
499
|
+
|
|
500
|
+
# Convertir cada fila a DiagnosisDTO
|
|
501
|
+
diagnoses_list = []
|
|
502
|
+
for row in rows:
|
|
503
|
+
diagnosis = DiagnosisDTO(
|
|
504
|
+
name_diagnosis=row[0],
|
|
505
|
+
cie_10_code=row[1]
|
|
506
|
+
)
|
|
507
|
+
diagnoses_list.append(diagnosis)
|
|
508
|
+
|
|
509
|
+
return MedicalDiagnosesDTO(diagnoses=diagnoses_list)
|
|
@@ -3,11 +3,11 @@ healthdatalayer/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
3
3
|
healthdatalayer/config/config.py,sha256=vyqrlHDgCGpYX7V9fDn4g671lUU1RuWlSYCIazI-SqQ,689
|
|
4
4
|
healthdatalayer/config/db.py,sha256=b_SWTINJSVUhR0uyD4h93jPLKUzRm6Ky0tmALWbjM18,342
|
|
5
5
|
healthdatalayer/config/vault.py,sha256=9yUMXjaTYSnqr0npcQXDsg6Z7G3DityqpmHl1x42zS0,748
|
|
6
|
-
healthdatalayer/dtos/__init__.py,sha256=
|
|
6
|
+
healthdatalayer/dtos/__init__.py,sha256=AVQURjKBjhSm5d4av-_K__gJWPbSKaKxLbZFu6H-dIM,175
|
|
7
7
|
healthdatalayer/dtos/collaborator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
healthdatalayer/dtos/collaborator/schedule_collaborator.py,sha256=SUD7BIMownZuW9h9GUaFy2U9jaDjZ1tB_9-KCv4H0mk,369
|
|
9
9
|
healthdatalayer/dtos/medical_visit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
healthdatalayer/dtos/medical_visit/medical_certificate.py,sha256=
|
|
10
|
+
healthdatalayer/dtos/medical_visit/medical_certificate.py,sha256=xMROlxFe7o8RMPzVbTTDeJCmy4jyd6b79A5VP2IXrhM,1622
|
|
11
11
|
healthdatalayer/models/__init__.py,sha256=Hz31SDpnjtFZZcf_uLt0MuGqE-_P2ZIsZlPQ_YYaetk,2117
|
|
12
12
|
healthdatalayer/models/bridge_area_floor_branch/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
healthdatalayer/models/bridge_area_floor_branch/area.py,sha256=g_u6RoorLJ7XUx7qcqXLavrHxpflHGi0p77f-3RPbVU,201
|
|
@@ -70,7 +70,7 @@ healthdatalayer/repositories/client_repositories/nationality_repository.py,sha25
|
|
|
70
70
|
healthdatalayer/repositories/client_repositories/pathological_history_repository.py,sha256=RabXI8VCWHUHlHwtrYm2vQE_eyep2wrzOsemgYa5NPY,3082
|
|
71
71
|
healthdatalayer/repositories/client_repositories/pet_repository.py,sha256=aUjti4bUniQbbUz5-bjgvUgDrSpPyggy9k5e-RAoYgc,4802
|
|
72
72
|
healthdatalayer/repositories/client_repositories/profession_repository.py,sha256=ALnx_y_z9Jfx9rBDvOdnK1P1_lkqKmFBeR1GVXj3m3Q,2620
|
|
73
|
-
healthdatalayer/repositories/client_repositories/px_repository.py,sha256=
|
|
73
|
+
healthdatalayer/repositories/client_repositories/px_repository.py,sha256=vUcpc88LBTcQ4HlH_OGBXggwMGxCkND6U5b0J9oCSto,11330
|
|
74
74
|
healthdatalayer/repositories/collaborator_repositories/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
75
75
|
healthdatalayer/repositories/collaborator_repositories/collaborator_repository.py,sha256=jSKoM46Rp4MDjI1cotr2setidP9su8GKZBC5EsIr6Po,8329
|
|
76
76
|
healthdatalayer/repositories/collaborator_repositories/collaborator_type_repository.py,sha256=7-bJqbxgsJtyRU7nV_YCZhKufYLlighWBWjglw70nUw,2858
|
|
@@ -91,7 +91,7 @@ healthdatalayer/repositories/medical_visit_repositories/medical_diagnosis_visit_
|
|
|
91
91
|
healthdatalayer/repositories/medical_visit_repositories/medical_drug_recipe_repository.py,sha256=fZViKSu21mYihn3C4p7f7wqZkePoHi-Mm5ZI38XpSvw,3330
|
|
92
92
|
healthdatalayer/repositories/medical_visit_repositories/medical_drug_repository.py,sha256=woyrx4vuV7hpxS9WOZNmCTsfWrZiXoMV2__x9lTqPJY,3011
|
|
93
93
|
healthdatalayer/repositories/medical_visit_repositories/medical_recipe_visit_repository.py,sha256=j4cJ4zURKILN3lkqfpXya29MQYFIMiTmJukOADBj5_c,4551
|
|
94
|
-
healthdatalayer/repositories/medical_visit_repositories/medical_visit_repository.py,sha256=
|
|
94
|
+
healthdatalayer/repositories/medical_visit_repositories/medical_visit_repository.py,sha256=cU0qa4YgYkdFtJy-uWcThb9o0YwD0eAMaXbLrXNv-0Y,24442
|
|
95
95
|
healthdatalayer/repositories/medical_visit_repositories/organ_system_review_repository.py,sha256=7QNxpQIFcD6B8CX5fua8Qck75j24Y4uEkR_Lans1_0A,4197
|
|
96
96
|
healthdatalayer/repositories/medical_visit_repositories/physical_exam_repository.py,sha256=eCdokx60LB5hLfloqFhvsDj8UxFYXEDi6nqXO0TB18w,3877
|
|
97
97
|
healthdatalayer/repositories/medical_visit_repositories/visit_triage_repository.py,sha256=9Up5M7wWo5GnaYdl6QvTamYaIG4dG_ALM0Su66rlj44,4140
|
|
@@ -99,7 +99,7 @@ healthdatalayer/repositories/user_repositories/__init__.py,sha256=47DEQpj8HBSa-_
|
|
|
99
99
|
healthdatalayer/repositories/user_repositories/permission_repository.py,sha256=3L4y-zCkI2PIRo-L3FJRSk4g3nZnu6q35lEY4ACJyq4,9630
|
|
100
100
|
healthdatalayer/repositories/user_repositories/role_repository.py,sha256=jIsbeAFFQQ_CZJqBMcOskuMXtT1Il6eiN0Y2BpVO1JE,6821
|
|
101
101
|
healthdatalayer/repositories/user_repositories/user_repository.py,sha256=FUCNdRRGc12dq5XuwDT3btvDETt6HGXh_xQIPTLCAvk,9839
|
|
102
|
-
healthdatalayer-1.6.
|
|
103
|
-
healthdatalayer-1.6.
|
|
104
|
-
healthdatalayer-1.6.
|
|
105
|
-
healthdatalayer-1.6.
|
|
102
|
+
healthdatalayer-1.6.3.dist-info/METADATA,sha256=oHWdfM-z8Sk-_PcLxWOoviRbPqhRtGD_ZqYda0Mkpz0,827
|
|
103
|
+
healthdatalayer-1.6.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
104
|
+
healthdatalayer-1.6.3.dist-info/top_level.txt,sha256=6f1-gvpg533UEVuYsRJCDhdSDQUBwijyAHylyS4nG_4,16
|
|
105
|
+
healthdatalayer-1.6.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|