healthdatalayer 1.4.0__py3-none-any.whl → 1.4.2__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,9 +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_, join
4
4
  from sqlalchemy.orm import selectinload,joinedload
5
5
  from healthdatalayer.models import Collaborator
6
- from healthdatalayer.models import Speciality
6
+ from healthdatalayer.models import Speciality, CollaboratorSpeciality
7
7
  from healthdatalayer.config.db import engines, get_session
8
8
 
9
9
  class CollaboratorRepository:
@@ -41,6 +41,21 @@ class CollaboratorRepository:
41
41
  return collaborator
42
42
  else:
43
43
  return session.get(Collaborator, collaborator_id)
44
+
45
+ def get_by_speciality_id_command(self, speciality_id: UUID, load_relations: bool = False) -> List[Collaborator]:
46
+ with get_session(self.tenant) as session:
47
+ statement = (
48
+ select(Collaborator)
49
+ .join(CollaboratorSpeciality)
50
+ .where(CollaboratorSpeciality.speciality_id == speciality_id)
51
+ )
52
+
53
+ if load_relations:
54
+ statement = statement.options(selectinload(Collaborator.specialties))
55
+
56
+ collaborators = session.exec(statement).all()
57
+
58
+ return collaborators
44
59
 
45
60
  def get_by_ruc_name_code_command(self, content: str, active_only: bool = True, load_relations : bool = False)->List[Collaborator]:
46
61
  with get_session(self.tenant) as session:
@@ -27,7 +27,8 @@ class BridgeAreaFloorBranchRepository:
27
27
  statement = statement.options(
28
28
  selectinload(BridgeAreaFloorBranch.branch).selectinload(Branch.system),
29
29
  selectinload(BridgeAreaFloorBranch.area),
30
- selectinload(BridgeAreaFloorBranch.floor)
30
+ selectinload(BridgeAreaFloorBranch.floor),
31
+ selectinload(BridgeAreaFloorBranch.room)
31
32
  )
32
33
  bridge = session.exec(statement).first()
33
34
 
@@ -45,7 +46,8 @@ class BridgeAreaFloorBranchRepository:
45
46
  statement = statement.options(
46
47
  selectinload(BridgeAreaFloorBranch.branch).selectinload(Branch.system),
47
48
  selectinload(BridgeAreaFloorBranch.area),
48
- selectinload(BridgeAreaFloorBranch.floor)
49
+ selectinload(BridgeAreaFloorBranch.floor),
50
+ selectinload(BridgeAreaFloorBranch.room)
49
51
  )
50
52
 
51
53
  results = session.exec(statement).all()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: healthdatalayer
3
- Version: 1.4.0
3
+ Version: 1.4.2
4
4
  Summary: Health Datalayer to access data from different sources
5
5
  Author: Jesus Martinez
6
6
  Author-email: jesusmartinez@noosds.com
@@ -64,13 +64,13 @@ healthdatalayer/repositories/client_repositories/pet_repository.py,sha256=aUjti4
64
64
  healthdatalayer/repositories/client_repositories/profession_repository.py,sha256=ALnx_y_z9Jfx9rBDvOdnK1P1_lkqKmFBeR1GVXj3m3Q,2620
65
65
  healthdatalayer/repositories/client_repositories/px_repository.py,sha256=cTXDfKolG5aLdlQzXV98_r4Y1Qm5jYW9cUtntdw7e0k,10116
66
66
  healthdatalayer/repositories/collaborator_repositories/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
- healthdatalayer/repositories/collaborator_repositories/collaborator_repository.py,sha256=61c3xFzjRm0_XT8FDQ2hA6tD_ruRVQjWhAPn8JBci18,6898
67
+ healthdatalayer/repositories/collaborator_repositories/collaborator_repository.py,sha256=JB0UdtUEJEY8y33EIT51wHNytroXw_4aVg1U4KmGmGw,7572
68
68
  healthdatalayer/repositories/collaborator_repositories/collaborator_type_repository.py,sha256=7-bJqbxgsJtyRU7nV_YCZhKufYLlighWBWjglw70nUw,2858
69
69
  healthdatalayer/repositories/collaborator_repositories/speciality_repository.py,sha256=tcAjp2OzFAnHpRKNdmw2Zsqvs7XdsO51h7cIJHt105s,2940
70
70
  healthdatalayer/repositories/infraestructure_repositories/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
71
71
  healthdatalayer/repositories/infraestructure_repositories/area_repository.py,sha256=Ubnir4Vc-ViglmE1KclOnLb_4ZkYPhwALmgWJ76Tr0Y,2393
72
72
  healthdatalayer/repositories/infraestructure_repositories/branch_repository.py,sha256=iW0483qD0AXK0cSZ5qHvF-aFnkI8oYLUVfPdFyNBIOQ,2467
73
- healthdatalayer/repositories/infraestructure_repositories/bridge_repository.py,sha256=QON-qsmTPnHeRteXtnO01J6-AQEhXuZh41ilPyrDi9I,3534
73
+ healthdatalayer/repositories/infraestructure_repositories/bridge_repository.py,sha256=dHqWVTxOON3jF-4XZqLmb2unlIlAg-vkU9TPI4kChTo,3658
74
74
  healthdatalayer/repositories/infraestructure_repositories/floor_repository.py,sha256=03GuTBI9X1u2zdASEv7t9O2CO7fz6-86Qdj0s11SqhU,2430
75
75
  healthdatalayer/repositories/infraestructure_repositories/room_repository.py,sha256=QBN5xSKGj9I2Is1NE6eKpUBkSgTj0yB2Y8y_tZfWQVU,2393
76
76
  healthdatalayer/repositories/infraestructure_repositories/system_repository.py,sha256=msEN6VuoCJL2zBQ2FaB7mZjKZJcAcle4lGVy3Sn83QE,2467
@@ -91,7 +91,7 @@ healthdatalayer/repositories/user_repositories/__init__.py,sha256=47DEQpj8HBSa-_
91
91
  healthdatalayer/repositories/user_repositories/permission_repository.py,sha256=3L4y-zCkI2PIRo-L3FJRSk4g3nZnu6q35lEY4ACJyq4,9630
92
92
  healthdatalayer/repositories/user_repositories/role_repository.py,sha256=jIsbeAFFQQ_CZJqBMcOskuMXtT1Il6eiN0Y2BpVO1JE,6821
93
93
  healthdatalayer/repositories/user_repositories/user_repository.py,sha256=FUCNdRRGc12dq5XuwDT3btvDETt6HGXh_xQIPTLCAvk,9839
94
- healthdatalayer-1.4.0.dist-info/METADATA,sha256=ROGIK8-I3x00Ubf9wHNG6nFtLPSlLJdZw2R6ag-X2eA,827
95
- healthdatalayer-1.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
96
- healthdatalayer-1.4.0.dist-info/top_level.txt,sha256=6f1-gvpg533UEVuYsRJCDhdSDQUBwijyAHylyS4nG_4,16
97
- healthdatalayer-1.4.0.dist-info/RECORD,,
94
+ healthdatalayer-1.4.2.dist-info/METADATA,sha256=gP7YXWYYDnmmDfIUJ3I1iwFwdZCitP_pK2z9rrSM6sA,827
95
+ healthdatalayer-1.4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
96
+ healthdatalayer-1.4.2.dist-info/top_level.txt,sha256=6f1-gvpg533UEVuYsRJCDhdSDQUBwijyAHylyS4nG_4,16
97
+ healthdatalayer-1.4.2.dist-info/RECORD,,