LeireTedCas commited on
Commit
7a182fb
1 Parent(s): 6613f26

Upload 7 files

Browse files
Files changed (6) hide show
  1. README (1).md +15 -0
  2. app (4).py +1067 -0
  3. gitattributes (2).txt +29 -0
  4. packages.txt +2 -1
  5. preguntas_qh_tags.xlsx +0 -0
  6. requirements.txt +3 -0
README (1).md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Quirohelp
3
+ emoji: ⚗️
4
+ colorFrom: gray
5
+ colorTo: gray
6
+ sdk: gradio
7
+ sdk_version: 2.9.1
8
+ app_file: app.py
9
+ models: [osanseviero/BigGAN-deep-128, t5-small]
10
+ datasets: [emotion]
11
+ license: mit
12
+ pinned: false
13
+ ---
14
+
15
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
app (4).py ADDED
@@ -0,0 +1,1067 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from flask import Flask ,render_template ,request ,jsonify ,redirect ,url_for #line:1
2
+ import pandas as pd #line:2
3
+ import numpy as np #line:3
4
+ import xlrd2 as xlrd #line:4
5
+ import unicodedata #line:5
6
+ import spacy #line:6
7
+ import inflect #line:7
8
+ nlp =spacy .load ("es_core_news_md")#line:8
9
+ from inflector import Inflector ,Spanish #line:10
10
+ inflector =Inflector (Spanish )#line:11
11
+ import speech_recognition as sr #line:12
12
+ import os #line:13
13
+ import requests #line:14
14
+ from requests .auth import HTTPBasicAuth #line:15
15
+ import asyncio #line:16
16
+ import aiohttp #line:17
17
+ from flask_socketio import SocketIO #line:18
18
+ auth =aiohttp .BasicAuth ('1234','API')#line:20
19
+ base_url ='https://orva.tedcas.com/api/'#line:21
20
+ archivo ="./preguntas_qh_tags.xlsx"#line:22
21
+ async def faq ():#line:24
22
+ OOOOO0OO0O0OOOO0O =pd .read_excel (archivo ,engine ="openpyxl")#line:25
23
+ OO00000OO0O0O00OO =OOOOO0OO0O0OOOO0O #line:26
24
+ OOOOO0OO0O0OOOO0O =xlrd .open_workbook (archivo )#line:27
25
+ OOOOO0OO0O0OOOO0O =OOOOO0OO0O0OOOO0O .sheet_by_index (0 )#line:28
26
+ OO00000000OO00OO0 =[]#line:29
27
+ O0OOO00OOOO00O0O0 =[]#line:30
28
+ O00OO00O000O0OO00 =[]#line:31
29
+ O00OOO0O00O000O0O =pd .read_excel (archivo ,header =1 )#line:32
30
+ for O0OO0O000O0000O00 ,O00O00O00OO000OOO in O00OOO0O00O000O0O .iterrows ():#line:33
31
+ if OO00000OO0O0O00OO .loc [O0OO0O000O0000O00 ,'Especialidad']=='trauma':#line:34
32
+ OO0OO0OO0OO00O00O =OOOOO0OO0O0OOOO0O .cell (int (O0OO0O000O0000O00 )+1 ,2 )#line:35
33
+ O00O0O0O0OOO000O0 =OOOOO0OO0O0OOOO0O .cell (int (O0OO0O000O0000O00 )+1 ,3 )#line:36
34
+ OO0OO0OO0OO00O00O =str (OO0OO0OO0OO00O00O )#line:37
35
+ O00O0O0O0OOO000O0 =str (O00O0O0O0OOO000O0 )#line:38
36
+ OO0OO0OO0OO00O00O =OO0OO0OO0OO00O00O .split ("'")#line:39
37
+ O00O0O0O0OOO000O0 =O00O0O0O0OOO000O0 .split ("'")#line:40
38
+ OO00000000OO00OO0 .append (f" {OO0OO0OO0OO00O00O[1]} {O00O0O0O0OOO000O0[1]} ")#line:41
39
+ elif OO00000OO0O0O00OO .loc [O0OO0O000O0000O00 ,'Especialidad']=='uro':#line:42
40
+ OO0OO0OO0OO00O00O =OOOOO0OO0O0OOOO0O .cell (int (O0OO0O000O0000O00 )+1 ,2 )#line:43
41
+ O00O0O0O0OOO000O0 =OOOOO0OO0O0OOOO0O .cell (int (O0OO0O000O0000O00 )+1 ,3 )#line:44
42
+ OO0OO0OO0OO00O00O =str (OO0OO0OO0OO00O00O )#line:45
43
+ O00O0O0O0OOO000O0 =str (O00O0O0O0OOO000O0 )#line:46
44
+ OO0OO0OO0OO00O00O =OO0OO0OO0OO00O00O .split ("'")#line:47
45
+ O00O0O0O0OOO000O0 =O00O0O0O0OOO000O0 .split ("'")#line:48
46
+ O0OOO00OOOO00O0O0 .append (f" {OO0OO0OO0OO00O00O[1]} {O00O0O0O0OOO000O0[1]} ")#line:49
47
+ elif OO00000OO0O0O00OO .loc [O0OO0O000O0000O00 ,'Especialidad']=='admin':#line:50
48
+ OO0OO0OO0OO00O00O =OOOOO0OO0O0OOOO0O .cell (int (O0OO0O000O0000O00 )+1 ,2 )#line:51
49
+ O00O0O0O0OOO000O0 =OOOOO0OO0O0OOOO0O .cell (int (O0OO0O000O0000O00 )+1 ,3 )#line:52
50
+ OO0OO0OO0OO00O00O =str (OO0OO0OO0OO00O00O )#line:53
51
+ O00O0O0O0OOO000O0 =str (O00O0O0O0OOO000O0 )#line:54
52
+ OO0OO0OO0OO00O00O =OO0OO0OO0OO00O00O .split ("'")#line:55
53
+ O00O0O0O0OOO000O0 =O00O0O0O0OOO000O0 .split ("'")#line:56
54
+ O00OO00O000O0OO00 .append (f" {OO0OO0OO0OO00O00O[1]} {O00O0O0O0OOO000O0[1]} ")#line:57
55
+ if O00O00O00OO000OOO .dropna ().empty :#line:58
56
+ break #line:59
57
+ return OO00000000OO00OO0 ,O0OOO00OOOO00O0O0 ,O00OO00O000O0OO00 #line:60
58
+ async def buscar_faq (OO0OO0OO0O0OO0O0O ,O0O0O000O000OOO0O ):#line:62
59
+ OOO0OO0OO00O000O0 =pd .read_excel (archivo ,engine ="openpyxl")#line:63
60
+ OO0O0OOO0O00O000O =OOO0OO0OO00O000O0 #line:64
61
+ OO0O0O0O0OO0OOO00 =0 #line:65
62
+ OOOO000OO00OO0O0O =OO0OO0OO0O0OO0O0O #line:66
63
+ O0000O0000OOOO000 =[]#line:67
64
+ print ("result"+str (OOOO000OO00OO0O0O ))#line:68
65
+ for OOOO00O0O0000000O ,OOO000O000OOO00O0 in OOO0OO0OO00O000O0 .iterrows ():#line:69
66
+ O00O00OOO000O0O00 =OOO0OO0OO00O000O0 .loc [OOOO00O0O0000000O ,'TAGS2']#line:70
67
+ O00O00OOO000O0O00 =O00O00OOO000O0O00 .split (",")#line:71
68
+ O0000O0000OOOO000 .append (O00O00OOO000O0O00 )#line:72
69
+ O0O0O0O00OO00O0O0 =[]#line:73
70
+ O00O00OOO000O0O00 =[]#line:74
71
+ for O000O0000OO00000O ,O00O0O0O00OOO000O in enumerate (OOOO000OO00OO0O0O ):#line:75
72
+ OOOO000OO00OO0O0O [O000O0000OO00000O ]=inflector .singularize (str (O00O0O0O00OOO000O ))#line:76
73
+ OO0O0O0O00O00O00O =np .zeros (len (OOO0OO0OO00O000O0 .index ),dtype =int )#line:77
74
+ for OOO00OOOOOOOOOO00 ,OOO000O000OOO00O0 in enumerate (O0000O0000OOOO000 ):#line:78
75
+ O00OOO0O0OO00OO00 =[]#line:79
76
+ for O00O0O0O00OOO000O in OOO000O000OOO00O0 :#line:80
77
+ if O0O0O000O000OOO0O ==0 :#line:81
78
+ if O00O0O0O00OOO000O !=[]:#line:82
79
+ OO0O0O0O0OO0OOO00 =0 #line:83
80
+ for O0O0O0O000O0O0O0O in range (100 ):#line:84
81
+ O0O0O0O000O0O0O0O =O0O0O0O000O0O0O0O /10 #line:85
82
+ O0O0O0O000O0O0O0O =str (O0O0O0O000O0O0O0O )#line:86
83
+ if O00O0O0O00OOO000O ==O0O0O0O000O0O0O0O :#line:87
84
+ O0O0O0O000O0O0O0O =O0O0O0O000O0O0O0O .split (".")#line:88
85
+ O00OOO0O0OO00OO00 .append (O0O0O0O000O0O0O0O [0 ])#line:89
86
+ O00OOO0O0OO00OO00 .append ("con")#line:90
87
+ O00OOO0O0OO00OO00 .append (O0O0O0O000O0O0O0O [1 ])#line:91
88
+ OO0O0O0O0OO0OOO00 =OO0O0O0O0OO0OOO00 +1 #line:92
89
+ if OO0O0O0O0OO0OOO00 ==0 :#line:93
90
+ O00OOO0O0OO00OO00 .append (O00O0O0O00OOO000O )#line:94
91
+ if O0O0O000O000OOO0O ==1 :#line:95
92
+ O00OOO0O0OO00OO00 .append (O00O0O0O00OOO000O )#line:96
93
+ O0O0O0O00OO00O0O0 .append (O00OOO0O0OO00OO00 )#line:97
94
+ for O00000OOOO00OO00O in OOOO000OO00OO0O0O :#line:98
95
+ for OOO0OO0OO00OO0000 ,O00O0O0O00OOO000O in enumerate (O0O0O0O00OO00O0O0 [OOO00OOOOOOOOOO00 ]):#line:99
96
+ if str (O00000OOOO00OO00O )=="maya":#line:100
97
+ O00000OOOO00OO00O ="malla"#line:101
98
+ if str (O00000OOOO00OO00O )=="pilos"or str (O00000OOOO00OO00O )=="pilo":#line:102
99
+ O00000OOOO00OO00O ="philo"#line:103
100
+ if str (O00000OOOO00OO00O )=="filos"or str (O00000OOOO00OO00O )=="filo":#line:104
101
+ O00000OOOO00OO00O ="philo"#line:105
102
+ if str (O00000OOOO00OO00O )=="sinces"or str (O00000OOOO00OO00O )=="sinc":#line:106
103
+ O00000OOOO00OO00O ="synthe"#line:107
104
+ if str (O00000OOOO00OO00O )=="sintes"or str (O00000OOOO00OO00O )=="sint":#line:108
105
+ O00000OOOO00OO00O ="synthe"#line:109
106
+ if str (O00000OOOO00OO00O )=="axos"or str (O00000OOOO00OO00O )=="axo":#line:110
107
+ O00000OOOO00OO00O ="axso"#line:111
108
+ if str (O00000OOOO00OO00O )=="uno":#line:112
109
+ O00000OOOO00OO00O ="1"#line:113
110
+ if str (O00000OOOO00OO00O )=="dos"or str (O00000OOOO00OO00O )=="do":#line:114
111
+ O00000OOOO00OO00O ="2"#line:115
112
+ if str (O00000OOOO00OO00O )=="tres"or str (O00000OOOO00OO00O )=="tr":#line:116
113
+ O00000OOOO00OO00O ="3"#line:117
114
+ if str (O00000OOOO00OO00O )=="cuatro":#line:118
115
+ O00000OOOO00OO00O ="4"#line:119
116
+ if str (O00000OOOO00OO00O )=="cinco":#line:120
117
+ O00000OOOO00OO00O ="5"#line:121
118
+ if str (O00000OOOO00OO00O )=="seis"or str (O00000OOOO00OO00O )=="sei":#line:122
119
+ O00000OOOO00OO00O ="6"#line:123
120
+ if str (O00000OOOO00OO00O )=="siete":#line:124
121
+ O00000OOOO00OO00O ="7"#line:125
122
+ if str (O00000OOOO00OO00O )=="ocho":#line:126
123
+ O00000OOOO00OO00O ="8"#line:127
124
+ if str (O00000OOOO00OO00O )=="nueve":#line:128
125
+ O00000OOOO00OO00O ="9"#line:129
126
+ if str (O00000OOOO00OO00O )=="cero":#line:130
127
+ O00000OOOO00OO00O ="0"#line:131
128
+ if str (O00000OOOO00OO00O )=="veintiuno":#line:132
129
+ O00000OOOO00OO00O ="21"#line:133
130
+ if str (O00000OOOO00OO00O )=="veinte":#line:134
131
+ O00000OOOO00OO00O ="20"#line:135
132
+ if str (O00000OOOO00OO00O )=="veintidos"or str (O00000OOOO00OO00O )=="veintido":#line:136
133
+ O00000OOOO00OO00O ="22"#line:137
134
+ if str (O00000OOOO00OO00O )=="veintitres"or str (O00000OOOO00OO00O )=="veintitre":#line:138
135
+ O00000OOOO00OO00O ="23"#line:139
136
+ if str (O00000OOOO00OO00O )=="veinticuatro":#line:140
137
+ O00000OOOO00OO00O ="24"#line:141
138
+ if str (O00000OOOO00OO00O )=="veinticinco":#line:142
139
+ O00000OOOO00OO00O ="25"#line:143
140
+ if str (O00000OOOO00OO00O )=="veintiseis"or str (O00000OOOO00OO00O )=="veintisei":#line:144
141
+ O00000OOOO00OO00O ="26"#line:145
142
+ if str (O00000OOOO00OO00O )=="veintisiete":#line:146
143
+ O00000OOOO00OO00O ="27"#line:147
144
+ if str (O00000OOOO00OO00O )=="veintiocho":#line:148
145
+ O00000OOOO00OO00O ="28"#line:149
146
+ if str (O00000OOOO00OO00O )=="veintinueve":#line:150
147
+ O00000OOOO00OO00O ="29"#line:151
148
+ if str (O00000OOOO00OO00O )=="treinta":#line:152
149
+ O00000OOOO00OO00O ="30"#line:153
150
+ if str (remove_accents (O00O0O0O00OOO000O )).lower ()==str (remove_accents (O00000OOOO00OO00O )).lower ():#line:154
151
+ OO0O0O0O00O00O00O [OOO00OOOOOOOOOO00 ]=OO0O0O0O00O00O00O [OOO00OOOOOOOOOO00 ]+1 #line:155
152
+ O0O0O0O00OO00O0O0 [OOO00OOOOOOOOOO00 ].pop (OOO0OO0OO00OO0000 )#line:156
153
+ OO0000OOOOOO00OO0 =np .argwhere (OO0O0O0O00O00O00O ==np .amax (OO0O0O0O00O00O00O ))#line:158
154
+ OOOO00OO0O0O0OO0O =[]#line:159
155
+ O00OO000OOOO0OO0O =[]#line:160
156
+ OO000O00000O00O0O =[]#line:161
157
+ O0OO000O0O0OOO0O0 ={}#line:162
158
+ OOO0OO0OO00O000O0 =xlrd .open_workbook (archivo )#line:163
159
+ OOO0OO0OO00O000O0 =OOO0OO0OO00O000O0 .sheet_by_index (0 )#line:164
160
+ if not np .all (OO0O0O0O00O00O00O ==0 ):#line:165
161
+ for O0O0O000OO0OO0O00 in OO0000OOOOOO00OO0 :#line:166
162
+ if (OO0O0OOO0O00O000O .loc [O0O0O000OO0OO0O00 ,'Especialidad']=='trauma').any ():#line:167
163
+ O0000OOOOOOO00OO0 =OOO0OO0OO00O000O0 .cell (int (O0O0O000OO0OO0O00 )+1 ,2 )#line:168
164
+ O0000O000OO0O00OO =OOO0OO0OO00O000O0 .cell (int (O0O0O000OO0OO0O00 )+1 ,3 )#line:169
165
+ O0000OOOOOOO00OO0 =str (O0000OOOOOOO00OO0 )#line:170
166
+ O0000O000OO0O00OO =str (O0000O000OO0O00OO )#line:171
167
+ O0000OOOOOOO00OO0 =O0000OOOOOOO00OO0 .split ("'")#line:172
168
+ O0000O000OO0O00OO =O0000O000OO0O00OO .split ("'")#line:173
169
+ OOOO00OO0O0O0OO0O .append (f" {O0000OOOOOOO00OO0[1]} {O0000O000OO0O00OO[1]} ")#line:174
170
+ elif (OO0O0OOO0O00O000O .loc [O0O0O000OO0OO0O00 ,'Especialidad']=='uro').any ():#line:175
171
+ O0000OOOOOOO00OO0 =OOO0OO0OO00O000O0 .cell (int (O0O0O000OO0OO0O00 )+1 ,2 )#line:176
172
+ O0000O000OO0O00OO =OOO0OO0OO00O000O0 .cell (int (O0O0O000OO0OO0O00 )+1 ,3 )#line:177
173
+ O0000OOOOOOO00OO0 =str (O0000OOOOOOO00OO0 )#line:178
174
+ O0000O000OO0O00OO =str (O0000O000OO0O00OO )#line:179
175
+ O0000OOOOOOO00OO0 =O0000OOOOOOO00OO0 .split ("'")#line:180
176
+ O0000O000OO0O00OO =O0000O000OO0O00OO .split ("'")#line:181
177
+ O00OO000OOOO0OO0O .append (f" {O0000OOOOOOO00OO0[1]} {O0000O000OO0O00OO[1]} ")#line:182
178
+ elif (OO0O0OOO0O00O000O .loc [O0O0O000OO0OO0O00 ,'Especialidad']=='admin').any ():#line:183
179
+ O0000OOOOOOO00OO0 =OOO0OO0OO00O000O0 .cell (int (O0O0O000OO0OO0O00 )+1 ,2 )#line:184
180
+ O0000O000OO0O00OO =OOO0OO0OO00O000O0 .cell (int (O0O0O000OO0OO0O00 )+1 ,3 )#line:185
181
+ O0000OOOOOOO00OO0 =str (O0000OOOOOOO00OO0 )#line:186
182
+ O0000O000OO0O00OO =str (O0000O000OO0O00OO )#line:187
183
+ O0000OOOOOOO00OO0 =O0000OOOOOOO00OO0 .split ("'")#line:188
184
+ O0000O000OO0O00OO =O0000O000OO0O00OO .split ("'")#line:189
185
+ OO000O00000O00O0O .append (f" {O0000OOOOOOO00OO0[1]} {O0000O000OO0O00OO[1]} ")#line:190
186
+ return OOOO00OO0O0O0OO0O ,O00OO000OOOO0OO0O ,OO000O00000O00O0O #line:191
187
+ async def boton_pdf_video (OOO00O000O0OOOOOO ,O00O0OO0OO0O0O0O0 ,O0O0O00OOO0000000 ):#line:193
188
+ O0000O000OO0O000O =aiohttp .TCPConnector (ssl =True )#line:194
189
+ async with aiohttp .ClientSession (connector =O0000O000OO0O000O )as O00O0OO00OOOO0O0O :#line:195
190
+ OO0000OOOO0OO00O0 =await O00O0OO00OOOO0O0O .get (f'{base_url}all-content/{OOO00O000O0OOOOOO}',auth =auth )#line:196
191
+ OO0OOO00000O00O00 =await OO0000OOOO0OO00O0 .json ()#line:197
192
+ OO000OOO00O00OO00 =[]#line:199
193
+ OOOO00OOOOO0OO00O ={}#line:200
194
+ if O0O0O00OOO0000000 =="0":#line:202
195
+ for O000O0OOOOO0OOOO0 in OO0OOO00000O00O00 :#line:203
196
+ if O000O0OOOOO0OOOO0 ['type']=="Intervencion":#line:204
197
+ OO000OOO00O00OO00 .append (O000O0OOOOO0OOOO0 ['nid'])#line:205
198
+ else :#line:206
199
+ OO000OOO00O00OO00 .append (O0O0O00OOO0000000 )#line:207
200
+ for O0O0O00O0OOO0OOOO in OO000OOO00O00OO00 :#line:209
201
+ OO000000O0O0OOOO0 =await O00O0OO00OOOO0O0O .get (f'{base_url}intervenciones/{O0O0O00O0OOO0OOOO}',auth =auth )#line:210
202
+ O0O0O000O000OO00O =await OO000000O0O0OOOO0 .json ()#line:211
203
+ O0O0O000O000OO00O =O0O0O000O000OO00O [0 ]#line:212
204
+ O0OO000OO0OO0OOOO ={}#line:213
205
+ if O00O0OO0OO0O0O0O0 in O0O0O000O000OO00O :#line:215
206
+ OO00OOO00000000OO =O0O0O000O000OO00O [O00O0OO0OO0O0O0O0 ]#line:216
207
+ for OO0000000O0OOOO0O in OO00OOO00000000OO :#line:217
208
+ if O00O0OO0OO0O0O0O0 =='field_pdf':#line:218
209
+ O0OO000OO0OO0OOOO [OO0000000O0OOOO0O ['descripcion']]="https://orva.tedcas.com/"+str (OO0000000O0OOOO0O ['url'])#line:219
210
+ if O00O0OO0OO0O0O0O0 =='field_video':#line:220
211
+ O0OO000OO0OO0OOOO [OO0000000O0OOOO0O ['descripcion']]=str (OO0000000O0OOOO0O ['url'])#line:221
212
+ OOOO00OOOOO0OO00O [O0O0O000O000OO00O ['title']]=O0OO000OO0OO0OOOO #line:223
213
+ else :#line:224
214
+ if O0O0O00OOO0000000 =='0':#line:225
215
+ O0O0O00OOO0000000 ='0'#line:226
216
+ else :#line:227
217
+ print ("nid dentro del if "+str (O0O0O00OOO0000000 ))#line:228
218
+ O0OO000OO0OO0OOOO ["No hay archivos"]=""#line:229
219
+ OOOO00OOOOO0OO00O ["No hay archivos"]=O0OO000OO0OO0OOOO #line:230
220
+ return {}#line:231
221
+ return OOOO00OOOOO0OO00O #line:233
222
+ async def boton_word_ppt (O0OOOO0O0000OO0OO ,OO0OO000OO00000OO ,OO0OO0OO0OOO00OOO ):#line:235
223
+ O00OO0OOO0O00OO00 =aiohttp .TCPConnector (ssl =True )#line:236
224
+ async with aiohttp .ClientSession (connector =O00OO0OOO0O00OO00 )as O0O000000O000O00O :#line:237
225
+ O00OO00000OOO0OO0 =await O0O000000O000O00O .get (f'{base_url}all-content/{O0OOOO0O0000OO0OO}',auth =auth )#line:238
226
+ O0OOO0OO0O0O0OOOO =await O00OO00000OOO0OO0 .json ()#line:239
227
+ O00OOO0O000O00O00 =[]#line:241
228
+ OO0O0O0OOO0OO00OO ={}#line:242
229
+ if OO0OO0OO0OOO00OOO =='0':#line:244
230
+ for OO0O0O0O00OO0O0O0 in O0OOO0OO0O0O0OOOO :#line:245
231
+ if OO0O0O0O00OO0O0O0 ['type']=="Intervencion":#line:246
232
+ O00OOO0O000O00O00 .append (OO0O0O0O00OO0O0O0 ['nid'])#line:247
233
+ else :#line:248
234
+ O00OOO0O000O00O00 .append (OO0OO0OO0OOO00OOO )#line:249
235
+ for OOOO0O0O00O000OOO in O00OOO0O000O00O00 :#line:251
236
+ O0OO0OOO0OO0O0OOO =await O0O000000O000O00O .get (f'{base_url}intervenciones/{OOOO0O0O00O000OOO}',auth =auth )#line:252
237
+ O0OOOO0OO000OOOO0 =await O0OO0OOO0OO0O0OOO .json ()#line:253
238
+ O0OOOO0OO000OOOO0 =O0OOOO0OO000OOOO0 [0 ]#line:254
239
+ if len (O0OOOO0OO000OOOO0 [OO0OO000OO00000OO ])!=0 :#line:255
240
+ OO0O0O0OOO0OO00OO [O0OOOO0OO000OOOO0 ['title']]="https://orva.tedcas.com/"+str (O0OOOO0OO000OOOO0 [OO0OO000OO00000OO ])#line:256
241
+ if len (O0OOOO0OO000OOOO0 [OO0OO000OO00000OO ])==0 and OO0OO0OO0OOO00OOO !='0':#line:257
242
+ OO0O0O0OOO0OO00OO ["No hay archivos"]=""#line:258
243
+ return {}#line:259
244
+ return OO0O0O0OOO0OO00OO #line:261
245
+ async def boton_materiales (OOOO0O00OOO0O0O0O ,O00O00O0O00O0000O ):#line:263
246
+ O0O0OOOO0OOO0OOO0 =aiohttp .TCPConnector (ssl =True )#line:264
247
+ async with aiohttp .ClientSession (connector =O0O0OOOO0OOO0OOO0 )as OO0OOOOOO0OO0O000 :#line:265
248
+ O00O0OO00OOO0000O ={}#line:266
249
+ if O00O00O0O00O0000O =='0':#line:268
250
+ OOO0OO00O0OOOOOOO =await OO0OOOOOO0OO0O000 .get (f'{base_url}listado_completo_cajas/{OOOO0O00OOO0O0O0O}',auth =auth )#line:269
251
+ O0OOOOO00O0000O00 =await OOO0OO00O0OOOOOOO .json ()#line:270
252
+ for OOOOO000000O00OOO in O0OOOOO00O0000O00 :#line:271
253
+ O00O0OO00OOO0000O [OOOOO000000O00OOO ['title']]=OOOOO000000O00OOO ['nid']#line:272
254
+ O00O0OO00OOO0000O ['']="si hay"#line:273
255
+ else :#line:274
256
+ OOO0OO00O0OOOOOOO =await OO0OOOOOO0OO0O000 .get (f'{base_url}intervenciones/{O00O00O0O00O0000O}',auth =auth )#line:275
257
+ O0OOOOO00O0000O00 =await OOO0OO00O0OOOOOOO .json ()#line:276
258
+ O0OOOOO00O0000O00 =O0OOOOO00O0000O00 [0 ]#line:277
259
+ if 'field_cajas'in O0OOOOO00O0000O00 :#line:278
260
+ O0OOOOO00O0000O00 =O0OOOOO00O0000O00 ['field_cajas']#line:279
261
+ for OOOOO000000O00OOO in O0OOOOO00O0000O00 :#line:280
262
+ O00O0OO00OOO0000O [OOOOO000000O00OOO ['caja']]=OOOOO000000O00OOO ['id']#line:281
263
+ O00O0OO00OOO0000O ['']="si hay"#line:282
264
+ else :#line:283
265
+ if O00O00O0O00O0000O !=0 :#line:284
266
+ O00O0OO00OOO0000O ['']=""#line:285
267
+ return {}#line:286
268
+ return O00O0OO00OOO0000O #line:287
269
+ async def cargar_base_datos (O000O0O0000OO00OO ,O00OOO00O0OOOOOOO ):#line:289
270
+ OO0O00O0O00OO00OO =None #line:290
271
+ O0O0OO0OO00O00O00 =[]#line:291
272
+ OO0OOO0OO000O00O0 =aiohttp .TCPConnector (ssl =True )#line:292
273
+ async with aiohttp .ClientSession (connector =OO0OOO0OO000O00O0 )as O0O000O0OOO00OOOO :#line:293
274
+ OO00OO00OOO000O00 =await O0O000O0OOO00OOOO .get ('https://orva.tedcas.com/api/all-content/'+str (O00OOO00O0OOOOOOO ),auth =auth )#line:294
275
+ OOO0O0O000O0OO0O0 =await OO00OO00OOO000O00 .json ()#line:295
276
+ OO000O0O0O0O0O0O0 =np .zeros (len (OOO0O0O000O0OO0O0 ),dtype =int )#line:296
277
+ O0O00O00OO0OO0O00 =[]#line:297
278
+ for O000OO0OO0O0O0OOO in O000O0O0000OO00OO :#line:298
279
+ O000000OOOOO0000O =0 #line:299
280
+ for OO00O00O00O0000OO in range (100 ):#line:300
281
+ OO00O00O00O0000OO =OO00O00O00O0000OO /10 #line:301
282
+ if O000OO0OO0O0O0OOO ==str (OO00O00O00O0000OO ):#line:302
283
+ O000OO0OO0O0O0OOO =str (OO00O00O00O0000OO ).split ('.')#line:303
284
+ O0O00O00OO0OO0O00 .append (O000OO0OO0O0O0OOO )#line:304
285
+ O000000OOOOO0000O =O000000OOOOO0000O +1 #line:305
286
+ if O000OO0OO0O0O0OOO =='con':#line:306
287
+ O000000OOOOO0000O =O000000OOOOO0000O +1 #line:307
288
+ if O000000OOOOO0000O ==0 :#line:308
289
+ O0O00O00OO0OO0O00 .append (O000OO0OO0O0O0OOO )#line:309
290
+ for OOOO0O000O0OOO0OO in range (len (OOO0O0O000O0OO0O0 )):#line:310
291
+ O000O0O00OOOOO0O0 =0 #line:311
292
+ O00OO0OO0OOO00O0O =OOO0O0O000O0OO0O0 [OOOO0O000O0OOO0OO ]#line:312
293
+ OO0000OO0OO00O00O =str (O00OO0OO0OOO00O0O ['title']).lower ()#line:313
294
+ OO0000OO0OO00O00O =remove_accents (OO0000OO0OO00O00O )#line:314
295
+ OO0000OO0OO00O00O =OO0000OO0OO00O00O .split (' ')#line:315
296
+ for OO00000000OO00O0O ,O0O00OO000O00OO00 in enumerate (OO0000OO0OO00O00O ):#line:316
297
+ for OO00O0OOOOOOO0OO0 ,O00O0OO00O0O0O0O0 in enumerate (OO0000OO0OO00O00O ):#line:317
298
+ if OO00O0OOOOOOO0OO0 !=OO00000000OO00O0O :#line:318
299
+ if O0O00OO000O00OO00 ==O00O0OO00O0O0O0O0 :#line:319
300
+ OO0000OO0OO00O00O .pop (OO00O0OOOOOOO0OO0 )#line:320
301
+ for OO00000000OO00O0O ,O0O00OO000O00OO00 in enumerate (OO0000OO0OO00O00O ):#line:321
302
+ for OO00O00O00O0000OO in range (100 ):#line:322
303
+ OO00O00O00O0000OO =OO00O00O00O0000OO /10 #line:323
304
+ if O0O00OO000O00OO00 ==str (OO00O00O00O0000OO ):#line:324
305
+ O0O00OO000O00OO00 =str (OO00O00O00O0000OO ).split ('.')#line:325
306
+ OO0000OO0OO00O00O .append (O0O00OO000O00OO00 )#line:326
307
+ for O0O0O000O0OOOO00O in O0O00O00OO0OO0O00 :#line:327
308
+ if O0O0O000O0OOOO00O =="maya":#line:328
309
+ O0O0O000O0OOOO00O ="malla"#line:329
310
+ if O0O0O000O0OOOO00O =="pilos"or O0O0O000O0OOOO00O =="pilo":#line:330
311
+ O0O0O000O0OOOO00O ="philo"#line:331
312
+ if O0O0O000O0OOOO00O =="filos"or O0O0O000O0OOOO00O =="filo":#line:332
313
+ O0O0O000O0OOOO00O ="philo"#line:333
314
+ if O0O0O000O0OOOO00O =="sinces"or O0O0O000O0OOOO00O =="sinc":#line:334
315
+ O0O0O000O0OOOO00O ="synthe"#line:335
316
+ if O0O0O000O0OOOO00O =="sintes"or O0O0O000O0OOOO00O =="sint":#line:336
317
+ O0O0O000O0OOOO00O ="synthe"#line:337
318
+ if O0O0O000O0OOOO00O =="axos"or O0O0O000O0OOOO00O =="axo":#line:338
319
+ O0O0O000O0OOOO00O ="axso"#line:339
320
+ if O0O0O000O0OOOO00O =="uno":#line:340
321
+ O0O0O000O0OOOO00O =1 #line:341
322
+ if O0O0O000O0OOOO00O =="dos"or O0O0O000O0OOOO00O =="do":#line:342
323
+ O0O0O000O0OOOO00O =2 #line:343
324
+ if O0O0O000O0OOOO00O =="tres"or O0O0O000O0OOOO00O =="tr":#line:344
325
+ O0O0O000O0OOOO00O =3 #line:345
326
+ if O0O0O000O0OOOO00O =="cuatro":#line:346
327
+ O0O0O000O0OOOO00O =4 #line:347
328
+ if O0O0O000O0OOOO00O =="cinco":#line:348
329
+ O0O0O000O0OOOO00O =5 #line:349
330
+ if O0O0O000O0OOOO00O =="seis"or O0O0O000O0OOOO00O =="sei":#line:350
331
+ O0O0O000O0OOOO00O =6 #line:351
332
+ if O0O0O000O0OOOO00O =="siete":#line:352
333
+ O0O0O000O0OOOO00O =7 #line:353
334
+ if O0O0O000O0OOOO00O =="ocho":#line:354
335
+ O0O0O000O0OOOO00O =8 #line:355
336
+ if O0O0O000O0OOOO00O =="nueve":#line:356
337
+ O0O0O000O0OOOO00O =9 #line:357
338
+ if O0O0O000O0OOOO00O =="cero":#line:358
339
+ O0O0O000O0OOOO00O =0 #line:359
340
+ if O0O0O000O0OOOO00O =="veintiuno":#line:360
341
+ O0O0O000O0OOOO00O ="21"#line:361
342
+ if O0O0O000O0OOOO00O =="veinte":#line:362
343
+ O0O0O000O0OOOO00O ="20"#line:363
344
+ if O0O0O000O0OOOO00O =="veintidos"or O0O0O000O0OOOO00O =="veintido":#line:364
345
+ O0O0O000O0OOOO00O ="22"#line:365
346
+ if O0O0O000O0OOOO00O =="veintitres"or O0O0O000O0OOOO00O =="veintitre":#line:366
347
+ O0O0O000O0OOOO00O ="23"#line:367
348
+ if O0O0O000O0OOOO00O =="veinticuatro":#line:368
349
+ O0O0O000O0OOOO00O ="24"#line:369
350
+ if O0O0O000O0OOOO00O =="veinticinco":#line:370
351
+ O0O0O000O0OOOO00O ="25"#line:371
352
+ if O0O0O000O0OOOO00O =="veintiseis"or O0O0O000O0OOOO00O =="veintisei":#line:372
353
+ O0O0O000O0OOOO00O ="26"#line:373
354
+ if O0O0O000O0OOOO00O =="veintisiete":#line:374
355
+ O0O0O000O0OOOO00O ="27"#line:375
356
+ if O0O0O000O0OOOO00O =="veintiocho":#line:376
357
+ O0O0O000O0OOOO00O ="28"#line:377
358
+ if O0O0O000O0OOOO00O =="veintinueve":#line:378
359
+ O0O0O000O0OOOO00O ="29"#line:379
360
+ if O0O0O000O0OOOO00O =="treinta":#line:380
361
+ O0O0O000O0OOOO00O ="30"#line:381
362
+ if type (O0O0O000O0OOOO00O )==int and type (OO0O00O0O00OO00OO )==int :#line:382
363
+ OO00O00O00O0000OO =str (OO0O00O0O00OO00OO )+'.'+str (O0O0O000O0OOOO00O )#line:383
364
+ O0O0O000O0OOOO00O =OO00O00O00O0000OO .split ('.')#line:384
365
+ OO0O00O0O00OO00OO =O0O0O000O0OOOO00O #line:385
366
+ O0O0O000O0OOOO00O =inflector .singularize (str (O0O0O000O0OOOO00O ))#line:386
367
+ O0O00OO000O00OO00 =inflector .singularize (str (O0O00OO000O00OO00 ))#line:387
368
+ O0O0O000O0OOOO00O =remove_accents (O0O0O000O0OOOO00O )#line:388
369
+ if O0O00OO000O00OO00 ==O0O0O000O0OOOO00O :#line:389
370
+ O000O0O00OOOOO0O0 =O000O0O00OOOOO0O0 +1 #line:390
371
+ OO000O0O0O0O0O0O0 [OOOO0O000O0OOO0OO ]=O000O0O00OOOOO0O0 #line:391
372
+ O00000OO00O0OOO00 =np .argwhere (OO000O0O0O0O0O0O0 ==np .amax (OO000O0O0O0O0O0O0 ))#line:392
373
+ for OOOO0O000O0OOO0OO in O00000OO00O0OOO00 :#line:393
374
+ O0O0OO0OO00O00O00 .append (OOO0O0O000O0OO0O0 [int (OOOO0O000O0OOO0OO )])#line:394
375
+ if np .all (OO000O0O0O0O0O0O0 ==0 ):#line:395
376
+ O0O0OO0OO00O00O00 =None #line:396
377
+ return O0O0OO0OO00O00O00 #line:397
378
+ async def cargar_tipo (O000000O00000O00O ,OO0000OO000O000OO ):#line:399
379
+ OOOOO00OO00OO0OOO =aiohttp .TCPConnector (ssl =True )#line:400
380
+ async with aiohttp .ClientSession (connector =OOOOO00OO00OO0OOO )as OOO00OO0O0O0OO0OO :#line:401
381
+ O0000O00O000OO0OO =await OOO00OO0O0O0OO0OO .get (f'{base_url}all-content/{OO0000OO000O000OO}',auth =auth )#line:402
382
+ O0O0O0000OO00OO00 =await O0000O00O000OO0OO .json ()#line:403
383
+ OOOOO0O000O0O00OO =None #line:404
384
+ OOOO0O00OOOOO00OO =None #line:405
385
+ for O00O00O0OO0OO0OO0 in O0O0O0000OO00OO00 :#line:406
386
+ if O000000O00000O00O ==O00O00O0OO0OO0OO0 ["nid"]:#line:407
387
+ OOOOO0O000O0O00OO =O00O00O0OO0OO0OO0 ["type"]#line:408
388
+ OOOO0O00OOOOO00OO =O00O00O0OO0OO0OO0 #line:409
389
+ break #line:410
390
+ return OOOO0O00OOOOO00OO ,OOOOO0O000O0O00OO #line:411
391
+ async def cargar_archivo (O00O0OOO0OO000OOO ,O00O00OO00OOO0O0O ,O0O00O0O0O0OO00OO ):#line:413
392
+ O0OOOOOO0OO0OO0O0 =[]#line:414
393
+ O0OO00OO0O0O0O00O =aiohttp .TCPConnector (ssl =True )#line:415
394
+ async with aiohttp .ClientSession (connector =O0OO00OO0O0O0O00O )as OO00OO0OO00000OOO :#line:416
395
+ OOOO0O0O0O0OOO0O0 =await OO00OO0OO00000OOO .get ('https://orva.tedcas.com/api/'+str (O0O00O0O0O0OO00OO ),auth =auth )#line:417
396
+ OOO0O0O0O0OOO000O =await OOOO0O0O0O0OOO0O0 .json ()#line:418
397
+ OOO0O0O0O0OOO000O =OOO0O0O0O0OOO000O [0 ]#line:419
398
+ O0OOO00OO0O00OO00 ="field_"+str (O00O0OOO0OO000OOO )#line:420
399
+ O0OOO0O00O00OO0O0 =OOO0O0O0O0OOO000O [O0OOO00OO0O00OO00 ]#line:421
400
+ if O0OOO00OO0O00OO00 =="field_image":#line:422
401
+ OOO0O0O0O0OOO000O =OOO0O0O0O0OOO000O ['field_image']#line:423
402
+ OOO0O0O0O0OOO000O =OOO0O0O0O0OOO000O .split (',')#line:424
403
+ OOO0O0O0O0OOO000O =[OOOOO0O0OO000OOO0 .replace (' ','')for OOOOO0O0OO000OOO0 in OOO0O0O0O0OOO000O ]#line:425
404
+ for OOO0OO00000O00000 in OOO0O0O0O0OOO000O :#line:426
405
+ O0OOOOOO0OO0OO0O0 .append ("https://orva.tedcas.com/"+str (OOO0OO00000O00000 ))#line:427
406
+ print (O0OOOOOO0OO0OO0O0 )#line:428
407
+ return O0OOOOOO0OO0OO0O0 #line:429
408
+ if len (O0OOO0O00O00OO0O0 )==0 :#line:430
409
+ O00O0OO0000O0OOOO ="No hay archivos subidos"#line:431
410
+ O0OOOOOO0OO0OO0O0 ="templates/especialidad"#line:432
411
+ elif type (O0OOO0O00O00OO0O0 )==str :#line:433
412
+ O0OOOOOO0OO0OO0O0 ="https://orva.tedcas.com/"+str (O0OOO0O00O00OO0O0 )#line:434
413
+ O00O0OO0000O0OOOO =O0OOO0O00O00OO0O0 #line:435
414
+ elif type (O0OOO0O00O00OO0O0 )==list :#line:436
415
+ for O0OOOO0OOO0OOO000 ,OO0O0O00OO0OO0OOO in O0OOO0O00O00OO0O0 :#line:437
416
+ O0OOOOOO0OO0OO0O0 [O0OOOO0OOO0OOO000 ]="https://orva.tedcas.com/"+str (OO0O0O00OO0OO0OOO )#line:438
417
+ O00O0OO0000O0OOOO =O0OOO0O00O00OO0O0 #line:439
418
+ return O00O00OO00OOO0O0O ,O0OOOOOO0OO0OO0O0 ,O00O0OO0000O0OOOO #line:440
419
+ async def cargar_archivo_grande (OO00OO0OO0OO0O00O ,O0000OO0O0O000OOO ,O00OO00OOOO000OO0 ):#line:442
420
+ O000OOO000O0000O0 =aiohttp .TCPConnector (ssl =True )#line:443
421
+ async with aiohttp .ClientSession (connector =O000OOO000O0000O0 )as O00OO0OOO0OO0O0OO :#line:444
422
+ OOOOOO000OO000O0O =await O00OO0OOO0OO0O0OO .get ('https://orva.tedcas.com/api/'+str (O00OO00OOOO000OO0 ),auth =auth )#line:445
423
+ OOO0000OO0O00O0O0 =await OOOOOO000OO000O0O .json ()#line:446
424
+ O0OOO0OOOOOOO0OOO ={}#line:447
425
+ if OO00OO0OO0OO0O00O =='title_material':#line:448
426
+ for OO0OOO00000O00OOO in OOO0000OO0O00O0O0 :#line:449
427
+ O0OOO0OOOOOOO0OOO [OO0OOO00000O00OOO [OO00OO0OO0OO0O00O ]]=(OO0OOO00000O00OOO [OO00OO0OO0OO0O00O ])#line:450
428
+ return O0OOO0OOOOOOO0OOO ,O0000OO0O0O000OOO #line:451
429
+ OOO0000OO0O00O0O0 =OOO0000OO0O00O0O0 [0 ]#line:452
430
+ O0OOOO0O0000OO00O ="field_"+str (OO00OO0OO0OO0O00O )#line:453
431
+ O0OOOO0O0000OO00O =OOO0000OO0O00O0O0 [O0OOOO0O0000OO00O ]#line:454
432
+ if len (O0OOOO0O0000OO00O )==0 :#line:455
433
+ O0OOO0OOOOOOO0OOO ["No hay archivos"]="templates/especialidad"#line:456
434
+ else :#line:457
435
+ for OO0OOO00000O00OOO in O0OOOO0O0000OO00O :#line:458
436
+ O0OOO0OOOOOOO0OOO [OO0OOO00000O00OOO ['descripcion']]="https://orva.tedcas.com/"+str (OO0OOO00000O00OOO ['url'])#line:459
437
+ return O0000OO0O0O000OOO ,O0OOO0OOOOOOO0OOO #line:460
438
+ async def cargar_caja (O0O000OO0OOOO0000 ,OOOOO0O0O0O0OOO0O ):#line:462
439
+ O0O0O00O000O00OOO ={}#line:463
440
+ O0OO00OOOO0OO0O00 =aiohttp .TCPConnector (ssl =True )#line:464
441
+ async with aiohttp .ClientSession (connector =O0OO00OOOO0OO0O00 )as O0O0O000OOO00O000 :#line:465
442
+ O0OO0OOO0O000OOOO =await O0O0O000OOO00O000 .get (f'{base_url}intervenciones/{O0O000OO0OOOO0000}',auth =auth )#line:466
443
+ OOOOOO000000OO00O =await O0OO0OOO0O000OOOO .json ()#line:467
444
+ OOOOOO000000OO00O =OOOOOO000000OO00O [0 ]#line:468
445
+ if 'field_cajas'in OOOOOO000000OO00O :#line:469
446
+ OOOOOO000000OO00O =OOOOOO000000OO00O ['field_cajas']#line:470
447
+ for OOOO0000O0OOOO0O0 in OOOOOO000000OO00O :#line:471
448
+ O0O0O00O000O00OOO [OOOO0000O0OOOO0O0 ['id']]=OOOO0000O0OOOO0O0 ['caja']#line:472
449
+ else :#line:473
450
+ O0O0O00O000O00OOO [str (O0O000OO0OOOO0000 )]="No hay archivos"#line:474
451
+ return O0O0O00O000O00OOO ,OOOOO0O0O0O0OOO0O #line:475
452
+ async def cargar_instrumental (OO00OO0OO0OO00O0O ,O0000O00OOO00O0OO ):#line:477
453
+ OOOO00OOO000OO0OO ={}#line:478
454
+ OO000O0O0OOO0O0OO =aiohttp .TCPConnector (ssl =True )#line:479
455
+ async with aiohttp .ClientSession (connector =OO000O0O0OOO0O0OO )as O0OOO00OO0OOOOOOO :#line:480
456
+ O0OOO0O0OOOOOOO00 =await O0OOO00OO0OOOOOOO .get ('https://orva.tedcas.com/api/'+str (O0000O00OOO00O0OO ),auth =auth )#line:481
457
+ O000O0O00OOOOOOOO =await O0OOO0O0OOOOOOO00 .json ()#line:482
458
+ for OO000OO00O00O000O in O000O0O00OOOOOOOO :#line:483
459
+ if 'instrumental'in OO000OO00O00O000O :#line:484
460
+ for OOO00O0000000OOOO in OO000OO00O00O000O ['instrumental']:#line:485
461
+ if OOO00O0000000OOOO ['id']==OO00OO0OO0OO00O0O :#line:486
462
+ OOOO00OOO000OO0OO [OO000OO00O00O000O ['nid']]=OO000OO00O00O000O ['title']#line:487
463
+ return OOOO00OOO000OO0OO #line:488
464
+ async def cargar_botones_pdf_admision ():#line:490
465
+ O00O0OO0OO0O0O0OO ={}#line:491
466
+ O0OO0OOOO00000O0O ={}#line:492
467
+ O0OOO0000OO000OOO ={}#line:493
468
+ O0000OO00O00O0O00 ={}#line:494
469
+ OO000OO00O000OO0O =aiohttp .TCPConnector (ssl =True )#line:495
470
+ async with aiohttp .ClientSession (connector =OO000OO00O000OO0O )as OO0OOO0OOOOO00000 :#line:496
471
+ OOO0O00O000O00OOO =await OO0OOO0OOOOO00000 .get ('https://orva.tedcas.com/api/all-content/1621',auth =auth )#line:497
472
+ O0OOO0O0OOOOO000O =await OOO0O00O000O00OOO .json ()#line:498
473
+ for OOO00OOO0O00OO0OO in O0OOO0O0OOOOO000O :#line:499
474
+ O00OOO00O0O0O0O00 =await OO0OOO0OOOOO00000 .get ('https://orva.tedcas.com/api/intervenciones/'+str (OOO00OOO0O00OO0OO ['nid']),auth =auth )#line:500
475
+ O0OO00000OO00O00O =await O00OOO00O0O0O0O00 .json ()#line:501
476
+ O0OO00000OO00O00O =O0OO00000OO00O00O [0 ]#line:502
477
+ OOO0OOOO000O0O000 =O0OO00000OO00O00O ['field_pdf']#line:503
478
+ OOO0OOOO000O0O000 =OOO0OOOO000O0O000 [0 ]#line:504
479
+ if O0OO00000OO00O00O ['field_tecnica']=="Mapa de camas":#line:505
480
+ O00O0OO0OO0O0O0OO [O0OO00000OO00O00O ['title']]="https://orva.tedcas.com/"+str (OOO0OOOO000O0O000 ['url'])#line:506
481
+ elif O0OO00000OO00O00O ['field_tecnica']=="Ambulancias":#line:507
482
+ O0OO0OOOO00000O0O [O0OO00000OO00O00O ['title']]="https://orva.tedcas.com/"+str (OOO0OOOO000O0O000 ['url'])#line:508
483
+ elif O0OO00000OO00O00O ['field_tecnica']=="Programación quirúrgica":#line:509
484
+ O0OOO0000OO000OOO [O0OO00000OO00O00O ['title']]="https://orva.tedcas.com/"+str (OOO0OOOO000O0O000 ['url'])#line:510
485
+ elif O0OO00000OO00O00O ['field_tecnica']=="Otros":#line:511
486
+ O0000OO00O00O0O00 [O0OO00000OO00O00O ['title']]="https://orva.tedcas.com/"+str (OOO0OOOO000O0O000 ['url'])#line:512
487
+ return O00O0OO0OO0O0O0OO ,O0OO0OOOO00000O0O ,O0OOO0000OO000OOO ,O0000OO00O00O0O00 #line:513
488
+ def remove_accents (OOO00000O00OOO00O ):#line:515
489
+ OO0000O0O0O0000O0 =unicodedata .normalize ('NFKD',OOO00000O00OOO00O )#line:516
490
+ return u"".join ([OO00OO0OO0OO0OOOO for OO00OO0OO0OO0OOOO in OO0000O0O0O0000O0 if not unicodedata .combining (OO00OO0OO0OO0OOOO )])#line:517
491
+ def adaptar_salida (OO0OO00O0O000O000 ):#line:519
492
+ OO0O0OOO00O000000 =[]#line:520
493
+ OO0OO00O0O000O000 =str (OO0OO00O0O000O000 ).lower ()#line:521
494
+ OO0OO00O0O000O000 =OO0OO00O0O000O000 .split ("}")#line:522
495
+ OO0OO00O0O000O000 =OO0OO00O0O000O000 [0 ].split (":")#line:523
496
+ if len (OO0OO00O0O000O000 )>=2 :#line:524
497
+ O0000OOOOO0O0OOOO =OO0OO00O0O000O000 [1 ].split ("'")#line:525
498
+ OO0O0OOO00O000000 =O0000OOOOO0O0OOOO [1 ].split ()#line:526
499
+ return OO0O0OOO00O000000 #line:527
500
+ def takeCommand (audio_data ):#line:529
501
+ O0O0000O00O00OO0O =sr .Recognizer ()#line:531
502
+ try :#line:532
503
+ print ("Recognizing...")#line:533
504
+ audio_data =O0O0000O00O00OO0O .recognize_google (O0OO0000O0000O0OO ,language ='es-ES')#line:534
505
+ print (f"User said: {audio_data}\n")#line:535
506
+ return audio_data
507
+ except Exception as OOO00O0O0O0OO0OOO :#line:536
508
+ print (OOO00O0O0O0OO0OOO )#line:537
509
+ print ("Unable to Recognize your voice.")#line:538
510
+ audio_data ="none"#line:539
511
+ return audio_data
512
+ app =Flask (__name__ )#line:541
513
+ socketio =SocketIO (app )#line:542
514
+ app .config ['SECRET_KEY']='mysecretkey'#line:543
515
+ IMG_FOLDER =os .path .join ('static','IMG')#line:545
516
+ app .config ['UPLOAD_FOLDER']=IMG_FOLDER #line:546
517
+ recognized_text =[]#line:548
518
+ @app .route ("/")#line:550
519
+ async def hello ():#line:551
520
+ OOO000OOOO0O0O0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'trauma.jpeg')#line:552
521
+ OOO0O00O000O0O0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'uro.jpeg')#line:553
522
+ OO0O000O00OOO000O =os .path .join (app .config ['UPLOAD_FOLDER'],'adm.jpeg')#line:554
523
+ OOO0O00O0O00O0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'tijerass.png')#line:555
524
+ return render_template ('especialidad.html',user_image0 =OOO0O00O0O00O0O0O ,user_image1 =OOO000OOOO0O0O0OO ,user_image2 =OOO0O00O000O0O0OO ,user_image3 =OO0O000O00OOO000O )#line:556
525
+ @socketio .on ('audio_data')#line:558
526
+ def handle_audio (OOOO000OO00OOOOOO ):#line:559
527
+ takeCommand (OOOO000OO00OOOOOO )#line:560
528
+ socketio .emit ('transcription',recognized_text )#line:561
529
+ return recognized_text #line:562
530
+ @app .route ("/especialidad")#line:564
531
+ async def especialidad ():#line:565
532
+ O00O0OO000OO000OO =os .path .join (app .config ['UPLOAD_FOLDER'],'trauma.jpeg')#line:566
533
+ OO000OOOO000O0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'uro.jpeg')#line:567
534
+ OOOO000OO000O0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'adm.jpeg')#line:568
535
+ O0O0OOOOOOOO00OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'tijerass.png')#line:569
536
+ return render_template ('especialidad.html',user_image0 =O0O0OOOOOOOO00OO0 ,user_image1 =O00O0OO000OO000OO ,user_image2 =OO000OOOO000O0O0O ,user_image3 =OOOO000OO000O0O00 )#line:570
537
+ @app .route ("/seleccion_trauma",methods =['GET','POST'])#line:572
538
+ async def seleccion_trauma ():#line:573
539
+ OO0O0O000O0OOOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:574
540
+ OO0OO0000O0OO000O =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:575
541
+ O00O00000O0O0OOOO =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:576
542
+ O0000O0OOOOO00OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:577
543
+ return render_template ('seleccion_trauma.html',user_image4 =OO0O0O000O0OOOO00 ,user_image5 =OO0OO0000O0OO000O ,user_image6 =O00O00000O0O0OOOO ,user_image7 =O0000O0OOOOO00OOO )#line:578
544
+ @app .route ("/preguntas_respuestas_trauma",methods =['GET','POST'])#line:580
545
+ async def preguntas_respuestas_trauma ():#line:581
546
+ OO0OOO0OOOOOO000O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:582
547
+ O0OO0O00OO00O00OO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:583
548
+ O0OO0000O0000O000 ,OOO0OOO0O0OOOOOOO ,OO0000OO00O000OO0 =await faq ()#line:584
549
+ return render_template ('preguntas_respuestas.html',user_image6 =OO0OOO0OOOOOO000O ,user_image7 =O0OO0O00OO00O00OO ,faqs =O0OO0000O0000O000 ,faq_titulo ="Preguntas y respuestas: ")#line:585
550
+ @app .route ("/preguntas_respuestas_uro",methods =['GET','POST'])#line:587
551
+ async def preguntas_respuestas_uro ():#line:588
552
+ OOOO0O0OO0OOO0OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:589
553
+ OOOO0OO00OOO0000O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:590
554
+ OOO00O000OOO00000 ,OO0OOO0000O000OOO ,OOO0O000000OO00O0 =await faq ()#line:591
555
+ return render_template ('preguntas_respuestas.html',user_image6 =OOOO0O0OO0OOO0OO0 ,user_image7 =OOOO0OO00OOO0000O ,faqs =OO0OOO0000O000OOO ,faq_titulo ="Preguntas y respuestas: ")#line:592
556
+ @app .route ("/preguntas_respuestas_admin",methods =['GET','POST'])#line:594
557
+ async def preguntas_respuestas_admin ():#line:595
558
+ OOOOOO0O0OO00OO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:596
559
+ OOO00OOO0OO0000OO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:597
560
+ OOO000O0O000OOO00 ,O000OOOO0O000O0OO ,OOOOO0OOO0O0O0O00 =await faq ()#line:598
561
+ return render_template ('preguntas_respuestas.html',user_image6 =OOOOOO0O0OO00OO00 ,user_image7 =OOO00OOO0OO0000OO ,faqs =OOOOO0OOO0O0O0O00 ,faq_titulo ="Preguntas y respuestas: ")#line:599
562
+ @app .route ("/buscador_trauma",methods =['GET','POST'])#line:601
563
+ async def buscador_trauma ():#line:602
564
+ O0OOO0OO0OOO0OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:603
565
+ O0OO0OO00OOO0O000 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:604
566
+ OOOO00OO0OOOO00OO =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:605
567
+ OO0OOO000OOOOOO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:606
568
+ O00OO00000OO000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:607
569
+ OO0O0O00O0OO00O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:608
570
+ O0OOO0O0000O000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:609
571
+ O0O0OO0O00OO000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:610
572
+ OO00O00OO0O0O0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'preguntas_respuestas.png')#line:611
573
+ O0OO0O0O00O0O0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:612
574
+ OO0O0000OO0O0O0O0 =str (request .form .to_dict ())#line:613
575
+ OO0O0000OO0O0O0O0 =adaptar_salida (OO0O0000OO0O0O0O0 )#line:614
576
+ OOOOO0O00OO0O00OO ={}#line:615
577
+ OOOOO0O00OO0O00OO [""]=""#line:616
578
+ if len (OO0O0000OO0O0O0O0 )==0 :#line:617
579
+ return render_template ('buscador_trauma.html',preguntas_respuestas =OO00O00OO0O0O0O00 ,result_busqueda =OOOOO0O00OO0O00OO ,user_image4 =O0OOO0OO0OOO0OO0O ,user_image5 =O0OO0OO00OOO0O000 ,user_image6 =OOOO00OO0OOOO00OO ,user_image7 =OO0OOO000OOOOOO0O ,user_image8 =O0OOO0O0000O000O0 ,user_image9 =O0O0OO0O00OO000O0 ,user_image10 =O00OO00000OO000O0 ,user_image11 =O0OO0O0O00O0O0O0O ,user_image12 =OO0O0O00O0OO00O0O ,nid2 =0 )#line:618
580
+ elif OO0O0000OO0O0O0O0 !=None or "{}":#line:619
581
+ O00O0000OOO0OO00O =1 #line:620
582
+ O00O0OO0O0OOO0OOO =await cargar_base_datos (OO0O0000OO0O0O0O0 ,O00O0000OOO0OO00O )#line:621
583
+ OOOOOOOO000O0000O ,OO00OO000OOOO0O0O ,O0000O00O0O0O0O00 =await buscar_faq (OO0O0000OO0O0O0O0 ,1 )#line:622
584
+ if O00O0OO0O0OOO0OOO ==None :#line:623
585
+ if len (OOOOOOOO000O0000O )==0 :#line:624
586
+ return render_template ('buscador_trauma.html',preguntas_respuestas =OO00O00OO0O0O0O00 ,result_busqueda =OOOOO0O00OO0O00OO ,prediction_text ="No hay resultados para tu busqueda",user_image4 =O0OOO0OO0OOO0OO0O ,user_image5 =O0OO0OO00OOO0O000 ,user_image6 =OOOO00OO0OOOO00OO ,user_image7 =OO0OOO000OOOOOO0O ,user_image8 =O0OOO0O0000O000O0 ,user_image9 =O0O0OO0O00OO000O0 ,user_image10 =O00OO00000OO000O0 ,user_image11 =O0OO0O0O00O0O0O0O ,user_image12 =OO0O0O00O0OO00O0O ,nid2 =0 )#line:625
587
+ else :#line:626
588
+ return render_template ('buscador_trauma.html',preguntas_respuestas =OO00O00OO0O0O0O00 ,faqs =OOOOOOOO000O0000O ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OOOOO0O00OO0O00OO ,user_image4 =O0OOO0OO0OOO0OO0O ,user_image5 =O0OO0OO00OOO0O000 ,user_image6 =OOOO00OO0OOOO00OO ,user_image7 =OO0OOO000OOOOOO0O ,user_image8 =O0OOO0O0000O000O0 ,user_image9 =O0O0OO0O00OO000O0 ,user_image10 =O00OO00000OO000O0 ,user_image11 =O0OO0O0O00O0O0O0O ,user_image12 =OO0O0O00O0OO00O0O ,nid2 =0 )#line:627
589
+ elif len (O00O0OO0O0OOO0OOO )>=1 :#line:628
590
+ OOOO0OO000000O0O0 =[]#line:629
591
+ OOO0O00O00OO000O0 =[]#line:630
592
+ OOOOO0O00OO0O00OO ={}#line:631
593
+ for O00O0OOO00OOO0O00 in O00O0OO0O0OOO0OOO :#line:632
594
+ OOOO0OO000000O0O0 .append (O00O0OOO00OOO0O00 ["title"])#line:633
595
+ OOO0O00O00OO000O0 .append (O00O0OOO00OOO0O00 ["nid"])#line:634
596
+ for O00O000OOO00OOOO0 ,O00O0OOO00OOO0O00 in enumerate (OOOO0OO000000O0O0 ):#line:635
597
+ OOOOO0O00OO0O00OO [OOO0O00O00OO000O0 [O00O000OOO00OOOO0 ]]=O00O0OOO00OOO0O00 #line:636
598
+ if len (OOOOOOOO000O0000O )!=0 :#line:637
599
+ return render_template ('buscador_trauma1.html',faqs =OOOOOOOO000O0000O ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OOOOO0O00OO0O00OO ,user_image4 =O0OOO0OO0OOO0OO0O ,user_image5 =O0OO0OO00OOO0O000 ,user_image6 =OOOO00OO0OOOO00OO ,user_image7 =OO0OOO000OOOOOO0O ,user_image8 =O0OOO0O0000O000O0 ,user_image9 =O0O0OO0O00OO000O0 ,user_image10 =O00OO00000OO000O0 ,user_image11 =O0OO0O0O00O0O0O0O ,user_image12 =OO0O0O00O0OO00O0O ,nid2 =0 )#line:638
600
+ else :#line:639
601
+ if len (OOOOO0O00OO0O00OO )==1 :#line:640
602
+ return redirect (url_for ('resultado_trauma',link =OOO0O00O00OO000O0 ))#line:641
603
+ else :#line:642
604
+ return render_template ('buscador_trauma1.html',result_busqueda =OOOOO0O00OO0O00OO ,user_image4 =O0OOO0OO0OOO0OO0O ,user_image5 =O0OO0OO00OOO0O000 ,user_image6 =OOOO00OO0OOOO00OO ,user_image7 =OO0OOO000OOOOOO0O ,user_image8 =O0OOO0O0000O000O0 ,user_image9 =O0O0OO0O00OO000O0 ,user_image10 =O00OO00000OO000O0 ,user_image11 =O0OO0O0O00O0O0O0O ,user_image12 =OO0O0O00O0OO00O0O ,nid2 =0 )#line:643
605
+ @app .route ("/resultado_trauma",methods =['GET','POST'])#line:645
606
+ async def resultado_trauma ():#line:646
607
+ OOO0000O00O00O000 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:647
608
+ O0OOOOOO00O00O00O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:648
609
+ OOOO0O0OOOO0OO0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:649
610
+ O0000OO00OOOO00OO =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:650
611
+ OOOOOO0O0O0O00OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:651
612
+ OOOOOO000OOOOO0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:652
613
+ OO00OOO0000000000 =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:653
614
+ O0000O0O0000O00O0 =request .args .get ('link')#line:654
615
+ O00OO00O00000000O ,OOO0000O0OO0O00O0 =await cargar_tipo (O0000O0O0000O00O0 ,1 )#line:655
616
+ O0000000O0O00OO00 =O00OO00O00000000O ['title']#line:656
617
+ if OOO0000O0OO0O00O0 =="Intervencion":#line:658
618
+ OOOO0OOO0OOO000O0 ,OO00OO0O0OOOOO00O =await cargar_caja (str (O0000O0O0000O00O0 ),'Instrumental - Cajas: ')#line:659
619
+ return render_template ('intervencion_trauma.html',user_image8 =OOOOOO0O0O0O00OO0 ,user_image9 =OOOOOO000OOOOO0OO ,user_image10 =OOOO0O0OOOO0OO0O0 ,user_image11 =OO00OOO0000000000 ,user_image12 =O0000OO00OOOO00OO ,instrumental =OOOO0OOO0OOO000O0 ,texto_cajas =OO00OO0O0OOOOO00O ,title =O0000000O0O00OO00 ,user_image6 =OOO0000O00O00O000 ,user_image7 =O0OOOOOO00O00O00O ,nid2 =O0000O0O0000O00O0 )#line:660
620
+ elif OOO0000O0OO0O00O0 =='Caja':#line:661
621
+ O00O0000O000O00OO ,O000OO00O000O0OOO ,OO0OO0O0OOO00O0O0 =await cargar_archivo ("ubicacion","Ubicacion: ","cajas/"+str (O0000O0O0000O00O0 ))#line:662
622
+ OO0OO0OO00O0OO0OO =await cargar_archivo ("image","Imagen: ","cajas/"+str (O0000O0O0000O00O0 ))#line:663
623
+ O0OO0OOOOO0OOOO00 ,OOO00OO000O000OO0 =await cargar_archivo_grande ("title_material","Instrumental : ","cajas/"+str (O0000O0O0000O00O0 ))#line:664
624
+ if len (O0000000O0O00OO00 )==1 :#line:665
625
+ return render_template ('caja_trauma1.html',title =O0000000O0O00OO00 ,files_instru =O0OO0OOOOO0OOOO00 ,texto_instru =OOO00OO000O000OO0 ,texto_ubi =O00O0000O000O00OO ,file_texto_ubi =OO0OO0O0OOO00O0O0 ,file_imagen =OO0OO0OO00O0OO0OO ,user_image6 =OOO0000O00O00O000 ,user_image7 =O0OOOOOO00O00O00O )#line:666
626
+ else :#line:667
627
+ return render_template ('caja_trauma.html',title =O0000000O0O00OO00 ,files_instru =O0OO0OOOOO0OOOO00 ,texto_instru =OOO00OO000O000OO0 ,texto_ubi =O00O0000O000O00OO ,file_texto_ubi =OO0OO0O0OOO00O0O0 ,file_imagen =OO0OO0OO00O0OO0OO ,user_image6 =OOO0000O00O00O000 ,user_image7 =O0OOOOOO00O00O00O )#line:668
628
+ elif OOO0000O0OO0O00O0 =='Instrumental':#line:669
629
+ OOOOO00O0O000OO0O =await cargar_instrumental (O0000O0O0000O00O0 ,'listado_completo_cajas/1')#line:670
630
+ if len (OOOOO00O0O000OO0O )==1 :#line:671
631
+ return render_template ('instrumental_trauma1.html',cajas =OOOOO00O0O000OO0O ,texto ='El instrumental que buscas esta presente en las siguientes cajas: ',title =O0000000O0O00OO00 ,user_image6 =OOO0000O00O00O000 ,user_image7 =O0OOOOOO00O00O00O )#line:672
632
+ else :#line:673
633
+ return render_template ('instrumental_trauma.html',cajas =OOOOO00O0O000OO0O ,texto ='El instrumental que buscas esta presente en las siguientes cajas: ',title =O0000000O0O00OO00 ,user_image6 =OOO0000O00O00O000 ,user_image7 =O0OOOOOO00O00O00O )#line:674
634
+ @app .route ("/protocolos_trauma",methods =['GET','POST'])#line:676
635
+ async def protocolos_trauma ():#line:677
636
+ OO00OOO0OOOOO00O0 =request .args .get ('link2')#line:678
637
+ O00OOOO0O00000OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:679
638
+ OO00O00O0O0OOOO00 =await boton_word_ppt (1 ,"field_protocolo",OO00OOO0OOOOO00O0 )#line:680
639
+ if len (OO00O00O0O0OOOO00 )==1 :#line:681
640
+ return render_template ('protocolo1.html',protocolos =OO00O00O0O0OOOO00 ,user_image7 =O00OOOO0O00000OOO )#line:682
641
+ else :#line:683
642
+ return render_template ('protocolo.html',protocolos =OO00O00O0O0OOOO00 ,user_image7 =O00OOOO0O00000OOO )#line:684
643
+ @app .route ("/guia_visual_trauma",methods =['GET','POST'])#line:686
644
+ async def guia_visual_trauma ():#line:687
645
+ OOOO00O0000OO00O0 =request .args .get ('link2')#line:688
646
+ O0OO0O0OO0O00O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:689
647
+ OO0O000OOOOO0OOOO =await boton_word_ppt (1 ,"field_guia_visual",OOOO00O0000OO00O0 )#line:690
648
+ if len (OO0O000OOOOO0OOOO )==1 :#line:691
649
+ return render_template ('guia_visual1.html',guia_visual =OO0O000OOOOO0OOOO ,user_image7 =O0OO0O0OO0O00O0O0 )#line:692
650
+ else :#line:693
651
+ return render_template ('guia_visual.html',guia_visual =OO0O000OOOOO0OOOO ,user_image7 =O0OO0O0OO0O00O0O0 )#line:694
652
+ @app .route ("/pdf_casa_trauma",methods =['GET','POST'])#line:696
653
+ async def pdf_casa_trauma ():#line:697
654
+ OOOOO000O00000O00 =request .args .get ('link2')#line:698
655
+ O0O0O0OOOOO0O0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:699
656
+ O0O00OOOO00OOOOO0 =await boton_pdf_video (1 ,"field_pdf",OOOOO000O00000O00 )#line:700
657
+ O000OO000OO00000O =0 #line:701
658
+ for O0OOOOO00OO00O00O ,O00O0OOO0OOOOOOO0 in O0O00OOOO00OOOOO0 .items ():#line:702
659
+ for OOOOOOOOOOO0OOOO0 ,OOO0OO0OOOO00OO0O in O00O0OOO0OOOOOOO0 .items ():#line:703
660
+ O000OO000OO00000O =O000OO000OO00000O +1 #line:704
661
+ if len (O0O00OOOO00OOOOO0 .items ())==1 :#line:705
662
+ if O000OO000OO00000O ==1 :#line:706
663
+ print ("bien")#line:707
664
+ return render_template ('pdf_casa_comercial1.html',user_image7 =O0O0O0OOOOO0O0O0O ,titulos =O0O00OOOO00OOOOO0 )#line:708
665
+ else :#line:709
666
+ return render_template ('pdf_casa_comercial.html',user_image7 =O0O0O0OOOOO0O0O0O ,titulos =O0O00OOOO00OOOOO0 )#line:710
667
+ else :#line:711
668
+ return render_template ('pdf_casa_comercial.html',user_image7 =O0O0O0OOOOO0O0O0O ,titulos =O0O00OOOO00OOOOO0 )#line:712
669
+ @app .route ("/videos_trauma",methods =['GET','POST'])#line:714
670
+ async def videos_trauma ():#line:715
671
+ OO000OO0O00OO0O0O =request .args .get ('link2')#line:716
672
+ O0O0OOOO000O0OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:717
673
+ OO00O0OOOOOO0OOOO =await boton_pdf_video (1 ,"field_video",OO000OO0O00OO0O0O )#line:718
674
+ O0OO000O00O0OO000 =0 #line:719
675
+ for OO0O0OO00000OOOOO ,O000O000OOOOOOOOO in OO00O0OOOOOO0OOOO .items ():#line:720
676
+ for O00O0000O0O00000O ,OOO00O0O0000OO0OO in O000O000OOOOOOOOO .items ():#line:721
677
+ O0OO000O00O0OO000 =O0OO000O00O0OO000 +1 #line:722
678
+ if len (OO00O0OOOOOO0OOOO .items ())==1 :#line:723
679
+ if O0OO000O00O0OO000 ==1 :#line:724
680
+ print ("bien")#line:725
681
+ return render_template ('videos1.html',user_image7 =O0O0OOOO000O0OO0O ,titulos =OO00O0OOOOOO0OOOO )#line:726
682
+ else :#line:727
683
+ return render_template ('videos.html',user_image7 =O0O0OOOO000O0OO0O ,titulos =OO00O0OOOOOO0OOOO )#line:728
684
+ else :#line:729
685
+ return render_template ('videos.html',user_image7 =O0O0OOOO000O0OO0O ,titulos =OO00O0OOOOOO0OOOO )#line:730
686
+ @app .route ("/materiales_trauma",methods =['GET','POST'])#line:732
687
+ async def materiales_trauma ():#line:733
688
+ OO0O000O00O0OO0O0 =request .args .get ('link2')#line:734
689
+ OOOOO0O00O0OO0OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:735
690
+ O0OO00OOOOOO0O0O0 =await boton_materiales (1 ,OO0O000O00O0OO0O0 )#line:736
691
+ if len (O0OO00OOOOOO0O0O0 [''])==0 :#line:737
692
+ return render_template ('materiales_uro.html',user_image7 =OOOOO0O00O0OO0OO0 ,cajas =O0OO00OOOOOO0O0O0 ,no_hay ="No hay instrumental")#line:738
693
+ else :#line:739
694
+ if len (O0OO00OOOOOO0O0O0 )==1 :#line:740
695
+ return render_template ('materiales_uro1.html',user_image7 =OOOOO0O00O0OO0OO0 ,cajas =O0OO00OOOOOO0O0O0 )#line:741
696
+ else :#line:742
697
+ return render_template ('materiales_uro.html',user_image7 =OOOOO0O00O0OO0OO0 ,cajas =O0OO00OOOOOO0O0O0 )#line:743
698
+ @app .route ("/escuchar_trauma1",methods =['GET','POST'])#line:745
699
+ async def escuchar_trauma1 ():#line:746
700
+ OO000000O0O000OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:747
701
+ O000OO00OO0000O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:748
702
+ OO000OOO00000O00O =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:749
703
+ O0OO000OO0OO0O0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:750
704
+ O0OOOOO000O0000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:751
705
+ O0000O00000OO0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:752
706
+ O0OOO0O000O000OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:753
707
+ OO0OO0OOOOOOOO000 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:754
708
+ return render_template ('escuchar_trauma1.html',nid2 =0 ,prediction_text ="Dale a `Escuchar´ y haz tu pregunta",user_image5 =O0000O00000OO0O0O ,user_image6 =O0OOO0O000O000OOO ,user_image7 =OO0OO0OOOOOOOO000 ,user_image8 =OO000OOO00000O00O ,user_image9 =O0OO000OO0OO0O0OO ,user_image10 =OO000000O0O000OO0 ,user_image11 =O0OOOOO000O0000O0 ,user_image12 =O000OO00OO0000O00 )#line:755
709
+ @app .route ("/escuchar_trauma",methods =['GET','POST'])#line:757
710
+ async def escuchar_trauma ():#line:758
711
+ OOO0O0OOO0O0O0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:759
712
+ OOOO000OOO00O0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:760
713
+ O000OO0OOOO0O00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:761
714
+ OOO0O00O0OO0OO0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:762
715
+ O0O0O0OO0OO0O0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:763
716
+ OOOOO00OO0OOOO0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:764
717
+ O0OOO00OOO0000OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:765
718
+ OO0OO0O00OO00OO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:766
719
+ global recognized_text #line:767
720
+ OO0O000O00OOO0O0O =recognized_text #line:768
721
+ OO0O000O00OOO0O0O =str (OO0O000O00OOO0O0O ).lower ()#line:769
722
+ OO0O000O00OOO0O0O =OO0O000O00OOO0O0O .split ()#line:770
723
+ O0O00000O0O00OO0O ={}#line:771
724
+ O0O00000O0O00OO0O [""]=""#line:772
725
+ if OO0O000O00OOO0O0O [0 ]!="none":#line:773
726
+ O0OOO00O0000OOOOO =1 #line:774
727
+ OO00O0000OOO0OO0O =await cargar_base_datos (OO0O000O00OOO0O0O ,O0OOO00O0000OOOOO )#line:775
728
+ O0000OO00OOOO0O0O ,O0OO0OO0OO0O00000 ,OO0O00OOOOOOOO00O =await buscar_faq (OO0O000O00OOO0O0O ,0 )#line:776
729
+ if OO00O0000OOO0OO0O ==None :#line:777
730
+ if len (O0000OO00OOOO0O0O )==0 :#line:778
731
+ return render_template ('escuchar_trauma.html',nid2 =0 ,result_busqueda =O0O00000O0O00OO0O ,prediction_text ="No hay resultados para tu busqueda",user_image6 =O0OOO00OOO0000OO0 ,user_image7 =OO0OO0O00OO00OO00 ,user_image5 =OOOOO00OO0OOOO0O0 ,user_image8 =O000OO0OOOO0O00O0 ,user_image9 =OOO0O00O0OO0OO0OO ,user_image10 =OOO0O0OOO0O0O0000 ,user_image11 =O0O0O0OO0OO0O0OOO ,user_image12 =OOOO000OOO00O0000 )#line:779
732
+ else :#line:780
733
+ return render_template ('escuchar_trauma.html',nid2 =0 ,faqs =O0000OO00OOOO0O0O ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =O0O00000O0O00OO0O ,user_image6 =O0OOO00OOO0000OO0 ,user_image7 =OO0OO0O00OO00OO00 ,user_image5 =OOOOO00OO0OOOO0O0 ,user_image8 =O000OO0OOOO0O00O0 ,user_image9 =OOO0O00O0OO0OO0OO ,user_image10 =OOO0O0OOO0O0O0000 ,user_image11 =O0O0O0OO0OO0O0OOO ,user_image12 =OOOO000OOO00O0000 )#line:781
734
+ elif len (OO00O0000OOO0OO0O )>=1 :#line:782
735
+ OOO0OOOO00O0O0000 =[]#line:783
736
+ OOO0O000O000O000O =[]#line:784
737
+ O0O00000O0O00OO0O ={}#line:785
738
+ for OOOO0000000OOOO0O in OO00O0000OOO0OO0O :#line:786
739
+ OOO0OOOO00O0O0000 .append (OOOO0000000OOOO0O ["title"])#line:787
740
+ OOO0O000O000O000O .append (OOOO0000000OOOO0O ["nid"])#line:788
741
+ for O0OOO00000OO000O0 ,OOOO0000000OOOO0O in enumerate (OOO0OOOO00O0O0000 ):#line:789
742
+ O0O00000O0O00OO0O [OOO0O000O000O000O [O0OOO00000OO000O0 ]]=OOOO0000000OOOO0O #line:790
743
+ if len (O0000OO00OOOO0O0O )==0 :#line:792
744
+ return render_template ('escuchar_trauma.html',nid2 =0 ,result_busqueda =O0O00000O0O00OO0O ,user_image6 =O0OOO00OOO0000OO0 ,user_image7 =OO0OO0O00OO00OO00 ,user_image5 =OOOOO00OO0OOOO0O0 ,user_image8 =O000OO0OOOO0O00O0 ,user_image9 =OOO0O00O0OO0OO0OO ,user_image10 =OOO0O0OOO0O0O0000 ,user_image11 =O0O0O0OO0OO0O0OOO ,user_image12 =OOOO000OOO00O0000 )#line:793
745
+ else :#line:794
746
+ return render_template ('escuchar_trauma.html',nid2 =0 ,faqs =O0000OO00OOOO0O0O ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =O0O00000O0O00OO0O ,user_image6 =O0OOO00OOO0000OO0 ,user_image7 =OO0OO0O00OO00OO00 ,user_image5 =OOOOO00OO0OOOO0O0 ,user_image8 =O000OO0OOOO0O00O0 ,user_image9 =OOO0O00O0OO0OO0OO ,user_image10 =OOO0O0OOO0O0O0000 ,user_image11 =O0O0O0OO0OO0O0OOO ,user_image12 =OOOO000OOO00O0000 )#line:795
747
+ else :#line:796
748
+ return render_template ('escuchar_trauma.html',nid2 =0 ,result_busqueda =O0O00000O0O00OO0O ,prediction_text ="No te he entendido bien, dale al boton `Escuchar´ y repite tu pregunta",user_image5 =OOOOO00OO0OOOO0O0 ,user_image6 =O0OOO00OOO0000OO0 ,user_image7 =OO0OO0O00OO00OO00 ,user_image8 =O000OO0OOOO0O00O0 ,user_image9 =OOO0O00O0OO0OO0OO ,user_image10 =OOO0O0OOO0O0O0000 ,user_image11 =O0O0O0OO0OO0O0OOO ,user_image12 =OOOO000OOO00O0000 )#line:797
749
+ @app .route ("/buscador_admision",methods =['GET','POST'])#line:799
750
+ async def buscador_admision ():#line:800
751
+ O0000O0O00OO00O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:801
752
+ OO0O0O00O00OOOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:802
753
+ OO0OOOOOO0O000O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:803
754
+ O0O0O000O0000O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:804
755
+ O000OOO0OOO0OO000 =os .path .join (app .config ['UPLOAD_FOLDER'],'otros_img.png')#line:805
756
+ O000OOOOOO00O000O =os .path .join (app .config ['UPLOAD_FOLDER'],'programacion_img.png')#line:806
757
+ OO00000OOO00000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'preguntas_respuestas.png')#line:807
758
+ O0O0O0O00000O0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'ambulancias_img.jpg')#line:808
759
+ O0OOO0OO0OOO0OOOO =os .path .join (app .config ['UPLOAD_FOLDER'],'mapa_camas_img.jpg')#line:809
760
+ OOOO00O00OO00O0OO =str (request .form .to_dict ())#line:810
761
+ OOOO00O00OO00O0OO =adaptar_salida (OOOO00O00OO00O0OO )#line:811
762
+ O00OO000OO0OOOOO0 ={}#line:812
763
+ O00OO000OO0OOOOO0 [""]=""#line:813
764
+ if len (OOOO00O00OO00O0OO )==0 :#line:814
765
+ return render_template ('buscador_admision.html',preguntas_respuestas =OO00000OOO00000O0 ,user_image8 =O0OOO0OO0OOO0OOOO ,user_image9 =O0O0O0O00000O0O00 ,user_image10 =O000OOOOOO00O000O ,user_image11 =O000OOO0OOO0OO000 ,result_busqueda =O00OO000OO0OOOOO0 ,prediction_text ="ya puedes hacer tu pregunta",user_image4 =O0000O0O00OO00O0O ,user_image5 =OO0O0O00O00OOOO00 ,user_image6 =OO0OOOOOO0O000O0O ,user_image7 =O0O0O000O0000O0O0 )#line:815
766
+ elif OOOO00O00OO00O0OO !=None or "{}":#line:816
767
+ O0OOOO0O0O0O0000O =1621 #line:817
768
+ O000000OO0O0O00OO =await cargar_base_datos (OOOO00O00OO00O0OO ,O0OOOO0O0O0O0000O )#line:818
769
+ O0OOOO0OOO000OOOO ,O0O0OOOOOOO00OO0O ,OOO00O00OO0OOO00O =await buscar_faq (OOOO00O00OO00O0OO ,1 )#line:819
770
+ if O000000OO0O0O00OO ==None :#line:820
771
+ if len (OOO00O00OO0OOO00O )==0 :#line:821
772
+ return render_template ('buscador_admision.html',preguntas_respuestas =OO00000OOO00000O0 ,user_image8 =O0OOO0OO0OOO0OOOO ,user_image9 =O0O0O0O00000O0O00 ,user_image10 =O000OOOOOO00O000O ,user_image11 =O000OOO0OOO0OO000 ,result_busqueda =O00OO000OO0OOOOO0 ,prediction_text ="No hay resultados para tu busqueda",user_image4 =O0000O0O00OO00O0O ,user_image5 =OO0O0O00O00OOOO00 ,user_image6 =OO0OOOOOO0O000O0O ,user_image7 =O0O0O000O0000O0O0 )#line:822
773
+ else :#line:823
774
+ return render_template ('buscador_admision.html',preguntas_respuestas =OO00000OOO00000O0 ,user_image8 =O0OOO0OO0OOO0OOOO ,user_image9 =O0O0O0O00000O0O00 ,user_image10 =O000OOOOOO00O000O ,user_image11 =O000OOO0OOO0OO000 ,faqs =OOO00O00OO0OOO00O ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =O00OO000OO0OOOOO0 ,user_image4 =O0000O0O00OO00O0O ,user_image5 =OO0O0O00O00OOOO00 ,user_image6 =OO0OOOOOO0O000O0O ,user_image7 =O0O0O000O0000O0O0 )#line:824
775
+ elif len (O000000OO0O0O00OO )>=1 :#line:825
776
+ O0OO00OOO0OOOOO00 =[]#line:826
777
+ OOO00OOOOO0OO0O0O =[]#line:827
778
+ O00OO000OO0OOOOO0 ={}#line:828
779
+ for OOO0000OO00000O0O in O000000OO0O0O00OO :#line:829
780
+ OOO00OOOOO0OO0O0O .append (OOO0000OO00000O0O ["nid"])#line:830
781
+ for OO0OO000O0O0OOO0O in OOO00OOOOO0OO0O0O :#line:831
782
+ O00O0O0O00O0OO0OO =aiohttp .TCPConnector (ssl =True )#line:832
783
+ async with aiohttp .ClientSession (connector =O00O0O0O00O0OO0OO )as O0OO0O00O000OO00O :#line:833
784
+ O00OOO0OO0OO000O0 =await O0OO0O00O000OO00O .get ('https://orva.tedcas.com/api/intervenciones/'+str (OO0OO000O0O0OOO0O ),auth =auth )#line:834
785
+ OOOO000O00O000OOO =await O00OOO0OO0OO000O0 .json ()#line:835
786
+ OOOO000O00O000OOO =OOOO000O00O000OOO [0 ]#line:836
787
+ O00000OOOOOOOOO0O =OOOO000O00O000OOO ['field_pdf']#line:837
788
+ O00000OOOOOOOOO0O =O00000OOOOOOOOO0O [0 ]#line:838
789
+ O00OO000OO0OOOOO0 [OOOO000O00O000OOO ['title']]="https://orva.tedcas.com/"+str (O00000OOOOOOOOO0O ['url'])#line:839
790
+ if len (OOO00O00OO0OOO00O )==0 :#line:840
791
+ return render_template ('buscador_admision1.html',user_image8 =O0OOO0OO0OOO0OOOO ,user_image9 =O0O0O0O00000O0O00 ,user_image10 =O000OOOOOO00O000O ,user_image11 =O000OOO0OOO0OO000 ,result_busqueda =O00OO000OO0OOOOO0 ,user_image4 =O0000O0O00OO00O0O ,user_image5 =OO0O0O00O00OOOO00 ,user_image6 =OO0OOOOOO0O000O0O ,user_image7 =O0O0O000O0000O0O0 )#line:841
792
+ else :#line:842
793
+ return render_template ('buscador_admision1.html',faqs =OOO00O00OO0OOO00O ,faq_titulo ="Preguntas y respuestas: ",user_image8 =O0OOO0OO0OOO0OOOO ,user_image9 =O0O0O0O00000O0O00 ,user_image10 =O000OOOOOO00O000O ,user_image11 =O000OOO0OOO0OO000 ,result_busqueda =O00OO000OO0OOOOO0 ,user_image4 =O0000O0O00OO00O0O ,user_image5 =OO0O0O00O00OOOO00 ,user_image6 =OO0OOOOOO0O000O0O ,user_image7 =O0O0O000O0000O0O0 )#line:843
794
+ @app .route ("/mapa_camas",methods =['GET','POST'])#line:845
795
+ async def mapa_camas ():#line:846
796
+ OOOO0O0OO0OOO0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:847
797
+ OOOO0O0000OO0O000 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:848
798
+ O0O0000OO00O00OOO ,O0O00O00OO0O0OOOO ,O00O000OOO0OO00O0 ,O0O0OOOO00000OOOO =await cargar_botones_pdf_admision ()#line:849
799
+ return render_template ('mapa_camas.html',text =O0O0000OO00O00OOO ,user_image6 =OOOO0O0OO0OOO0O00 ,user_image7 =OOOO0O0000OO0O000 )#line:850
800
+ @app .route ("/ambulancias",methods =['GET','POST'])#line:852
801
+ async def ambulancias ():#line:853
802
+ O0O0OOOO00OO00000 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:854
803
+ O0000O0000OOO000O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:855
804
+ OO0O0OOO000OOO0O0 ,OO0OOOOO0OO000O0O ,OOOO000OOOOOOO00O ,O0O0OOOO0000O0000 =await cargar_botones_pdf_admision ()#line:856
805
+ return render_template ('ambulancias.html',text =OO0OOOOO0OO000O0O ,user_image6 =O0O0OOOO00OO00000 ,user_image7 =O0000O0000OOO000O )#line:857
806
+ @app .route ("/programacion_quirurgica",methods =['GET','POST'])#line:859
807
+ async def programacion_quirurgica ():#line:860
808
+ OO0O0O000OOO00OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:861
809
+ O0O00000O0O00OOOO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:862
810
+ OOO00000O0OOO0O0O ,OO0O0OOOO0O0O0O00 ,O000O000O000OOO0O ,O000O00O00O000OO0 =await cargar_botones_pdf_admision ()#line:863
811
+ return render_template ('programacion_quirurgica.html',text =O000O000O000OOO0O ,user_image6 =OO0O0O000OOO00OOO ,user_image7 =O0O00000O0O00OOOO )#line:864
812
+ @app .route ("/otros",methods =['GET','POST'])#line:866
813
+ async def otros ():#line:867
814
+ O00O00OOOOOO0OOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:868
815
+ O0OOO00O0O0O0OOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:869
816
+ O00O0O00O0OOO00O0 ,O000OOOOO00O0O0O0 ,OOOO000OO0OO0O00O ,O0O0OOOOO000O0OO0 =await cargar_botones_pdf_admision ()#line:870
817
+ return render_template ('otros.html',text =O0O0OOOOO000O0OO0 ,user_image6 =O00O00OOOOOO0OOO0 ,user_image7 =O0OOO00O0O0O0OOO0 )#line:871
818
+ @app .route ("/escuchar_admision1",methods =['GET','POST'])#line:873
819
+ async def escuchar_admision1 ():#line:874
820
+ OO00OOOO000OO0OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'otros_img.png')#line:875
821
+ OOO0O0O000OO0OOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'programacion_img.png')#line:876
822
+ OOOO0O0O00O0O0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'ambulancias_img.jpg')#line:877
823
+ O00OO0OO000OO0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'mapa_camas_img.jpg')#line:878
824
+ O00OOO00000O0O00O =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:879
825
+ OO0O0O0OO00OO0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:880
826
+ O0O0000OOO0O0OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:881
827
+ return render_template ('escuchar_admision1.html',user_image8 =O00OO0OO000OO0OOO ,user_image9 =OOOO0O0O00O0O0O00 ,user_image10 =OOO0O0O000OO0OOO0 ,user_image11 =OO00OOOO000OO0OO0 ,prediction_text ="Dale a `Escuchar´ y haz tu pregunta",user_image5 =O00OOO00000O0O00O ,user_image6 =OO0O0O0OO00OO0O0O ,user_image7 =O0O0000OOO0O0OO0O )#line:882
828
+ @app .route ("/escuchar_admision",methods =['GET','POST'])#line:884
829
+ async def escuchar_admision ():#line:885
830
+ O000O00O00OO0O00O =os .path .join (app .config ['UPLOAD_FOLDER'],'otros_img.png')#line:886
831
+ OOO00O0000OO0OO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'programacion_img.png')#line:887
832
+ OOOOO0O00000000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ambulancias_img.jpg')#line:888
833
+ O0OOO000000O00OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'mapa_camas_img.jpg')#line:889
834
+ O00O0OO0OO000O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:890
835
+ O00OO0000O0O0O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:891
836
+ O0OOO00OO000O00OO =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:892
837
+ OOOO000O0O00O00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:893
838
+ global recognized_text #line:894
839
+ OO000O0O00OO00O0O =recognized_text #line:895
840
+ OO000O0O00OO00O0O =str (OO000O0O00OO00O0O ).lower ()#line:896
841
+ OO000O0O00OO00O0O =OO000O0O00OO00O0O .split ()#line:897
842
+ OO0OOOOOO00O0OOO0 ={}#line:898
843
+ OO0OOOOOO00O0OOO0 [""]=""#line:899
844
+ if OO000O0O00OO00O0O [0 ]!="none":#line:900
845
+ OOO0OOOO0O0O00OOO =1621 #line:901
846
+ OOOOOO000OO0O00O0 =await cargar_base_datos (OO000O0O00OO00O0O ,OOO0OOOO0O0O00OOO )#line:902
847
+ O0O00OO0O0OOO0000 ,OOOO0O0O00000O000 ,OO000OO00OOO0OOOO =await buscar_faq (OO000O0O00OO00O0O ,0 )#line:903
848
+ if OOOOOO000OO0O00O0 ==None :#line:904
849
+ if len (OO000OO00OOO0OOOO )==0 :#line:905
850
+ return render_template ('escuchar_admision.html',user_image8 =O0OOO000000O00OO0 ,user_image9 =OOOOO0O00000000O0 ,user_image10 =OOO00O0000OO0OO00 ,user_image11 =O000O00O00OO0O00O ,result_busqueda =OO0OOOOOO00O0OOO0 ,prediction_text ="No hay resultados para tu busqueda",user_image4 =O00O0OO0OO000O0O0 ,user_image5 =O00OO0000O0O0O0O0 ,user_image6 =O0OOO00OO000O00OO ,user_image7 =OOOO000O0O00O00O0 )#line:906
851
+ else :#line:907
852
+ return render_template ('escuchar_admision.html',faqs =OO000OO00OOO0OOOO ,faq_titulo ="Preguntas y respuestas: ",user_image8 =O0OOO000000O00OO0 ,user_image9 =OOOOO0O00000000O0 ,user_image10 =OOO00O0000OO0OO00 ,user_image11 =O000O00O00OO0O00O ,result_busqueda =OO0OOOOOO00O0OOO0 ,user_image4 =O00O0OO0OO000O0O0 ,user_image5 =O00OO0000O0O0O0O0 ,user_image6 =O0OOO00OO000O00OO ,user_image7 =OOOO000O0O00O00O0 )#line:908
853
+ elif len (OOOOOO000OO0O00O0 )>=1 :#line:909
854
+ O0O0000OO0000000O =[]#line:910
855
+ OOO0000O0O000O0O0 =[]#line:911
856
+ OO0OOOOOO00O0OOO0 ={}#line:912
857
+ for OO00OOOOOO0OO000O in OOOOOO000OO0O00O0 :#line:913
858
+ OOO0000O0O000O0O0 .append (OO00OOOOOO0OO000O ["nid"])#line:914
859
+ for OOOO00O000OOOO0O0 in OOO0000O0O000O0O0 :#line:915
860
+ OOO0OO0O00OO00O0O =aiohttp .TCPConnector (ssl =True )#line:916
861
+ async with aiohttp .ClientSession (connector =OOO0OO0O00OO00O0O )as OO0OO0O0O000OO0OO :#line:917
862
+ O0O0O0O00OO0OOO00 =await OO0OO0O0O000OO0OO .get ('https://orva.tedcas.com/api/intervenciones/'+str (OOOO00O000OOOO0O0 ),auth =auth )#line:918
863
+ O0OOOOOO0OOO000OO =await O0O0O0O00OO0OOO00 .json ()#line:919
864
+ O0OOOOOO0OOO000OO =O0OOOOOO0OOO000OO [0 ]#line:920
865
+ OO0OOO0000OOO000O =O0OOOOOO0OOO000OO ['field_pdf']#line:921
866
+ OO0OOO0000OOO000O =OO0OOO0000OOO000O [0 ]#line:922
867
+ OO0OOOOOO00O0OOO0 [O0OOOOOO0OOO000OO ['title']]="https://orva.tedcas.com/"+str (OO0OOO0000OOO000O ['url'])#line:923
868
+ if len (OO000OO00OOO0OOOO )==0 :#line:924
869
+ return render_template ('escuchar_admision.html',user_image8 =O0OOO000000O00OO0 ,user_image9 =OOOOO0O00000000O0 ,user_image10 =OOO00O0000OO0OO00 ,user_image11 =O000O00O00OO0O00O ,result_busqueda =OO0OOOOOO00O0OOO0 ,user_image4 =O00O0OO0OO000O0O0 ,user_image5 =O00OO0000O0O0O0O0 ,user_image6 =O0OOO00OO000O00OO ,user_image7 =OOOO000O0O00O00O0 )#line:925
870
+ else :#line:926
871
+ return render_template ('escuchar_admision.html',faqs =OO000OO00OOO0OOOO ,faq_titulo ="Preguntas y respuestas: ",user_image8 =O0OOO000000O00OO0 ,user_image9 =OOOOO0O00000000O0 ,user_image10 =OOO00O0000OO0OO00 ,user_image11 =O000O00O00OO0O00O ,result_busqueda =OO0OOOOOO00O0OOO0 ,user_image4 =O00O0OO0OO000O0O0 ,user_image5 =O00OO0000O0O0O0O0 ,user_image6 =O0OOO00OO000O00OO ,user_image7 =OOOO000O0O00O00O0 )#line:927
872
+ else :#line:928
873
+ return render_template ('escuchar_admision.html',user_image8 =O0OOO000000O00OO0 ,user_image9 =OOOOO0O00000000O0 ,user_image10 =OOO00O0000OO0OO00 ,user_image11 =O000O00O00OO0O00O ,prediction_text ="No te he entendido bien, dale al boton `Escuchar´ y repite tu pregunta",result_busqueda =OO0OOOOOO00O0OOO0 ,user_image4 =O00O0OO0OO000O0O0 ,user_image5 =O00OO0000O0O0O0O0 ,user_image6 =O0OOO00OO000O00OO ,user_image7 =OOOO000O0O00O00O0 )#line:929
874
+ @app .route ("/buscador_uro",methods =['GET','POST'])#line:931
875
+ async def buscador_uro ():#line:932
876
+ OO00OO0OO0000OO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:933
877
+ OOOO00O0OOOO00000 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:934
878
+ OOOOOOO0OO00OO0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:935
879
+ OO0OOO0000OOOO000 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:936
880
+ OO000O0O0OO0OO0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:937
881
+ O00O0O0OOO0000O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:938
882
+ O0O000O0O000O0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:939
883
+ O0O0OO0000O0O0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:940
884
+ O0OO0OOOO00OOOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'preguntas_respuestas.png')#line:941
885
+ OO0OO0OO00OO0000O =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:942
886
+ O0OO0O00OOO00000O =str (request .form .to_dict ())#line:943
887
+ O0OO0O00OOO00000O =adaptar_salida (O0OO0O00OOO00000O )#line:944
888
+ O0O0O000OOO0OOOOO ={}#line:945
889
+ O0O0O000OOO0OOOOO [""]=""#line:946
890
+ if len (O0OO0O00OOO00000O )==0 :#line:947
891
+ return render_template ('buscador_uro.html',preguntas_respuestas =O0OO0OOOO00OOOO00 ,result_busqueda =O0O0O000OOO0OOOOO ,user_image4 =OO00OO0OO0000OO00 ,user_image5 =OOOO00O0OOOO00000 ,user_image6 =OOOOOOO0OO00OO0O0 ,user_image7 =OO0OOO0000OOOO000 ,user_image8 =O0O000O0O000O0O0O ,user_image9 =O0O0OO0000O0O0OOO ,user_image10 =OO000O0O0OO0OO0OO ,user_image11 =OO0OO0OO00OO0000O ,user_image12 =O00O0O0OOO0000O0O ,nid2 =0 )#line:948
892
+ elif O0OO0O00OOO00000O !=None or "{}":#line:949
893
+ O0O0OO000OOOOO0O0 =1620 #line:950
894
+ OOO0OO0O00000O0O0 =await cargar_base_datos (O0OO0O00OOO00000O ,O0O0OO000OOOOO0O0 )#line:951
895
+ O000OOOO00O0O00OO ,O0O0O000OO0OOOOOO ,O000OO0O0O0000OOO =await buscar_faq (O0OO0O00OOO00000O ,1 )#line:952
896
+ if OOO0OO0O00000O0O0 ==None :#line:953
897
+ if len (O0O0O000OO0OOOOOO )==0 :#line:954
898
+ return render_template ('buscador_uro.html',preguntas_respuestas =O0OO0OOOO00OOOO00 ,result_busqueda =O0O0O000OOO0OOOOO ,prediction_text ="No hay resultados para tu busqueda",user_image4 =OO00OO0OO0000OO00 ,user_image5 =OOOO00O0OOOO00000 ,user_image6 =OOOOOOO0OO00OO0O0 ,user_image7 =OO0OOO0000OOOO000 ,user_image8 =O0O000O0O000O0O0O ,user_image9 =O0O0OO0000O0O0OOO ,user_image10 =OO000O0O0OO0OO0OO ,user_image11 =OO0OO0OO00OO0000O ,user_image12 =O00O0O0OOO0000O0O ,nid2 =0 )#line:955
899
+ else :#line:956
900
+ return render_template ('buscador_uro.html',preguntas_respuestas =O0OO0OOOO00OOOO00 ,faqs =O0O0O000OO0OOOOOO ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =O0O0O000OOO0OOOOO ,user_image4 =OO00OO0OO0000OO00 ,user_image5 =OOOO00O0OOOO00000 ,user_image6 =OOOOOOO0OO00OO0O0 ,user_image7 =OO0OOO0000OOOO000 ,user_image8 =O0O000O0O000O0O0O ,user_image9 =O0O0OO0000O0O0OOO ,user_image10 =OO000O0O0OO0OO0OO ,user_image11 =OO0OO0OO00OO0000O ,user_image12 =O00O0O0OOO0000O0O ,nid2 =0 )#line:957
901
+ elif len (OOO0OO0O00000O0O0 )>=1 :#line:958
902
+ O00O0O0O00OO0OO00 =[]#line:959
903
+ O000000O0O0OOOO0O =[]#line:960
904
+ O0O0O000OOO0OOOOO ={}#line:961
905
+ for OO0OOOOO00O000OO0 in OOO0OO0O00000O0O0 :#line:962
906
+ O00O0O0O00OO0OO00 .append (OO0OOOOO00O000OO0 ["title"])#line:963
907
+ O000000O0O0OOOO0O .append (OO0OOOOO00O000OO0 ["nid"])#line:964
908
+ for O0O00O0O0OOO0OOO0 ,OO0OOOOO00O000OO0 in enumerate (O00O0O0O00OO0OO00 ):#line:965
909
+ O0O0O000OOO0OOOOO [O000000O0O0OOOO0O [O0O00O0O0OOO0OOO0 ]]=OO0OOOOO00O000OO0 #line:966
910
+ if len (O0O0O000OO0OOOOOO )!=0 :#line:967
911
+ return render_template ('buscador_uro1.html',faqs =O0O0O000OO0OOOOOO ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =O0O0O000OOO0OOOOO ,user_image4 =OO00OO0OO0000OO00 ,user_image5 =OOOO00O0OOOO00000 ,user_image6 =OOOOOOO0OO00OO0O0 ,user_image7 =OO0OOO0000OOOO000 ,user_image8 =O0O000O0O000O0O0O ,user_image9 =O0O0OO0000O0O0OOO ,user_image10 =OO000O0O0OO0OO0OO ,user_image11 =OO0OO0OO00OO0000O ,user_image12 =O00O0O0OOO0000O0O ,nid2 =0 )#line:968
912
+ else :#line:969
913
+ if len (O0O0O000OOO0OOOOO )==1 :#line:970
914
+ return redirect (url_for ('resultado_uro',link =O000000O0O0OOOO0O ))#line:971
915
+ else :#line:972
916
+ return render_template ('buscador_uro1.html',result_busqueda =O0O0O000OOO0OOOOO ,user_image4 =OO00OO0OO0000OO00 ,user_image5 =OOOO00O0OOOO00000 ,user_image6 =OOOOOOO0OO00OO0O0 ,user_image7 =OO0OOO0000OOOO000 ,user_image8 =O0O000O0O000O0O0O ,user_image9 =O0O0OO0000O0O0OOO ,user_image10 =OO000O0O0OO0OO0OO ,user_image11 =OO0OO0OO00OO0000O ,user_image12 =O00O0O0OOO0000O0O ,nid2 =0 )#line:973
917
+ @app .route ("/resultado_uro",methods =['GET','POST'])#line:975
918
+ async def resultado_uro ():#line:976
919
+ OO0OOOO0000000000 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:977
920
+ O0O0OOOO0O00OOOOO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:978
921
+ O000O0OO00OO0O000 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:979
922
+ OOOO00O0000OOOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:980
923
+ O0OO00OOOOOOOOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:981
924
+ OO0O0OO00OOOO00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:982
925
+ OOOOO0O00OO0000OO =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:983
926
+ OO0O0OO0O00O000OO =request .args .get ('link')#line:984
927
+ OO0000OOOO000O0O0 ,OO00OOO000OO0OO00 =await cargar_tipo (OO0O0OO0O00O000OO ,1620 )#line:985
928
+ O000OO0O00000O0O0 =OO0000OOOO000O0O0 ['title']#line:986
929
+ if OO00OOO000OO0OO00 =="Intervencion":#line:987
930
+ print ("hola1")#line:988
931
+ OO0OO00O0O0OO000O ,OOOO0O000OOOOOO00 =await cargar_caja (str (OO0O0OO0O00O000OO ),'Instrumental - Cajas: ')#line:989
932
+ return render_template ('intervencion_uro.html',user_image8 =O0OO00OOOOOOOOO00 ,user_image9 =OO0O0OO00OOOO00O0 ,user_image10 =O000O0OO00OO0O000 ,user_image11 =OOOOO0O00OO0000OO ,user_image12 =OOOO00O0000OOOO00 ,instrumental =OO0OO00O0O0OO000O ,texto_cajas =OOOO0O000OOOOOO00 ,title =O000OO0O00000O0O0 ,user_image6 =OO0OOOO0000000000 ,user_image7 =O0O0OOOO0O00OOOOO ,nid2 =OO0O0OO0O00O000OO )#line:990
933
+ elif OO00OOO000OO0OO00 =='Caja':#line:991
934
+ O000O0O0O0O0OOO00 ,O00OO00O000O0O0OO ,OO00000O000000O00 =await cargar_archivo ("ubicacion","Ubicacion: ","cajas/"+str (OO0O0OO0O00O000OO ))#line:992
935
+ OOO00OOO0000OOO0O =await cargar_archivo ("image","Imagen: ","cajas/"+str (OO0O0OO0O00O000OO ))#line:993
936
+ OOOOO00OOO0000000 ,OOO00OO000OO0OO0O =await cargar_archivo_grande ("title_material","Instrumental : ","cajas/"+str (OO0O0OO0O00O000OO ))#line:994
937
+ if len (O000OO0O00000O0O0 )==1 :#line:995
938
+ return render_template ('caja_trauma1.html',title =O000OO0O00000O0O0 ,files_instru =OOOOO00OOO0000000 ,texto_instru =OOO00OO000OO0OO0O ,texto_ubi =O000O0O0O0O0OOO00 ,file_texto_ubi =OO00000O000000O00 ,file_imagen =OOO00OOO0000OOO0O ,user_image6 =OO0OOOO0000000000 ,user_image7 =O0O0OOOO0O00OOOOO )#line:996
939
+ else :#line:997
940
+ return render_template ('caja_trauma.html',title =O000OO0O00000O0O0 ,files_instru =OOOOO00OOO0000000 ,texto_instru =OOO00OO000OO0OO0O ,texto_ubi =O000O0O0O0O0OOO00 ,file_texto_ubi =OO00000O000000O00 ,file_imagen =OOO00OOO0000OOO0O ,user_image6 =OO0OOOO0000000000 ,user_image7 =O0O0OOOO0O00OOOOO )#line:998
941
+ elif OO00OOO000OO0OO00 =='Instrumental':#line:999
942
+ print ("hola2")#line:1000
943
+ OO0OO0OOOOO0000O0 =await cargar_instrumental (OO0O0OO0O00O000OO ,'listado_completo_cajas/1620')#line:1001
944
+ if len (OO0OO0OOOOO0000O0 )==1 :#line:1002
945
+ return render_template ('instrumental_uro1.html',cajas =OO0OO0OOOOO0000O0 ,texto ='El instrumental que buscas esta presente en las siguientes cajas: ',title =O000OO0O00000O0O0 ,user_image6 =OO0OOOO0000000000 ,user_image7 =O0O0OOOO0O00OOOOO )#line:1003
946
+ else :#line:1004
947
+ return render_template ('instrumental_uro.html',cajas =OO0OO0OOOOO0000O0 ,texto ='El instrumental que buscas esta presente en las siguientes cajas: ',title =O000OO0O00000O0O0 ,user_image6 =OO0OOOO0000000000 ,user_image7 =O0O0OOOO0O00OOOOO )#line:1005
948
+ @app .route ("/protocolos_uro",methods =['GET','POST'])#line:1007
949
+ async def protocolos_uro ():#line:1008
950
+ OOO0OOO0OOOO0OOO0 =request .args .get ('link2')#line:1009
951
+ OOO0O000O00000OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1010
952
+ O0000O000000O0OO0 =await boton_word_ppt (1620 ,"field_protocolo",OOO0OOO0OOOO0OOO0 )#line:1011
953
+ if len (O0000O000000O0OO0 )==1 :#line:1012
954
+ return render_template ('protocolo1.html',protocolos =O0000O000000O0OO0 ,user_image7 =OOO0O000O00000OO0 )#line:1013
955
+ else :#line:1014
956
+ return render_template ('protocolo.html',protocolos =O0000O000000O0OO0 ,user_image7 =OOO0O000O00000OO0 )#line:1015
957
+ @app .route ("/guia_visual_uro",methods =['GET','POST'])#line:1017
958
+ async def guia_visual_uro ():#line:1018
959
+ O000OO0O0OOO0O00O =request .args .get ('link2')#line:1019
960
+ OO0O0OO0O000O0OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1020
961
+ O0OO0OOOOO00O00OO =await boton_word_ppt (1620 ,"field_guia_visual",O000OO0O0OOO0O00O )#line:1021
962
+ if len (O0OO0OOOOO00O00OO )==1 :#line:1022
963
+ return render_template ('guia_visual1.html',guia_visual =O0OO0OOOOO00O00OO ,user_image7 =OO0O0OO0O000O0OO0 )#line:1023
964
+ else :#line:1024
965
+ return render_template ('guia_visual.html',guia_visual =O0OO0OOOOO00O00OO ,user_image7 =OO0O0OO0O000O0OO0 )#line:1025
966
+ @app .route ("/pdf_casa_uro",methods =['GET','POST'])#line:1027
967
+ async def pdf_casa_uro ():#line:1028
968
+ OOOO0OOOO000O0000 =request .args .get ('link2')#line:1029
969
+ O000OOOOOOOO000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1030
970
+ OO0000OO00O0OO000 =await boton_pdf_video (1620 ,"field_pdf",OOOO0OOOO000O0000 )#line:1031
971
+ OO00OOO0000OO000O =0 #line:1032
972
+ for OOO0O000OO0OOO000 ,O0OO0OOOOO0O0OO0O in OO0000OO00O0OO000 .items ():#line:1033
973
+ for OOOO0000000O00O00 ,O0000O0O0000O0OOO in O0OO0OOOOO0O0OO0O .items ():#line:1034
974
+ OO00OOO0000OO000O =OO00OOO0000OO000O +1 #line:1035
975
+ if len (OO0000OO00O0OO000 .items ())==1 :#line:1036
976
+ if OO00OOO0000OO000O ==1 :#line:1037
977
+ print ("bien")#line:1038
978
+ return render_template ('pdf_casa_comercial1.html',user_image7 =O000OOOOOOOO000O0 ,titulos =OO0000OO00O0OO000 )#line:1039
979
+ else :#line:1040
980
+ return render_template ('pdf_casa_comercial.html',user_image7 =O000OOOOOOOO000O0 ,titulos =OO0000OO00O0OO000 )#line:1041
981
+ else :#line:1042
982
+ return render_template ('pdf_casa_comercial.html',user_image7 =O000OOOOOOOO000O0 ,titulos =OO0000OO00O0OO000 )#line:1043
983
+ @app .route ("/videos_uro",methods =['GET','POST'])#line:1045
984
+ async def videos_uro ():#line:1046
985
+ OO000O0000O0OOOO0 =request .args .get ('link2')#line:1047
986
+ OO0OO0O000OOO0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1048
987
+ O0O0O0OO00O0OOOOO =await boton_pdf_video (1620 ,"field_video",OO000O0000O0OOOO0 )#line:1049
988
+ O0O0OOO00O000000O =0 #line:1050
989
+ for OO00000OO0OO000O0 ,OOO0O0O00000O0O0O in O0O0O0OO00O0OOOOO .items ():#line:1051
990
+ for OOO000OOOOOOO000O ,O0O0O00O0OO0O0OOO in OOO0O0O00000O0O0O .items ():#line:1052
991
+ O0O0OOO00O000000O =O0O0OOO00O000000O +1 #line:1053
992
+ if len (O0O0O0OO00O0OOOOO .items ())==1 :#line:1054
993
+ if O0O0OOO00O000000O ==1 :#line:1055
994
+ return render_template ('videos1.html',user_image7 =OO0OO0O000OOO0O0O ,titulos =O0O0O0OO00O0OOOOO )#line:1056
995
+ else :#line:1057
996
+ return render_template ('videos.html',user_image7 =OO0OO0O000OOO0O0O ,titulos =O0O0O0OO00O0OOOOO )#line:1058
997
+ else :#line:1059
998
+ return render_template ('videos.html',user_image7 =OO0OO0O000OOO0O0O ,titulos =O0O0O0OO00O0OOOOO )#line:1060
999
+ @app .route ("/materiales_uro",methods =['GET','POST'])#line:1062
1000
+ async def materiales_uro ():#line:1063
1001
+ O0OO000OOO0O00OOO =request .args .get ('link2')#line:1064
1002
+ O0OO000O0OOO0O00O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1065
1003
+ O0OOO00O0O0OOOO00 =await boton_materiales (1620 ,O0OO000OOO0O00OOO )#line:1066
1004
+ if len (O0OOO00O0O0OOOO00 [''])==0 :#line:1067
1005
+ return render_template ('materiales_uro.html',user_image7 =O0OO000O0OOO0O00O ,cajas =O0OOO00O0O0OOOO00 ,no_hay ="No hay instrumental")#line:1068
1006
+ else :#line:1069
1007
+ if len (O0OOO00O0O0OOOO00 )==1 :#line:1070
1008
+ return render_template ('materiales_uro1.html',user_image7 =O0OO000O0OOO0O00O ,cajas =O0OOO00O0O0OOOO00 )#line:1071
1009
+ else :#line:1072
1010
+ return render_template ('materiales_uro.html',user_image7 =O0OO000O0OOO0O00O ,cajas =O0OOO00O0O0OOOO00 )#line:1073
1011
+ @app .route ("/escuchar_uro1",methods =['GET','POST'])#line:1075
1012
+ async def escuchar_uro1 ():#line:1076
1013
+ O0OO00O0OOOOO0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:1077
1014
+ OOO00O000OO0O0OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:1078
1015
+ O0O0O0000O0OO000O =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:1079
1016
+ OOOO00000O000O0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:1080
1017
+ OO000OO0OO000O0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:1081
1018
+ OO0O00OOO0OO0OOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:1082
1019
+ O0OOO000OO0OO00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:1083
1020
+ OO0O000000000OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1084
1021
+ return render_template ('escuchar_uro1.html',nid2 =0 ,prediction_text ="Dale a `Escuchar´ y haz tu pregunta",user_image5 =OO0O00OOO0OO0OOO0 ,user_image6 =O0OOO000OO0OO00O0 ,user_image7 =OO0O000000000OO0O ,user_image8 =O0O0O0000O0OO000O ,user_image9 =OOOO00000O000O0OO ,user_image10 =O0OO00O0OOOOO0O0O ,user_image11 =OO000OO0OO000O0OO ,user_image12 =OOO00O000OO0O0OO0 )#line:1085
1022
+ @app .route ("/escuchar_uro",methods =['GET','POST'])#line:1087
1023
+ async def escuchar_uro ():#line:1088
1024
+ O000OO00000O00000 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:1089
1025
+ O0OO0O0O0O000000O =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:1090
1026
+ O00OOOOOO00OOO00O =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:1091
1027
+ O000000OOO00000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:1092
1028
+ O00O00O0O0O00O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:1093
1029
+ O0000O0OOO0O0O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:1094
1030
+ OOO000OOOOO00O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:1095
1031
+ O0O0000OO0O0O000O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1096
1032
+ global recognized_text #line:1097
1033
+ OOO0O000O00O000O0 =recognized_text #line:1098
1034
+ OOO0O000O00O000O0 =str (OOO0O000O00O000O0 ).lower ()#line:1099
1035
+ OOO0O000O00O000O0 =OOO0O000O00O000O0 .split ()#line:1100
1036
+ OO0O00OOO0O0OO0O0 ={}#line:1101
1037
+ OO0O00OOO0O0OO0O0 [""]=""#line:1102
1038
+ if OOO0O000O00O000O0 [0 ]!="none":#line:1103
1039
+ O000OOOO00OOO000O =1620 #line:1104
1040
+ O00000O0OOOO00000 =await cargar_base_datos (OOO0O000O00O000O0 ,O000OOOO00OOO000O )#line:1105
1041
+ O0OO0O000O0OOO00O ,OO0OO000O0O000O00 ,O0O0O000O00000000 =await buscar_faq (OOO0O000O00O000O0 ,0 )#line:1106
1042
+ if O00000O0OOOO00000 ==None :#line:1107
1043
+ if len (OO0OO000O0O000O00 )==0 :#line:1108
1044
+ return render_template ('escuchar_uro.html',nid2 =0 ,result_busqueda =OO0O00OOO0O0OO0O0 ,prediction_text ="No hay resultados para tu busqueda",user_image6 =OOO000OOOOO00O0O0 ,user_image7 =O0O0000OO0O0O000O ,user_image5 =O0000O0OOO0O0O0O0 ,user_image8 =O00OOOOOO00OOO00O ,user_image9 =O000000OOO00000O0 ,user_image10 =O000OO00000O00000 ,user_image11 =O00O00O0O0O00O0O0 ,user_image12 =O0OO0O0O0O000000O )#line:1109
1045
+ else :#line:1110
1046
+ return render_template ('escuchar_uro.html',nid2 =0 ,faqs =OO0OO000O0O000O00 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OO0O00OOO0O0OO0O0 ,user_image6 =OOO000OOOOO00O0O0 ,user_image7 =O0O0000OO0O0O000O ,user_image5 =O0000O0OOO0O0O0O0 ,user_image8 =O00OOOOOO00OOO00O ,user_image9 =O000000OOO00000O0 ,user_image10 =O000OO00000O00000 ,user_image11 =O00O00O0O0O00O0O0 ,user_image12 =O0OO0O0O0O000000O )#line:1111
1047
+ elif len (O00000O0OOOO00000 )>=1 :#line:1112
1048
+ OOO00O0000O0O0OO0 =[]#line:1113
1049
+ O00000OO00O00OO0O =[]#line:1114
1050
+ OO0O00OOO0O0OO0O0 ={}#line:1115
1051
+ for OO0000OOO000O00OO in O00000O0OOOO00000 :#line:1116
1052
+ OOO00O0000O0O0OO0 .append (OO0000OOO000O00OO ["title"])#line:1117
1053
+ O00000OO00O00OO0O .append (OO0000OOO000O00OO ["nid"])#line:1118
1054
+ for OOOO0OOOOO0O0O00O ,OO0000OOO000O00OO in enumerate (OOO00O0000O0O0OO0 ):#line:1119
1055
+ OO0O00OOO0O0OO0O0 [O00000OO00O00OO0O [OOOO0OOOOO0O0O00O ]]=OO0000OOO000O00OO #line:1120
1056
+ if len (OO0OO000O0O000O00 )==0 :#line:1122
1057
+ return render_template ('escuchar_uro.html',nid2 =0 ,result_busqueda =OO0O00OOO0O0OO0O0 ,user_image6 =OOO000OOOOO00O0O0 ,user_image7 =O0O0000OO0O0O000O ,user_image5 =O0000O0OOO0O0O0O0 ,user_image8 =O00OOOOOO00OOO00O ,user_image9 =O000000OOO00000O0 ,user_image10 =O000OO00000O00000 ,user_image11 =O00O00O0O0O00O0O0 ,user_image12 =O0OO0O0O0O000000O )#line:1123
1058
+ else :#line:1124
1059
+ return render_template ('escuchar_uro.html',nid2 =0 ,faqs =OO0OO000O0O000O00 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OO0O00OOO0O0OO0O0 ,user_image6 =OOO000OOOOO00O0O0 ,user_image7 =O0O0000OO0O0O000O ,user_image5 =O0000O0OOO0O0O0O0 ,user_image8 =O00OOOOOO00OOO00O ,user_image9 =O000000OOO00000O0 ,user_image10 =O000OO00000O00000 ,user_image11 =O00O00O0O0O00O0O0 ,user_image12 =O0OO0O0O0O000000O )#line:1125
1060
+ else :#line:1126
1061
+ return render_template ('escuchar_uro.html',nid2 =0 ,result_busqueda =OO0O00OOO0O0OO0O0 ,prediction_text ="No te he entendido bien, dale al boton `Escuchar´ y repite tu pregunta",user_image5 =O0000O0OOO0O0O0O0 ,user_image6 =OOO000OOOOO00O0O0 ,user_image7 =O0O0000OO0O0O000O ,user_image8 =O00OOOOOO00OOO00O ,user_image9 =O000000OOO00000O0 ,user_image10 =O000OO00000O00000 ,user_image11 =O00O00O0O0O00O0O0 ,user_image12 =O0OO0O0O0O000000O )#line:1127
1062
+ @app .route ("/ajustes")#line:1129
1063
+ async def ajustes ():#line:1130
1064
+ OO0OOO000O0OO0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'estrella.png')#line:1131
1065
+ return render_template ('ajustes.html',user_image7 =OO0OOO000O0OO0O0O )#line:1132
1066
+ if __name__ =="__main__":#line:1134
1067
+ socketio .run (app ,host ="0.0.0.0",port =7860 ,allow_unsafe_werkzeug =True )#line:1135
gitattributes (2).txt ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.model filter=lfs diff=lfs merge=lfs -text
12
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
13
+ *.onnx filter=lfs diff=lfs merge=lfs -text
14
+ *.ot filter=lfs diff=lfs merge=lfs -text
15
+ *.parquet filter=lfs diff=lfs merge=lfs -text
16
+ *.pb filter=lfs diff=lfs merge=lfs -text
17
+ *.pt filter=lfs diff=lfs merge=lfs -text
18
+ *.pth filter=lfs diff=lfs merge=lfs -text
19
+ *.rar filter=lfs diff=lfs merge=lfs -text
20
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
22
+ *.tflite filter=lfs diff=lfs merge=lfs -text
23
+ *.tgz filter=lfs diff=lfs merge=lfs -text
24
+ *.wasm filter=lfs diff=lfs merge=lfs -text
25
+ *.xz filter=lfs diff=lfs merge=lfs -text
26
+ *.zip filter=lfs diff=lfs merge=lfs -text
27
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
28
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
29
+ es_dep_news_trf-3.7.2-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text
packages.txt CHANGED
@@ -1 +1,2 @@
1
- ffmpeg
 
 
1
+ ffmpeg
2
+ portaudio19-dev
preguntas_qh_tags.xlsx ADDED
Binary file (32.7 kB). View file
 
requirements.txt CHANGED
@@ -3,12 +3,14 @@ async==0.6.2
3
  async-timeout==4.0.3
4
  asyncio==3.4.3
5
  Flask==3.0.0
 
6
  Flask[async]==3.0.0
7
  Inflector==3.1.0
8
  inflect
9
  numpy==1.24.0
10
  openpyxl==3.1.2
11
  pandas==2.0.3
 
12
  requests==2.31.0
13
  requests-oauthlib==1.3.1
14
  spacy==3.7
@@ -24,6 +26,7 @@ tensorflow-io-gcs-filesystem==0.31.0
24
  transformers==4.30.2
25
  unicodedata2==15.1.0
26
  xlrd2==1.3.4
 
27
  https://huggingface.co/spacy/es_core_news_md/resolve/main/es_core_news_md-any-py3-none-any.whl
28
 
29
 
 
3
  async-timeout==4.0.3
4
  asyncio==3.4.3
5
  Flask==3.0.0
6
+ flask-socketio
7
  Flask[async]==3.0.0
8
  Inflector==3.1.0
9
  inflect
10
  numpy==1.24.0
11
  openpyxl==3.1.2
12
  pandas==2.0.3
13
+ pyaudio
14
  requests==2.31.0
15
  requests-oauthlib==1.3.1
16
  spacy==3.7
 
26
  transformers==4.30.2
27
  unicodedata2==15.1.0
28
  xlrd2==1.3.4
29
+ Werkzeug
30
  https://huggingface.co/spacy/es_core_news_md/resolve/main/es_core_news_md-any-py3-none-any.whl
31
 
32