healthdatalayer 0.0.2__tar.gz → 1.0.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-0.0.2 → healthdatalayer-1.0.0}/PKG-INFO +3 -1
- healthdatalayer-1.0.0/config/__init__.py +0 -0
- healthdatalayer-1.0.0/config/config.py +24 -0
- healthdatalayer-1.0.0/config/db.py +12 -0
- healthdatalayer-1.0.0/config/vault.py +20 -0
- {healthdatalayer-0.0.2 → healthdatalayer-1.0.0}/healthdatalayer.egg-info/PKG-INFO +3 -1
- {healthdatalayer-0.0.2 → healthdatalayer-1.0.0}/healthdatalayer.egg-info/SOURCES.txt +7 -1
- {healthdatalayer-0.0.2 → healthdatalayer-1.0.0}/healthdatalayer.egg-info/requires.txt +2 -0
- healthdatalayer-1.0.0/healthdatalayer.egg-info/top_level.txt +3 -0
- healthdatalayer-1.0.0/models/__init__.py +72 -0
- healthdatalayer-1.0.0/repositories/__init__.py +37 -0
- {healthdatalayer-0.0.2 → healthdatalayer-1.0.0}/setup.py +1 -1
- healthdatalayer-0.0.2/healthdatalayer.egg-info/top_level.txt +0 -1
- {healthdatalayer-0.0.2 → healthdatalayer-1.0.0}/README.md +0 -0
- {healthdatalayer-0.0.2 → healthdatalayer-1.0.0}/healthdatalayer.egg-info/dependency_links.txt +0 -0
- {healthdatalayer-0.0.2 → healthdatalayer-1.0.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: healthdatalayer
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Health Datalayer to access data from different sources
|
|
5
5
|
Author: Jesus Martinez
|
|
6
6
|
Author-email: jesusmartinez@noosds.com
|
|
@@ -15,6 +15,8 @@ Requires-Dist: twine
|
|
|
15
15
|
Requires-Dist: sqlmodel
|
|
16
16
|
Requires-Dist: psycopg2-binary
|
|
17
17
|
Requires-Dist: python-dotenv
|
|
18
|
+
Requires-Dist: azure-keyvault-secrets
|
|
19
|
+
Requires-Dist: azure-identity
|
|
18
20
|
Dynamic: author
|
|
19
21
|
Dynamic: author-email
|
|
20
22
|
Dynamic: classifier
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from urllib.parse import quote_plus
|
|
3
|
+
from dotenv import load_dotenv
|
|
4
|
+
from .vault import AzureVault
|
|
5
|
+
|
|
6
|
+
load_dotenv()
|
|
7
|
+
|
|
8
|
+
vault=AzureVault()
|
|
9
|
+
|
|
10
|
+
app_env=os.getenv("APP_ENV").lower() # type: ignore
|
|
11
|
+
|
|
12
|
+
DB_USER_T1 = vault.get_secret(f"milaf-db-{app_env}-username")
|
|
13
|
+
DB_PASSWORD_T1 = vault.get_secret(f"milaf-db-{app_env}-password")
|
|
14
|
+
DB_HOST_T1 = os.getenv("DATABASE_HOST_T1")
|
|
15
|
+
DB_PORT_T1 = os.getenv("DATABASE_PORT_T1")
|
|
16
|
+
DB_NAME_T1 = os.getenv("DATABASE_NAME_T1")
|
|
17
|
+
|
|
18
|
+
DB_PASSWORD_ENCODED_T1 = quote_plus(DB_PASSWORD_T1) # type: ignore
|
|
19
|
+
|
|
20
|
+
DATABASE_URL_T1 = f"postgresql+psycopg2://{DB_USER_T1}:{DB_PASSWORD_ENCODED_T1}@{DB_HOST_T1}:{DB_PORT_T1}/{DB_NAME_T1}"
|
|
21
|
+
|
|
22
|
+
DATABASES = {
|
|
23
|
+
"tenant1": DATABASE_URL_T1
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from sqlmodel import create_engine, Session
|
|
2
|
+
from .config import DATABASES
|
|
3
|
+
|
|
4
|
+
engines = {
|
|
5
|
+
tenant: create_engine(url, echo=True)
|
|
6
|
+
for tenant, url in DATABASES.items()
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
def get_session(tenant: str) -> Session:
|
|
10
|
+
if tenant not in engines:
|
|
11
|
+
raise ValueError(f"Tenant {tenant} is not configured")
|
|
12
|
+
return Session(engines[tenant])
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from azure.identity import ClientSecretCredential
|
|
3
|
+
from azure.keyvault.secrets import SecretClient
|
|
4
|
+
|
|
5
|
+
class AzureVault:
|
|
6
|
+
def __init__(self) -> None:
|
|
7
|
+
credential=ClientSecretCredential(
|
|
8
|
+
tenant_id=os.getenv("AZURE_TENANT_ID",""),
|
|
9
|
+
client_id=os.getenv("AZURE_CLIENT_ID",""),
|
|
10
|
+
client_secret=os.getenv("AZURE_CLIENT_SECRET","")
|
|
11
|
+
)
|
|
12
|
+
self.key_vault_uri=os.getenv("AZURE_KEY_VAULT_URI","")
|
|
13
|
+
self.client=SecretClient(vault_url=self.key_vault_uri,credential=credential)
|
|
14
|
+
|
|
15
|
+
def get_secret(self,secret_name:str):
|
|
16
|
+
secret=self.client.get_secret(name=secret_name)
|
|
17
|
+
if secret:
|
|
18
|
+
return secret.value
|
|
19
|
+
else:
|
|
20
|
+
raise ValueError("Secret not exist")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: healthdatalayer
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Health Datalayer to access data from different sources
|
|
5
5
|
Author: Jesus Martinez
|
|
6
6
|
Author-email: jesusmartinez@noosds.com
|
|
@@ -15,6 +15,8 @@ Requires-Dist: twine
|
|
|
15
15
|
Requires-Dist: sqlmodel
|
|
16
16
|
Requires-Dist: psycopg2-binary
|
|
17
17
|
Requires-Dist: python-dotenv
|
|
18
|
+
Requires-Dist: azure-keyvault-secrets
|
|
19
|
+
Requires-Dist: azure-identity
|
|
18
20
|
Dynamic: author
|
|
19
21
|
Dynamic: author-email
|
|
20
22
|
Dynamic: classifier
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
README.md
|
|
2
2
|
setup.py
|
|
3
|
+
config/__init__.py
|
|
4
|
+
config/config.py
|
|
5
|
+
config/db.py
|
|
6
|
+
config/vault.py
|
|
3
7
|
healthdatalayer.egg-info/PKG-INFO
|
|
4
8
|
healthdatalayer.egg-info/SOURCES.txt
|
|
5
9
|
healthdatalayer.egg-info/dependency_links.txt
|
|
6
10
|
healthdatalayer.egg-info/requires.txt
|
|
7
|
-
healthdatalayer.egg-info/top_level.txt
|
|
11
|
+
healthdatalayer.egg-info/top_level.txt
|
|
12
|
+
models/__init__.py
|
|
13
|
+
repositories/__init__.py
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from .bridge_area_floor_branch.system import System
|
|
2
|
+
from .bridge_area_floor_branch.area import Area
|
|
3
|
+
from .bridge_area_floor_branch.branch import Branch
|
|
4
|
+
from .bridge_area_floor_branch.floor import Floor
|
|
5
|
+
from .bridge_area_floor_branch.room import Room
|
|
6
|
+
from .bridge_area_floor_branch.bridge_area_floor_branch import BridgeAreaFloorBranch
|
|
7
|
+
|
|
8
|
+
from .user.user import User
|
|
9
|
+
from .user.permission import Permission
|
|
10
|
+
from .user.permission_user import PermissionUser
|
|
11
|
+
from .user.role import Role
|
|
12
|
+
from .user.role_permission import RolePermission
|
|
13
|
+
from .user.role_user import RoleUser
|
|
14
|
+
|
|
15
|
+
from .client.client import Client
|
|
16
|
+
from .client.address import Address
|
|
17
|
+
from .client.client_type import ClientType
|
|
18
|
+
from .client.education import Education
|
|
19
|
+
from .client.emergency_contact import EmergencyContact
|
|
20
|
+
from .client.gender import Gender
|
|
21
|
+
from .client.marriage_status import MarriageStatus
|
|
22
|
+
from .client.nationality import Nationality
|
|
23
|
+
from .client.pathological_history import PathologicalHistory
|
|
24
|
+
from .client.pet import Pet
|
|
25
|
+
from .client.profession import Profession
|
|
26
|
+
from .client.px import Px
|
|
27
|
+
|
|
28
|
+
from .collaborator.collaborator_speciality import CollaboratorSpeciality
|
|
29
|
+
from .collaborator.collaborator import Collaborator
|
|
30
|
+
from .collaborator.collaborator_type import CollaboratorType
|
|
31
|
+
from .collaborator.speciality import Speciality
|
|
32
|
+
|
|
33
|
+
from .lab.medical_lab import MedicalLab
|
|
34
|
+
from .lab.measure_lab import MeasureLab
|
|
35
|
+
from .lab.client_lab import ClientLab
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
from .medical_visit.medical_diagnosis import MedicalDiagnosis
|
|
39
|
+
from .medical_visit.medical_drug import MedicalDrug
|
|
40
|
+
from .medical_visit.medical_drug_recipe import MedicalDrugRecipe
|
|
41
|
+
from .medical_visit.medical_recipe_visit import MedicalRecipeVisit
|
|
42
|
+
from .medical_visit.medical_diagnosis_visit import MedicalDiagnosisVisit
|
|
43
|
+
from .medical_visit.organ_system_review import OrganSystemReview
|
|
44
|
+
from .medical_visit.physical_exam import PhysicalExam
|
|
45
|
+
from .medical_visit.visit_triage import VisitTriage
|
|
46
|
+
from .medical_visit.medical_visit import MedicalVisit
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from .client_repositories.address_repository import AddressRepository
|
|
2
|
+
from .client_repositories.client_type_repository import ClientTypeRepository
|
|
3
|
+
from .client_repositories.education_repository import EducationRepository
|
|
4
|
+
from .client_repositories.gender_repository import GenderRepository
|
|
5
|
+
from .client_repositories.marriage_status_repository import MarriageStatusRepository
|
|
6
|
+
from .client_repositories.pet_repository import PetRepository
|
|
7
|
+
from .client_repositories.profession_repository import ProfessionRepository
|
|
8
|
+
from .client_repositories.px_repository import PxRepository
|
|
9
|
+
|
|
10
|
+
from .collaborator_repositories.collaborator_repository import CollaboratorRepository
|
|
11
|
+
from .collaborator_repositories.collaborator_type_repository import CollaboratorTypeRepository
|
|
12
|
+
from .collaborator_repositories.speciality_repository import SpecialityRepository
|
|
13
|
+
|
|
14
|
+
from .infraestructure_repositories.area_repository import AreaRepository
|
|
15
|
+
from .infraestructure_repositories.branch_repository import BranchRepository
|
|
16
|
+
from .infraestructure_repositories.bridge_repository import BridgeAreaFloorBranchRepository
|
|
17
|
+
from .infraestructure_repositories.floor_repository import FloorRepository
|
|
18
|
+
from .infraestructure_repositories.room_repository import RoomRepository
|
|
19
|
+
from .infraestructure_repositories.system_repository import SystemRepository
|
|
20
|
+
|
|
21
|
+
from .lab_repositories.measure_lab_repository import MeasureLabRepository
|
|
22
|
+
from .lab_repositories.medical_lab_repository import MedicalLabRepository
|
|
23
|
+
|
|
24
|
+
from .medical_visit_repositories.medical_diagnosis_repository import MedicalDiagnosisRepository
|
|
25
|
+
from .medical_visit_repositories.medical_diagnosis_visit_repository import MedicalDiagnosisVisitRepository
|
|
26
|
+
from .medical_visit_repositories.medical_drug_recipe_repository import MedicalDrugRecipeRepository
|
|
27
|
+
from .medical_visit_repositories.medical_drug_repository import MedicalDrugRepository
|
|
28
|
+
from .medical_visit_repositories.medical_recipe_visit_repository import MedicalRecipeVisitRepository
|
|
29
|
+
from .medical_visit_repositories.medical_visit_repository import MedicalVisitRepository
|
|
30
|
+
from .medical_visit_repositories.organ_system_review_repository import OrganSystemReviewRepository
|
|
31
|
+
from .medical_visit_repositories.physical_exam_repository import PhysicalExamRepository
|
|
32
|
+
from .medical_visit_repositories.visit_triage_repository import VisitTriageRepository
|
|
33
|
+
|
|
34
|
+
from .user_repositories.permission_repository import PermissionRepository
|
|
35
|
+
from .user_repositories.role_repository import RoleRepository
|
|
36
|
+
from .user_repositories.user_repository import UserRepository
|
|
37
|
+
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
File without changes
|
{healthdatalayer-0.0.2 → healthdatalayer-1.0.0}/healthdatalayer.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|