healthdatalayer 1.6.0__tar.gz → 1.6.2__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.
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/PKG-INFO +1 -1
- healthdatalayer-1.6.2/healthdatalayer/dtos/__init__.py +2 -0
- healthdatalayer-1.6.2/healthdatalayer/dtos/medical_visit/medical_certificate.py +51 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/client_repositories/px_repository.py +23 -1
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/medical_visit_repositories/medical_visit_repository.py +138 -2
- healthdatalayer-1.6.2/healthdatalayer/repositories/user_repositories/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer.egg-info/PKG-INFO +1 -1
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer.egg-info/SOURCES.txt +2 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/setup.py +1 -1
- healthdatalayer-1.6.0/healthdatalayer/dtos/__init__.py +0 -1
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/README.md +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/config/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/config/config.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/config/db.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/config/vault.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/dtos/collaborator/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/dtos/collaborator/schedule_collaborator.py +0 -0
- {healthdatalayer-1.6.0/healthdatalayer/models/bridge_area_floor_branch → healthdatalayer-1.6.2/healthdatalayer/dtos/medical_visit}/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/__init__.py +0 -0
- {healthdatalayer-1.6.0/healthdatalayer/models/client → healthdatalayer-1.6.2/healthdatalayer/models/bridge_area_floor_branch}/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/bridge_area_floor_branch/area.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/bridge_area_floor_branch/branch.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/bridge_area_floor_branch/bridge_area_floor_branch.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/bridge_area_floor_branch/floor.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/bridge_area_floor_branch/room.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/bridge_area_floor_branch/system.py +0 -0
- {healthdatalayer-1.6.0/healthdatalayer/models/collaborator → healthdatalayer-1.6.2/healthdatalayer/models/client}/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/address.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/city.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/client.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/client_type.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/education.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/emergency_contact.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/gender.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/marriage_status.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/nationality.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/pathological_history.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/pet.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/profession.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/px.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/state.py +0 -0
- {healthdatalayer-1.6.0/healthdatalayer/models/lab → healthdatalayer-1.6.2/healthdatalayer/models/collaborator}/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/collaborator/collaborator.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/collaborator/collaborator_speciality.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/collaborator/collaborator_type.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/collaborator/speciality.py +0 -0
- {healthdatalayer-1.6.0/healthdatalayer/models/medical_visit → healthdatalayer-1.6.2/healthdatalayer/models/lab}/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/lab/client_lab.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/lab/measure_lab.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/lab/medical_lab.py +0 -0
- {healthdatalayer-1.6.0/healthdatalayer/models/user → healthdatalayer-1.6.2/healthdatalayer/models/medical_visit}/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/medical_visit/medical_diagnosis.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/medical_visit/medical_diagnosis_visit.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/medical_visit/medical_drug.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/medical_visit/medical_drug_recipe.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/medical_visit/medical_recipe_visit.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/medical_visit/medical_visit.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/medical_visit/organ_system_review.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/medical_visit/physical_exam.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/medical_visit/status_visit_enum.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/medical_visit/visit_triage.py +0 -0
- {healthdatalayer-1.6.0/healthdatalayer/repositories/client_repositories → healthdatalayer-1.6.2/healthdatalayer/models/user}/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/user/permission.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/user/permission_user.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/user/role.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/user/role_permission.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/user/role_user.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/user/user.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/__init__.py +0 -0
- {healthdatalayer-1.6.0/healthdatalayer/repositories/collaborator_repositories → healthdatalayer-1.6.2/healthdatalayer/repositories/client_repositories}/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/client_repositories/address_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/client_repositories/client_type_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/client_repositories/education_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/client_repositories/emergency_contact_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/client_repositories/gender_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/client_repositories/marriage_status_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/client_repositories/nationality_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/client_repositories/pathological_history_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/client_repositories/pet_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/client_repositories/profession_repository.py +0 -0
- {healthdatalayer-1.6.0/healthdatalayer/repositories/infraestructure_repositories → healthdatalayer-1.6.2/healthdatalayer/repositories/collaborator_repositories}/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/collaborator_repositories/collaborator_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/collaborator_repositories/collaborator_type_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/collaborator_repositories/speciality_repository.py +0 -0
- {healthdatalayer-1.6.0/healthdatalayer/repositories/lab_repositories → healthdatalayer-1.6.2/healthdatalayer/repositories/infraestructure_repositories}/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/infraestructure_repositories/area_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/infraestructure_repositories/branch_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/infraestructure_repositories/bridge_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/infraestructure_repositories/floor_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/infraestructure_repositories/room_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/infraestructure_repositories/system_repository.py +0 -0
- {healthdatalayer-1.6.0/healthdatalayer/repositories/medical_visit_repositories → healthdatalayer-1.6.2/healthdatalayer/repositories/lab_repositories}/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/lab_repositories/measure_lab_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/lab_repositories/medical_lab_repository.py +0 -0
- {healthdatalayer-1.6.0/healthdatalayer/repositories/user_repositories → healthdatalayer-1.6.2/healthdatalayer/repositories/medical_visit_repositories}/__init__.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/medical_visit_repositories/medical_diagnosis_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/medical_visit_repositories/medical_diagnosis_visit_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/medical_visit_repositories/medical_drug_recipe_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/medical_visit_repositories/medical_drug_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/medical_visit_repositories/medical_recipe_visit_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/medical_visit_repositories/organ_system_review_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/medical_visit_repositories/physical_exam_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/medical_visit_repositories/visit_triage_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/user_repositories/permission_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/user_repositories/role_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/repositories/user_repositories/user_repository.py +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer.egg-info/dependency_links.txt +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer.egg-info/requires.txt +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer.egg-info/top_level.txt +0 -0
- {healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/setup.cfg +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
|
+
from typing import List, Optional
|
|
3
|
+
from datetime import date, datetime, time
|
|
4
|
+
|
|
5
|
+
class MedicalCertificateDTO(BaseModel):
|
|
6
|
+
sys: Optional[str] = None
|
|
7
|
+
stablishment: Optional[str] = None
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
medical_record_number: Optional[str] = None
|
|
11
|
+
number_his: Optional[str] = None
|
|
12
|
+
last_name: Optional[str] = None
|
|
13
|
+
first_name: Optional[str] = None
|
|
14
|
+
sex: Optional[str] = None
|
|
15
|
+
age: Optional[int] = None
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
service: Optional[str] = None
|
|
19
|
+
speciality: Optional[str] = None
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
year_visit: Optional[int] = None
|
|
23
|
+
month_visit: Optional[int] = None
|
|
24
|
+
day_visit: Optional[int] = None
|
|
25
|
+
hour_start: Optional[time] = None
|
|
26
|
+
hour_end: Optional[time] = None
|
|
27
|
+
visit_date_spanish: Optional[str] = None
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
rest: Optional[bool] = None
|
|
31
|
+
rest_hours: Optional[float] = None
|
|
32
|
+
rest_date_start: Optional[datetime] = None
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
year_rest_start: Optional[int] = None
|
|
36
|
+
month_rest_start: Optional[int] = None
|
|
37
|
+
day_rest_start: Optional[int] = None
|
|
38
|
+
rest_date_start_spanish: Optional[str] = None
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
rest_date_end: Optional[datetime] = None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
year_rest_end: Optional[int] = None
|
|
45
|
+
month_rest_end: Optional[int] = None
|
|
46
|
+
day_rest_end: Optional[int] = None
|
|
47
|
+
rest_date_end_spanish: Optional[str] = None
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
doctor_name: Optional[str] = None
|
|
51
|
+
doctor_ruc: Optional[str] = None
|
|
@@ -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
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
from typing import Optional, List
|
|
2
2
|
from datetime import datetime, date, time
|
|
3
3
|
from uuid import UUID
|
|
4
|
-
from sqlmodel import select
|
|
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
8
|
from healthdatalayer.config.db import engines, get_session
|
|
8
9
|
|
|
9
10
|
class MedicalVisitRepository:
|
|
@@ -342,4 +343,139 @@ class MedicalVisitRepository:
|
|
|
342
343
|
statement = select(MedicalVisit).where(MedicalVisit.collaborator_id == collaborator_id, MedicalVisit.visit_date == target_date)
|
|
343
344
|
result = session.exec(statement).first()
|
|
344
345
|
return result is not None
|
|
345
|
-
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
def get_data_medical_certificate_command(self, medical_visit_id: str) -> MedicalCertificateDTO:
|
|
349
|
+
|
|
350
|
+
with get_session(self.tenant) as session:
|
|
351
|
+
|
|
352
|
+
query = text("""
|
|
353
|
+
select
|
|
354
|
+
s."name" as "sys",
|
|
355
|
+
b2."name" as stablishment,
|
|
356
|
+
px.medical_record_number,
|
|
357
|
+
px.identification as number_his,
|
|
358
|
+
px.last_name ,
|
|
359
|
+
px.first_name,
|
|
360
|
+
case
|
|
361
|
+
when g.name ='Male' then 'M'
|
|
362
|
+
else 'F'
|
|
363
|
+
end as sex,
|
|
364
|
+
EXTRACT(YEAR FROM AGE(px.birth_date)) AS age,
|
|
365
|
+
sp.name as service,
|
|
366
|
+
sp.subspeciality as speciality,
|
|
367
|
+
EXTRACT(YEAR FROM mv.visit_date) AS year_visit,
|
|
368
|
+
EXTRACT(MONTH FROM mv.visit_date) AS month_visit,
|
|
369
|
+
EXTRACT(DAY FROM mv.visit_date) AS day_visit,
|
|
370
|
+
mv.visit_date::time AS hour_start,
|
|
371
|
+
(mv.visit_date + INTERVAL '30 minutes')::time AS hour_end,
|
|
372
|
+
TO_CHAR(mv.visit_date, 'DD') || ' de ' ||
|
|
373
|
+
CASE EXTRACT(MONTH FROM mv.visit_date)
|
|
374
|
+
WHEN 1 THEN 'enero'
|
|
375
|
+
WHEN 2 THEN 'febrero'
|
|
376
|
+
WHEN 3 THEN 'marzo'
|
|
377
|
+
WHEN 4 THEN 'abril'
|
|
378
|
+
WHEN 5 THEN 'mayo'
|
|
379
|
+
WHEN 6 THEN 'junio'
|
|
380
|
+
WHEN 7 THEN 'julio'
|
|
381
|
+
WHEN 8 THEN 'agosto'
|
|
382
|
+
WHEN 9 THEN 'septiembre'
|
|
383
|
+
WHEN 10 THEN 'octubre'
|
|
384
|
+
WHEN 11 THEN 'noviembre'
|
|
385
|
+
WHEN 12 THEN 'diciembre'
|
|
386
|
+
END || ' del ' || EXTRACT(YEAR FROM mv.visit_date) AS visit_date_spanish,
|
|
387
|
+
mv.rest,
|
|
388
|
+
mv.rest_hours,
|
|
389
|
+
mv.rest_date_start ,
|
|
390
|
+
EXTRACT(YEAR FROM mv.rest_date_start) AS year_rest_start,
|
|
391
|
+
EXTRACT(MONTH FROM mv.rest_date_start) AS month_rest_start,
|
|
392
|
+
EXTRACT(DAY FROM mv.rest_date_start) AS day_rest_start,
|
|
393
|
+
TO_CHAR(mv.rest_date_start, 'DD') || ' de ' ||
|
|
394
|
+
CASE EXTRACT(MONTH FROM mv.rest_date_start)
|
|
395
|
+
WHEN 1 THEN 'enero'
|
|
396
|
+
WHEN 2 THEN 'febrero'
|
|
397
|
+
WHEN 3 THEN 'marzo'
|
|
398
|
+
WHEN 4 THEN 'abril'
|
|
399
|
+
WHEN 5 THEN 'mayo'
|
|
400
|
+
WHEN 6 THEN 'junio'
|
|
401
|
+
WHEN 7 THEN 'julio'
|
|
402
|
+
WHEN 8 THEN 'agosto'
|
|
403
|
+
WHEN 9 THEN 'septiembre'
|
|
404
|
+
WHEN 10 THEN 'octubre'
|
|
405
|
+
WHEN 11 THEN 'noviembre'
|
|
406
|
+
WHEN 12 THEN 'diciembre'
|
|
407
|
+
END || ' del ' || EXTRACT(YEAR FROM mv.rest_date_start) AS rest_date_start_spanish,
|
|
408
|
+
mv.rest_date_end,
|
|
409
|
+
EXTRACT(YEAR FROM mv.rest_date_end) AS year_rest_end,
|
|
410
|
+
EXTRACT(MONTH FROM mv.rest_date_end) AS month_rest_end,
|
|
411
|
+
EXTRACT(DAY FROM mv.rest_date_end) AS day_rest_end,
|
|
412
|
+
TO_CHAR( mv.rest_date_end, 'DD') || ' de ' ||
|
|
413
|
+
CASE EXTRACT(MONTH FROM mv.rest_date_end)
|
|
414
|
+
WHEN 1 THEN 'enero'
|
|
415
|
+
WHEN 2 THEN 'febrero'
|
|
416
|
+
WHEN 3 THEN 'marzo'
|
|
417
|
+
WHEN 4 THEN 'abril'
|
|
418
|
+
WHEN 5 THEN 'mayo'
|
|
419
|
+
WHEN 6 THEN 'junio'
|
|
420
|
+
WHEN 7 THEN 'julio'
|
|
421
|
+
WHEN 8 THEN 'agosto'
|
|
422
|
+
WHEN 9 THEN 'septiembre'
|
|
423
|
+
WHEN 10 THEN 'octubre'
|
|
424
|
+
WHEN 11 THEN 'noviembre'
|
|
425
|
+
WHEN 12 THEN 'diciembre'
|
|
426
|
+
END || ' del ' || EXTRACT(YEAR FROM mv.rest_date_end) AS rest_date_end_spanish,
|
|
427
|
+
c.name as doctor_name,
|
|
428
|
+
c.ruc as doctor_ruc
|
|
429
|
+
from medical_visit mv
|
|
430
|
+
left join px on px.client_id = mv.client_id
|
|
431
|
+
left join gender g on g.gender_id = px.gender_id
|
|
432
|
+
left join collaborator c on c.collaborator_id = mv.collaborator_id
|
|
433
|
+
left join bridge_area_floor_branch b on b.bridge_area_floor_branch_id = mv.bridge_area_floor_branch_id
|
|
434
|
+
left join branch b2 on b.branch_id = b2.branch_id
|
|
435
|
+
left join "system" s on s.system_id = b2.system_id
|
|
436
|
+
left join speciality sp on sp.speciality_id = mv.speciality_id
|
|
437
|
+
where mv.medical_visit_id = :medical_visit_id
|
|
438
|
+
and mv.status_visit != 'CANCELADO'
|
|
439
|
+
""")
|
|
440
|
+
|
|
441
|
+
result = session.exec(query, params={"medical_visit_id": medical_visit_id})
|
|
442
|
+
|
|
443
|
+
row = result.fetchone()
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
if not row:
|
|
447
|
+
raise ValueError(f"No se encontró la visita médica con ID: {medical_visit_id}")
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
return MedicalCertificateDTO(
|
|
451
|
+
sys=row[0],
|
|
452
|
+
stablishment=row[1],
|
|
453
|
+
medical_record_number=row[2],
|
|
454
|
+
number_his=row[3],
|
|
455
|
+
last_name=row[4],
|
|
456
|
+
first_name=row[5],
|
|
457
|
+
sex=row[6],
|
|
458
|
+
age=row[7],
|
|
459
|
+
service=row[8],
|
|
460
|
+
speciality=row[9],
|
|
461
|
+
year_visit=row[10],
|
|
462
|
+
month_visit=row[11],
|
|
463
|
+
day_visit=row[12],
|
|
464
|
+
hour_start=row[13],
|
|
465
|
+
hour_end=row[14],
|
|
466
|
+
visit_date_spanish=row[15],
|
|
467
|
+
rest=row[16],
|
|
468
|
+
rest_hours=row[17],
|
|
469
|
+
rest_date_start=row[18],
|
|
470
|
+
year_rest_start=row[19],
|
|
471
|
+
month_rest_start=row[20],
|
|
472
|
+
day_rest_start=row[21],
|
|
473
|
+
rest_date_start_spanish=row[22],
|
|
474
|
+
rest_date_end=row[23],
|
|
475
|
+
year_rest_end=row[24],
|
|
476
|
+
month_rest_end=row[25],
|
|
477
|
+
day_rest_end=row[26],
|
|
478
|
+
rest_date_end_spanish=row[27],
|
|
479
|
+
doctor_name=row[28],
|
|
480
|
+
doctor_ruc=row[29]
|
|
481
|
+
)
|
|
File without changes
|
|
@@ -13,6 +13,8 @@ healthdatalayer/config/vault.py
|
|
|
13
13
|
healthdatalayer/dtos/__init__.py
|
|
14
14
|
healthdatalayer/dtos/collaborator/__init__.py
|
|
15
15
|
healthdatalayer/dtos/collaborator/schedule_collaborator.py
|
|
16
|
+
healthdatalayer/dtos/medical_visit/__init__.py
|
|
17
|
+
healthdatalayer/dtos/medical_visit/medical_certificate.py
|
|
16
18
|
healthdatalayer/models/__init__.py
|
|
17
19
|
healthdatalayer/models/bridge_area_floor_branch/__init__.py
|
|
18
20
|
healthdatalayer/models/bridge_area_floor_branch/area.py
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from .collaborator.schedule_collaborator import ScheduleCollaboratorDTO
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/dtos/collaborator/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/client_type.py
RENAMED
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/emergency_contact.py
RENAMED
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/marriage_status.py
RENAMED
|
File without changes
|
{healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/client/nationality.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/collaborator/collaborator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/collaborator/speciality.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/medical_visit/medical_drug.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/medical_visit/visit_triage.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/user/permission_user.py
RENAMED
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer/models/user/role_permission.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{healthdatalayer-1.6.0 → healthdatalayer-1.6.2}/healthdatalayer.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|