healthdatalayer 1.5.4__py3-none-any.whl → 1.5.6__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,6 +1,6 @@
1
1
  from typing import Optional, List
2
2
  from uuid import UUID
3
- from sqlmodel import select
3
+ from sqlmodel import select, or_
4
4
 
5
5
  from healthdatalayer.models import MedicalDiagnosis
6
6
  from healthdatalayer.config.db import engines, get_session
@@ -32,9 +32,14 @@ class MedicalDiagnosisRepository:
32
32
  medical_diagnosis = session.exec(statement).first()
33
33
  return medical_diagnosis
34
34
 
35
- def get_by_name_ilike_command(self, name:str, active_only: bool = True) -> List[MedicalDiagnosis]:
35
+ def get_by_name_code_ilike_command(self, name:str, active_only: bool = True) -> List[MedicalDiagnosis]:
36
36
  with get_session(self.tenant) as session:
37
- statement = select(MedicalDiagnosis).where(MedicalDiagnosis.name.ilike(f"%{name}%"))
37
+ statement = select(MedicalDiagnosis).where(
38
+ or_(
39
+ MedicalDiagnosis.name.ilike(f"%{name}%"),
40
+ MedicalDiagnosis.cie_10_code.ilike(f"%{name}%")
41
+ )
42
+ )
38
43
 
39
44
  if active_only:
40
45
  statement = statement.where(MedicalDiagnosis.is_active == True)
@@ -96,7 +96,7 @@ class MedicalDiagnosisVisitRepository:
96
96
 
97
97
  def delete_command(self, medical_diagnosis_visit_id: UUID, soft_delete: bool = False)->None:
98
98
  with get_session(self.tenant) as session:
99
- existing_medical_diagnosis_visit = session.get(MedicalVisit, medical_diagnosis_visit_id)
99
+ existing_medical_diagnosis_visit = session.get(MedicalDiagnosisVisit, medical_diagnosis_visit_id)
100
100
  if not existing_medical_diagnosis_visit:
101
101
  raise ValueError(f"MedicalDiagnosisVisit with id {medical_diagnosis_visit_id} does not exist")
102
102
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: healthdatalayer
3
- Version: 1.5.4
3
+ Version: 1.5.6
4
4
  Summary: Health Datalayer to access data from different sources
5
5
  Author: Jesus Martinez
6
6
  Author-email: jesusmartinez@noosds.com
@@ -84,8 +84,8 @@ healthdatalayer/repositories/lab_repositories/__init__.py,sha256=47DEQpj8HBSa-_T
84
84
  healthdatalayer/repositories/lab_repositories/measure_lab_repository.py,sha256=AAwgGjaLWTqyH3YHTD_eisunn6I0E0GmYLEseuLgZ0Q,3174
85
85
  healthdatalayer/repositories/lab_repositories/medical_lab_repository.py,sha256=owZQe3cXKkXsRuGXpqPBXjZvA-DEb7yD1OKPMOCqF1o,10909
86
86
  healthdatalayer/repositories/medical_visit_repositories/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
- healthdatalayer/repositories/medical_visit_repositories/medical_diagnosis_repository.py,sha256=dnVW3hMUqrVGctBSNKVU2_j0ITH46aXN31XduELO8wg,4012
88
- healthdatalayer/repositories/medical_visit_repositories/medical_diagnosis_visit_repository.py,sha256=BHhglV8CBw4xpcLsFjRJPglg2D0ASnYD2k4RmbP80tU,5499
87
+ healthdatalayer/repositories/medical_visit_repositories/medical_diagnosis_repository.py,sha256=hwb5vh64ze72tFMSIUPNitC5t6pUCcO6pnI0gk-7LZU,4157
88
+ healthdatalayer/repositories/medical_visit_repositories/medical_diagnosis_visit_repository.py,sha256=5-QSverT7FN5nay2j_EevCqNAnuD--FTDVQnj0_WRhs,5508
89
89
  healthdatalayer/repositories/medical_visit_repositories/medical_drug_recipe_repository.py,sha256=6rubP_KtheyJSvLmpBJwYuPKNsjhSvKi-_HM2QoP1hM,3141
90
90
  healthdatalayer/repositories/medical_visit_repositories/medical_drug_repository.py,sha256=mJNN6_aAK3eY9IpFc16nT3IshObGcFE5fi27SK-Sjio,2401
91
91
  healthdatalayer/repositories/medical_visit_repositories/medical_recipe_visit_repository.py,sha256=j4cJ4zURKILN3lkqfpXya29MQYFIMiTmJukOADBj5_c,4551
@@ -97,7 +97,7 @@ healthdatalayer/repositories/user_repositories/__init__.py,sha256=47DEQpj8HBSa-_
97
97
  healthdatalayer/repositories/user_repositories/permission_repository.py,sha256=3L4y-zCkI2PIRo-L3FJRSk4g3nZnu6q35lEY4ACJyq4,9630
98
98
  healthdatalayer/repositories/user_repositories/role_repository.py,sha256=jIsbeAFFQQ_CZJqBMcOskuMXtT1Il6eiN0Y2BpVO1JE,6821
99
99
  healthdatalayer/repositories/user_repositories/user_repository.py,sha256=FUCNdRRGc12dq5XuwDT3btvDETt6HGXh_xQIPTLCAvk,9839
100
- healthdatalayer-1.5.4.dist-info/METADATA,sha256=bqu_siXQB-Xn2dwFXeurSFOXdCZT5SqIrZRA57b7Yxc,827
101
- healthdatalayer-1.5.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
102
- healthdatalayer-1.5.4.dist-info/top_level.txt,sha256=6f1-gvpg533UEVuYsRJCDhdSDQUBwijyAHylyS4nG_4,16
103
- healthdatalayer-1.5.4.dist-info/RECORD,,
100
+ healthdatalayer-1.5.6.dist-info/METADATA,sha256=xwmSyEECE2TIDHHg9pdvSc1g00YqxECv6_ADMQK8YBA,827
101
+ healthdatalayer-1.5.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
102
+ healthdatalayer-1.5.6.dist-info/top_level.txt,sha256=6f1-gvpg533UEVuYsRJCDhdSDQUBwijyAHylyS4nG_4,16
103
+ healthdatalayer-1.5.6.dist-info/RECORD,,