healthdatalayer 1.6.2__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.

@@ -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
@@ -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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: healthdatalayer
3
- Version: 1.6.2
3
+ Version: 1.6.3
4
4
  Summary: Health Datalayer to access data from different sources
5
5
  Author: Jesus Martinez
6
6
  Author-email: jesusmartinez@noosds.com
@@ -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=6KxXXnebS8tgfI6l2Fd7nuQL88wfCKU3tmtigbLjgKM,140
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=7Kgn95WXXQ_rLXtr-N20hXFs_0DsKAVai0rIwbOk2JQ,1404
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
@@ -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=beTd34sFQx_r4FwUQ1dePdWbJlllVdCCotl3ffP5ZBY,23288
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.2.dist-info/METADATA,sha256=QOC65F9ClnWGl1E3T4-VDFsIg_Y9aDKZ2zq8tyYl8RE,827
103
- healthdatalayer-1.6.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
104
- healthdatalayer-1.6.2.dist-info/top_level.txt,sha256=6f1-gvpg533UEVuYsRJCDhdSDQUBwijyAHylyS4nG_4,16
105
- healthdatalayer-1.6.2.dist-info/RECORD,,
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,,