diff --git "a/app.py" "b/app.py" --- "a/app.py" +++ "b/app.py" @@ -1,1080 +1,1133 @@ -from flask import Flask ,render_template ,request ,jsonify ,redirect ,url_for #line: +from flask import Flask ,render_template ,request ,jsonify ,redirect ,url_for #line:1 import pandas as pd #line:2 -import ast -import numpy as np #line:3 -import xlrd2 as xlrd #line:4 -import unicodedata #line:5 -import spacy #line:6 -import inflect #line:7 +import ast #line:3 +import numpy as np #line:4 +import xlrd2 as xlrd #line:5 +import unicodedata #line:6 +import spacy #line:7 +import inflect #line:8 nlp =spacy .load ("es_core_news_md")#line:9 -from inflector import Inflector ,Spanish #line:11 -inflector =Inflector (Spanish )#line:12 -import speech_recognition as sr #line:13 -import os #line:14 -import requests #line:15 -from requests .auth import HTTPBasicAuth #line:16 -import asyncio #line:17 -import aiohttp #line:18 -from flask_socketio import SocketIO #line:19 -auth =aiohttp .BasicAuth ('1234','API')#line:21 -base_url ='https://orva.tedcas.com/api/'#line:22 -archivo ="./preguntas_qh_tags.xlsx"#line:23 -async def faq ():#line:25 - O0O000OO00O00OO00 =pd .read_excel (archivo ,engine ="openpyxl")#line:26 - O0O0OO00OOO00000O =O0O000OO00O00OO00 #line:27 - O0O000OO00O00OO00 =xlrd .open_workbook (archivo )#line:28 - O0O000OO00O00OO00 =O0O000OO00O00OO00 .sheet_by_index (0 )#line:29 - O00O00O0O0OO000O0 =[]#line:30 - O00OO00OOOOO00000 =[]#line:31 - O0O0OO0OOO0O0O00O =[]#line:32 - OOO0OO0O00O00OOO0 =pd .read_excel (archivo ,header =1 )#line:33 - for OOO0O00O00O0000O0 ,O00O000OO0OOO0000 in OOO0OO0O00O00OOO0 .iterrows ():#line:34 - if O0O0OO00OOO00000O .loc [OOO0O00O00O0000O0 ,'Especialidad']=='trauma':#line:35 - OOOO000000OOOOO00 =O0O000OO00O00OO00 .cell (int (OOO0O00O00O0000O0 )+1 ,2 )#line:36 - OO0O00O0O0O00O0OO =O0O000OO00O00OO00 .cell (int (OOO0O00O00O0000O0 )+1 ,3 )#line:37 - OOOO000000OOOOO00 =str (OOOO000000OOOOO00 )#line:38 - OO0O00O0O0O00O0OO =str (OO0O00O0O0O00O0OO )#line:39 - OOOO000000OOOOO00 =OOOO000000OOOOO00 .split ("'")#line:40 - OO0O00O0O0O00O0OO =OO0O00O0O0O00O0OO .split ("'")#line:41 - O00O00O0O0OO000O0 .append (f" {OOOO000000OOOOO00[1]} {OO0O00O0O0O00O0OO[1]} ")#line:42 - elif O0O0OO00OOO00000O .loc [OOO0O00O00O0000O0 ,'Especialidad']=='uro':#line:43 - OOOO000000OOOOO00 =O0O000OO00O00OO00 .cell (int (OOO0O00O00O0000O0 )+1 ,2 )#line:44 - OO0O00O0O0O00O0OO =O0O000OO00O00OO00 .cell (int (OOO0O00O00O0000O0 )+1 ,3 )#line:45 - OOOO000000OOOOO00 =str (OOOO000000OOOOO00 )#line:46 - OO0O00O0O0O00O0OO =str (OO0O00O0O0O00O0OO )#line:47 - OOOO000000OOOOO00 =OOOO000000OOOOO00 .split ("'")#line:48 - OO0O00O0O0O00O0OO =OO0O00O0O0O00O0OO .split ("'")#line:49 - O00OO00OOOOO00000 .append (f" {OOOO000000OOOOO00[1]} {OO0O00O0O0O00O0OO[1]} ")#line:50 - elif O0O0OO00OOO00000O .loc [OOO0O00O00O0000O0 ,'Especialidad']=='admin':#line:51 - OOOO000000OOOOO00 =O0O000OO00O00OO00 .cell (int (OOO0O00O00O0000O0 )+1 ,2 )#line:52 - OO0O00O0O0O00O0OO =O0O000OO00O00OO00 .cell (int (OOO0O00O00O0000O0 )+1 ,3 )#line:53 - OOOO000000OOOOO00 =str (OOOO000000OOOOO00 )#line:54 - OO0O00O0O0O00O0OO =str (OO0O00O0O0O00O0OO )#line:55 - OOOO000000OOOOO00 =OOOO000000OOOOO00 .split ("'")#line:56 - OO0O00O0O0O00O0OO =OO0O00O0O0O00O0OO .split ("'")#line:57 - O0O0OO0OOO0O0O00O .append (f" {OOOO000000OOOOO00[1]} {OO0O00O0O0O00O0OO[1]} ")#line:58 - if O00O000OO0OOO0000 .dropna ().empty :#line:59 - break #line:60 - return O00O00O0O0OO000O0 ,O00OO00OOOOO00000 ,O0O0OO0OOO0O0O00O #line:61 -async def buscar_faq (O0O0OOO0O00OOOOOO ,O000OOO0O000O0000 ):#line:63 - O0O000O00O0OOO0O0 =pd .read_excel (archivo ,engine ="openpyxl")#line:64 - O00000O0OOOO0OOOO =O0O000O00O0OOO0O0 #line:65 - O0OO00OO0O0OOOOOO =0 #line:66 - OO0O0OOO0O00O0OO0 =O0O0OOO0O00OOOOOO #line:67 - print(O00000O0OOOO0OOOO) - O0O0O0O0OOOOOO00O =[]#line:68 - #print ("result"+str (OO0O0OOO0O00O0OO0 ))#line:69 - for OOO0O00O00OOOO000 ,O00O0OO0OOOO0OOO0 in O0O000O00O0OOO0O0 .iterrows ():#line:70 - O0O0OOO0O00OOOO00 =O0O000O00O0OOO0O0 .loc [OOO0O00O00OOOO000 ,'TAGS2']#line:71 - O0O0OOO0O00OOOO00 =O0O0OOO0O00OOOO00 .split (",")#line:72 - O0O0O0O0OOOOOO00O .append (O0O0OOO0O00OOOO00 )#line:73 - OOOOO00O000OO00O0 =[]#line:74 - O0O0OOO0O00OOOO00 =[]#line:75 - for O00OOOO000OO0OO0O ,O00OOO000O0OO0OOO in enumerate (OO0O0OOO0O00O0OO0 ):#line:76 - OO0O0OOO0O00O0OO0 [O00OOOO000OO0OO0O ]=inflector .singularize (str (O00OOO000O0OO0OOO ))#line:77 - #cadena_lista = eval(OO0O0OOO0O00O0OO0) - #cadena_texto = ''.join(cadena_lista) - #cadena_limpia = cadena_texto.strip('["\']') - #OO0O0OOO0O00O0OO0 = cadena_limpia.replace("[",'').replace("]",'').replace("'",'').split(', ') - formatted_strings = [] - for item in OO0O0OOO0O00O0OO0: - words = item.replace("[", "").replace("]", "").replace("'", "").split(',') - formatted_strings.append(' '.join(words).strip()) - OO0O0OOO0O00O0OO0 = [ast.literal_eval(item) for item in formatted_strings] - #evaluated_list = [ast.literal_eval(item.replace("'", "")) for item in OO0O0OOO0O00O0OO0] - #OO0O0OOO0O00O0OO0 = [' '.join(item) for item in evaluated_list] - #OO0O0OOO0O00O0OO0 = [elemento.strip("'") for elemento in elementos] - #for i in range(len(OO0O0OOO0O00O0OO0)): - #OO0O0OOO0O00O0OO0.append = ast.literal_eval(OO0O0OOO0O00O0OO0[i]) - OO0O00OOO00OOOO0O =np .zeros (len (O0O000O00O0OOO0O0 .index ),dtype =int )#line:78 - for O0000O0OOOO0OO000 ,O00O0OO0OOOO0OOO0 in enumerate (O0O0O0O0OOOOOO00O ):#line:79 - OO0000000OOOOO00O =[]#line:80 - for O00OOO000O0OO0OOO in O00O0OO0OOOO0OOO0 :#line:81 - if O000OOO0O000O0000 ==0 :#line:82 - if O00OOO000O0OO0OOO !=[]:#line:83 - O0OO00OO0O0OOOOOO =0 #line:84 - for OO00O0OO0OOO000O0 in range (100 ):#line:85 - OO00O0OO0OOO000O0 =OO00O0OO0OOO000O0 /10 #line:86 - OO00O0OO0OOO000O0 =str (OO00O0OO0OOO000O0 )#line:87 - if O00OOO000O0OO0OOO ==OO00O0OO0OOO000O0 :#line:88 - OO00O0OO0OOO000O0 =OO00O0OO0OOO000O0 .split (".")#line:89 - OO0000000OOOOO00O .append (OO00O0OO0OOO000O0 [0 ])#line:90 - OO0000000OOOOO00O .append ("con")#line:91 - OO0000000OOOOO00O .append (OO00O0OO0OOO000O0 [1 ])#line:92 - O0OO00OO0O0OOOOOO =O0OO00OO0O0OOOOOO +1 #line:93 - if O0OO00OO0O0OOOOOO ==0 :#line:94 - OO0000000OOOOO00O .append (O00OOO000O0OO0OOO )#line:95 - if O000OOO0O000O0000 ==1 :#line:96 - OO0000000OOOOO00O .append (O00OOO000O0OO0OOO )#line:97 - OOOOO00O000OO00O0 .append (OO0000000OOOOO00O )#line:98 - for O00O0OO0OOO0O000O in OO0O0OOO0O00O0OO0 :#line:99 - for O0OOOO0OOO00OO00O ,O00OOO000O0OO0OOO in enumerate (OOOOO00O000OO00O0 [O0000O0OOOO0OO000 ]):#line:100 - if str (O00O0OO0OOO0O000O )=="maya":#line:101 - O00O0OO0OOO0O000O ="malla"#line:102 - if str (O00O0OO0OOO0O000O )=="pilos"or str (O00O0OO0OOO0O000O )=="pilo":#line:103 - O00O0OO0OOO0O000O ="philo"#line:104 - if str (O00O0OO0OOO0O000O )=="filos"or str (O00O0OO0OOO0O000O )=="filo":#line:105 - O00O0OO0OOO0O000O ="philo"#line:106 - if str (O00O0OO0OOO0O000O )=="sinces"or str (O00O0OO0OOO0O000O )=="sinc":#line:107 - O00O0OO0OOO0O000O ="synthe"#line:108 - if str (O00O0OO0OOO0O000O )=="sintes"or str (O00O0OO0OOO0O000O )=="sint":#line:109 - O00O0OO0OOO0O000O ="synthe"#line:110 - if str (O00O0OO0OOO0O000O )=="axos"or str (O00O0OO0OOO0O000O )=="axo":#line:111 - O00O0OO0OOO0O000O ="axso"#line:112 - if str (O00O0OO0OOO0O000O )=="uno":#line:113 - O00O0OO0OOO0O000O ="1"#line:114 - if str (O00O0OO0OOO0O000O )=="dos"or str (O00O0OO0OOO0O000O )=="do":#line:115 - O00O0OO0OOO0O000O ="2"#line:116 - if str (O00O0OO0OOO0O000O )=="tres"or str (O00O0OO0OOO0O000O )=="tr":#line:117 - O00O0OO0OOO0O000O ="3"#line:118 - if str (O00O0OO0OOO0O000O )=="cuatro":#line:119 - O00O0OO0OOO0O000O ="4"#line:120 - if str (O00O0OO0OOO0O000O )=="cinco":#line:121 - O00O0OO0OOO0O000O ="5"#line:122 - if str (O00O0OO0OOO0O000O )=="seis"or str (O00O0OO0OOO0O000O )=="sei":#line:123 - O00O0OO0OOO0O000O ="6"#line:124 - if str (O00O0OO0OOO0O000O )=="siete":#line:125 - O00O0OO0OOO0O000O ="7"#line:126 - if str (O00O0OO0OOO0O000O )=="ocho":#line:127 - O00O0OO0OOO0O000O ="8"#line:128 - if str (O00O0OO0OOO0O000O )=="nueve":#line:129 - O00O0OO0OOO0O000O ="9"#line:130 - if str (O00O0OO0OOO0O000O )=="cero":#line:131 - O00O0OO0OOO0O000O ="0"#line:132 - if str (O00O0OO0OOO0O000O )=="veintiuno":#line:133 - O00O0OO0OOO0O000O ="21"#line:134 - if str (O00O0OO0OOO0O000O )=="veinte":#line:135 - O00O0OO0OOO0O000O ="20"#line:136 - if str (O00O0OO0OOO0O000O )=="veintidos"or str (O00O0OO0OOO0O000O )=="veintido":#line:137 - O00O0OO0OOO0O000O ="22"#line:138 - if str (O00O0OO0OOO0O000O )=="veintitres"or str (O00O0OO0OOO0O000O )=="veintitre":#line:139 - O00O0OO0OOO0O000O ="23"#line:140 - if str (O00O0OO0OOO0O000O )=="veinticuatro":#line:141 - O00O0OO0OOO0O000O ="24"#line:142 - if str (O00O0OO0OOO0O000O )=="veinticinco":#line:143 - O00O0OO0OOO0O000O ="25"#line:144 - if str (O00O0OO0OOO0O000O )=="veintiseis"or str (O00O0OO0OOO0O000O )=="veintisei":#line:145 - O00O0OO0OOO0O000O ="26"#line:146 - if str (O00O0OO0OOO0O000O )=="veintisiete":#line:147 - O00O0OO0OOO0O000O ="27"#line:148 - if str (O00O0OO0OOO0O000O )=="veintiocho":#line:149 - O00O0OO0OOO0O000O ="28"#line:150 - if str (O00O0OO0OOO0O000O )=="veintinueve":#line:151 - O00O0OO0OOO0O000O ="29"#line:152 - if str (O00O0OO0OOO0O000O )=="treinta":#line:153 - O00O0OO0OOO0O000O ="30"#line:154 - if str (remove_accents (O00OOO000O0OO0OOO )).lower ()==str (remove_accents (O00O0OO0OOO0O000O )).lower ():#line:155 - OO0O00OOO00OOOO0O [O0000O0OOOO0OO000 ]=OO0O00OOO00OOOO0O [O0000O0OOOO0OO000 ]+1 #line:156 - OOOOO00O000OO00O0 [O0000O0OOOO0OO000 ].pop (O0OOOO0OOO00OO00O )#line:157 - O00O000O000O00OO0 =np .argwhere (OO0O00OOO00OOOO0O ==np .amax (OO0O00OOO00OOOO0O ))#line:159 - O0OOO0OO00O0O000O =[]#line:160 - O000OOO0O0O0O00OO =[]#line:161 - OOO0OO00OOOO0OOOO =[]#line:162 - O00O00O00OO00OOOO ={}#line:163 - O0O000O00O0OOO0O0 =xlrd .open_workbook (archivo )#line:164 - O0O000O00O0OOO0O0 =O0O000O00O0OOO0O0 .sheet_by_index (0 )#line:165 - if not np .all (OO0O00OOO00OOOO0O ==0 ):#line:166 - for indexin in indexmax: - sq = df.cell(int(indexin) + 1, 3) - sr = df.cell(int(indexin) + 1, 4) - sq = str(sq) - sr = str(sr) - sq = sq.split("'") - sr = sr.split("'") - output.append(f" {sq[1]} {sr[1]} ") - return output -async def boton_pdf_video (O00000OO0OOOO00O0 ,OO0OO00OOOOOOO00O ,OOO0OO0OOOO00O0O0 ):#line:194 - O00O000O0OOOO0OO0 =aiohttp .TCPConnector (ssl =True )#line:195 - async with aiohttp .ClientSession (connector =O00O000O0OOOO0OO0 )as OO0OO000O0OO00OOO :#line:196 - OOOO0OO0OOOO0OOO0 =await OO0OO000O0OO00OOO .get (f'{base_url}all-content/{O00000OO0OOOO00O0}',auth =auth )#line:197 - OOOO000OOO0O0OOOO =await OOOO0OO0OOOO0OOO0 .json ()#line:198 - O000O00O0O0OOOOO0 =[]#line:200 - O00O0O0OO00OOOO00 ={}#line:201 - if OOO0OO0OOOO00O0O0 =="0":#line:203 - for O0O0000OO0OOOO00O in OOOO000OOO0O0OOOO :#line:204 - if O0O0000OO0OOOO00O ['type']=="Intervencion":#line:205 - O000O00O0O0OOOOO0 .append (O0O0000OO0OOOO00O ['nid'])#line:206 - else :#line:207 - O000O00O0O0OOOOO0 .append (OOO0OO0OOOO00O0O0 )#line:208 - for OO00OO00O0OOO0O00 in O000O00O0O0OOOOO0 :#line:210 - OO0O0OOO00000OO0O =await OO0OO000O0OO00OOO .get (f'{base_url}intervenciones/{OO00OO00O0OOO0O00}',auth =auth )#line:211 - OO00O00000OO00OOO =await OO0O0OOO00000OO0O .json ()#line:212 - OO00O00000OO00OOO =OO00O00000OO00OOO [0 ]#line:213 - OOO00000O0OOO00OO ={}#line:214 - if OO0OO00OOOOOOO00O in OO00O00000OO00OOO :#line:216 - OO0O00OOOOOO0OO00 =OO00O00000OO00OOO [OO0OO00OOOOOOO00O ]#line:217 - for OOO00O0O00O0OOOOO in OO0O00OOOOOO0OO00 :#line:218 - if OO0OO00OOOOOOO00O =='field_pdf':#line:219 - OOO00000O0OOO00OO [OOO00O0O00O0OOOOO ['descripcion']]="https://orva.tedcas.com/"+str (OOO00O0O00O0OOOOO ['url'])#line:220 - if OO0OO00OOOOOOO00O =='field_video':#line:221 - OOO00000O0OOO00OO [OOO00O0O00O0OOOOO ['descripcion']]=str (OOO00O0O00O0OOOOO ['url'])#line:222 - O00O0O0OO00OOOO00 [OO00O00000OO00OOO ['title']]=OOO00000O0OOO00OO #line:224 - else :#line:225 - if OOO0OO0OOOO00O0O0 =='0':#line:226 - OOO0OO0OOOO00O0O0 ='0'#line:227 - else :#line:228 - print ("nid dentro del if "+str (OOO0OO0OOOO00O0O0 ))#line:229 - OOO00000O0OOO00OO ["No hay archivos"]=""#line:230 - O00O0O0OO00OOOO00 ["No hay archivos"]=OOO00000O0OOO00OO #line:231 - return {}#line:232 - return O00O0O0OO00OOOO00 #line:234 -async def boton_word_ppt (O00OO0OOO0000OO0O ,OO0OO000OOO00O00O ,O00O000OOO0O0OOOO ):#line:236 - OO0O0O0O00O00O0OO =aiohttp .TCPConnector (ssl =True )#line:237 - async with aiohttp .ClientSession (connector =OO0O0O0O00O00O0OO )as OO000OOO000OO0O0O :#line:238 - O0OOO00000OOOO0O0 =await OO000OOO000OO0O0O .get (f'{base_url}all-content/{O00OO0OOO0000OO0O}',auth =auth )#line:239 - OOO00OO00O0O0OO00 =await O0OOO00000OOOO0O0 .json ()#line:240 - O0O0OOOO00OOO000O =[]#line:242 - O0O00OOO00O0OOO0O ={}#line:243 - if O00O000OOO0O0OOOO =='0':#line:245 - for OO0000O00OOOO00OO in OOO00OO00O0O0OO00 :#line:246 - if OO0000O00OOOO00OO ['type']=="Intervencion":#line:247 - O0O0OOOO00OOO000O .append (OO0000O00OOOO00OO ['nid'])#line:248 - else :#line:249 - O0O0OOOO00OOO000O .append (O00O000OOO0O0OOOO )#line:250 - for O00OO0OO0000OOOO0 in O0O0OOOO00OOO000O :#line:252 - O0000OO00OO0OOOO0 =await OO000OOO000OO0O0O .get (f'{base_url}intervenciones/{O00OO0OO0000OOOO0}',auth =auth )#line:253 - OO0OO0O0OOO0O0000 =await O0000OO00OO0OOOO0 .json ()#line:254 - OO0OO0O0OOO0O0000 =OO0OO0O0OOO0O0000 [0 ]#line:255 - if len (OO0OO0O0OOO0O0000 [OO0OO000OOO00O00O ])!=0 :#line:256 - O0O00OOO00O0OOO0O [OO0OO0O0OOO0O0000 ['title']]="https://orva.tedcas.com/"+str (OO0OO0O0OOO0O0000 [OO0OO000OOO00O00O ])#line:257 - if len (OO0OO0O0OOO0O0000 [OO0OO000OOO00O00O ])==0 and O00O000OOO0O0OOOO !='0':#line:258 - O0O00OOO00O0OOO0O ["No hay archivos"]=""#line:259 - return {}#line:260 - return O0O00OOO00O0OOO0O #line:262 -async def boton_materiales (O00O00OO0OO0000O0 ,O0O0OOO000000000O ):#line:264 - OO00O0OO0OO0OO00O =aiohttp .TCPConnector (ssl =True )#line:265 - async with aiohttp .ClientSession (connector =OO00O0OO0OO0OO00O )as O0O000O000O0OO0O0 :#line:266 - OOOOO0OO000OO000O ={}#line:267 - if O0O0OOO000000000O =='0':#line:269 - O00OOO0OO0O00O0O0 =await O0O000O000O0OO0O0 .get (f'{base_url}listado_completo_cajas/{O00O00OO0OO0000O0}',auth =auth )#line:270 - OOOO0O00OO0OO0O0O =await O00OOO0OO0O00O0O0 .json ()#line:271 - for O0O0O0OO0O00OOO00 in OOOO0O00OO0OO0O0O :#line:272 - OOOOO0OO000OO000O [O0O0O0OO0O00OOO00 ['title']]=O0O0O0OO0O00OOO00 ['nid']#line:273 - OOOOO0OO000OO000O ['']="si hay"#line:274 - else :#line:275 - O00OOO0OO0O00O0O0 =await O0O000O000O0OO0O0 .get (f'{base_url}intervenciones/{O0O0OOO000000000O}',auth =auth )#line:276 - OOOO0O00OO0OO0O0O =await O00OOO0OO0O00O0O0 .json ()#line:277 - OOOO0O00OO0OO0O0O =OOOO0O00OO0OO0O0O [0 ]#line:278 - if 'field_cajas'in OOOO0O00OO0OO0O0O :#line:279 - OOOO0O00OO0OO0O0O =OOOO0O00OO0OO0O0O ['field_cajas']#line:280 - for O0O0O0OO0O00OOO00 in OOOO0O00OO0OO0O0O :#line:281 - OOOOO0OO000OO000O [O0O0O0OO0O00OOO00 ['caja']]=O0O0O0OO0O00OOO00 ['id']#line:282 - OOOOO0OO000OO000O ['']="si hay"#line:283 - else :#line:284 - if O0O0OOO000000000O !=0 :#line:285 - OOOOO0OO000OO000O ['']=""#line:286 - return {}#line:287 - return OOOOO0OO000OO000O #line:288 -async def cargar_base_datos (O0000000O0O000O0O ,OOO0O0O0OO0OO00OO ):#line:290 - O000OOOO0O0O0O00O =None #line:291 - O00000000OO0OO0OO =[]#line:292 - OO0OO00O00OOOOO00 =aiohttp .TCPConnector (ssl =True )#line:293 - #cadena_lista = eval(O0000000O0O000O0O) - #cadena_texto=''.join(cadena_lista) - #cadena_limpia = cadena_texto.strip('["\']') - #O0000000O0O000O0O = cadena_limpia.replace("[",'').replace("]",'').replace("'",'').split(', ') - #O0000000O0O000O0O = [elemento.strip("'") for elemento in elementos] - formatted_strings = [] - for item in O0000000O0O000O0O: - words = item.replace("[", "").replace("]", "").replace("'", "").split(',') - formatted_strings.append(' '.join(words).strip()) - O0000000O0O000O0O = [ast.literal_eval(item) for item in formatted_strings] - #evaluated_list = [ast.literal_eval(item.replace("'", "")) for item in O0000000O0O000O0O] - #O0000000O0O000O0O = [' '.join(item) for item in evaluated_list] - #for i in range(len(O0000000O0O000O0O)): - #O0000000O0O000O0O.append = ast.literal_eval(O0000000O0O000O0O[i]) - async with aiohttp .ClientSession (connector =OO0OO00O00OOOOO00 )as O0O0OOO000O000O00 :#line:294 - O0OOO0O00OOOOOOO0 =await O0O0OOO000O000O00 .get ('https://orva.tedcas.com/api/all-content/'+str (OOO0O0O0OO0OO00OO ),auth =auth )#line:295 - OOOO00000OOO0OO0O =await O0OOO0O00OOOOOOO0 .json ()#line:296 - O000O0O00O00O00OO =np .zeros (len (OOOO00000OOO0OO0O ),dtype =int )#line:297 - OOOO0OOOOO00O0O00 =[]#line:298 - for OOO0OO0OOO000OOO0 in O0000000O0O000O0O :#line:299 - O0OO0O00O0OO0O000 =0 #line:300 - for O0OO000O00O00OO00 in range (100 ):#line:301 - O0OO000O00O00OO00 =O0OO000O00O00OO00 /10 #line:302 - if OOO0OO0OOO000OOO0 ==str (O0OO000O00O00OO00 ):#line:303 - OOO0OO0OOO000OOO0 =str (O0OO000O00O00OO00 ).split ('.')#line:304 - OOOO0OOOOO00O0O00 .append (OOO0OO0OOO000OOO0 )#line:305 - O0OO0O00O0OO0O000 =O0OO0O00O0OO0O000 +1 #line:306 - if OOO0OO0OOO000OOO0 =='con':#line:307 - O0OO0O00O0OO0O000 =O0OO0O00O0OO0O000 +1 #line:308 - if O0OO0O00O0OO0O000 ==0 :#line:309 - OOOO0OOOOO00O0O00 .append (OOO0OO0OOO000OOO0 )#line:310 - for OO000OOOO00000000 in range (len (OOOO00000OOO0OO0O )):#line:311 - OOOOOO0OO000O0000 =0 #line:312 - OOO0OO0O0000OO0OO =OOOO00000OOO0OO0O [OO000OOOO00000000 ]#line:313 - OO00OOOOO000OO0O0 =str (OOO0OO0O0000OO0OO ['title']).lower ()#line:314 - OO00OOOOO000OO0O0 =remove_accents (OO00OOOOO000OO0O0 )#line:315 - OO00OOOOO000OO0O0 =OO00OOOOO000OO0O0 .split (' ')#line:316 - for OO0O0O000O0OOOO0O ,OO00O0OOO0O0000O0 in enumerate (OO00OOOOO000OO0O0 ):#line:317 - for O0OO00O00O000000O ,OO0O00O00O0OO0OO0 in enumerate (OO00OOOOO000OO0O0 ):#line:318 - if O0OO00O00O000000O !=OO0O0O000O0OOOO0O :#line:319 - if OO00O0OOO0O0000O0 ==OO0O00O00O0OO0OO0 :#line:320 - OO00OOOOO000OO0O0 .pop (O0OO00O00O000000O )#line:321 - for OO0O0O000O0OOOO0O ,OO00O0OOO0O0000O0 in enumerate (OO00OOOOO000OO0O0 ):#line:322 - for O0OO000O00O00OO00 in range (100 ):#line:323 - O0OO000O00O00OO00 =O0OO000O00O00OO00 /10 #line:324 - if OO00O0OOO0O0000O0 ==str (O0OO000O00O00OO00 ):#line:325 - OO00O0OOO0O0000O0 =str (O0OO000O00O00OO00 ).split ('.')#line:326 - OO00OOOOO000OO0O0 .append (OO00O0OOO0O0000O0 )#line:327 - for O000O00O0OO000O00 in OOOO0OOOOO00O0O00 :#line:328 - if O000O00O0OO000O00 =="maya":#line:329 - O000O00O0OO000O00 ="malla"#line:330 - if O000O00O0OO000O00 =="pilos"or O000O00O0OO000O00 =="pilo":#line:331 - O000O00O0OO000O00 ="philo"#line:332 - if O000O00O0OO000O00 =="filos"or O000O00O0OO000O00 =="filo":#line:333 - O000O00O0OO000O00 ="philo"#line:334 - if O000O00O0OO000O00 =="sinces"or O000O00O0OO000O00 =="sinc":#line:335 - O000O00O0OO000O00 ="synthe"#line:336 - if O000O00O0OO000O00 =="sintes"or O000O00O0OO000O00 =="sint":#line:337 - O000O00O0OO000O00 ="synthe"#line:338 - if O000O00O0OO000O00 =="axos"or O000O00O0OO000O00 =="axo":#line:339 - O000O00O0OO000O00 ="axso"#line:340 - if O000O00O0OO000O00 =="uno":#line:341 - O000O00O0OO000O00 =1 #line:342 - if O000O00O0OO000O00 =="dos"or O000O00O0OO000O00 =="do":#line:343 - O000O00O0OO000O00 =2 #line:344 - if O000O00O0OO000O00 =="tres"or O000O00O0OO000O00 =="tr":#line:345 - O000O00O0OO000O00 =3 #line:346 - if O000O00O0OO000O00 =="cuatro":#line:347 - O000O00O0OO000O00 =4 #line:348 - if O000O00O0OO000O00 =="cinco":#line:349 - O000O00O0OO000O00 =5 #line:350 - if O000O00O0OO000O00 =="seis"or O000O00O0OO000O00 =="sei":#line:351 - O000O00O0OO000O00 =6 #line:352 - if O000O00O0OO000O00 =="siete":#line:353 - O000O00O0OO000O00 =7 #line:354 - if O000O00O0OO000O00 =="ocho":#line:355 - O000O00O0OO000O00 =8 #line:356 - if O000O00O0OO000O00 =="nueve":#line:357 - O000O00O0OO000O00 =9 #line:358 - if O000O00O0OO000O00 =="cero":#line:359 - O000O00O0OO000O00 =0 #line:360 - if O000O00O0OO000O00 =="veintiuno":#line:361 - O000O00O0OO000O00 ="21"#line:362 - if O000O00O0OO000O00 =="veinte":#line:363 - O000O00O0OO000O00 ="20"#line:364 - if O000O00O0OO000O00 =="veintidos"or O000O00O0OO000O00 =="veintido":#line:365 - O000O00O0OO000O00 ="22"#line:366 - if O000O00O0OO000O00 =="veintitres"or O000O00O0OO000O00 =="veintitre":#line:367 - O000O00O0OO000O00 ="23"#line:368 - if O000O00O0OO000O00 =="veinticuatro":#line:369 - O000O00O0OO000O00 ="24"#line:370 - if O000O00O0OO000O00 =="veinticinco":#line:371 - O000O00O0OO000O00 ="25"#line:372 - if O000O00O0OO000O00 =="veintiseis"or O000O00O0OO000O00 =="veintisei":#line:373 - O000O00O0OO000O00 ="26"#line:374 - if O000O00O0OO000O00 =="veintisiete":#line:375 - O000O00O0OO000O00 ="27"#line:376 - if O000O00O0OO000O00 =="veintiocho":#line:377 - O000O00O0OO000O00 ="28"#line:378 - if O000O00O0OO000O00 =="veintinueve":#line:379 - O000O00O0OO000O00 ="29"#line:380 - if O000O00O0OO000O00 =="treinta":#line:381 - O000O00O0OO000O00 ="30"#line:382 - if type (O000O00O0OO000O00 )==int and type (O000OOOO0O0O0O00O )==int :#line:383 - O0OO000O00O00OO00 =str (O000OOOO0O0O0O00O )+'.'+str (O000O00O0OO000O00 )#line:384 - O000O00O0OO000O00 =O0OO000O00O00OO00 .split ('.')#line:385 - O000OOOO0O0O0O00O =O000O00O0OO000O00 #line:386 - O000O00O0OO000O00 =inflector .singularize (str (O000O00O0OO000O00 ))#line:387 - OO00O0OOO0O0000O0 =inflector .singularize (str (OO00O0OOO0O0000O0 ))#line:388 - O000O00O0OO000O00 =remove_accents (O000O00O0OO000O00 )#line:389 - if OO00O0OOO0O0000O0 ==O000O00O0OO000O00 :#line:390 - OOOOOO0OO000O0000 =OOOOOO0OO000O0000 +1 #line:391 - O000O0O00O00O00OO [OO000OOOO00000000 ]=OOOOOO0OO000O0000 #line:392 - O00O0O0OOOO0OO00O =np .argwhere (O000O0O00O00O00OO ==np .amax (O000O0O00O00O00OO ))#line:393 - for OO000OOOO00000000 in O00O0O0OOOO0OO00O :#line:394 - O00000000OO0OO0OO .append (OOOO00000OOO0OO0O [int (OO000OOOO00000000 )])#line:395 - if np .all (O000O0O00O00O00OO ==0 ):#line:396 - O00000000OO0OO0OO =None #line:397 - return O00000000OO0OO0OO #line:398 -async def cargar_tipo (OO0OO00O0OOOO0OOO ,OO0O0000OOOO0OO00 ):#line:400 - OO0OOOO000OO0OO00 =aiohttp .TCPConnector (ssl =True )#line:401 - async with aiohttp .ClientSession (connector =OO0OOOO000OO0OO00 )as OO0O0O00O0OOO00OO :#line:402 - O000000OO0O000000 =await OO0O0O00O0OOO00OO .get (f'{base_url}all-content/{OO0O0000OOOO0OO00}',auth =auth )#line:403 - O00O0O0O0O000OO0O =await O000000OO0O000000 .json ()#line:404 - OOOOO0OO00000OO0O =None #line:405 - O00O00000OO0O0000 =None #line:406 - for OOO00000OOOO000OO in O00O0O0O0O000OO0O :#line:407 - if OO0OO00O0OOOO0OOO ==OOO00000OOOO000OO ["nid"]:#line:408 - OOOOO0OO00000OO0O =OOO00000OOOO000OO ["type"]#line:409 - O00O00000OO0O0000 =OOO00000OOOO000OO #line:410 - break #line:411 - return O00O00000OO0O0000 ,OOOOO0OO00000OO0O #line:412 -async def cargar_archivo (OO0OO0OO0O000OO0O ,OOO00OO0O0O0OOOO0 ,OOO0OO0O0O0O0OO00 ):#line:414 - O0O0OOO00OOOO00OO =[]#line:415 - OO00OO00OOO0O0O0O =aiohttp .TCPConnector (ssl =True )#line:416 - async with aiohttp .ClientSession (connector =OO00OO00OOO0O0O0O )as OO0OO0O00OO0OOO00 :#line:417 - O0O0OO00O0O000OO0 =await OO0OO0O00OO0OOO00 .get ('https://orva.tedcas.com/api/'+str (OOO0OO0O0O0O0OO00 ),auth =auth )#line:418 - OO0OOO0OOOO000000 =await O0O0OO00O0O000OO0 .json ()#line:419 - OO0OOO0OOOO000000 =OO0OOO0OOOO000000 [0 ]#line:420 - O0OOO0000OOOO000O ="field_"+str (OO0OO0OO0O000OO0O )#line:421 - O00OO000O0O00O0O0 =OO0OOO0OOOO000000 [O0OOO0000OOOO000O ]#line:422 - if O0OOO0000OOOO000O =="field_image":#line:423 - OO0OOO0OOOO000000 =OO0OOO0OOOO000000 ['field_image']#line:424 - OO0OOO0OOOO000000 =OO0OOO0OOOO000000 .split (',')#line:425 - OO0OOO0OOOO000000 =[O0O0O0OO000OO00OO .replace (' ','')for O0O0O0OO000OO00OO in OO0OOO0OOOO000000 ]#line:426 - for OO000O0O000O000OO in OO0OOO0OOOO000000 :#line:427 - O0O0OOO00OOOO00OO .append ("https://orva.tedcas.com/"+str (OO000O0O000O000OO ))#line:428 - print (O0O0OOO00OOOO00OO )#line:429 - return O0O0OOO00OOOO00OO #line:430 - if len (O00OO000O0O00O0O0 )==0 :#line:431 - O0OO0OOOO000OO0O0 ="No hay archivos subidos"#line:432 - O0O0OOO00OOOO00OO ="templates/especialidad"#line:433 - elif type (O00OO000O0O00O0O0 )==str :#line:434 - O0O0OOO00OOOO00OO ="https://orva.tedcas.com/"+str (O00OO000O0O00O0O0 )#line:435 - O0OO0OOOO000OO0O0 =O00OO000O0O00O0O0 #line:436 - elif type (O00OO000O0O00O0O0 )==list :#line:437 - for OOO0O0OOO0OOOOOO0 ,O00O00OOOO0OO000O in O00OO000O0O00O0O0 :#line:438 - O0O0OOO00OOOO00OO [OOO0O0OOO0OOOOOO0 ]="https://orva.tedcas.com/"+str (O00O00OOOO0OO000O )#line:439 - O0OO0OOOO000OO0O0 =O00OO000O0O00O0O0 #line:440 - return OOO00OO0O0O0OOOO0 ,O0O0OOO00OOOO00OO ,O0OO0OOOO000OO0O0 #line:441 -async def cargar_archivo_grande (O00OO0OO00OO0OO00 ,OOO000O0O0OO0OOO0 ,O0000OO0O00O0OOOO ):#line:443 - O0000OOOO0OOOOOO0 =aiohttp .TCPConnector (ssl =True )#line:444 - async with aiohttp .ClientSession (connector =O0000OOOO0OOOOOO0 )as O0000O00O0O0O0OOO :#line:445 - OOOOOOO00OOOOOOO0 =await O0000O00O0O0O0OOO .get ('https://orva.tedcas.com/api/'+str (O0000OO0O00O0OOOO ),auth =auth )#line:446 - O000OOOOO00000000 =await OOOOOOO00OOOOOOO0 .json ()#line:447 - O00O0OO00OOOOOOO0 ={}#line:448 - if O00OO0OO00OO0OO00 =='title_material':#line:449 - for OO00O0O0O000O000O in O000OOOOO00000000 :#line:450 - O00O0OO00OOOOOOO0 [OO00O0O0O000O000O [O00OO0OO00OO0OO00 ]]=(OO00O0O0O000O000O [O00OO0OO00OO0OO00 ])#line:451 - return O00O0OO00OOOOOOO0 ,OOO000O0O0OO0OOO0 #line:452 - O000OOOOO00000000 =O000OOOOO00000000 [0 ]#line:453 - OOOO0OO00O000OOOO ="field_"+str (O00OO0OO00OO0OO00 )#line:454 - OOOO0OO00O000OOOO =O000OOOOO00000000 [OOOO0OO00O000OOOO ]#line:455 - if len (OOOO0OO00O000OOOO )==0 :#line:456 - O00O0OO00OOOOOOO0 ["No hay archivos"]="templates/especialidad"#line:457 - else :#line:458 - for OO00O0O0O000O000O in OOOO0OO00O000OOOO :#line:459 - O00O0OO00OOOOOOO0 [OO00O0O0O000O000O ['descripcion']]="https://orva.tedcas.com/"+str (OO00O0O0O000O000O ['url'])#line:460 - return OOO000O0O0OO0OOO0 ,O00O0OO00OOOOOOO0 #line:461 -async def cargar_caja (O0O00000O0OOO0OOO ,O0OO000O00O00000O ):#line:463 - O000OO00000OOOOOO ={}#line:464 - OO00O0OOO0OO0OOO0 =aiohttp .TCPConnector (ssl =True )#line:465 - async with aiohttp .ClientSession (connector =OO00O0OOO0OO0OOO0 )as OOOOOO0O0O00000OO :#line:466 - O00O0OOOOO00OO0OO =await OOOOOO0O0O00000OO .get (f'{base_url}intervenciones/{O0O00000O0OOO0OOO}',auth =auth )#line:467 - O00000O0O000000OO =await O00O0OOOOO00OO0OO .json ()#line:468 - O00000O0O000000OO =O00000O0O000000OO [0 ]#line:469 - if 'field_cajas'in O00000O0O000000OO :#line:470 - O00000O0O000000OO =O00000O0O000000OO ['field_cajas']#line:471 - for OOOOO00OO0O000OOO in O00000O0O000000OO :#line:472 - O000OO00000OOOOOO [OOOOO00OO0O000OOO ['id']]=OOOOO00OO0O000OOO ['caja']#line:473 - else :#line:474 - O000OO00000OOOOOO [str (O0O00000O0OOO0OOO )]="No hay archivos"#line:475 - return O000OO00000OOOOOO ,O0OO000O00O00000O #line:476 -async def cargar_instrumental (OO0000O00O0O0OOO0 ,OO00O0O0OO00OOOOO ):#line:478 - O00000000OO000O00 ={}#line:479 - O000000OOOOO00O0O =aiohttp .TCPConnector (ssl =True )#line:480 - async with aiohttp .ClientSession (connector =O000000OOOOO00O0O )as OO0OO00000O00O0OO :#line:481 - OOO0OOO0OO00000O0 =await OO0OO00000O00O0OO .get ('https://orva.tedcas.com/api/'+str (OO00O0O0OO00OOOOO ),auth =auth )#line:482 - O0000O000OOOOO0OO =await OOO0OOO0OO00000O0 .json ()#line:483 - for OO000OO0OO00OOOO0 in O0000O000OOOOO0OO :#line:484 - if 'instrumental'in OO000OO0OO00OOOO0 :#line:485 - for OOO0O00OO000O0000 in OO000OO0OO00OOOO0 ['instrumental']:#line:486 - if OOO0O00OO000O0000 ['id']==OO0000O00O0O0OOO0 :#line:487 - O00000000OO000O00 [OO000OO0OO00OOOO0 ['nid']]=OO000OO0OO00OOOO0 ['title']#line:488 - return O00000000OO000O00 #line:489 -async def cargar_botones_pdf_admision ():#line:491 - OO0OOOO000O0OOOO0 ={}#line:492 - O0OO00OO00OOO00O0 ={}#line:493 - O000O00OO0O0O00OO ={}#line:494 - O0O0OO0000O000OOO ={}#line:495 - O0O0O0OOO0O0O00OO =aiohttp .TCPConnector (ssl =True )#line:496 - async with aiohttp .ClientSession (connector =O0O0O0OOO0O0O00OO )as OOO000O0O000O0OO0 :#line:497 - OOOO0O000OOOO0000 =await OOO000O0O000O0OO0 .get ('https://orva.tedcas.com/api/all-content/1621',auth =auth )#line:498 - O0O000OO0O0OOO000 =await OOOO0O000OOOO0000 .json ()#line:499 - for O0000OO00OOOO0OOO in O0O000OO0O0OOO000 :#line:500 - OO0O00OO00OOO00OO =await OOO000O0O000O0OO0 .get ('https://orva.tedcas.com/api/intervenciones/'+str (O0000OO00OOOO0OOO ['nid']),auth =auth )#line:501 - O0OOOOOOO0OO000OO =await OO0O00OO00OOO00OO .json ()#line:502 - O0OOOOOOO0OO000OO =O0OOOOOOO0OO000OO [0 ]#line:503 - O0O000OOOOOO00O0O =O0OOOOOOO0OO000OO ['field_pdf']#line:504 - O0O000OOOOOO00O0O =O0O000OOOOOO00O0O [0 ]#line:505 - if O0OOOOOOO0OO000OO ['field_tecnica']=="Mapa de camas":#line:506 - OO0OOOO000O0OOOO0 [O0OOOOOOO0OO000OO ['title']]="https://orva.tedcas.com/"+str (O0O000OOOOOO00O0O ['url'])#line:507 - elif O0OOOOOOO0OO000OO ['field_tecnica']=="Ambulancias":#line:508 - O0OO00OO00OOO00O0 [O0OOOOOOO0OO000OO ['title']]="https://orva.tedcas.com/"+str (O0O000OOOOOO00O0O ['url'])#line:509 - elif O0OOOOOOO0OO000OO ['field_tecnica']=="Programación quirúrgica":#line:510 - O000O00OO0O0O00OO [O0OOOOOOO0OO000OO ['title']]="https://orva.tedcas.com/"+str (O0O000OOOOOO00O0O ['url'])#line:511 - elif O0OOOOOOO0OO000OO ['field_tecnica']=="Otros":#line:512 - O0O0OO0000O000OOO [O0OOOOOOO0OO000OO ['title']]="https://orva.tedcas.com/"+str (O0O000OOOOOO00O0O ['url'])#line:513 - return OO0OOOO000O0OOOO0 ,O0OO00OO00OOO00O0 ,O000O00OO0O0O00OO ,O0O0OO0000O000OOO #line:514 -def remove_accents (O00000O0O00OOOOOO ):#line:516 - O00OOOOOO0O0000O0 =unicodedata .normalize ('NFKD',O00000O0O00OOOOOO )#line:517 - return u"".join ([O0OOO00OOOO00OO00 for O0OOO00OOOO00OO00 in O00OOOOOO0O0000O0 if not unicodedata .combining (O0OOO00OOOO00OO00 )])#line:518 -def adaptar_salida (O00O00000OO0O00O0 ):#line:520 - OO00OOO000000OO0O =[]#line:521 - O00O00000OO0O00O0 =str (O00O00000OO0O00O0 ).lower ()#line:522 - O00O00000OO0O00O0 =O00O00000OO0O00O0 .split ("}")#line:523 - O00O00000OO0O00O0 =O00O00000OO0O00O0 [0 ].split (":")#line:524 - if len (O00O00000OO0O00O0 )>=2 :#line:525 - OO00OOO0000000OO0 =O00O00000OO0O00O0 [1 ].split ("'")#line:526 - OO00OOO000000OO0O =OO00OOO0000000OO0 [1 ].split ()#line:527 - return OO00OOO000000OO0O #line:528 -app =Flask (__name__ )#line:530 -socketio =SocketIO (app )#line:531 -app .config ['SECRET_KEY']='mysecretkey'#line:532 -IMG_FOLDER =os .path .join ('static','IMG')#line:534 -app .config ['UPLOAD_FOLDER']=IMG_FOLDER #line:535 -@app .route ("/")#line:537 -async def hello ():#line:538 - OOO0O0OOOO0O0O000 =os .path .join (app .config ['UPLOAD_FOLDER'],'trauma.jpeg')#line:539 - O0O0O0OOOOO0O0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'uro.jpeg')#line:540 - OOOO0O00O0OO0OOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'adm.jpeg')#line:541 - OOO0000O00OOOO0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'tijerass.png')#line:542 - return render_template ('especialidad.html',user_image0 =OOO0000O00OOOO0OO ,user_image1 =OOO0O0OOOO0O0O000 ,user_image2 =O0O0O0OOOOO0O0O0O ,user_image3 =OOOO0O00O0OO0OOO0 )#line:543 -@app .route ("/especialidad")#line:545 -async def especialidad ():#line:546 - O00000O00OO0000OO =os .path .join (app .config ['UPLOAD_FOLDER'],'trauma.jpeg')#line:547 - O0O0O0OO00000O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'uro.jpeg')#line:548 - OO00OO000O00O00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'adm.jpeg')#line:549 - OOOO0OO0OOO00OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'tijerass.png')#line:550 - return render_template ('especialidad.html',user_image0 =OOOO0OO0OOO00OO0O ,user_image1 =O00000O00OO0000OO ,user_image2 =O0O0O0OO00000O0O0 ,user_image3 =OO00OO000O00O00O0 )#line:551 -@app .route ("/seleccion_trauma",methods =['GET','POST'])#line:553 -async def seleccion_trauma ():#line:554 - OO0O0000OOOO0000O =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:555 - O0OO000O00O00OOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:556 - OO0OO0OOO0OO00O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:557 - O000O0OOOO0000OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:558 - return render_template ('seleccion_trauma.html',user_image4 =OO0O0000OOOO0000O ,user_image5 =O0OO000O00O00OOO0 ,user_image6 =OO0OO0OOO0OO00O0O ,user_image7 =O000O0OOOO0000OO0 )#line:559 -@app .route ("/preguntas_respuestas_trauma",methods =['GET','POST'])#line:561 -async def preguntas_respuestas_trauma ():#line:562 - O00OO00OOO0O00O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:563 - OOOO0000O0O0OOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:564 - OO00O0OO0OOOO00OO ,OO0OOO00OOO00O0OO ,OO0O0O0OO0O00OOO0 =await faq ()#line:565 - return render_template ('preguntas_respuestas.html',user_image6 =O00OO00OOO0O00O00 ,user_image7 =OOOO0000O0O0OOO00 ,faqs =OO00O0OO0OOOO00OO ,faq_titulo ="Preguntas y respuestas: ")#line:566 -@app .route ("/preguntas_respuestas_uro",methods =['GET','POST'])#line:568 -async def preguntas_respuestas_uro ():#line:569 - OO0OO0OO0O00O00OO =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:570 - OO0O0OO0OO000OO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:571 - O00000000OOO0O0OO ,OOO000OO0OOO00000 ,O0OOOO0000OO0O0O0 =await faq ()#line:572 - return render_template ('preguntas_respuestas.html',user_image6 =OO0OO0OO0O00O00OO ,user_image7 =OO0O0OO0OO000OO00 ,faqs =OOO000OO0OOO00000 ,faq_titulo ="Preguntas y respuestas: ")#line:573 -@app .route ("/preguntas_respuestas_admin",methods =['GET','POST'])#line:575 -async def preguntas_respuestas_admin ():#line:576 - OOOOO000OOOOO0OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:577 - O00O0O00000OO0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:578 - OOO0O0000O00000O0 ,OO0000O00000OOOO0 ,OOOO000OO0O000OOO =await faq ()#line:579 - return render_template ('preguntas_respuestas.html',user_image6 =OOOOO000OOOOO0OO0 ,user_image7 =O00O0O00000OO0O00 ,faqs =OOOO000OO0O000OOO ,faq_titulo ="Preguntas y respuestas: ")#line:580 -@app .route ("/buscador_trauma",methods =['GET','POST'])#line:582 -async def buscador_trauma ():#line:583 - OOOOO0OOO000O00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:584 - O0OO0OO0OO00O0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:585 - O0O0O0OOO000OOO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:586 - O0OO0000OOOOOO0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:587 - OO0O0OO0O0O00OOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:588 - OOO0OO0OO0O00O00O =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:589 - O00OOOOOO0OOO0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:590 - O0000OOOO0OOO0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:591 - O0OO00O000OOOO000 =os .path .join (app .config ['UPLOAD_FOLDER'],'preguntas_respuestas.png')#line:592 - O0O000OO000OOOOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:593 - O0000OO000O000O00 =str (request .form .to_dict ())#line:594 - O0000OO000O000O00 =adaptar_salida (O0000OO000O000O00 )#line:595 - OOO000OOOO0000O00 ={}#line:596 - OOO000OOOO0000O00 [""]=""#line:597 - if len (O0000OO000O000O00 )==0 :#line:598 - return render_template ('buscador_trauma.html',preguntas_respuestas =O0OO00O000OOOO000 ,result_busqueda =OOO000OOOO0000O00 ,user_image4 =OOOOO0OOO000O00O0 ,user_image5 =O0OO0OO0OO00O0OOO ,user_image6 =O0O0O0OOO000OOO0O ,user_image7 =O0OO0000OOOOOO0O0 ,user_image8 =O00OOOOOO0OOO0000 ,user_image9 =O0000OOOO0OOO0OOO ,user_image10 =OO0O0OO0O0O00OOO0 ,user_image11 =O0O000OO000OOOOO0 ,user_image12 =OOO0OO0OO0O00O00O ,nid2 =0 )#line:599 - elif O0000OO000O000O00 !=None or "{}":#line:600 - OOOOOO0O0OOO0OOOO =1 #line:601 - OOOOOOOOOO0000OOO =await cargar_base_datos (O0000OO000O000O00 ,OOOOOO0O0OOO0OOOO )#line:602 - OO0OOOOOO00OO00O0 ,OO0OO0O0O0OOOOOOO ,O0OOO0O0O0O00OOOO =await buscar_faq (O0000OO000O000O00 ,1 )#line:603 - if OOOOOOOOOO0000OOO ==None :#line:604 - if len (OO0OOOOOO00OO00O0 )==0 :#line:605 - return render_template ('buscador_trauma.html',preguntas_respuestas =O0OO00O000OOOO000 ,result_busqueda =OOO000OOOO0000O00 ,prediction_text ="No hay resultados para tu busqueda",user_image4 =OOOOO0OOO000O00O0 ,user_image5 =O0OO0OO0OO00O0OOO ,user_image6 =O0O0O0OOO000OOO0O ,user_image7 =O0OO0000OOOOOO0O0 ,user_image8 =O00OOOOOO0OOO0000 ,user_image9 =O0000OOOO0OOO0OOO ,user_image10 =OO0O0OO0O0O00OOO0 ,user_image11 =O0O000OO000OOOOO0 ,user_image12 =OOO0OO0OO0O00O00O ,nid2 =0 )#line:606 - else :#line:607 - return render_template ('buscador_trauma.html',preguntas_respuestas =O0OO00O000OOOO000 ,faqs =OO0OOOOOO00OO00O0 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OOO000OOOO0000O00 ,user_image4 =OOOOO0OOO000O00O0 ,user_image5 =O0OO0OO0OO00O0OOO ,user_image6 =O0O0O0OOO000OOO0O ,user_image7 =O0OO0000OOOOOO0O0 ,user_image8 =O00OOOOOO0OOO0000 ,user_image9 =O0000OOOO0OOO0OOO ,user_image10 =OO0O0OO0O0O00OOO0 ,user_image11 =O0O000OO000OOOOO0 ,user_image12 =OOO0OO0OO0O00O00O ,nid2 =0 )#line:608 - elif len (OOOOOOOOOO0000OOO )>=1 :#line:609 - OOO0O00OO0000OOO0 =[]#line:610 - OO000000OO0O00OOO =[]#line:611 - OOO000OOOO0000O00 ={}#line:612 - for O0O00O00O0O00OOOO in OOOOOOOOOO0000OOO :#line:613 - OOO0O00OO0000OOO0 .append (O0O00O00O0O00OOOO ["title"])#line:614 - OO000000OO0O00OOO .append (O0O00O00O0O00OOOO ["nid"])#line:615 - for OO0O00OOO0000OO00 ,O0O00O00O0O00OOOO in enumerate (OOO0O00OO0000OOO0 ):#line:616 - OOO000OOOO0000O00 [OO000000OO0O00OOO [OO0O00OOO0000OO00 ]]=O0O00O00O0O00OOOO #line:617 - if len (OO0OOOOOO00OO00O0 )!=0 :#line:618 - return render_template ('buscador_trauma1.html',faqs =OO0OOOOOO00OO00O0 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OOO000OOOO0000O00 ,user_image4 =OOOOO0OOO000O00O0 ,user_image5 =O0OO0OO0OO00O0OOO ,user_image6 =O0O0O0OOO000OOO0O ,user_image7 =O0OO0000OOOOOO0O0 ,user_image8 =O00OOOOOO0OOO0000 ,user_image9 =O0000OOOO0OOO0OOO ,user_image10 =OO0O0OO0O0O00OOO0 ,user_image11 =O0O000OO000OOOOO0 ,user_image12 =OOO0OO0OO0O00O00O ,nid2 =0 )#line:619 - else :#line:620 - if len (OOO000OOOO0000O00 )==1 :#line:621 - return redirect (url_for ('resultado_trauma',link =OO000000OO0O00OOO ))#line:622 - else :#line:623 - return render_template ('buscador_trauma1.html',result_busqueda =OOO000OOOO0000O00 ,user_image4 =OOOOO0OOO000O00O0 ,user_image5 =O0OO0OO0OO00O0OOO ,user_image6 =O0O0O0OOO000OOO0O ,user_image7 =O0OO0000OOOOOO0O0 ,user_image8 =O00OOOOOO0OOO0000 ,user_image9 =O0000OOOO0OOO0OOO ,user_image10 =OO0O0OO0O0O00OOO0 ,user_image11 =O0O000OO000OOOOO0 ,user_image12 =OOO0OO0OO0O00O00O ,nid2 =0 )#line:624 -@app .route ("/resultado_trauma",methods =['GET','POST'])#line:626 -async def resultado_trauma ():#line:627 - OOO0OOOOO0OOOOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:628 - O0OOO0OOO0OOO0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:629 - OOO00OO0OO000O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:630 - O0O00O00000O000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:631 - OO0O00OO00OO0O00O =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:632 - O00O0000OOOOOO00O =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:633 - OOO000000OO00OO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:634 - O00O0O0OO0O00OO0O =request .args .get ('link')#line:635 - O00O000000OO00O0O ,OO00OO00OO000O000 =await cargar_tipo (O00O0O0OO0O00OO0O ,1 )#line:636 - OOO00OO0O0OOO0O00 =O00O000000OO00O0O ['title']#line:637 - if OO00OO00OO000O000 =="Intervencion":#line:639 - O00OOOOO0O0000OO0 ,OOO0O000O0OOOOOO0 =await cargar_caja (str (O00O0O0OO0O00OO0O ),'Instrumental - Cajas: ')#line:640 - return render_template ('intervencion_trauma.html',user_image8 =OO0O00OO00OO0O00O ,user_image9 =O00O0000OOOOOO00O ,user_image10 =OOO00OO0OO000O0O0 ,user_image11 =OOO000000OO00OO00 ,user_image12 =O0O00O00000O000O0 ,instrumental =O00OOOOO0O0000OO0 ,texto_cajas =OOO0O000O0OOOOOO0 ,title =OOO00OO0O0OOO0O00 ,user_image6 =OOO0OOOOO0OOOOO00 ,user_image7 =O0OOO0OOO0OOO0OOO ,nid2 =O00O0O0OO0O00OO0O )#line:641 - elif OO00OO00OO000O000 =='Caja':#line:642 - OOOO0OO0O0OO0000O ,OO0OOOOOO00OO0OO0 ,OO00O00O0O00O0000 =await cargar_archivo ("ubicacion","Ubicacion: ","cajas/"+str (O00O0O0OO0O00OO0O ))#line:643 - OO0O000O0OO0OOOO0 =await cargar_archivo ("image","Imagen: ","cajas/"+str (O00O0O0OO0O00OO0O ))#line:644 - OOO0OO0OOOO0OOOOO ,OO00O0O0OOOOO0O00 =await cargar_archivo_grande ("title_material","Instrumental : ","cajas/"+str (O00O0O0OO0O00OO0O ))#line:645 - if len (OOO00OO0O0OOO0O00 )==1 :#line:646 - return render_template ('caja_trauma1.html',title =OOO00OO0O0OOO0O00 ,files_instru =OOO0OO0OOOO0OOOOO ,texto_instru =OO00O0O0OOOOO0O00 ,texto_ubi =OOOO0OO0O0OO0000O ,file_texto_ubi =OO00O00O0O00O0000 ,file_imagen =OO0O000O0OO0OOOO0 ,user_image6 =OOO0OOOOO0OOOOO00 ,user_image7 =O0OOO0OOO0OOO0OOO )#line:647 - else :#line:648 - return render_template ('caja_trauma.html',title =OOO00OO0O0OOO0O00 ,files_instru =OOO0OO0OOOO0OOOOO ,texto_instru =OO00O0O0OOOOO0O00 ,texto_ubi =OOOO0OO0O0OO0000O ,file_texto_ubi =OO00O00O0O00O0000 ,file_imagen =OO0O000O0OO0OOOO0 ,user_image6 =OOO0OOOOO0OOOOO00 ,user_image7 =O0OOO0OOO0OOO0OOO )#line:649 - elif OO00OO00OO000O000 =='Instrumental':#line:650 - OOO000000OO0O000O =await cargar_instrumental (O00O0O0OO0O00OO0O ,'listado_completo_cajas/1')#line:651 - if len (OOO000000OO0O000O )==1 :#line:652 - return render_template ('instrumental_trauma1.html',cajas =OOO000000OO0O000O ,texto ='El instrumental que buscas esta presente en las siguientes cajas: ',title =OOO00OO0O0OOO0O00 ,user_image6 =OOO0OOOOO0OOOOO00 ,user_image7 =O0OOO0OOO0OOO0OOO )#line:653 - else :#line:654 - return render_template ('instrumental_trauma.html',cajas =OOO000000OO0O000O ,texto ='El instrumental que buscas esta presente en las siguientes cajas: ',title =OOO00OO0O0OOO0O00 ,user_image6 =OOO0OOOOO0OOOOO00 ,user_image7 =O0OOO0OOO0OOO0OOO )#line:655 -@app .route ("/protocolos_trauma",methods =['GET','POST'])#line:657 -async def protocolos_trauma ():#line:658 - OOOO00000O00O00O0 =request .args .get ('link2')#line:659 - OOOO00O00O00O0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:660 - OO0OOOOO00O00O000 =await boton_word_ppt (1 ,"field_protocolo",OOOO00000O00O00O0 )#line:661 - if len (OO0OOOOO00O00O000 )==1 :#line:662 - return render_template ('protocolo1.html',protocolos =OO0OOOOO00O00O000 ,user_image7 =OOOO00O00O00O0000 )#line:663 - else :#line:664 - return render_template ('protocolo.html',protocolos =OO0OOOOO00O00O000 ,user_image7 =OOOO00O00O00O0000 )#line:665 -@app .route ("/guia_visual_trauma",methods =['GET','POST'])#line:667 -async def guia_visual_trauma ():#line:668 - OOO0O0OOO0OO0000O =request .args .get ('link2')#line:669 - O0OO00O0O000O0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:670 - OOOO0O00000000OO0 =await boton_word_ppt (1 ,"field_guia_visual",OOO0O0OOO0OO0000O )#line:671 - if len (OOOO0O00000000OO0 )==1 :#line:672 - return render_template ('guia_visual1.html',guia_visual =OOOO0O00000000OO0 ,user_image7 =O0OO00O0O000O0000 )#line:673 - else :#line:674 - return render_template ('guia_visual.html',guia_visual =OOOO0O00000000OO0 ,user_image7 =O0OO00O0O000O0000 )#line:675 -@app .route ("/pdf_casa_trauma",methods =['GET','POST'])#line:677 -async def pdf_casa_trauma ():#line:678 - OO000O000OO0OOOO0 =request .args .get ('link2')#line:679 - OOOOOO00OO0OO0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:680 - OO0O0O0OOOOO0000O =await boton_pdf_video (1 ,"field_pdf",OO000O000OO0OOOO0 )#line:681 - O0OO00000O0OO0000 =0 #line:682 - for OOOOO00000000O000 ,O0OOO0O0O0OOOO0OO in OO0O0O0OOOOO0000O .items ():#line:683 - for OO0O0000OOO00OOOO ,OOOOOOOOOOOOOO00O in O0OOO0O0O0OOOO0OO .items ():#line:684 - O0OO00000O0OO0000 =O0OO00000O0OO0000 +1 #line:685 - if len (OO0O0O0OOOOO0000O .items ())==1 :#line:686 - if O0OO00000O0OO0000 ==1 :#line:687 - print ("bien")#line:688 - return render_template ('pdf_casa_comercial1.html',user_image7 =OOOOOO00OO0OO0O00 ,titulos =OO0O0O0OOOOO0000O )#line:689 - else :#line:690 - return render_template ('pdf_casa_comercial.html',user_image7 =OOOOOO00OO0OO0O00 ,titulos =OO0O0O0OOOOO0000O )#line:691 - else :#line:692 - return render_template ('pdf_casa_comercial.html',user_image7 =OOOOOO00OO0OO0O00 ,titulos =OO0O0O0OOOOO0000O )#line:693 -@app .route ("/videos_trauma",methods =['GET','POST'])#line:695 -async def videos_trauma ():#line:696 - O0O00O00OO0OO00OO =request .args .get ('link2')#line:697 - O00000OO0OOO000OO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:698 - OOOO00OOOOO0O000O =await boton_pdf_video (1 ,"field_video",O0O00O00OO0OO00OO )#line:699 - O0OO0O0O0O000OO0O =0 #line:700 - for OOOOO00O0OOOO0OO0 ,O000O0OOO0OO00OOO in OOOO00OOOOO0O000O .items ():#line:701 - for OOO00OOOOOOO000OO ,OOO0O00O0OOOOO0OO in O000O0OOO0OO00OOO .items ():#line:702 - O0OO0O0O0O000OO0O =O0OO0O0O0O000OO0O +1 #line:703 - if len (OOOO00OOOOO0O000O .items ())==1 :#line:704 - if O0OO0O0O0O000OO0O ==1 :#line:705 - print ("bien")#line:706 - return render_template ('videos1.html',user_image7 =O00000OO0OOO000OO ,titulos =OOOO00OOOOO0O000O )#line:707 - else :#line:708 - return render_template ('videos.html',user_image7 =O00000OO0OOO000OO ,titulos =OOOO00OOOOO0O000O )#line:709 - else :#line:710 - return render_template ('videos.html',user_image7 =O00000OO0OOO000OO ,titulos =OOOO00OOOOO0O000O )#line:711 -@app .route ("/materiales_trauma",methods =['GET','POST'])#line:713 -async def materiales_trauma ():#line:714 - OOO0OOOO0OOO00OOO =request .args .get ('link2')#line:715 - O00O00O00OOO0O0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:716 - OOO0OOO0O0O00O000 =await boton_materiales (1 ,OOO0OOOO0OOO00OOO )#line:717 - if len (OOO0OOO0O0O00O000 [''])==0 :#line:718 - return render_template ('materiales_uro.html',user_image7 =O00O00O00OOO0O0OO ,cajas =OOO0OOO0O0O00O000 ,no_hay ="No hay instrumental")#line:719 - else :#line:720 - if len (OOO0OOO0O0O00O000 )==1 :#line:721 - return render_template ('materiales_uro1.html',user_image7 =O00O00O00OOO0O0OO ,cajas =OOO0OOO0O0O00O000 )#line:722 - else :#line:723 - return render_template ('materiales_uro.html',user_image7 =O00O00O00OOO0O0OO ,cajas =OOO0OOO0O0O00O000 )#line:724 -@app .route ("/escuchar_trauma1",methods =['GET','POST'])#line:726 -async def escuchar_trauma1 ():#line:727 - O0O00OOOO00OO0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:728 - OOO000O000O000O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:729 - OOO00O00O00OO00OO =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:730 - OOOO0OO000OO000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:731 - OO00O000OO00000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:732 - O0O000OO0OO000OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:733 - OO00OO00OOO0OOOOO =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:734 - O0O0OO0OOOOO00OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:735 - return render_template ('escuchar_trauma1.html',nid2 =0 ,prediction_text ="Dale a `Escuchar´ y haz tu pregunta",user_image5 =O0O000OO0OO000OO0 ,user_image6 =OO00OO00OOO0OOOOO ,user_image7 =O0O0OO0OOOOO00OOO ,user_image8 =OOO00O00O00OO00OO ,user_image9 =OOOO0OO000OO000O0 ,user_image10 =O0O00OOOO00OO0OOO ,user_image11 =OO00O000OO00000O0 ,user_image12 =OOO000O000O000O0O )#line:736 -socket_data =[]#line:738 -@socketio .on ('audio_data')#line:739 -def handle_audio (OOO00O00O0000O000 ):#line:740 - if socket_data: - socket_data.clear - O0O00O0O0OO00O0O0 =OOO00O00O0000O000 #line:741 - socketio .emit ('transcription',O0O00O0O0OO00O0O0 )#line:742 - socket_data .append (O0O00O0O0OO00O0O0 )#line:743 -@app .route ("/escuchar_trauma",methods =['GET','POST'])#line:745 -async def escuchar_trauma ():#line:747 - OOOOO0OOO00O0O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:748 - OO0O00OOO000O0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:749 - OO000OO0OOOOO000O =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:750 - OOOOOO0O00000OOOO =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:751 - OO00OOOO0000O0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:752 - OO0OOOOOO0O0O00OO =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:753 - O0OO00O00O000OOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:754 - OOOO0O00OO0OOO000 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:755 - #print(socket_data) - OO000OO0OO0OO00OO =socket_data #line:756 - print(OO000OO0OO0OO00OO) - OO000OO0OO0OO00OO =str (OO000OO0OO0OO00OO ).lower ()#line:757 - print (OO000OO0OO0OO00OO )#line:758 - OO000OO0OO0OO00OO =OO000OO0OO0OO00OO .split ()#line:759 - print (OO000OO0OO0OO00OO )#line:758 - OOO0OOOO0O0000OOO ={}#line:760 - OOO0OOOO0O0000OOO [""]=""#line:761 - if len(OO000OO0OO0OO00OO) == 0: - return render_template ('escuchar_trauma.html',nid2 =0 ,result_busqueda =OOO0OOOO0O0000OOO ,prediction_text ="No te he entendido bien, dale al boton `Escuchar´ y repite tu pregunta",user_image5 =OO0OOOOOO0O0O00OO ,user_image6 =O0OO00O00O000OOO0 ,user_image7 =OOOO0O00OO0OOO000 ,user_image8 =OO000OO0OOOOO000O ,user_image9 =OOOOOO0O00000OOOO ,user_image10 =OOOOO0OOO00O0O0O0 ,user_image11 =OO00OOOO0000O0000 ,user_image12 =OO0O00OOO000O0000 )#line:786 - else: - print("primer if bien") - #if OO000OO0OO0OO00OO [0 ]!="none":#line:762 - O000OOO00OOO0O0OO =1 #line:763 - O00OO0O0O0OO0OO0O =await cargar_base_datos (OO000OO0OO0OO00OO ,O000OOO00OOO0O0OO )#line:764 - output2 =await buscar_faq (OO000OO0OO0OO00OO ,0 )#line:765 - if O00OO0O0O0OO0OO0O ==None : - print(OO0O0O0000O0O0O0O) - #if O00OO0O0O0OO0OO0O ==None :#line:766 - if len (output2 )==0 :#line:767 - print("tercer if") - return render_template ('escuchar_trauma.html',nid2 =0 ,result_busqueda =OOO0OOOO0O0000OOO ,prediction_text ="No hay resultados para tu busqueda",user_image6 =O0OO00O00O000OOO0 ,user_image7 =OOOO0O00OO0OOO000 ,user_image5 =OO0OOOOOO0O0O00OO ,user_image8 =OO000OO0OOOOO000O ,user_image9 =OOOOOO0O00000OOOO ,user_image10 =OOOOO0OOO00O0O0O0 ,user_image11 =OO00OOOO0000O0000 ,user_image12 =OO0O00OOO000O0000 )#line:768 - else :#line:769 - print("cuarto if") - return render_template ('escuchar_trauma.html',nid2 =0 ,faqs =OO0O0O0000O0O0O0O ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OOO0OOOO0O0000OOO ,user_image6 =O0OO00O00O000OOO0 ,user_image7 =OOOO0O00OO0OOO000 ,user_image5 =OO0OOOOOO0O0O00OO ,user_image8 =OO000OO0OOOOO000O ,user_image9 =OOOOOO0O00000OOOO ,user_image10 =OOOOO0OOO00O0O0O0 ,user_image11 =OO00OOOO0000O0000 ,user_image12 =OO0O00OOO000O0000 )#line:770 - elif len (O00OO0O0O0OO0OO0O )>=1 :#line:771 - OOOO0OOO00OOO0OO0 =[]#line:772 - OOO0O00O0O0OOOOO0 =[]#line:773 - OOO0OOOO0O0000OOO ={}#line:774 - for O00OOO0OOOOO0O0O0 in O00OO0O0O0OO0OO0O :#line:775 - OOOO0OOO00OOO0OO0 .append (O00OOO0OOOOO0O0O0 ["title"])#line:776 - OOO0O00O0O0OOOOO0 .append (O00OOO0OOOOO0O0O0 ["nid"])#line:777 - for OOOO000O00000O0O0 ,O00OOO0OOOOO0O0O0 in enumerate (OOOO0OOO00OOO0OO0 ):#line:778 - OOO0OOOO0O0000OOO [OOO0O00O0O0OOOOO0 [OOOO000O00000O0O0 ]]=O00OOO0OOOOO0O0O0 #line:779 - if len (OO0O0O0000O0O0O0O )==0 :#line:781 - return render_template ('escuchar_trauma.html',nid2 =0 ,result_busqueda =OOO0OOOO0O0000OOO ,user_image6 =O0OO00O00O000OOO0 ,user_image7 =OOOO0O00OO0OOO000 ,user_image5 =OO0OOOOOO0O0O00OO ,user_image8 =OO000OO0OOOOO000O ,user_image9 =OOOOOO0O00000OOOO ,user_image10 =OOOOO0OOO00O0O0O0 ,user_image11 =OO00OOOO0000O0000 ,user_image12 =OO0O00OOO000O0000 )#line:782 - else :#line:783 - print("aqui quiero que entre") - return render_template ('escuchar_trauma.html',nid2 =0 ,faqs =OO0O0O0000O0O0O0O ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OOO0OOOO0O0000OOO ,user_image6 =O0OO00O00O000OOO0 ,user_image7 =OOOO0O00OO0OOO000 ,user_image5 =OO0OOOOOO0O0O00OO ,user_image8 =OO000OO0OOOOO000O ,user_image9 =OOOOOO0O00000OOOO ,user_image10 =OOOOO0OOO00O0O0O0 ,user_image11 =OO00OOOO0000O0000 ,user_image12 =OO0O00OOO000O0000 )#line:784 -@app .route ("/buscador_admision",methods =['GET','POST'])#line:788 -async def buscador_admision ():#line:789 - O0OOO0O000OOOOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:790 - OOO00OO0O00OOOO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:791 - OO00000O0O00O000O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:792 - OOO0000OO0O0OOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:793 - OOOOOOO0O00OO000O =os .path .join (app .config ['UPLOAD_FOLDER'],'otros_img.png')#line:794 - OOOOOOOO0OO000O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'programacion_img.png')#line:795 - O000O0OO00OOOOO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'preguntas_respuestas.png')#line:796 - OO000OOOO00O00000 =os .path .join (app .config ['UPLOAD_FOLDER'],'ambulancias_img.jpg')#line:797 - O0O000O00OO0OO0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'mapa_camas_img.jpg')#line:798 - OO0O0O0OO0O00O000 =str (request .form .to_dict ())#line:799 - OO0O0O0OO0O00O000 =adaptar_salida (OO0O0O0OO0O00O000 )#line:800 - OOO00000O0O00000O ={}#line:801 - OOO00000O0O00000O [""]=""#line:802 - if len (OO0O0O0OO0O00O000 )==0 :#line:803 - return render_template ('buscador_admision.html',preguntas_respuestas =O000O0OO00OOOOO0O ,user_image8 =O0O000O00OO0OO0OO ,user_image9 =OO000OOOO00O00000 ,user_image10 =OOOOOOOO0OO000O00 ,user_image11 =OOOOOOO0O00OO000O ,result_busqueda =OOO00000O0O00000O ,prediction_text ="ya puedes hacer tu pregunta",user_image4 =O0OOO0O000OOOOO00 ,user_image5 =OOO00OO0O00OOOO0O ,user_image6 =OO00000O0O00O000O ,user_image7 =OOO0000OO0O0OOO00 )#line:804 - elif OO0O0O0OO0O00O000 !=None or "{}":#line:805 - OOO000000000O0O00 =1621 #line:806 - OOOO000OOO0OO00OO =await cargar_base_datos (OO0O0O0OO0O00O000 ,OOO000000000O0O00 )#line:807 - O0O0OOO000O000OOO ,O0OO0OO000O0OO0OO ,O0OO00OOOO0OO00O0 =await buscar_faq (OO0O0O0OO0O00O000 ,1 )#line:808 - if OOOO000OOO0OO00OO ==None :#line:809 - if len (O0OO00OOOO0OO00O0 )==0 :#line:810 - return render_template ('buscador_admision.html',preguntas_respuestas =O000O0OO00OOOOO0O ,user_image8 =O0O000O00OO0OO0OO ,user_image9 =OO000OOOO00O00000 ,user_image10 =OOOOOOOO0OO000O00 ,user_image11 =OOOOOOO0O00OO000O ,result_busqueda =OOO00000O0O00000O ,prediction_text ="No hay resultados para tu busqueda",user_image4 =O0OOO0O000OOOOO00 ,user_image5 =OOO00OO0O00OOOO0O ,user_image6 =OO00000O0O00O000O ,user_image7 =OOO0000OO0O0OOO00 )#line:811 - else :#line:812 - return render_template ('buscador_admision.html',preguntas_respuestas =O000O0OO00OOOOO0O ,user_image8 =O0O000O00OO0OO0OO ,user_image9 =OO000OOOO00O00000 ,user_image10 =OOOOOOOO0OO000O00 ,user_image11 =OOOOOOO0O00OO000O ,faqs =O0OO00OOOO0OO00O0 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OOO00000O0O00000O ,user_image4 =O0OOO0O000OOOOO00 ,user_image5 =OOO00OO0O00OOOO0O ,user_image6 =OO00000O0O00O000O ,user_image7 =OOO0000OO0O0OOO00 )#line:813 - elif len (OOOO000OOO0OO00OO )>=1 :#line:814 - O0OO00O00OOOO0OO0 =[]#line:815 - OOOOOO00O0OOOOO0O =[]#line:816 - OOO00000O0O00000O ={}#line:817 - for OOO00O00OOO0OOOOO in OOOO000OOO0OO00OO :#line:818 - OOOOOO00O0OOOOO0O .append (OOO00O00OOO0OOOOO ["nid"])#line:819 - for O0OO000O000O00O00 in OOOOOO00O0OOOOO0O :#line:820 - O0OO0OO00O0000OOO =aiohttp .TCPConnector (ssl =True )#line:821 - async with aiohttp .ClientSession (connector =O0OO0OO00O0000OOO )as OOO0000000OOO0OOO :#line:822 - O0O0OO0000OOO0O00 =await OOO0000000OOO0OOO .get ('https://orva.tedcas.com/api/intervenciones/'+str (O0OO000O000O00O00 ),auth =auth )#line:823 - O0OO0O000OOO00000 =await O0O0OO0000OOO0O00 .json ()#line:824 - O0OO0O000OOO00000 =O0OO0O000OOO00000 [0 ]#line:825 - O0OOOO000OOOOOO0O =O0OO0O000OOO00000 ['field_pdf']#line:826 - O0OOOO000OOOOOO0O =O0OOOO000OOOOOO0O [0 ]#line:827 - OOO00000O0O00000O [O0OO0O000OOO00000 ['title']]="https://orva.tedcas.com/"+str (O0OOOO000OOOOOO0O ['url'])#line:828 - if len (O0OO00OOOO0OO00O0 )==0 :#line:829 - return render_template ('buscador_admision1.html',user_image8 =O0O000O00OO0OO0OO ,user_image9 =OO000OOOO00O00000 ,user_image10 =OOOOOOOO0OO000O00 ,user_image11 =OOOOOOO0O00OO000O ,result_busqueda =OOO00000O0O00000O ,user_image4 =O0OOO0O000OOOOO00 ,user_image5 =OOO00OO0O00OOOO0O ,user_image6 =OO00000O0O00O000O ,user_image7 =OOO0000OO0O0OOO00 )#line:830 - else :#line:831 - return render_template ('buscador_admision1.html',faqs =O0OO00OOOO0OO00O0 ,faq_titulo ="Preguntas y respuestas: ",user_image8 =O0O000O00OO0OO0OO ,user_image9 =OO000OOOO00O00000 ,user_image10 =OOOOOOOO0OO000O00 ,user_image11 =OOOOOOO0O00OO000O ,result_busqueda =OOO00000O0O00000O ,user_image4 =O0OOO0O000OOOOO00 ,user_image5 =OOO00OO0O00OOOO0O ,user_image6 =OO00000O0O00O000O ,user_image7 =OOO0000OO0O0OOO00 )#line:832 -@app .route ("/mapa_camas",methods =['GET','POST'])#line:834 -async def mapa_camas ():#line:835 - OO0OO00O0OOOO0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:836 - O0O0OO00OO0O0000O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:837 - OOO00O00OOO00O0OO ,OOO00O0O0O00OO00O ,OO000O0000O0000O0 ,O00O0OOO0O00O00O0 =await cargar_botones_pdf_admision ()#line:838 - return render_template ('mapa_camas.html',text =OOO00O00OOO00O0OO ,user_image6 =OO0OO00O0OOOO0000 ,user_image7 =O0O0OO00OO0O0000O )#line:839 -@app .route ("/ambulancias",methods =['GET','POST'])#line:841 -async def ambulancias ():#line:842 - OOO000OOOOOOO0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:843 - OOOOO0OOO0O0O0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:844 - O00O0OO0O0OOO0OO0 ,OOOO0O0O000000OOO ,OO0OOOOOOO0OOOOO0 ,OOO0O0O000O00OO0O =await cargar_botones_pdf_admision ()#line:845 - return render_template ('ambulancias.html',text =OOOO0O0O000000OOO ,user_image6 =OOO000OOOOOOO0O0O ,user_image7 =OOOOO0OOO0O0O0OOO )#line:846 -@app .route ("/programacion_quirurgica",methods =['GET','POST'])#line:848 -async def programacion_quirurgica ():#line:849 - O0OOOOOO0O0OOOO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:850 - O0O00000O0OOOO000 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:851 - O0OOOO0OOO0OOOOOO ,OO000O00OOO000OOO ,O0OOO0OOOO0O000OO ,OO000O00000O00000 =await cargar_botones_pdf_admision ()#line:852 - return render_template ('programacion_quirurgica.html',text =O0OOO0OOOO0O000OO ,user_image6 =O0OOOOOO0O0OOOO0O ,user_image7 =O0O00000O0OOOO000 )#line:853 -@app .route ("/otros",methods =['GET','POST'])#line:855 -async def otros ():#line:856 - O00OO000O00000O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:857 - O0O0OOO00OO0O000O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:858 - OO00O000O0OO00OOO ,O0OO0000O00O000OO ,OOOOO0O000OOOOOOO ,OOOOO0OOO00O0O00O =await cargar_botones_pdf_admision ()#line:859 - return render_template ('otros.html',text =OOOOO0OOO00O0O00O ,user_image6 =O00OO000O00000O0O ,user_image7 =O0O0OOO00OO0O000O )#line:860 -@app .route ("/escuchar_admision1",methods =['GET','POST'])#line:862 -async def escuchar_admision1 ():#line:863 - OO0OO00O0OO0O0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'otros_img.png')#line:864 - O0OO0OO00O000OOOO =os .path .join (app .config ['UPLOAD_FOLDER'],'programacion_img.png')#line:865 - OOOO0000OO0OO0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'ambulancias_img.jpg')#line:866 - O0O0000O00O00O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'mapa_camas_img.jpg')#line:867 - O000OO00OOO000OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:868 - O0000O0O0O0OOOOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:869 - OOOO0000O0000000O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:870 - return render_template ('escuchar_admision1.html',user_image8 =O0O0000O00O00O0O0 ,user_image9 =OOOO0000OO0OO0000 ,user_image10 =O0OO0OO00O000OOOO ,user_image11 =OO0OO00O0OO0O0OOO ,prediction_text ="Dale a `Escuchar´ y haz tu pregunta",user_image5 =O000OO00OOO000OO0 ,user_image6 =O0000O0O0O0OOOOO0 ,user_image7 =OOOO0000O0000000O )#line:871 -@app .route ("/escuchar_admision",methods =['GET','POST'])#line:873 -async def escuchar_admision ():#line:874 - O0000OO00O0OOOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'otros_img.png')#line:875 - O00O0O0O0OOOOOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'programacion_img.png')#line:876 - O0O00O000OOO00OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ambulancias_img.jpg')#line:877 - OOO00OOOOOOOOO0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'mapa_camas_img.jpg')#line:878 - OO00OOOOO000O0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:879 - OOO00000000OOOO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:880 - OOO0OO0OOOOOOO00O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:881 - OOO0OOOOO0OO0OO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:882 - global recognized_text #line:883 - OO00000O00OOOOOO0 =recognized_text #line:884 - OO00000O00OOOOOO0 =str (OO00000O00OOOOOO0 ).lower ()#line:885 - OO00000O00OOOOOO0 =OO00000O00OOOOOO0 .split ()#line:886 - OOOOO0O00OO00O0OO ={}#line:887 - OOOOO0O00OO00O0OO [""]=""#line:888 - if OO00000O00OOOOOO0 [0 ]!="none":#line:889 - O00O0000O00OOOOO0 =1621 #line:890 - OOO0000OO0OOO00O0 =await cargar_base_datos (OO00000O00OOOOOO0 ,O00O0000O00OOOOO0 )#line:891 - OO000OO0O0O00OO00 ,OO00OOOOO0OO0OO0O ,OOO0O0OOOOO00O000 =await buscar_faq (OO00000O00OOOOOO0 ,0 )#line:892 - if OOO0000OO0OOO00O0 ==None :#line:893 - if len (OOO0O0OOOOO00O000 )==0 :#line:894 - return render_template ('escuchar_admision.html',user_image8 =OOO00OOOOOOOOO0O0 ,user_image9 =O0O00O000OOO00OO0 ,user_image10 =O00O0O0O0OOOOOO00 ,user_image11 =O0000OO00O0OOOO00 ,result_busqueda =OOOOO0O00OO00O0OO ,prediction_text ="No hay resultados para tu busqueda",user_image4 =OO00OOOOO000O0OOO ,user_image5 =OOO00000000OOOO0O ,user_image6 =OOO0OO0OOOOOOO00O ,user_image7 =OOO0OOOOO0OO0OO00 )#line:895 - else :#line:896 - return render_template ('escuchar_admision.html',faqs =OOO0O0OOOOO00O000 ,faq_titulo ="Preguntas y respuestas: ",user_image8 =OOO00OOOOOOOOO0O0 ,user_image9 =O0O00O000OOO00OO0 ,user_image10 =O00O0O0O0OOOOOO00 ,user_image11 =O0000OO00O0OOOO00 ,result_busqueda =OOOOO0O00OO00O0OO ,user_image4 =OO00OOOOO000O0OOO ,user_image5 =OOO00000000OOOO0O ,user_image6 =OOO0OO0OOOOOOO00O ,user_image7 =OOO0OOOOO0OO0OO00 )#line:897 - elif len (OOO0000OO0OOO00O0 )>=1 :#line:898 - O000O00OO0OOOO000 =[]#line:899 - OOO0O0O000000OO0O =[]#line:900 - OOOOO0O00OO00O0OO ={}#line:901 - for O000000O0OO0000OO in OOO0000OO0OOO00O0 :#line:902 - OOO0O0O000000OO0O .append (O000000O0OO0000OO ["nid"])#line:903 - for O0O0O0OOO00O000O0 in OOO0O0O000000OO0O :#line:904 - OO00OOOO0O0O0OO00 =aiohttp .TCPConnector (ssl =True )#line:905 - async with aiohttp .ClientSession (connector =OO00OOOO0O0O0OO00 )as OO0OOOOO0OO0O00OO :#line:906 - O0OO000OO00000OO0 =await OO0OOOOO0OO0O00OO .get ('https://orva.tedcas.com/api/intervenciones/'+str (O0O0O0OOO00O000O0 ),auth =auth )#line:907 - OO00OOOO0O000O00O =await O0OO000OO00000OO0 .json ()#line:908 - OO00OOOO0O000O00O =OO00OOOO0O000O00O [0 ]#line:909 - O00000O000OOOOO00 =OO00OOOO0O000O00O ['field_pdf']#line:910 - O00000O000OOOOO00 =O00000O000OOOOO00 [0 ]#line:911 - OOOOO0O00OO00O0OO [OO00OOOO0O000O00O ['title']]="https://orva.tedcas.com/"+str (O00000O000OOOOO00 ['url'])#line:912 - if len (OOO0O0OOOOO00O000 )==0 :#line:913 - return render_template ('escuchar_admision.html',user_image8 =OOO00OOOOOOOOO0O0 ,user_image9 =O0O00O000OOO00OO0 ,user_image10 =O00O0O0O0OOOOOO00 ,user_image11 =O0000OO00O0OOOO00 ,result_busqueda =OOOOO0O00OO00O0OO ,user_image4 =OO00OOOOO000O0OOO ,user_image5 =OOO00000000OOOO0O ,user_image6 =OOO0OO0OOOOOOO00O ,user_image7 =OOO0OOOOO0OO0OO00 )#line:914 - else :#line:915 - return render_template ('escuchar_admision.html',faqs =OOO0O0OOOOO00O000 ,faq_titulo ="Preguntas y respuestas: ",user_image8 =OOO00OOOOOOOOO0O0 ,user_image9 =O0O00O000OOO00OO0 ,user_image10 =O00O0O0O0OOOOOO00 ,user_image11 =O0000OO00O0OOOO00 ,result_busqueda =OOOOO0O00OO00O0OO ,user_image4 =OO00OOOOO000O0OOO ,user_image5 =OOO00000000OOOO0O ,user_image6 =OOO0OO0OOOOOOO00O ,user_image7 =OOO0OOOOO0OO0OO00 )#line:916 - else :#line:917 - return render_template ('escuchar_admision.html',user_image8 =OOO00OOOOOOOOO0O0 ,user_image9 =O0O00O000OOO00OO0 ,user_image10 =O00O0O0O0OOOOOO00 ,user_image11 =O0000OO00O0OOOO00 ,prediction_text ="No te he entendido bien, dale al boton `Escuchar´ y repite tu pregunta",result_busqueda =OOOOO0O00OO00O0OO ,user_image4 =OO00OOOOO000O0OOO ,user_image5 =OOO00000000OOOO0O ,user_image6 =OOO0OO0OOOOOOO00O ,user_image7 =OOO0OOOOO0OO0OO00 )#line:918 -@app .route ("/buscador_uro",methods =['GET','POST'])#line:920 -async def buscador_uro ():#line:921 - O000OOO0000O00000 =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:922 - OOOO0O0000O000OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:923 - OO0OO00OOOO0OO00O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:924 - OOOO0O00O0000OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:925 - OO0OO000O0O000OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:926 - O0O0OO0OO0000000O =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:927 - OOOO0O000O00O0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:928 - OOO0O00O0000O0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:929 - OOO00OOOOOO0OOO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'preguntas_respuestas.png')#line:930 - OOOOOOO0OO00O000O =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:931 - O0O00O0O00O0OO00O =str (request .form .to_dict ())#line:932 - O0O00O0O00O0OO00O =adaptar_salida (O0O00O0O00O0OO00O )#line:933 - O0OOOOO0O0O0OO000 ={}#line:934 - O0OOOOO0O0O0OO000 [""]=""#line:935 - if len (O0O00O0O00O0OO00O )==0 :#line:936 - return render_template ('buscador_uro.html',preguntas_respuestas =OOO00OOOOOO0OOO0O ,result_busqueda =O0OOOOO0O0O0OO000 ,user_image4 =O000OOO0000O00000 ,user_image5 =OOOO0O0000O000OO0 ,user_image6 =OO0OO00OOOO0OO00O ,user_image7 =OOOO0O00O0000OO0O ,user_image8 =OOOO0O000O00O0000 ,user_image9 =OOO0O00O0000O0O00 ,user_image10 =OO0OO000O0O000OO0 ,user_image11 =OOOOOOO0OO00O000O ,user_image12 =O0O0OO0OO0000000O ,nid2 =0 )#line:937 - elif O0O00O0O00O0OO00O !=None or "{}":#line:938 - OOO00O00O0O000O0O =1620 #line:939 - O0O000O0OOOOO0OO0 =await cargar_base_datos (O0O00O0O00O0OO00O ,OOO00O00O0O000O0O )#line:940 - O000OOOO0O0OOOO00 ,O0OO0O0O0OO0OOO00 ,O00OO0OO0000OO0OO =await buscar_faq (O0O00O0O00O0OO00O ,1 )#line:941 - if O0O000O0OOOOO0OO0 ==None :#line:942 - if len (O0OO0O0O0OO0OOO00 )==0 :#line:943 - return render_template ('buscador_uro.html',preguntas_respuestas =OOO00OOOOOO0OOO0O ,result_busqueda =O0OOOOO0O0O0OO000 ,prediction_text ="No hay resultados para tu busqueda",user_image4 =O000OOO0000O00000 ,user_image5 =OOOO0O0000O000OO0 ,user_image6 =OO0OO00OOOO0OO00O ,user_image7 =OOOO0O00O0000OO0O ,user_image8 =OOOO0O000O00O0000 ,user_image9 =OOO0O00O0000O0O00 ,user_image10 =OO0OO000O0O000OO0 ,user_image11 =OOOOOOO0OO00O000O ,user_image12 =O0O0OO0OO0000000O ,nid2 =0 )#line:944 - else :#line:945 - return render_template ('buscador_uro.html',preguntas_respuestas =OOO00OOOOOO0OOO0O ,faqs =O0OO0O0O0OO0OOO00 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =O0OOOOO0O0O0OO000 ,user_image4 =O000OOO0000O00000 ,user_image5 =OOOO0O0000O000OO0 ,user_image6 =OO0OO00OOOO0OO00O ,user_image7 =OOOO0O00O0000OO0O ,user_image8 =OOOO0O000O00O0000 ,user_image9 =OOO0O00O0000O0O00 ,user_image10 =OO0OO000O0O000OO0 ,user_image11 =OOOOOOO0OO00O000O ,user_image12 =O0O0OO0OO0000000O ,nid2 =0 )#line:946 - elif len (O0O000O0OOOOO0OO0 )>=1 :#line:947 - O0O0OO0OO0OO0O0O0 =[]#line:948 - OOOOOOOO00OO00O0O =[]#line:949 - O0OOOOO0O0O0OO000 ={}#line:950 - for O0OO00000OO000OOO in O0O000O0OOOOO0OO0 :#line:951 - O0O0OO0OO0OO0O0O0 .append (O0OO00000OO000OOO ["title"])#line:952 - OOOOOOOO00OO00O0O .append (O0OO00000OO000OOO ["nid"])#line:953 - for O0000O00O0O0OO000 ,O0OO00000OO000OOO in enumerate (O0O0OO0OO0OO0O0O0 ):#line:954 - O0OOOOO0O0O0OO000 [OOOOOOOO00OO00O0O [O0000O00O0O0OO000 ]]=O0OO00000OO000OOO #line:955 - if len (O0OO0O0O0OO0OOO00 )!=0 :#line:956 - return render_template ('buscador_uro1.html',faqs =O0OO0O0O0OO0OOO00 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =O0OOOOO0O0O0OO000 ,user_image4 =O000OOO0000O00000 ,user_image5 =OOOO0O0000O000OO0 ,user_image6 =OO0OO00OOOO0OO00O ,user_image7 =OOOO0O00O0000OO0O ,user_image8 =OOOO0O000O00O0000 ,user_image9 =OOO0O00O0000O0O00 ,user_image10 =OO0OO000O0O000OO0 ,user_image11 =OOOOOOO0OO00O000O ,user_image12 =O0O0OO0OO0000000O ,nid2 =0 )#line:957 - else :#line:958 - if len (O0OOOOO0O0O0OO000 )==1 :#line:959 - return redirect (url_for ('resultado_uro',link =OOOOOOOO00OO00O0O ))#line:960 - else :#line:961 - return render_template ('buscador_uro1.html',result_busqueda =O0OOOOO0O0O0OO000 ,user_image4 =O000OOO0000O00000 ,user_image5 =OOOO0O0000O000OO0 ,user_image6 =OO0OO00OOOO0OO00O ,user_image7 =OOOO0O00O0000OO0O ,user_image8 =OOOO0O000O00O0000 ,user_image9 =OOO0O00O0000O0O00 ,user_image10 =OO0OO000O0O000OO0 ,user_image11 =OOOOOOO0OO00O000O ,user_image12 =O0O0OO0OO0000000O ,nid2 =0 )#line:962 -@app .route ("/resultado_uro",methods =['GET','POST'])#line:964 -async def resultado_uro ():#line:965 - OOOOOOO0OOO0OO000 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:966 - O00OO000OO00000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:967 - OOO00OO0O00OO000O =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:968 - O000O00O0O0OOO00O =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:969 - OO0000000OO00000O =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:970 - O0000OO0000OOO00O =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:971 - OOOOO0O0OOOOO00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:972 - O00O000O0O000O00O =request .args .get ('link')#line:973 - OO0OO0OOO000O0OOO ,O00O0000OOO0O0O00 =await cargar_tipo (O00O000O0O000O00O ,1620 )#line:974 - O0OOOOOO00000O0O0 =OO0OO0OOO000O0OOO ['title']#line:975 - if O00O0000OOO0O0O00 =="Intervencion":#line:976 - print ("hola1")#line:977 - OOOO00OOO00O0O00O ,O0O0000O0O0O0O00O =await cargar_caja (str (O00O000O0O000O00O ),'Instrumental - Cajas: ')#line:978 - return render_template ('intervencion_uro.html',user_image8 =OO0000000OO00000O ,user_image9 =O0000OO0000OOO00O ,user_image10 =OOO00OO0O00OO000O ,user_image11 =OOOOO0O0OOOOO00O0 ,user_image12 =O000O00O0O0OOO00O ,instrumental =OOOO00OOO00O0O00O ,texto_cajas =O0O0000O0O0O0O00O ,title =O0OOOOOO00000O0O0 ,user_image6 =OOOOOOO0OOO0OO000 ,user_image7 =O00OO000OO00000O0 ,nid2 =O00O000O0O000O00O )#line:979 - elif O00O0000OOO0O0O00 =='Caja':#line:980 - O00OOOO00OOO00O0O ,OO0OO00OO0000O0O0 ,OO000O0000000000O =await cargar_archivo ("ubicacion","Ubicacion: ","cajas/"+str (O00O000O0O000O00O ))#line:981 - O00O0OOOOO000O0OO =await cargar_archivo ("image","Imagen: ","cajas/"+str (O00O000O0O000O00O ))#line:982 - O0OO00OO0O00O0O0O ,OOOO0O00O0OOO0OO0 =await cargar_archivo_grande ("title_material","Instrumental : ","cajas/"+str (O00O000O0O000O00O ))#line:983 - if len (O0OOOOOO00000O0O0 )==1 :#line:984 - return render_template ('caja_trauma1.html',title =O0OOOOOO00000O0O0 ,files_instru =O0OO00OO0O00O0O0O ,texto_instru =OOOO0O00O0OOO0OO0 ,texto_ubi =O00OOOO00OOO00O0O ,file_texto_ubi =OO000O0000000000O ,file_imagen =O00O0OOOOO000O0OO ,user_image6 =OOOOOOO0OOO0OO000 ,user_image7 =O00OO000OO00000O0 )#line:985 - else :#line:986 - return render_template ('caja_trauma.html',title =O0OOOOOO00000O0O0 ,files_instru =O0OO00OO0O00O0O0O ,texto_instru =OOOO0O00O0OOO0OO0 ,texto_ubi =O00OOOO00OOO00O0O ,file_texto_ubi =OO000O0000000000O ,file_imagen =O00O0OOOOO000O0OO ,user_image6 =OOOOOOO0OOO0OO000 ,user_image7 =O00OO000OO00000O0 )#line:987 - elif O00O0000OOO0O0O00 =='Instrumental':#line:988 - print ("hola2")#line:989 - O000O00OO00O000OO =await cargar_instrumental (O00O000O0O000O00O ,'listado_completo_cajas/1620')#line:990 - if len (O000O00OO00O000OO )==1 :#line:991 - return render_template ('instrumental_uro1.html',cajas =O000O00OO00O000OO ,texto ='El instrumental que buscas esta presente en las siguientes cajas: ',title =O0OOOOOO00000O0O0 ,user_image6 =OOOOOOO0OOO0OO000 ,user_image7 =O00OO000OO00000O0 )#line:992 - else :#line:993 - return render_template ('instrumental_uro.html',cajas =O000O00OO00O000OO ,texto ='El instrumental que buscas esta presente en las siguientes cajas: ',title =O0OOOOOO00000O0O0 ,user_image6 =OOOOOOO0OOO0OO000 ,user_image7 =O00OO000OO00000O0 )#line:994 -@app .route ("/protocolos_uro",methods =['GET','POST'])#line:996 -async def protocolos_uro ():#line:997 - OOO00O0OOOO0OOO0O =request .args .get ('link2')#line:998 - O0OOOOO000O0O00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:999 - OOOOO00O0OOOO0000 =await boton_word_ppt (1620 ,"field_protocolo",OOO00O0OOOO0OOO0O )#line:1000 - if len (OOOOO00O0OOOO0000 )==1 :#line:1001 - return render_template ('protocolo1.html',protocolos =OOOOO00O0OOOO0000 ,user_image7 =O0OOOOO000O0O00O0 )#line:1002 - else :#line:1003 - return render_template ('protocolo.html',protocolos =OOOOO00O0OOOO0000 ,user_image7 =O0OOOOO000O0O00O0 )#line:1004 -@app .route ("/guia_visual_uro",methods =['GET','POST'])#line:1006 -async def guia_visual_uro ():#line:1007 - OOO00O0OO0OOOO0OO =request .args .get ('link2')#line:1008 - OO00O00OOOOO00O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1009 - OO00O000O0O0O00O0 =await boton_word_ppt (1620 ,"field_guia_visual",OOO00O0OO0OOOO0OO )#line:1010 - if len (OO00O000O0O0O00O0 )==1 :#line:1011 - return render_template ('guia_visual1.html',guia_visual =OO00O000O0O0O00O0 ,user_image7 =OO00O00OOOOO00O00 )#line:1012 - else :#line:1013 - return render_template ('guia_visual.html',guia_visual =OO00O000O0O0O00O0 ,user_image7 =OO00O00OOOOO00O00 )#line:1014 -@app .route ("/pdf_casa_uro",methods =['GET','POST'])#line:1016 -async def pdf_casa_uro ():#line:1017 - O0OOOOOOOOOOOO00O =request .args .get ('link2')#line:1018 - OO00O00O0OOOOO000 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1019 - O0O0O0OOOO0O0O0OO =await boton_pdf_video (1620 ,"field_pdf",O0OOOOOOOOOOOO00O )#line:1020 - OO000OOO00000OO00 =0 #line:1021 - for OOO00OOO00OOOOO0O ,O00OO00O0OO00O0O0 in O0O0O0OOOO0O0O0OO .items ():#line:1022 - for O0O0O000000O00O0O ,OOOO0000O0O00O0OO in O00OO00O0OO00O0O0 .items ():#line:1023 - OO000OOO00000OO00 =OO000OOO00000OO00 +1 #line:1024 - if len (O0O0O0OOOO0O0O0OO .items ())==1 :#line:1025 - if OO000OOO00000OO00 ==1 :#line:1026 - print ("bien")#line:1027 - return render_template ('pdf_casa_comercial1.html',user_image7 =OO00O00O0OOOOO000 ,titulos =O0O0O0OOOO0O0O0OO )#line:1028 - else :#line:1029 - return render_template ('pdf_casa_comercial.html',user_image7 =OO00O00O0OOOOO000 ,titulos =O0O0O0OOOO0O0O0OO )#line:1030 - else :#line:1031 - return render_template ('pdf_casa_comercial.html',user_image7 =OO00O00O0OOOOO000 ,titulos =O0O0O0OOOO0O0O0OO )#line:1032 -@app .route ("/videos_uro",methods =['GET','POST'])#line:1034 -async def videos_uro ():#line:1035 - OO0OOO0000OOOO0O0 =request .args .get ('link2')#line:1036 - OO000O0OO0O0O0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1037 - O0O0OOO0000OOO0O0 =await boton_pdf_video (1620 ,"field_video",OO0OOO0000OOOO0O0 )#line:1038 - O0O0OOO00OOO0O0O0 =0 #line:1039 - for O0OO00000O000O0O0 ,O0O0O0OOO00O0O000 in O0O0OOO0000OOO0O0 .items ():#line:1040 - for O00O0O00OOOO0OOO0 ,O00O0000OOOO0OO0O in O0O0O0OOO00O0O000 .items ():#line:1041 - O0O0OOO00OOO0O0O0 =O0O0OOO00OOO0O0O0 +1 #line:1042 - if len (O0O0OOO0000OOO0O0 .items ())==1 :#line:1043 - if O0O0OOO00OOO0O0O0 ==1 :#line:1044 - return render_template ('videos1.html',user_image7 =OO000O0OO0O0O0OOO ,titulos =O0O0OOO0000OOO0O0 )#line:1045 - else :#line:1046 - return render_template ('videos.html',user_image7 =OO000O0OO0O0O0OOO ,titulos =O0O0OOO0000OOO0O0 )#line:1047 +from inflector import Inflector ,Spanish #line:10 +inflector =Inflector (Spanish )#line:11 +import speech_recognition as sr #line:12 +import os #line:13 +import requests #line:14 +from requests .auth import HTTPBasicAuth #line:15 +import asyncio #line:16 +import aiohttp #line:17 +auth =aiohttp .BasicAuth ('1234','API')#line:20 +base_url ='https://orva.tedcas.com/api/'#line:21 +archivo ="./preguntas_qh_tags.xlsx"#line:22 +xlrd .xlsx .ensure_elementtree_imported (False ,None )#line:25 +xlrd .xlsx .Element_has_iter =True #line:26 +async def faq ():#line:28 + OO0000OO00O0OOO00 =pd .read_excel (archivo ,engine ="openpyxl")#line:29 + OOOO000OOO0OO0O0O =OO0000OO00O0OOO00 #line:30 + OO0000OO00O0OOO00 =xlrd .open_workbook (archivo )#line:31 + OO0000OO00O0OOO00 =OO0000OO00O0OOO00 .sheet_by_index (0 )#line:32 + O0000OO00OO0OO000 =[]#line:33 + OOOO0O00O000OOO00 =[]#line:34 + OOOO0O000000O0000 =[]#line:35 + OOO0O00OOO000OO00 =pd .read_excel (archivo ,header =1 )#line:36 + for O0OO00O000OO0O0OO ,OO0000O0O00000O0O in OOO0O00OOO000OO00 .iterrows ():#line:37 + if OOOO000OOO0OO0O0O .loc [O0OO00O000OO0O0OO ,'Especialidad']=='trauma':#line:38 + O0OOO00O0O0000O0O =OO0000OO00O0OOO00 .cell (int (O0OO00O000OO0O0OO )+1 ,2 )#line:39 + OO0O0O0000OOO00O0 =OO0000OO00O0OOO00 .cell (int (O0OO00O000OO0O0OO )+1 ,3 )#line:40 + O0OOO00O0O0000O0O =str (O0OOO00O0O0000O0O )#line:41 + OO0O0O0000OOO00O0 =str (OO0O0O0000OOO00O0 )#line:42 + O0OOO00O0O0000O0O =O0OOO00O0O0000O0O .split ("'")#line:43 + OO0O0O0000OOO00O0 =OO0O0O0000OOO00O0 .split ("'")#line:44 + O0000OO00OO0OO000 .append (f" {O0OOO00O0O0000O0O[1]} {OO0O0O0000OOO00O0[1]} ")#line:45 + elif OOOO000OOO0OO0O0O .loc [O0OO00O000OO0O0OO ,'Especialidad']=='uro':#line:46 + O0OOO00O0O0000O0O =OO0000OO00O0OOO00 .cell (int (O0OO00O000OO0O0OO )+1 ,2 )#line:47 + OO0O0O0000OOO00O0 =OO0000OO00O0OOO00 .cell (int (O0OO00O000OO0O0OO )+1 ,3 )#line:48 + O0OOO00O0O0000O0O =str (O0OOO00O0O0000O0O )#line:49 + OO0O0O0000OOO00O0 =str (OO0O0O0000OOO00O0 )#line:50 + O0OOO00O0O0000O0O =O0OOO00O0O0000O0O .split ("'")#line:51 + OO0O0O0000OOO00O0 =OO0O0O0000OOO00O0 .split ("'")#line:52 + OOOO0O00O000OOO00 .append (f" {O0OOO00O0O0000O0O[1]} {OO0O0O0000OOO00O0[1]} ")#line:53 + elif OOOO000OOO0OO0O0O .loc [O0OO00O000OO0O0OO ,'Especialidad']=='admin':#line:54 + O0OOO00O0O0000O0O =OO0000OO00O0OOO00 .cell (int (O0OO00O000OO0O0OO )+1 ,2 )#line:55 + OO0O0O0000OOO00O0 =OO0000OO00O0OOO00 .cell (int (O0OO00O000OO0O0OO )+1 ,3 )#line:56 + O0OOO00O0O0000O0O =str (O0OOO00O0O0000O0O )#line:57 + OO0O0O0000OOO00O0 =str (OO0O0O0000OOO00O0 )#line:58 + O0OOO00O0O0000O0O =O0OOO00O0O0000O0O .split ("'")#line:59 + OO0O0O0000OOO00O0 =OO0O0O0000OOO00O0 .split ("'")#line:60 + OOOO0O000000O0000 .append (f" {O0OOO00O0O0000O0O[1]} {OO0O0O0000OOO00O0[1]} ")#line:61 + if OO0000O0O00000O0O .dropna ().empty :#line:62 + break #line:63 + return O0000OO00OO0OO000 ,OOOO0O00O000OOO00 ,OOOO0O000000O0000 #line:64 +async def buscar_faq (OOO0O0O0OOOO000OO ,O0OOOOO00OO0000O0 ):#line:66 + O00OO0O00O000O00O =pd .read_excel (archivo ,engine ="openpyxl")#line:67 + O0OOOOO0OO0OO0000 =O00OO0O00O000O00O #line:68 + OO00OO0O000OO0O00 =0 #line:69 + O000O00O00O0OO0OO =OOO0O0O0OOOO000OO #line:70 + O000O0OO0O0OO0O00 =[]#line:71 + print ("result"+str (O000O00O00O0OO0OO ))#line:72 + for O000O00OOOO0OO000 ,O00OO000OOOO00OOO in O00OO0O00O000O00O .iterrows ():#line:73 + O0O0O00OOOOO0O0O0 =O00OO0O00O000O00O .loc [O000O00OOOO0OO000 ,'TAGS2']#line:74 + O0O0O00OOOOO0O0O0 =O0O0O00OOOOO0O0O0 .split (",")#line:75 + O000O0OO0O0OO0O00 .append (O0O0O00OOOOO0O0O0 )#line:76 + O00O0000OO0O0OOO0 =[]#line:77 + O0O0O00OOOOO0O0O0 =[]#line:78 + for OOO0O0O0OOOOO0O0O ,O000O0OO0OOOO00OO in enumerate (O000O00O00O0OO0OO ):#line:79 + O000O00O00O0OO0OO [OOO0O0O0OOOOO0O0O ]=inflector .singularize (str (O000O0OO0OOOO00OO ))#line:80 + OOO00OO000O0O0O00 =np .zeros (len (O00OO0O00O000O00O .index ),dtype =int )#line:81 + for OOO0OO0OOOOO00OOO ,O00OO000OOOO00OOO in enumerate (O000O0OO0O0OO0O00 ):#line:82 + OOO000OO000000O0O =[]#line:83 + for O000O0OO0OOOO00OO in O00OO000OOOO00OOO :#line:84 + if O0OOOOO00OO0000O0 ==0 :#line:85 + if O000O0OO0OOOO00OO !=[]:#line:86 + OO00OO0O000OO0O00 =0 #line:87 + for OO0OOO0OOOOOO000O in range (100 ):#line:88 + OO0OOO0OOOOOO000O =OO0OOO0OOOOOO000O /10 #line:89 + OO0OOO0OOOOOO000O =str (OO0OOO0OOOOOO000O )#line:90 + if O000O0OO0OOOO00OO ==OO0OOO0OOOOOO000O :#line:91 + OO0OOO0OOOOOO000O =OO0OOO0OOOOOO000O .split (".")#line:92 + OOO000OO000000O0O .append (OO0OOO0OOOOOO000O [0 ])#line:93 + OOO000OO000000O0O .append ("con")#line:94 + OOO000OO000000O0O .append (OO0OOO0OOOOOO000O [1 ])#line:95 + OO00OO0O000OO0O00 =OO00OO0O000OO0O00 +1 #line:96 + if OO00OO0O000OO0O00 ==0 :#line:97 + OOO000OO000000O0O .append (O000O0OO0OOOO00OO )#line:98 + if O0OOOOO00OO0000O0 ==1 :#line:99 + OOO000OO000000O0O .append (O000O0OO0OOOO00OO )#line:100 + O00O0000OO0O0OOO0 .append (OOO000OO000000O0O )#line:101 + for O00O0000OOOO0OO00 in O000O00O00O0OO0OO :#line:102 + for OOOOO0O0O0O00OO00 ,O000O0OO0OOOO00OO in enumerate (O00O0000OO0O0OOO0 [OOO0OO0OOOOO00OOO ]):#line:103 + if str (O00O0000OOOO0OO00 )=="maya":#line:104 + O00O0000OOOO0OO00 ="malla"#line:105 + if str (O00O0000OOOO0OO00 )=="pilos"or str (O00O0000OOOO0OO00 )=="pilo":#line:106 + O00O0000OOOO0OO00 ="philo"#line:107 + if str (O00O0000OOOO0OO00 )=="filos"or str (O00O0000OOOO0OO00 )=="filo":#line:108 + O00O0000OOOO0OO00 ="philo"#line:109 + if str (O00O0000OOOO0OO00 )=="sinces"or str (O00O0000OOOO0OO00 )=="sinc":#line:110 + O00O0000OOOO0OO00 ="synthe"#line:111 + if str (O00O0000OOOO0OO00 )=="sintes"or str (O00O0000OOOO0OO00 )=="sint":#line:112 + O00O0000OOOO0OO00 ="synthe"#line:113 + if str (O00O0000OOOO0OO00 )=="axos"or str (O00O0000OOOO0OO00 )=="axo":#line:114 + O00O0000OOOO0OO00 ="axso"#line:115 + if str (O00O0000OOOO0OO00 )=="uno":#line:116 + O00O0000OOOO0OO00 ="1"#line:117 + if str (O00O0000OOOO0OO00 )=="dos"or str (O00O0000OOOO0OO00 )=="do":#line:118 + O00O0000OOOO0OO00 ="2"#line:119 + if str (O00O0000OOOO0OO00 )=="tres"or str (O00O0000OOOO0OO00 )=="tr":#line:120 + O00O0000OOOO0OO00 ="3"#line:121 + if str (O00O0000OOOO0OO00 )=="cuatro":#line:122 + O00O0000OOOO0OO00 ="4"#line:123 + if str (O00O0000OOOO0OO00 )=="cinco":#line:124 + O00O0000OOOO0OO00 ="5"#line:125 + if str (O00O0000OOOO0OO00 )=="seis"or str (O00O0000OOOO0OO00 )=="sei":#line:126 + O00O0000OOOO0OO00 ="6"#line:127 + if str (O00O0000OOOO0OO00 )=="siete":#line:128 + O00O0000OOOO0OO00 ="7"#line:129 + if str (O00O0000OOOO0OO00 )=="ocho":#line:130 + O00O0000OOOO0OO00 ="8"#line:131 + if str (O00O0000OOOO0OO00 )=="nueve":#line:132 + O00O0000OOOO0OO00 ="9"#line:133 + if str (O00O0000OOOO0OO00 )=="cero":#line:134 + O00O0000OOOO0OO00 ="0"#line:135 + if str (O00O0000OOOO0OO00 )=="veintiuno":#line:136 + O00O0000OOOO0OO00 ="21"#line:137 + if str (O00O0000OOOO0OO00 )=="veinte":#line:138 + O00O0000OOOO0OO00 ="20"#line:139 + if str (O00O0000OOOO0OO00 )=="veintidos"or str (O00O0000OOOO0OO00 )=="veintido":#line:140 + O00O0000OOOO0OO00 ="22"#line:141 + if str (O00O0000OOOO0OO00 )=="veintitres"or str (O00O0000OOOO0OO00 )=="veintitre":#line:142 + O00O0000OOOO0OO00 ="23"#line:143 + if str (O00O0000OOOO0OO00 )=="veinticuatro":#line:144 + O00O0000OOOO0OO00 ="24"#line:145 + if str (O00O0000OOOO0OO00 )=="veinticinco":#line:146 + O00O0000OOOO0OO00 ="25"#line:147 + if str (O00O0000OOOO0OO00 )=="veintiseis"or str (O00O0000OOOO0OO00 )=="veintisei":#line:148 + O00O0000OOOO0OO00 ="26"#line:149 + if str (O00O0000OOOO0OO00 )=="veintisiete":#line:150 + O00O0000OOOO0OO00 ="27"#line:151 + if str (O00O0000OOOO0OO00 )=="veintiocho":#line:152 + O00O0000OOOO0OO00 ="28"#line:153 + if str (O00O0000OOOO0OO00 )=="veintinueve":#line:154 + O00O0000OOOO0OO00 ="29"#line:155 + if str (O00O0000OOOO0OO00 )=="treinta":#line:156 + O00O0000OOOO0OO00 ="30"#line:157 + if str (remove_accents (O000O0OO0OOOO00OO )).lower ()==str (remove_accents (O00O0000OOOO0OO00 )).lower ():#line:158 + OOO00OO000O0O0O00 [OOO0OO0OOOOO00OOO ]=OOO00OO000O0O0O00 [OOO0OO0OOOOO00OOO ]+1 #line:159 + O00O0000OO0O0OOO0 [OOO0OO0OOOOO00OOO ].pop (OOOOO0O0O0O00OO00 )#line:160 + OOO00O0OOOO0O0OO0 =np .argwhere (OOO00OO000O0O0O00 ==np .amax (OOO00OO000O0O0O00 ))#line:162 + O0000O0O00O0000OO =[]#line:163 + OOOOO00OOO000OO0O ={}#line:164 + OO0OOOO0000O00OO0 =[]#line:165 + O0000OO0000O0000O =[]#line:166 + O0O0O0O0000OOOOO0 =[]#line:167 + O00OO0O00O000O00O =xlrd .open_workbook (archivo )#line:168 + O00OO0O00O000O00O =O00OO0O00O000O00O .sheet_by_index (0 )#line:169 + if not np .all (OOO00OO000O0O0O00 ==0 ):#line:170 + for OO0O0OOO00OO000OO in OOO00O0OOOO0O0OO0 :#line:171 + if (O0OOOOO0OO0OO0000 .loc [OO0O0OOO00OO000OO ,'Especialidad']=='trauma').any ():#line:172 + OOO00000OOO0OOOO0 =O00OO0O00O000O00O .cell (int (OO0O0OOO00OO000OO )+1 ,2 )#line:173 + OO00O00OO00O0OO0O =O00OO0O00O000O00O .cell (int (OO0O0OOO00OO000OO )+1 ,3 )#line:174 + OOO00000OOO0OOOO0 =str (OOO00000OOO0OOOO0 )#line:175 + OO00O00OO00O0OO0O =str (OO00O00OO00O0OO0O )#line:176 + OOO00000OOO0OOOO0 =OOO00000OOO0OOOO0 .split ("'")#line:177 + OO00O00OO00O0OO0O =OO00O00OO00O0OO0O .split ("'")#line:178 + OO0OOOO0000O00OO0 .append (f" {OOO00000OOO0OOOO0[1]} {OO00O00OO00O0OO0O[1]} ")#line:179 + elif (O0OOOOO0OO0OO0000 .loc [OO0O0OOO00OO000OO ,'Especialidad']=='uro').any ():#line:180 + OOO00000OOO0OOOO0 =O00OO0O00O000O00O .cell (int (OO0O0OOO00OO000OO )+1 ,2 )#line:181 + OO00O00OO00O0OO0O =O00OO0O00O000O00O .cell (int (OO0O0OOO00OO000OO )+1 ,3 )#line:182 + OOO00000OOO0OOOO0 =str (OOO00000OOO0OOOO0 )#line:183 + OO00O00OO00O0OO0O =str (OO00O00OO00O0OO0O )#line:184 + OOO00000OOO0OOOO0 =OOO00000OOO0OOOO0 .split ("'")#line:185 + OO00O00OO00O0OO0O =OO00O00OO00O0OO0O .split ("'")#line:186 + O0000OO0000O0000O .append (f" {OOO00000OOO0OOOO0[1]} {OO00O00OO00O0OO0O[1]} ")#line:187 + elif (O0OOOOO0OO0OO0000 .loc [OO0O0OOO00OO000OO ,'Especialidad']=='admin').any ():#line:188 + OOO00000OOO0OOOO0 =O00OO0O00O000O00O .cell (int (OO0O0OOO00OO000OO )+1 ,2 )#line:189 + OO00O00OO00O0OO0O =O00OO0O00O000O00O .cell (int (OO0O0OOO00OO000OO )+1 ,3 )#line:190 + OOO00000OOO0OOOO0 =str (OOO00000OOO0OOOO0 )#line:191 + OO00O00OO00O0OO0O =str (OO00O00OO00O0OO0O )#line:192 + OOO00000OOO0OOOO0 =OOO00000OOO0OOOO0 .split ("'")#line:193 + OO00O00OO00O0OO0O =OO00O00OO00O0OO0O .split ("'")#line:194 + O0O0O0O0000OOOOO0 .append (f" {OOO00000OOO0OOOO0[1]} {OO00O00OO00O0OO0O[1]} ")#line:196 + print (OO0OOOO0000O00OO0 )#line:197 + return OO0OOOO0000O00OO0 ,O0000OO0000O0000O ,O0O0O0O0000OOOOO0 #line:198 +async def boton_pdf_video (OO0O0OOOOOOO00000 ,O00000O0O000O00O0 ,O00OOOOO00O0OOOO0 ):#line:200 + O00OO000OO0O00OO0 =aiohttp .TCPConnector (ssl =True )#line:201 + async with aiohttp .ClientSession (connector =O00OO000OO0O00OO0 )as OO0OO0OOOO000OOOO :#line:202 + O0OOO00O0O00O0O0O =await OO0OO0OOOO000OOOO .get (f'{base_url}all-content/{OO0O0OOOOOOO00000}',auth =auth )#line:203 + O0O0OO0O00O0O00O0 =await O0OOO00O0O00O0O0O .json ()#line:204 + O0000000O000OO00O =[]#line:206 + O0OOO0OO0OO0000OO ={}#line:207 + if O00OOOOO00O0OOOO0 =="0":#line:209 + for OOOOO00OO0OOO0OO0 in O0O0OO0O00O0O00O0 :#line:210 + if OOOOO00OO0OOO0OO0 ['type']=="Intervencion":#line:211 + O0000000O000OO00O .append (OOOOO00OO0OOO0OO0 ['nid'])#line:212 + else :#line:213 + O0000000O000OO00O .append (O00OOOOO00O0OOOO0 )#line:214 + for O000OOOOO00OOO00O in O0000000O000OO00O :#line:216 + OOOOOOOO00000000O =await OO0OO0OOOO000OOOO .get (f'{base_url}intervenciones/{O000OOOOO00OOO00O}',auth =auth )#line:217 + OO0OO0OO00O00O00O =await OOOOOOOO00000000O .json ()#line:218 + OO0OO0OO00O00O00O =OO0OO0OO00O00O00O [0 ]#line:219 + O00O0O0000O0OO0O0 ={}#line:220 + if O00000O0O000O00O0 in OO0OO0OO00O00O00O :#line:222 + OO000OOO00O0OO0OO =OO0OO0OO00O00O00O [O00000O0O000O00O0 ]#line:223 + for O0O0O000O0OOOO000 in OO000OOO00O0OO0OO :#line:224 + if O00000O0O000O00O0 =='field_pdf':#line:225 + O00O0O0000O0OO0O0 [O0O0O000O0OOOO000 ['descripcion']]="https://orva.tedcas.com/"+str (O0O0O000O0OOOO000 ['url'])#line:226 + if O00000O0O000O00O0 =='field_video':#line:227 + O00O0O0000O0OO0O0 [O0O0O000O0OOOO000 ['descripcion']]=str (O0O0O000O0OOOO000 ['url'])#line:228 + O0OOO0OO0OO0000OO [OO0OO0OO00O00O00O ['title']]=O00O0O0000O0OO0O0 #line:230 + else :#line:231 + if O00OOOOO00O0OOOO0 =='0':#line:232 + O00OOOOO00O0OOOO0 ='0'#line:233 + else :#line:234 + print ("nid dentro del if "+str (O00OOOOO00O0OOOO0 ))#line:235 + O00O0O0000O0OO0O0 ["No hay archivos"]=""#line:236 + O0OOO0OO0OO0000OO ["No hay archivos"]=O00O0O0000O0OO0O0 #line:237 + return {}#line:238 + return O0OOO0OO0OO0000OO #line:240 +async def boton_word_ppt (O0O00O000O00OO000 ,O000OO0OO0O000000 ,O0O0O000OO00OOO0O ):#line:242 + O0000O000O0O00O0O =aiohttp .TCPConnector (ssl =True )#line:243 + async with aiohttp .ClientSession (connector =O0000O000O0O00O0O )as OOO00OOOO000O0OOO :#line:244 + O0OOO00OOO00O0OO0 =await OOO00OOOO000O0OOO .get (f'{base_url}all-content/{O0O00O000O00OO000}',auth =auth )#line:245 + O0OO0OOO00OO00O00 =await O0OOO00OOO00O0OO0 .json ()#line:246 + OOO00OO0O0000OOO0 =[]#line:248 + O0O0O00O0O00O0OO0 ={}#line:249 + if O0O0O000OO00OOO0O =='0':#line:251 + for OO0O000OOO00O00OO in O0OO0OOO00OO00O00 :#line:252 + if OO0O000OOO00O00OO ['type']=="Intervencion":#line:253 + OOO00OO0O0000OOO0 .append (OO0O000OOO00O00OO ['nid'])#line:254 + else :#line:255 + OOO00OO0O0000OOO0 .append (O0O0O000OO00OOO0O )#line:256 + for O00OO0O0O0O0OOO00 in OOO00OO0O0000OOO0 :#line:258 + OO0O0000OOO000OOO =await OOO00OOOO000O0OOO .get (f'{base_url}intervenciones/{O00OO0O0O0O0OOO00}',auth =auth )#line:259 + O0O0000OO00OOOO00 =await OO0O0000OOO000OOO .json ()#line:260 + O0O0000OO00OOOO00 =O0O0000OO00OOOO00 [0 ]#line:261 + if len (O0O0000OO00OOOO00 [O000OO0OO0O000000 ])!=0 :#line:262 + O0O0O00O0O00O0OO0 [O0O0000OO00OOOO00 ['title']]="https://orva.tedcas.com/"+str (O0O0000OO00OOOO00 [O000OO0OO0O000000 ])#line:263 + if len (O0O0000OO00OOOO00 [O000OO0OO0O000000 ])==0 and O0O0O000OO00OOO0O !='0':#line:264 + O0O0O00O0O00O0OO0 ["No hay archivos"]=""#line:265 + return {}#line:266 + return O0O0O00O0O00O0OO0 #line:268 +async def boton_materiales (OOOOOO0O0OO00OO00 ,O000OOO000OOOO000 ):#line:270 + O00O000OOO0O0000O =aiohttp .TCPConnector (ssl =True )#line:271 + async with aiohttp .ClientSession (connector =O00O000OOO0O0000O )as OOO000000OOO0O000 :#line:272 + O0OO0O0OO00O000O0 ={}#line:273 + if O000OOO000OOOO000 =='0':#line:275 + OOOOOO00OOOOOO0O0 =await OOO000000OOO0O000 .get (f'{base_url}listado_completo_cajas/{OOOOOO0O0OO00OO00}',auth =auth )#line:276 + OO0OOO000OOO000O0 =await OOOOOO00OOOOOO0O0 .json ()#line:277 + for O00OOO0000O00OO00 in OO0OOO000OOO000O0 :#line:278 + O0OO0O0OO00O000O0 [O00OOO0000O00OO00 ['title']]=O00OOO0000O00OO00 ['nid']#line:279 + O0OO0O0OO00O000O0 ['']="si hay"#line:280 + else :#line:281 + OOOOOO00OOOOOO0O0 =await OOO000000OOO0O000 .get (f'{base_url}intervenciones/{O000OOO000OOOO000}',auth =auth )#line:282 + OO0OOO000OOO000O0 =await OOOOOO00OOOOOO0O0 .json ()#line:283 + OO0OOO000OOO000O0 =OO0OOO000OOO000O0 [0 ]#line:284 + if 'field_cajas'in OO0OOO000OOO000O0 :#line:285 + OO0OOO000OOO000O0 =OO0OOO000OOO000O0 ['field_cajas']#line:286 + for O00OOO0000O00OO00 in OO0OOO000OOO000O0 :#line:287 + O0OO0O0OO00O000O0 [O00OOO0000O00OO00 ['caja']]=O00OOO0000O00OO00 ['id']#line:288 + O0OO0O0OO00O000O0 ['']="si hay"#line:289 + else :#line:290 + if O000OOO000OOOO000 !=0 :#line:291 + O0OO0O0OO00O000O0 ['']=""#line:292 + return {}#line:293 + return O0OO0O0OO00O000O0 #line:294 +async def cargar_base_datos (O0OOO000O000OO0O0 ,O00OOO00OOO0OO000 ):#line:296 + OOOO0O0OO0OO00OO0 =None #line:297 + O0O0O0OOOOO00OOO0 =[]#line:298 + OO0O00OO0OO00O0OO =aiohttp .TCPConnector (ssl =True )#line:299 + async with aiohttp .ClientSession (connector =OO0O00OO0OO00O0OO )as OO0OO000OOO0O00OO :#line:300 + OO0O00OO000O00O0O =await OO0OO000OOO0O00OO .get ('https://orva.tedcas.com/api/all-content/'+str (O00OOO00OOO0OO000 ),auth =auth )#line:301 + OO0O0OO0OOOOOO000 =await OO0O00OO000O00O0O .json ()#line:302 + OOOO00000O000O00O =np .zeros (len (OO0O0OO0OOOOOO000 ),dtype =int )#line:303 + O00OO0OOOO0OO0O0O =[]#line:304 + for O0O0OO0OOO0000OO0 in O0OOO000O000OO0O0 :#line:305 + O0OOOO0O0OOOOOO00 =0 #line:306 + for OO000OOO00O00OOO0 in range (100 ):#line:307 + OO000OOO00O00OOO0 =OO000OOO00O00OOO0 /10 #line:308 + if O0O0OO0OOO0000OO0 ==str (OO000OOO00O00OOO0 ):#line:309 + O0O0OO0OOO0000OO0 =str (OO000OOO00O00OOO0 ).split ('.')#line:310 + O00OO0OOOO0OO0O0O .append (O0O0OO0OOO0000OO0 )#line:311 + O0OOOO0O0OOOOOO00 =O0OOOO0O0OOOOOO00 +1 #line:312 + if O0O0OO0OOO0000OO0 =='con':#line:313 + O0OOOO0O0OOOOOO00 =O0OOOO0O0OOOOOO00 +1 #line:314 + if O0OOOO0O0OOOOOO00 ==0 :#line:315 + O00OO0OOOO0OO0O0O .append (O0O0OO0OOO0000OO0 )#line:316 + for O0O00O000O00OO0OO in range (len (OO0O0OO0OOOOOO000 )):#line:317 + OOOO00O000OO000OO =0 #line:318 + O00O00O00OOO0OOOO =OO0O0OO0OOOOOO000 [O0O00O000O00OO0OO ]#line:319 + OO0O00OO00O0OOOO0 =str (O00O00O00OOO0OOOO ['title']).lower ()#line:320 + OO0O00OO00O0OOOO0 =remove_accents (OO0O00OO00O0OOOO0 )#line:321 + OO0O00OO00O0OOOO0 =OO0O00OO00O0OOOO0 .split (' ')#line:322 + for O0O00O0OO0O00O000 ,O0000O0OO0OO000OO in enumerate (OO0O00OO00O0OOOO0 ):#line:323 + for O0OO000OO0O0O00O0 ,O0OOO00O0O00OOOOO in enumerate (OO0O00OO00O0OOOO0 ):#line:324 + if O0OO000OO0O0O00O0 !=O0O00O0OO0O00O000 :#line:325 + if O0000O0OO0OO000OO ==O0OOO00O0O00OOOOO :#line:326 + OO0O00OO00O0OOOO0 .pop (O0OO000OO0O0O00O0 )#line:327 + for O0O00O0OO0O00O000 ,O0000O0OO0OO000OO in enumerate (OO0O00OO00O0OOOO0 ):#line:328 + for OO000OOO00O00OOO0 in range (100 ):#line:329 + OO000OOO00O00OOO0 =OO000OOO00O00OOO0 /10 #line:330 + if O0000O0OO0OO000OO ==str (OO000OOO00O00OOO0 ):#line:331 + O0000O0OO0OO000OO =str (OO000OOO00O00OOO0 ).split ('.')#line:332 + OO0O00OO00O0OOOO0 .append (O0000O0OO0OO000OO )#line:333 + for OOOO000000O00OOOO in O00OO0OOOO0OO0O0O :#line:334 + if OOOO000000O00OOOO =="maya":#line:335 + OOOO000000O00OOOO ="malla"#line:336 + if OOOO000000O00OOOO =="pilos"or OOOO000000O00OOOO =="pilo":#line:337 + OOOO000000O00OOOO ="philo"#line:338 + if OOOO000000O00OOOO =="filos"or OOOO000000O00OOOO =="filo":#line:339 + OOOO000000O00OOOO ="philo"#line:340 + if OOOO000000O00OOOO =="sinces"or OOOO000000O00OOOO =="sinc":#line:341 + OOOO000000O00OOOO ="synthe"#line:342 + if OOOO000000O00OOOO =="sintes"or OOOO000000O00OOOO =="sint":#line:343 + OOOO000000O00OOOO ="synthe"#line:344 + if OOOO000000O00OOOO =="axos"or OOOO000000O00OOOO =="axo":#line:345 + OOOO000000O00OOOO ="axso"#line:346 + if OOOO000000O00OOOO =="uno":#line:347 + OOOO000000O00OOOO =1 #line:348 + if OOOO000000O00OOOO =="dos"or OOOO000000O00OOOO =="do":#line:349 + OOOO000000O00OOOO =2 #line:350 + if OOOO000000O00OOOO =="tres"or OOOO000000O00OOOO =="tr":#line:351 + OOOO000000O00OOOO =3 #line:352 + if OOOO000000O00OOOO =="cuatro":#line:353 + OOOO000000O00OOOO =4 #line:354 + if OOOO000000O00OOOO =="cinco":#line:355 + OOOO000000O00OOOO =5 #line:356 + if OOOO000000O00OOOO =="seis"or OOOO000000O00OOOO =="sei":#line:357 + OOOO000000O00OOOO =6 #line:358 + if OOOO000000O00OOOO =="siete":#line:359 + OOOO000000O00OOOO =7 #line:360 + if OOOO000000O00OOOO =="ocho":#line:361 + OOOO000000O00OOOO =8 #line:362 + if OOOO000000O00OOOO =="nueve":#line:363 + OOOO000000O00OOOO =9 #line:364 + if OOOO000000O00OOOO =="cero":#line:365 + OOOO000000O00OOOO =0 #line:366 + if OOOO000000O00OOOO =="veintiuno":#line:367 + OOOO000000O00OOOO ="21"#line:368 + if OOOO000000O00OOOO =="veinte":#line:369 + OOOO000000O00OOOO ="20"#line:370 + if OOOO000000O00OOOO =="veintidos"or OOOO000000O00OOOO =="veintido":#line:371 + OOOO000000O00OOOO ="22"#line:372 + if OOOO000000O00OOOO =="veintitres"or OOOO000000O00OOOO =="veintitre":#line:373 + OOOO000000O00OOOO ="23"#line:374 + if OOOO000000O00OOOO =="veinticuatro":#line:375 + OOOO000000O00OOOO ="24"#line:376 + if OOOO000000O00OOOO =="veinticinco":#line:377 + OOOO000000O00OOOO ="25"#line:378 + if OOOO000000O00OOOO =="veintiseis"or OOOO000000O00OOOO =="veintisei":#line:379 + OOOO000000O00OOOO ="26"#line:380 + if OOOO000000O00OOOO =="veintisiete":#line:381 + OOOO000000O00OOOO ="27"#line:382 + if OOOO000000O00OOOO =="veintiocho":#line:383 + OOOO000000O00OOOO ="28"#line:384 + if OOOO000000O00OOOO =="veintinueve":#line:385 + OOOO000000O00OOOO ="29"#line:386 + if OOOO000000O00OOOO =="treinta":#line:387 + OOOO000000O00OOOO ="30"#line:388 + if type (OOOO000000O00OOOO )==int and type (OOOO0O0OO0OO00OO0 )==int :#line:389 + OO000OOO00O00OOO0 =str (OOOO0O0OO0OO00OO0 )+'.'+str (OOOO000000O00OOOO )#line:390 + OOOO000000O00OOOO =OO000OOO00O00OOO0 .split ('.')#line:391 + OOOO0O0OO0OO00OO0 =OOOO000000O00OOOO #line:392 + OOOO000000O00OOOO =inflector .singularize (str (OOOO000000O00OOOO ))#line:393 + O0000O0OO0OO000OO =inflector .singularize (str (O0000O0OO0OO000OO ))#line:394 + OOOO000000O00OOOO =remove_accents (OOOO000000O00OOOO )#line:395 + if O0000O0OO0OO000OO ==OOOO000000O00OOOO :#line:396 + OOOO00O000OO000OO =OOOO00O000OO000OO +1 #line:397 + OOOO00000O000O00O [O0O00O000O00OO0OO ]=OOOO00O000OO000OO #line:398 + OO00OOO0OOO0OO0OO =np .argwhere (OOOO00000O000O00O ==np .amax (OOOO00000O000O00O ))#line:399 + for O0O00O000O00OO0OO in OO00OOO0OOO0OO0OO :#line:400 + O0O0O0OOOOO00OOO0 .append (OO0O0OO0OOOOOO000 [int (O0O00O000O00OO0OO )])#line:401 + if np .all (OOOO00000O000O00O ==0 ):#line:402 + O0O0O0OOOOO00OOO0 =None #line:403 + return O0O0O0OOOOO00OOO0 #line:404 +async def cargar_tipo (O00O0O00OOOO000OO ,OO000OOO000OOOO00 ):#line:406 + O0O0O00O000O0000O =aiohttp .TCPConnector (ssl =True )#line:407 + async with aiohttp .ClientSession (connector =O0O0O00O000O0000O )as OO0OOO0O0OO0O00OO :#line:408 + O0000000O0O00O0O0 =await OO0OOO0O0OO0O00OO .get (f'{base_url}all-content/{OO000OOO000OOOO00}',auth =auth )#line:409 + O0O0O0O0OOOO0O000 =await O0000000O0O00O0O0 .json ()#line:410 + O0OO00O0O0OO0OOO0 =None #line:411 + O00O0O000O0O00000 =None #line:412 + for OO0O0O0000O00OOOO in O0O0O0O0OOOO0O000 :#line:413 + if O00O0O00OOOO000OO ==OO0O0O0000O00OOOO ["nid"]:#line:414 + O0OO00O0O0OO0OOO0 =OO0O0O0000O00OOOO ["type"]#line:415 + O00O0O000O0O00000 =OO0O0O0000O00OOOO #line:416 + break #line:417 + return O00O0O000O0O00000 ,O0OO00O0O0OO0OOO0 #line:418 +async def cargar_archivo (O0OO000OO000O0OOO ,O00O000O0000OO000 ,OOOO0OOO0O00OOOO0 ):#line:420 + O0O0OO00OO0O0O000 =[]#line:421 + O0O0000000O00OOOO =aiohttp .TCPConnector (ssl =True )#line:422 + async with aiohttp .ClientSession (connector =O0O0000000O00OOOO )as OO0OOOOO0OOO00OO0 :#line:423 + O0O0O0O000O0000OO =await OO0OOOOO0OOO00OO0 .get ('https://orva.tedcas.com/api/'+str (OOOO0OOO0O00OOOO0 ),auth =auth )#line:424 + OO0O000OO0O0O0000 =await O0O0O0O000O0000OO .json ()#line:425 + OO0O000OO0O0O0000 =OO0O000OO0O0O0000 [0 ]#line:426 + OOOO0000O00OO0000 ="field_"+str (O0OO000OO000O0OOO )#line:427 + O0O0O0O0OOO00O0O0 =OO0O000OO0O0O0000 [OOOO0000O00OO0000 ]#line:428 + if OOOO0000O00OO0000 =="field_image":#line:429 + OO0O000OO0O0O0000 =OO0O000OO0O0O0000 ['field_image']#line:430 + OO0O000OO0O0O0000 =OO0O000OO0O0O0000 .split (',')#line:431 + OO0O000OO0O0O0000 =[O0O00OO000OO0O00O .replace (' ','')for O0O00OO000OO0O00O in OO0O000OO0O0O0000 ]#line:432 + for OO0OOO0O0O000O0O0 in OO0O000OO0O0O0000 :#line:433 + O0O0OO00OO0O0O000 .append ("https://orva.tedcas.com/"+str (OO0OOO0O0O000O0O0 ))#line:434 + print (O0O0OO00OO0O0O000 )#line:435 + return O0O0OO00OO0O0O000 #line:436 + if len (O0O0O0O0OOO00O0O0 )==0 :#line:437 + O0OOOO0O0O0OOOO0O ="No hay archivos subidos"#line:438 + O0O0OO00OO0O0O000 ="templates/especialidad"#line:439 + elif type (O0O0O0O0OOO00O0O0 )==str :#line:440 + O0O0OO00OO0O0O000 ="https://orva.tedcas.com/"+str (O0O0O0O0OOO00O0O0 )#line:441 + O0OOOO0O0O0OOOO0O =O0O0O0O0OOO00O0O0 #line:442 + elif type (O0O0O0O0OOO00O0O0 )==list :#line:443 + for OOOO0OO0OOO0OOOO0 ,O0000OO00OO0O0O0O in O0O0O0O0OOO00O0O0 :#line:444 + O0O0OO00OO0O0O000 [OOOO0OO0OOO0OOOO0 ]="https://orva.tedcas.com/"+str (O0000OO00OO0O0O0O )#line:445 + O0OOOO0O0O0OOOO0O =O0O0O0O0OOO00O0O0 #line:446 + return O00O000O0000OO000 ,O0O0OO00OO0O0O000 ,O0OOOO0O0O0OOOO0O #line:447 +async def cargar_archivo_grande (OOO0OOO00OOOOO0O0 ,OOO0000000OO0OO00 ,OO0OOOO0O0OO000OO ):#line:449 + O0OO0000O0O0OO00O =aiohttp .TCPConnector (ssl =True )#line:450 + async with aiohttp .ClientSession (connector =O0OO0000O0O0OO00O )as O000O0O00O000O0OO :#line:451 + O000OO00OO000O0OO =await O000O0O00O000O0OO .get ('https://orva.tedcas.com/api/'+str (OO0OOOO0O0OO000OO ),auth =auth )#line:452 + O00O000O0000O0O00 =await O000OO00OO000O0OO .json ()#line:453 + O00O0OO0000O0000O ={}#line:454 + if OOO0OOO00OOOOO0O0 =='title_material':#line:455 + for OOO0O0O0O0OOOO000 in O00O000O0000O0O00 :#line:456 + O00O0OO0000O0000O [OOO0O0O0O0OOOO000 [OOO0OOO00OOOOO0O0 ]]=(OOO0O0O0O0OOOO000 [OOO0OOO00OOOOO0O0 ])#line:457 + return O00O0OO0000O0000O ,OOO0000000OO0OO00 #line:458 + O00O000O0000O0O00 =O00O000O0000O0O00 [0 ]#line:459 + OOO0OOOO0O0O00000 ="field_"+str (OOO0OOO00OOOOO0O0 )#line:460 + OOO0OOOO0O0O00000 =O00O000O0000O0O00 [OOO0OOOO0O0O00000 ]#line:461 + if len (OOO0OOOO0O0O00000 )==0 :#line:462 + O00O0OO0000O0000O ["No hay archivos"]="templates/especialidad"#line:463 + else :#line:464 + for OOO0O0O0O0OOOO000 in OOO0OOOO0O0O00000 :#line:465 + O00O0OO0000O0000O [OOO0O0O0O0OOOO000 ['descripcion']]="https://orva.tedcas.com/"+str (OOO0O0O0O0OOOO000 ['url'])#line:466 + return OOO0000000OO0OO00 ,O00O0OO0000O0000O #line:467 +async def cargar_caja (O00O0O0OO000O0OO0 ,O0O0000000OO000OO ):#line:469 + OO0O0O0OOOOO00OOO ={}#line:470 + OOOOO0OOO0O0OOO00 =aiohttp .TCPConnector (ssl =True )#line:471 + async with aiohttp .ClientSession (connector =OOOOO0OOO0O0OOO00 )as O00O00OOOO0OOO00O :#line:472 + OO0OO00OOO0OOO0OO =await O00O00OOOO0OOO00O .get (f'{base_url}intervenciones/{O00O0O0OO000O0OO0}',auth =auth )#line:473 + OOO0O0OOOO0OOOO00 =await OO0OO00OOO0OOO0OO .json ()#line:474 + OOO0O0OOOO0OOOO00 =OOO0O0OOOO0OOOO00 [0 ]#line:475 + if 'field_cajas'in OOO0O0OOOO0OOOO00 :#line:476 + OOO0O0OOOO0OOOO00 =OOO0O0OOOO0OOOO00 ['field_cajas']#line:477 + for OO00O0O00000O0OO0 in OOO0O0OOOO0OOOO00 :#line:478 + OO0O0O0OOOOO00OOO [OO00O0O00000O0OO0 ['id']]=OO00O0O00000O0OO0 ['caja']#line:479 + else :#line:480 + OO0O0O0OOOOO00OOO [str (O00O0O0OO000O0OO0 )]="No hay archivos"#line:481 + return OO0O0O0OOOOO00OOO ,O0O0000000OO000OO #line:482 +async def cargar_instrumental (O0OO0OO00O0O00000 ,OO0O0OO0O00O00OOO ):#line:484 + O0OO0O0000O000000 ={}#line:485 + O00O00O00OO0O0O00 =aiohttp .TCPConnector (ssl =True )#line:486 + async with aiohttp .ClientSession (connector =O00O00O00OO0O0O00 )as O00O0OOO0O00O0OO0 :#line:487 + OOO00O0OO00000O0O =await O00O0OOO0O00O0OO0 .get ('https://orva.tedcas.com/api/'+str (OO0O0OO0O00O00OOO ),auth =auth )#line:488 + O0000OOOOOOOOO0OO =await OOO00O0OO00000O0O .json ()#line:489 + for O00O000O00O000OOO in O0000OOOOOOOOO0OO :#line:490 + if 'instrumental'in O00O000O00O000OOO :#line:491 + for O00000O0O00O0O0OO in O00O000O00O000OOO ['instrumental']:#line:492 + if O00000O0O00O0O0OO ['id']==O0OO0OO00O0O00000 :#line:493 + O0OO0O0000O000000 [O00O000O00O000OOO ['nid']]=O00O000O00O000OOO ['title']#line:494 + return O0OO0O0000O000000 #line:495 +async def cargar_botones_pdf_admision ():#line:497 + O0O000O00O0OOO000 ={}#line:498 + O00O00O00000O0OOO ={}#line:499 + OO00OOO0OO000OOO0 ={}#line:500 + OO0000OO00O000O00 ={}#line:501 + O00OO000OO0000OO0 =aiohttp .TCPConnector (ssl =True )#line:502 + async with aiohttp .ClientSession (connector =O00OO000OO0000OO0 )as O0OOOO0OOO0O00000 :#line:503 + OO0OO0OOOOO0OO0OO =await O0OOOO0OOO0O00000 .get ('https://orva.tedcas.com/api/all-content/1621',auth =auth )#line:504 + O00O000OOO0O0O00O =await OO0OO0OOOOO0OO0OO .json ()#line:505 + for O0O0OO00OOOO00OO0 in O00O000OOO0O0O00O :#line:506 + O000OO00OO0O00OOO =await O0OOOO0OOO0O00000 .get ('https://orva.tedcas.com/api/intervenciones/'+str (O0O0OO00OOOO00OO0 ['nid']),auth =auth )#line:507 + O000OOOOO00O00OO0 =await O000OO00OO0O00OOO .json ()#line:508 + O000OOOOO00O00OO0 =O000OOOOO00O00OO0 [0 ]#line:509 + OO0O00O00O00000O0 =O000OOOOO00O00OO0 ['field_pdf']#line:510 + OO0O00O00O00000O0 =OO0O00O00O00000O0 [0 ]#line:511 + if O000OOOOO00O00OO0 ['field_tecnica']=="Mapa de camas":#line:512 + O0O000O00O0OOO000 [O000OOOOO00O00OO0 ['title']]="https://orva.tedcas.com/"+str (OO0O00O00O00000O0 ['url'])#line:513 + elif O000OOOOO00O00OO0 ['field_tecnica']=="Ambulancias":#line:514 + O00O00O00000O0OOO [O000OOOOO00O00OO0 ['title']]="https://orva.tedcas.com/"+str (OO0O00O00O00000O0 ['url'])#line:515 + elif O000OOOOO00O00OO0 ['field_tecnica']=="Programación quirúrgica":#line:516 + OO00OOO0OO000OOO0 [O000OOOOO00O00OO0 ['title']]="https://orva.tedcas.com/"+str (OO0O00O00O00000O0 ['url'])#line:517 + elif O000OOOOO00O00OO0 ['field_tecnica']=="Otros":#line:518 + OO0000OO00O000O00 [O000OOOOO00O00OO0 ['title']]="https://orva.tedcas.com/"+str (OO0O00O00O00000O0 ['url'])#line:519 + return O0O000O00O0OOO000 ,O00O00O00000O0OOO ,OO00OOO0OO000OOO0 ,OO0000OO00O000O00 #line:520 +def remove_accents (OOOOOOO0O0OOO0OOO ):#line:522 + OOOO00000000OOO0O =unicodedata .normalize ('NFKD',OOOOOOO0O0OOO0OOO )#line:523 + return u"".join ([O000000O0O0O0OOO0 for O000000O0O0O0OOO0 in OOOO00000000OOO0O if not unicodedata .combining (O000000O0O0O0OOO0 )])#line:524 +def adaptar_salida (O0O0OO0OO0O0O000O ):#line:526 + O0OO00O00O00OOOO0 =[]#line:527 + O0O0OO0OO0O0O000O =str (O0O0OO0OO0O0O000O ).lower ()#line:528 + O0O0OO0OO0O0O000O =O0O0OO0OO0O0O000O .split ("}")#line:529 + O0O0OO0OO0O0O000O =O0O0OO0OO0O0O000O [0 ].split (":")#line:530 + if len (O0O0OO0OO0O0O000O )>=2 :#line:531 + OO0OO00OOOO0O0O00 =O0O0OO0OO0O0O000O [1 ].split ("'")#line:532 + O0OO00O00O00OOOO0 =OO0OO00OOOO0O0O00 [1 ].split ()#line:533 + return O0OO00O00O00OOOO0 #line:534 +def takeCommand ():#line:536 + O0OOOOOOO0O00OO00 =sr .Recognizer ()#line:537 + with sr .Microphone ()as OO00OO0O0O00OO000 :#line:538 + print ("Listening...")#line:539 + O0OOOOOOO0O00OO00 .pause_threshold =1 #line:540 + OO0O0OOOO0OOOOOO0 =O0OOOOOOO0O00OO00 .adjust_for_ambient_noise (OO00OO0O0O00OO000 )#line:541 + OO0O0OOOO0OOOOOO0 =O0OOOOOOO0O00OO00 .listen (OO00OO0O0O00OO000 )#line:542 + try :#line:543 + print ("Recognizing...")#line:544 + OO00O00OOO0OOOOOO =O0OOOOOOO0O00OO00 .recognize_google (OO0O0OOOO0OOOOOO0 ,language ='es-ES')#line:545 + print (f"User said: {OO00O00OOO0OOOOOO}\n")#line:546 + except Exception as OOO0OO0OOO0OOO00O :#line:547 + print (OOO0OO0OOO0OOO00O )#line:548 + print ("Unable to Recognize your voice.")#line:549 + return "none"#line:550 + return OO00O00OOO0OOOOOO #line:580 +app =Flask (__name__ )#line:582 +app .config ['SECRET_KEY']='mysecretkey'#line:583 +IMG_FOLDER =os .path .join ('static','IMG')#line:585 +app .config ['UPLOAD_FOLDER']=IMG_FOLDER #line:586 +@app .route ("/")#line:588 +async def hello ():#line:589 + O0OOO0OOO0000OOOO =os .path .join (app .config ['UPLOAD_FOLDER'],'trauma.jpeg')#line:590 + O0O0OO0OO0000O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'uro.jpeg')#line:591 + OO00OOOO0OOO0OOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'adm.jpeg')#line:592 + O00O0O0O0OOOO000O =os .path .join (app .config ['UPLOAD_FOLDER'],'tijerass.png')#line:593 + return render_template ('especialidad.html',user_image0 =O00O0O0O0OOOO000O ,user_image1 =O0OOO0OOO0000OOOO ,user_image2 =O0O0OO0OO0000O0O0 ,user_image3 =OO00OOOO0OOO0OOO0 )#line:594 +@app .route ("/especialidad")#line:596 +async def especialidad ():#line:597 + O0O0O0O0O0OOOOOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'trauma.jpeg')#line:598 + OO0O00OOO0O000O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'uro.jpeg')#line:599 + OOO00O0O0O000O0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'adm.jpeg')#line:600 + OO00OOOOOO0O0O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'tijerass.png')#line:601 + return render_template ('especialidad.html',user_image0 =OO00OOOOOO0O0O0O0 ,user_image1 =O0O0O0O0O0OOOOOO0 ,user_image2 =OO0O00OOO0O000O0O ,user_image3 =OOO00O0O0O000O0OO )#line:602 +@app .route ("/preguntas_respuestas_trauma",methods =['GET','POST'])#line:604 +async def preguntas_respuestas_trauma ():#line:605 + OO000OOO000O00O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:606 + OO00O0OO0O000O0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:607 + O0OO0O00O00O0OOOO ,O0OOOO000O0OOOO00 ,O00OOOOOOOOO0O000 =await faq ()#line:608 + return render_template ('preguntas_respuestas.html',user_image6 =OO000OOO000O00O00 ,user_image7 =OO00O0OO0O000O0OO ,faqs =O0OO0O00O00O0OOOO ,faq_titulo ="Preguntas y respuestas: ")#line:609 +@app .route ("/preguntas_respuestas_uro",methods =['GET','POST'])#line:611 +async def preguntas_respuestas_uro ():#line:612 + OO000000O0OO00OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:613 + O0OOOO0OOO00OOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:614 + OOO000O0O00OOOO00 ,OOOOO0O00OO00OO0O ,O00O0OOOOO0O0OOOO =await faq ()#line:615 + return render_template ('preguntas_respuestas.html',user_image6 =OO000000O0OO00OO0 ,user_image7 =O0OOOO0OOO00OOO00 ,faqs =OOOOO0O00OO00OO0O ,faq_titulo ="Preguntas y respuestas: ")#line:616 +@app .route ("/preguntas_respuestas_admin",methods =['GET','POST'])#line:618 +async def preguntas_respuestas_admin ():#line:619 + O0OOOOO00O00000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:620 + OO0OO000000O00OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:621 + O0O0OO00OO00OOOOO ,O0O0O000O0OO0O0OO ,OOOO000000OO0000O =await faq ()#line:622 + return render_template ('preguntas_respuestas.html',user_image6 =O0OOOOO00O00000O0 ,user_image7 =OO0OO000000O00OOO ,faqs =OOOO000000OO0000O ,faq_titulo ="Preguntas y respuestas: ")#line:623 +@app .route ("/seleccion_trauma",methods =['GET','POST'])#line:625 +async def seleccion_trauma ():#line:626 + O0000O0OOO00OO00O =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:627 + OO00O0OO0O000OO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:628 + OOO000O0OOO00O0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:629 + O00O00O0OO0OO000O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:630 + return render_template ('seleccion_trauma.html',user_image4 =O0000O0OOO00OO00O ,user_image5 =OO00O0OO0O000OO00 ,user_image6 =OOO000O0OOO00O0OO ,user_image7 =O00O00O0OO0OO000O )#line:631 +@app .route ("/buscador_trauma",methods =['GET','POST'])#line:633 +async def buscador_trauma ():#line:634 + O00O000OO0O000OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:635 + OOO000OO0OO0OO000 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:636 + OOO0000OOO000OOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:637 + O0OOOOOO0OO0OO00O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:638 + OO000OO0OOO00OO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:639 + OO00OO0OO0O0O0OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:640 + OOOO00O0O0OOO0OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:641 + O0O00OOOO00O0000O =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:642 + O0OOO0O0O00OOO0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'preguntas_respuestas.png')#line:643 + OO0OO0OOO0O0OO0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:644 + OOOO0OOO0OO0OOO0O =str (request .form .to_dict ())#line:645 + OOOO0OOO0OO0OOO0O =adaptar_salida (OOOO0OOO0OO0OOO0O )#line:646 + OO0O000O00O00O0OO ={}#line:647 + OO0O000O00O00O0OO [""]=""#line:648 + if len (OOOO0OOO0OO0OOO0O )==0 :#line:649 + return render_template ('buscador_trauma.html',preguntas_respuestas =O0OOO0O0O00OOO0O0 ,result_busqueda =OO0O000O00O00O0OO ,user_image4 =O00O000OO0O000OO0 ,user_image5 =OOO000OO0OO0OO000 ,user_image6 =OOO0000OOO000OOO0 ,user_image7 =O0OOOOOO0OO0OO00O ,user_image8 =OOOO00O0O0OOO0OO0 ,user_image9 =O0O00OOOO00O0000O ,user_image10 =OO000OO0OOO00OO00 ,user_image11 =OO0OO0OOO0O0OO0OO ,user_image12 =OO00OO0OO0O0O0OO0 ,nid2 =0 )#line:650 + elif OOOO0OOO0OO0OOO0O !=None or "{}":#line:651 + O0O0O00OO0OOOOO00 =1 #line:652 + OOO000OOO00OO000O =await cargar_base_datos (OOOO0OOO0OO0OOO0O ,O0O0O00OO0OOOOO00 )#line:653 + O0OOO0OO00OO0OOO0 ,O00O00O0OOOOO00O0 ,O0O00O00OO00OO0O0 =await buscar_faq (OOOO0OOO0OO0OOO0O ,1 )#line:654 + if OOO000OOO00OO000O ==None :#line:655 + if len (O0OOO0OO00OO0OOO0 )==0 :#line:656 + return render_template ('buscador_trauma.html',preguntas_respuestas =O0OOO0O0O00OOO0O0 ,result_busqueda =OO0O000O00O00O0OO ,prediction_text ="No hay resultados para tu busqueda",user_image4 =O00O000OO0O000OO0 ,user_image5 =OOO000OO0OO0OO000 ,user_image6 =OOO0000OOO000OOO0 ,user_image7 =O0OOOOOO0OO0OO00O ,user_image8 =OOOO00O0O0OOO0OO0 ,user_image9 =O0O00OOOO00O0000O ,user_image10 =OO000OO0OOO00OO00 ,user_image11 =OO0OO0OOO0O0OO0OO ,user_image12 =OO00OO0OO0O0O0OO0 ,nid2 =0 )#line:657 + else :#line:658 + return render_template ('buscador_trauma.html',preguntas_respuestas =O0OOO0O0O00OOO0O0 ,faqs =O0OOO0OO00OO0OOO0 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OO0O000O00O00O0OO ,user_image4 =O00O000OO0O000OO0 ,user_image5 =OOO000OO0OO0OO000 ,user_image6 =OOO0000OOO000OOO0 ,user_image7 =O0OOOOOO0OO0OO00O ,user_image8 =OOOO00O0O0OOO0OO0 ,user_image9 =O0O00OOOO00O0000O ,user_image10 =OO000OO0OOO00OO00 ,user_image11 =OO0OO0OOO0O0OO0OO ,user_image12 =OO00OO0OO0O0O0OO0 ,nid2 =0 )#line:659 + elif len (OOO000OOO00OO000O )>=1 :#line:660 + OO00OOO0OOO0O0000 =[]#line:661 + O00OO0OOOOOO0OOO0 =[]#line:662 + OO0O000O00O00O0OO ={}#line:663 + for OO0O0OO000OOOOOO0 in OOO000OOO00OO000O :#line:664 + OO00OOO0OOO0O0000 .append (OO0O0OO000OOOOOO0 ["title"])#line:665 + O00OO0OOOOOO0OOO0 .append (OO0O0OO000OOOOOO0 ["nid"])#line:666 + for O0O0OOO0OOO0O00OO ,OO0O0OO000OOOOOO0 in enumerate (OO00OOO0OOO0O0000 ):#line:667 + OO0O000O00O00O0OO [O00OO0OOOOOO0OOO0 [O0O0OOO0OOO0O00OO ]]=OO0O0OO000OOOOOO0 #line:668 + if len (O0OOO0OO00OO0OOO0 )!=0 :#line:670 + return render_template ('buscador_trauma1.html',faqs =O0OOO0OO00OO0OOO0 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OO0O000O00O00O0OO ,user_image4 =O00O000OO0O000OO0 ,user_image5 =OOO000OO0OO0OO000 ,user_image6 =OOO0000OOO000OOO0 ,user_image7 =O0OOOOOO0OO0OO00O ,user_image8 =OOOO00O0O0OOO0OO0 ,user_image9 =O0O00OOOO00O0000O ,user_image10 =OO000OO0OOO00OO00 ,user_image11 =OO0OO0OOO0O0OO0OO ,user_image12 =OO00OO0OO0O0O0OO0 ,nid2 =0 )#line:671 + else :#line:672 + return render_template ('buscador_trauma1.html',result_busqueda =OO0O000O00O00O0OO ,user_image4 =O00O000OO0O000OO0 ,user_image5 =OOO000OO0OO0OO000 ,user_image6 =OOO0000OOO000OOO0 ,user_image7 =O0OOOOOO0OO0OO00O ,user_image8 =OOOO00O0O0OOO0OO0 ,user_image9 =O0O00OOOO00O0000O ,user_image10 =OO000OO0OOO00OO00 ,user_image11 =OO0OO0OOO0O0OO0OO ,user_image12 =OO00OO0OO0O0O0OO0 ,nid2 =0 )#line:673 +@app .route ("/resultado_trauma",methods =['GET','POST'])#line:675 +async def resultado_trauma ():#line:676 + OO00OOO00OO00O000 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:677 + OOO00O000OOOO0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:678 + OO000000O00OO0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:679 + OO0OOO0000OOO0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:680 + O000OOO0O00OO0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:681 + OO0O00OOO000O0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:682 + OOOO00000O00O000O =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:683 + OOOO00O0OO00OOOOO =request .args .get ('link')#line:684 + OOOOOOOO0O00000OO ,O0OO0O0000000O00O =await cargar_tipo (OOOO00O0OO00OOOOO ,1 )#line:685 + OOO0OOOO00OO00O0O =OOOOOOOO0O00000OO ['title']#line:686 + if O0OO0O0000000O00O =="Intervencion":#line:688 + O0O0OO0OO000OOO00 ,O00O0O0OOOO00OOO0 =await cargar_caja (str (OOOO00O0OO00OOOOO ),'Instrumental - Cajas: ')#line:689 + return render_template ('intervencion_trauma.html',user_image8 =O000OOO0O00OO0O00 ,user_image9 =OO0O00OOO000O0000 ,user_image10 =OO000000O00OO0000 ,user_image11 =OOOO00000O00O000O ,user_image12 =OO0OOO0000OOO0000 ,instrumental =O0O0OO0OO000OOO00 ,texto_cajas =O00O0O0OOOO00OOO0 ,title =OOO0OOOO00OO00O0O ,user_image6 =OO00OOO00OO00O000 ,user_image7 =OOO00O000OOOO0000 ,nid2 =OOOO00O0OO00OOOOO )#line:690 + elif O0OO0O0000000O00O =='Caja':#line:691 + OOOO000O0000O00O0 ,O0OOO00O00000OO0O ,O0OOOO0O0O0000O00 =await cargar_archivo ("ubicacion","Ubicacion: ","cajas/"+str (OOOO00O0OO00OOOOO ))#line:692 + OO0OO0OOOOOOOOO00 =await cargar_archivo ("image","Imagen: ","cajas/"+str (OOOO00O0OO00OOOOO ))#line:693 + O00000O0O000O0O00 ,OOOO0O00O000OOOOO =await cargar_archivo_grande ("title_material","Instrumental : ","cajas/"+str (OOOO00O0OO00OOOOO ))#line:694 + if len (OOO0OOOO00OO00O0O )==1 :#line:695 + return render_template ('caja_trauma1.html',title =OOO0OOOO00OO00O0O ,files_instru =O00000O0O000O0O00 ,texto_instru =OOOO0O00O000OOOOO ,texto_ubi =OOOO000O0000O00O0 ,file_texto_ubi =O0OOOO0O0O0000O00 ,file_imagen =OO0OO0OOOOOOOOO00 ,user_image6 =OO00OOO00OO00O000 ,user_image7 =OOO00O000OOOO0000 )#line:696 + else :#line:697 + return render_template ('caja_trauma.html',title =OOO0OOOO00OO00O0O ,files_instru =O00000O0O000O0O00 ,texto_instru =OOOO0O00O000OOOOO ,texto_ubi =OOOO000O0000O00O0 ,file_texto_ubi =O0OOOO0O0O0000O00 ,file_imagen =OO0OO0OOOOOOOOO00 ,user_image6 =OO00OOO00OO00O000 ,user_image7 =OOO00O000OOOO0000 )#line:698 + elif O0OO0O0000000O00O =='Instrumental':#line:699 + OO00O0OOOOO0OO00O =await cargar_instrumental (OOOO00O0OO00OOOOO ,'listado_completo_cajas/1')#line:700 + if len (OO00O0OOOOO0OO00O )==1 :#line:701 + return render_template ('instrumental_trauma1.html',cajas =OO00O0OOOOO0OO00O ,texto ='El instrumental que buscas esta presente en las siguientes cajas: ',title =OOO0OOOO00OO00O0O ,user_image6 =OO00OOO00OO00O000 ,user_image7 =OOO00O000OOOO0000 )#line:702 + else :#line:703 + return render_template ('instrumental_trauma.html',cajas =OO00O0OOOOO0OO00O ,texto ='El instrumental que buscas esta presente en las siguientes cajas: ',title =OOO0OOOO00OO00O0O ,user_image6 =OO00OOO00OO00O000 ,user_image7 =OOO00O000OOOO0000 )#line:704 +@app .route ("/protocolos_trauma",methods =['GET','POST'])#line:706 +async def protocolos_trauma ():#line:707 + OO0000000O0OO0O0O =request .args .get ('link2')#line:708 + O0OOO000OO00O0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:709 + OO00O0000OO0O0000 =await boton_word_ppt (1 ,"field_protocolo",OO0000000O0OO0O0O )#line:710 + if len (OO00O0000OO0O0000 )==1 :#line:711 + return render_template ('protocolo1.html',protocolos =OO00O0000OO0O0000 ,user_image7 =O0OOO000OO00O0O00 )#line:712 + else :#line:713 + return render_template ('protocolo.html',protocolos =OO00O0000OO0O0000 ,user_image7 =O0OOO000OO00O0O00 )#line:714 +@app .route ("/guia_visual_trauma",methods =['GET','POST'])#line:716 +async def guia_visual_trauma ():#line:717 + OO0O0OO000OO000OO =request .args .get ('link2')#line:718 + O0O000OO0000O00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:719 + O0O00000000O0OOOO =await boton_word_ppt (1 ,"field_guia_visual",OO0O0OO000OO000OO )#line:720 + if len (O0O00000000O0OOOO )==1 :#line:721 + return render_template ('guia_visual1.html',guia_visual =O0O00000000O0OOOO ,user_image7 =O0O000OO0000O00O0 )#line:722 + else :#line:723 + return render_template ('guia_visual.html',guia_visual =O0O00000000O0OOOO ,user_image7 =O0O000OO0000O00O0 )#line:724 +@app .route ("/pdf_casa_trauma",methods =['GET','POST'])#line:726 +async def pdf_casa_trauma ():#line:727 + O000OOO0OOO000000 =request .args .get ('link2')#line:728 + O0000000OO0000O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:729 + OO000OO00O0000000 =await boton_pdf_video (1 ,"field_pdf",O000OOO0OOO000000 )#line:730 + O0O00O0O0OOOO0OOO =0 #line:731 + for OO0O00OO0O0OO00O0 ,OO0O0OOOO0OO0OO0O in OO000OO00O0000000 .items ():#line:732 + for O0OOO0OOOO00O00O0 ,O0O000OOOOO00OOO0 in OO0O0OOOO0OO0OO0O .items ():#line:733 + O0O00O0O0OOOO0OOO =O0O00O0O0OOOO0OOO +1 #line:734 + if len (OO000OO00O0000000 .items ())==1 :#line:735 + if O0O00O0O0OOOO0OOO ==1 :#line:736 + print ("bien")#line:737 + return render_template ('pdf_casa_comercial1.html',user_image7 =O0000000OO0000O00 ,titulos =OO000OO00O0000000 )#line:738 + else :#line:739 + return render_template ('pdf_casa_comercial.html',user_image7 =O0000000OO0000O00 ,titulos =OO000OO00O0000000 )#line:740 + else :#line:741 + return render_template ('pdf_casa_comercial.html',user_image7 =O0000000OO0000O00 ,titulos =OO000OO00O0000000 )#line:742 +@app .route ("/videos_trauma",methods =['GET','POST'])#line:744 +async def videos_trauma ():#line:745 + O0O000O0OOO00OOO0 =request .args .get ('link2')#line:746 + OO0OOO00O0O00000O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:747 + OOO000O000OO000O0 =await boton_pdf_video (1 ,"field_video",O0O000O0OOO00OOO0 )#line:748 + OOO00OO0OO000O0OO =0 #line:749 + for OOO00O0OOOOO0OO0O ,O000O0000O0000O00 in OOO000O000OO000O0 .items ():#line:750 + for OO0O0OOO0O00O00O0 ,OO000O0O0OO0O0OO0 in O000O0000O0000O00 .items ():#line:751 + OOO00OO0OO000O0OO =OOO00OO0OO000O0OO +1 #line:752 + if len (OOO000O000OO000O0 .items ())==1 :#line:753 + if OOO00OO0OO000O0OO ==1 :#line:754 + print ("bien")#line:755 + return render_template ('videos1.html',user_image7 =OO0OOO00O0O00000O ,titulos =OOO000O000OO000O0 )#line:756 + else :#line:757 + return render_template ('videos.html',user_image7 =OO0OOO00O0O00000O ,titulos =OOO000O000OO000O0 )#line:758 + else :#line:759 + return render_template ('videos.html',user_image7 =OO0OOO00O0O00000O ,titulos =OOO000O000OO000O0 )#line:760 +@app .route ("/materiales_trauma",methods =['GET','POST'])#line:762 +async def materiales_trauma ():#line:763 + O0O0O00000OOOOOOO =request .args .get ('link2')#line:764 + O000O0O000O0000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:765 + O0O0O000OO0OO00O0 =await boton_materiales (1 ,O0O0O00000OOOOOOO )#line:766 + if len (O0O0O000OO0OO00O0 [''])==0 :#line:767 + return render_template ('materiales_uro.html',user_image7 =O000O0O000O0000O0 ,cajas =O0O0O000OO0OO00O0 ,no_hay ="No hay instrumental")#line:768 + else :#line:769 + if len (O0O0O000OO0OO00O0 )==1 :#line:770 + return render_template ('materiales_uro1.html',user_image7 =O000O0O000O0000O0 ,cajas =O0O0O000OO0OO00O0 )#line:771 + else :#line:772 + return render_template ('materiales_uro.html',user_image7 =O000O0O000O0000O0 ,cajas =O0O0O000OO0OO00O0 )#line:773 +@app .route ("/escuchar_trauma1",methods =['GET','POST'])#line:775 +async def escuchar_trauma1 ():#line:776 + OOO0OOO00O000OO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:777 + O00OO0O000O00O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:778 + O0OOOO0OO00OOO0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:779 + OOO00OO0O0O000OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:780 + O00OOOOO0000O0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:781 + OOOO000OOOO00O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:782 + O00O0000O0O0O00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:783 + O00OO0OOO0000OO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:784 + return render_template ('escuchar_trauma1.html',nid2 =0 ,prediction_text ="Dale a `Escuchar´ y haz tu pregunta",user_image5 =OOOO000OOOO00O0O0 ,user_image6 =O00O0000O0O0O00O0 ,user_image7 =O00OO0OOO0000OO00 ,user_image8 =O0OOOO0OO00OOO0OO ,user_image9 =OOO00OO0O0O000OOO ,user_image10 =OOO0OOO00O000OO00 ,user_image11 =O00OOOOO0000O0O00 ,user_image12 =O00OO0O000O00O0O0 )#line:785 +@app .route ("/escuchar_trauma",methods =['GET','POST'])#line:787 +async def escuchar_trauma ():#line:788 + OOOO00OOO0OOO000O =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:791 + OO00O0O0O00OOO0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:792 + O0OO000OOOOOO0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:793 + O000O0O00000O0OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:794 + OO0O0OOO0OOOO0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:795 + OO00OO0O0OO0OO000 =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:796 + O0OOOO0000O00O000 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:797 + OOO000OOOO0000OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:798 + OOO000000000000OO =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:799 + OO0O0OOO0OOOO0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:803 + OO00OO0O0OO0OO000 =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:804 + O0OOOO0000O00O000 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:805 + OOO000OOOO0000OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:806 + OOO000000000000OO =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:807 + OO00O0O0O00OOO0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:808 + O0OO000OOOOOO0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:809 + O000O0O00000O0OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:810 + O0O0OO0OO0O0OO0OO =sr .Recognizer ()#line:814 + O000OOOO000OOOO00 =""#line:816 + if request .method =="POST":#line:818 + O0OOO0000OO0OOO00 =request .files ['audio_data']#line:819 + with sr .AudioFile (O0OOO0000OO0OOO00 )as O00000OOO00OO0O0O :#line:821 + OOO0OO00O0000O00O =O0O0OO0OO0O0OO0OO .record (O00000OOO00OO0O0O )#line:822 + try :#line:825 + O000OOOO000OOOO00 =O0O0OO0OO0O0OO0OO .recognize_google (OOO0OO00O0000O00O ,language ='es-ES')#line:826 + except sr .UnknownValueError :#line:827 + O000OOOO000OOOO00 ="No se pudo reconocer el audio"#line:828 + except sr .RequestError as OO000O000OO0OO000 :#line:829 + O000OOOO000OOOO00 =f"Error en la solicitud: {str(OO000O000OO0OO000)}"#line:830 + print (O000OOOO000OOOO00 )#line:831 + OOO00OOOOOO00O00O =O000OOOO000OOOO00 #line:837 + print ("TEXTO")#line:838 + print (OOO00OOOOOO00O00O )#line:839 + OOO00OOOOOO00O00O =str (OOO00OOOOOO00O00O ).lower ()#line:841 + OOO00OOOOOO00O00O =OOO00OOOOOO00O00O .split ()#line:842 + OOOO0OOOOO0OOOO00 ={}#line:843 + OOOO0OOOOO0OOOO00 [""]=""#line:844 + if OOO00OOOOOO00O00O [0 ]!="none":#line:845 + O0O00OOO0OOO0OOO0 =1 #line:846 + OO0OO0O0O0000O0O0 =await cargar_base_datos (OOO00OOOOOO00O00O ,O0O00OOO0OOO0OOO0 )#line:847 + OOO0000OOOOO00000 ,OO0OOO00OOO0OOO00 ,OO00O00OO0OO00O00 =await buscar_faq (OOO00OOOOOO00O00O ,0 )#line:848 + if OO0OO0O0O0000O0O0 ==None :#line:849 + if len (OOO0000OOOOO00000 )==0 :#line:850 + return render_template ('escuchar_trauma.html',nid2 =0 ,result_busqueda =OOOO0OOOOO0OOOO00 ,prediction_text ="No hay resultados para tu busqueda",user_image6 =O0OO000OOOOOO0O0O ,user_image7 =O000O0O00000O0OO0 ,user_image5 =OO00O0O0O00OOO0O0 ,user_image8 =O0OOOO0000O00O000 ,user_image9 =OOO000OOOO0000OO0 ,user_image10 =OO0O0OOO0OOOO0OOO ,user_image11 =OOO000000000000OO ,user_image12 =OO00OO0O0OO0OO000 )#line:851 + else :#line:853 + return render_template ('escuchar_trauma.html',nid2 =0 ,faqs =OOO0000OOOOO00000 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OOOO0OOOOO0OOOO00 ,user_image6 =O0OO000OOOOOO0O0O ,user_image7 =O000O0O00000O0OO0 ,user_image5 =OO00O0O0O00OOO0O0 ,user_image8 =O0OOOO0000O00O000 ,user_image9 =OOO000OOOO0000OO0 ,user_image10 =OO0O0OOO0OOOO0OOO ,user_image11 =OOO000000000000OO ,user_image12 =OO00OO0O0OO0OO000 )#line:854 + elif len (OO0OO0O0O0000O0O0 )>=1 :#line:856 + OO00O0O000O000000 =[]#line:857 + OOOO0OO0O00OO0000 =[]#line:858 + OOOO0OOOOO0OOOO00 ={}#line:859 + for O0O0000000OO0OO00 in OO0OO0O0O0000O0O0 :#line:860 + OO00O0O000O000000 .append (O0O0000000OO0OO00 ["title"])#line:861 + OOOO0OO0O00OO0000 .append (O0O0000000OO0OO00 ["nid"])#line:862 + for OO0OO00O0O0OO0OO0 ,O0O0000000OO0OO00 in enumerate (OO00O0O000O000000 ):#line:863 + OOOO0OOOOO0OOOO00 [OOOO0OO0O00OO0000 [OO0OO00O0O0OO0OO0 ]]=O0O0000000OO0OO00 #line:864 + print ("RESULT BUSQUEDA")#line:865 + print (OOOO0OOOOO0OOOO00 )#line:866 + if len (OOO0000OOOOO00000 )==0 :#line:867 + print ("render1")#line:868 + return render_template ('escuchar_trauma.html',nid2 =0 ,result_busqueda =OOOO0OOOOO0OOOO00 ,user_image6 =O0OO000OOOOOO0O0O ,user_image7 =O000O0O00000O0OO0 ,user_image5 =OO00O0O0O00OOO0O0 ,user_image8 =O0OOOO0000O00O000 ,user_image9 =OOO000OOOO0000OO0 ,user_image10 =OO0O0OOO0OOOO0OOO ,user_image11 =OOO000000000000OO ,user_image12 =OO00OO0O0OO0OO000 )#line:869 + else :#line:871 + print ("render2")#line:872 + return render_template ('buscador_trauma.html',faqs =OOO0000OOOOO00000 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OOOO0OOOOO0OOOO00 ,user_image4 =OOOO00OOO0OOO000O ,user_image5 =OO00O0O0O00OOO0O0 ,user_image6 =O0OO000OOOOOO0O0O ,user_image7 =O000O0O00000O0OO0 ,user_image8 =O0OOOO0000O00O000 ,user_image9 =OOO000OOOO0000OO0 ,user_image10 =OO0O0OOO0OOOO0OOO ,user_image11 =OOO000000000000OO ,user_image12 =OO00OO0O0OO0OO000 ,nid2 =0 )#line:873 + else :#line:875 + return render_template ('escuchar_trauma.html',nid2 =0 ,result_busqueda =OOOO0OOOOO0OOOO00 ,prediction_text ="No te he entendido bien, dale al boton `Escuchar´ y repite tu pregunta",user_image5 =OO00O0O0O00OOO0O0 ,user_image6 =O0OO000OOOOOO0O0O ,user_image7 =O000O0O00000O0OO0 ,user_image8 =O0OOOO0000O00O000 ,user_image9 =OOO000OOOO0000OO0 ,user_image10 =OO0O0OOO0OOOO0OOO ,user_image11 =OOO000000000000OO ,user_image12 =OO00OO0O0OO0OO000 )#line:876 +@app .route ("/buscador_admision",methods =['GET','POST'])#line:878 +async def buscador_admision ():#line:879 + O0OO00OOO000OOOOO =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:880 + O0OO000000O00O000 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:881 + O00O00O0O0O0O0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:882 + OO000O0000OO0O00O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:883 + O000OO0O0O00O0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'otros_img.png')#line:884 + OO0O0OO00000O00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'programacion_img.png')#line:885 + OOO0000OO00OO0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'preguntas_respuestas.png')#line:886 + OOO00OOOO0OOO00OO =os .path .join (app .config ['UPLOAD_FOLDER'],'ambulancias_img.jpg')#line:887 + OOO0O00O00O0OO000 =os .path .join (app .config ['UPLOAD_FOLDER'],'mapa_camas_img.jpg')#line:888 + O00OOO00000000OOO =str (request .form .to_dict ())#line:889 + O00OOO00000000OOO =adaptar_salida (O00OOO00000000OOO )#line:890 + O0000O00O0O00O00O ={}#line:891 + O0000O00O0O00O00O [""]=""#line:892 + if len (O00OOO00000000OOO )==0 :#line:893 + return render_template ('buscador_admision.html',preguntas_respuestas =OOO0000OO00OO0O00 ,user_image8 =OOO0O00O00O0OO000 ,user_image9 =OOO00OOOO0OOO00OO ,user_image10 =OO0O0OO00000O00O0 ,user_image11 =O000OO0O0O00O0O00 ,result_busqueda =O0000O00O0O00O00O ,prediction_text ="ya puedes hacer tu pregunta",user_image4 =O0OO00OOO000OOOOO ,user_image5 =O0OO000000O00O000 ,user_image6 =O00O00O0O0O0O0000 ,user_image7 =OO000O0000OO0O00O )#line:894 + elif O00OOO00000000OOO !=None or "{}":#line:895 + O000OO0OO00O0O00O =1621 #line:896 + OO0O000O00O0O000O =await cargar_base_datos (O00OOO00000000OOO ,O000OO0OO00O0O00O )#line:897 + O00O0OOOOOOO0OO0O ,O0OO000OOO0O00O0O ,O00000OO00OO00000 =await buscar_faq (O00OOO00000000OOO ,1 )#line:898 + if OO0O000O00O0O000O ==None :#line:899 + if len (O00000OO00OO00000 )==0 :#line:900 + return render_template ('buscador_admision.html',preguntas_respuestas =OOO0000OO00OO0O00 ,user_image8 =OOO0O00O00O0OO000 ,user_image9 =OOO00OOOO0OOO00OO ,user_image10 =OO0O0OO00000O00O0 ,user_image11 =O000OO0O0O00O0O00 ,result_busqueda =O0000O00O0O00O00O ,prediction_text ="No hay resultados para tu busqueda",user_image4 =O0OO00OOO000OOOOO ,user_image5 =O0OO000000O00O000 ,user_image6 =O00O00O0O0O0O0000 ,user_image7 =OO000O0000OO0O00O )#line:901 + else :#line:902 + return render_template ('buscador_admision.html',preguntas_respuestas =OOO0000OO00OO0O00 ,user_image8 =OOO0O00O00O0OO000 ,user_image9 =OOO00OOOO0OOO00OO ,user_image10 =OO0O0OO00000O00O0 ,user_image11 =O000OO0O0O00O0O00 ,faqs =O00000OO00OO00000 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =O0000O00O0O00O00O ,user_image4 =O0OO00OOO000OOOOO ,user_image5 =O0OO000000O00O000 ,user_image6 =O00O00O0O0O0O0000 ,user_image7 =OO000O0000OO0O00O )#line:903 + elif len (OO0O000O00O0O000O )>=1 :#line:904 + O00OO00O0O0OO0OO0 =[]#line:905 + O0OOO00O000O0OO0O =[]#line:906 + O0000O00O0O00O00O ={}#line:907 + for OO00O0OOOO00OO000 in OO0O000O00O0O000O :#line:908 + O0OOO00O000O0OO0O .append (OO00O0OOOO00OO000 ["nid"])#line:909 + for O0OOOO0OOO00OO0OO in O0OOO00O000O0OO0O :#line:910 + O00000000O0OO00O0 =aiohttp .TCPConnector (ssl =True )#line:911 + async with aiohttp .ClientSession (connector =O00000000O0OO00O0 )as OOO0000O00OOOOO0O :#line:912 + OOOOO0O00O000O000 =await OOO0000O00OOOOO0O .get ('https://orva.tedcas.com/api/intervenciones/'+str (O0OOOO0OOO00OO0OO ),auth =auth )#line:913 + OO0O00O0OOOOOO000 =await OOOOO0O00O000O000 .json ()#line:914 + OO0O00O0OOOOOO000 =OO0O00O0OOOOOO000 [0 ]#line:915 + OOO000000OO0O0O0O =OO0O00O0OOOOOO000 ['field_pdf']#line:916 + OOO000000OO0O0O0O =OOO000000OO0O0O0O [0 ]#line:917 + O0000O00O0O00O00O [OO0O00O0OOOOOO000 ['title']]="https://orva.tedcas.com/"+str (OOO000000OO0O0O0O ['url'])#line:918 + if len (O00000OO00OO00000 )==0 :#line:919 + return render_template ('buscador_admision1.html',user_image8 =OOO0O00O00O0OO000 ,user_image9 =OOO00OOOO0OOO00OO ,user_image10 =OO0O0OO00000O00O0 ,user_image11 =O000OO0O0O00O0O00 ,result_busqueda =O0000O00O0O00O00O ,user_image4 =O0OO00OOO000OOOOO ,user_image5 =O0OO000000O00O000 ,user_image6 =O00O00O0O0O0O0000 ,user_image7 =OO000O0000OO0O00O )#line:920 + else :#line:921 + return render_template ('buscador_admision1.html',faqs =O00000OO00OO00000 ,faq_titulo ="Preguntas y respuestas: ",user_image8 =OOO0O00O00O0OO000 ,user_image9 =OOO00OOOO0OOO00OO ,user_image10 =OO0O0OO00000O00O0 ,user_image11 =O000OO0O0O00O0O00 ,result_busqueda =O0000O00O0O00O00O ,user_image4 =O0OO00OOO000OOOOO ,user_image5 =O0OO000000O00O000 ,user_image6 =O00O00O0O0O0O0000 ,user_image7 =OO000O0000OO0O00O )#line:922 +@app .route ("/mapa_camas",methods =['GET','POST'])#line:924 +async def mapa_camas ():#line:925 + OO0000O0O00O0000O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:926 + O0OO0OOOO00OO0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:927 + OO00O0O0OO0O00OO0 ,O0O0O0O00OOO0O00O ,O00O00OOO000O0OOO ,OOO00OOOO00O000O0 =await cargar_botones_pdf_admision ()#line:928 + return render_template ('mapa_camas.html',text =OO00O0O0OO0O00OO0 ,user_image6 =OO0000O0O00O0000O ,user_image7 =O0OO0OOOO00OO0OOO )#line:929 +@app .route ("/ambulancias",methods =['GET','POST'])#line:931 +async def ambulancias ():#line:932 + O0O0OOOO0O0O00OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:933 + OOOO00OOOO000OOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:934 + O0O0000OOOOOOO00O ,O00OOO00000O0O0O0 ,O0OO0OOO0OO000000 ,OO0OO0OO0OOO0OO0O =await cargar_botones_pdf_admision ()#line:935 + return render_template ('ambulancias.html',text =O00OOO00000O0O0O0 ,user_image6 =O0O0OOOO0O0O00OO0 ,user_image7 =OOOO00OOOO000OOO0 )#line:936 +@app .route ("/programacion_quirurgica",methods =['GET','POST'])#line:938 +async def programacion_quirurgica ():#line:939 + O0OOO0OO0OOO0OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:940 + OO00000OOO0O0OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:941 + O0000O0O000O0O000 ,O0000OOO000O0O0O0 ,O0OOO0OOO00OO00O0 ,OOOO0O00000O0O00O =await cargar_botones_pdf_admision ()#line:942 + return render_template ('programacion_quirurgica.html',text =O0OOO0OOO00OO00O0 ,user_image6 =O0OOO0OO0OOO0OO0O ,user_image7 =OO00000OOO0O0OO0O )#line:943 +@app .route ("/otros",methods =['GET','POST'])#line:945 +async def otros ():#line:946 + O000O0O0O00000000 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:947 + O0000OO00O0O0O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:948 + OO0O0OO0O0O0OOO00 ,O0O0OOOOO00O00OOO ,OOOOOO00OOO0OOO0O ,OOO0OO00OOOO0OO0O =await cargar_botones_pdf_admision ()#line:949 + return render_template ('otros.html',text =OOO0OO00OOOO0OO0O ,user_image6 =O000O0O0O00000000 ,user_image7 =O0000OO00O0O0O0O0 )#line:950 +@app .route ("/escuchar_admision1",methods =['GET','POST'])#line:952 +async def escuchar_admision1 ():#line:953 + O00O0OOO00OO0O0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'otros_img.png')#line:954 + O00O00OO0OO0000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'programacion_img.png')#line:955 + OOOO000000O000OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ambulancias_img.jpg')#line:956 + O0O000OO00O00OO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'mapa_camas_img.jpg')#line:957 + OOO000OOOO00O00OO =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:958 + O000000OOO0OO0OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:959 + O00OO0O00000OOO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:960 + return render_template ('escuchar_admision1.html',user_image8 =O0O000OO00O00OO00 ,user_image9 =OOOO000000O000OO0 ,user_image10 =O00O00OO0OO0000O0 ,user_image11 =O00O0OOO00OO0O0OO ,prediction_text ="Dale a `Escuchar´ y haz tu pregunta",user_image5 =OOO000OOOO00O00OO ,user_image6 =O000000OOO0OO0OOO ,user_image7 =O00OO0O00000OOO0O )#line:961 +@app .route ("/escuchar_admision",methods =['GET','POST'])#line:963 +async def escuchar_admision ():#line:964 + OOO0O000O000000OO =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:967 + O00OOOOOOO0O0OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:968 + OO0OOOO0OO000OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:969 + OO0O000OO0O0OOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:970 + OO0O0OO00O000O00O =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:971 + O0OO0O00000OO00OO =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:972 + O0O0OOOO0O00O00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:973 + OOOO0O0O000OOOO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:974 + OO0O000O000O0OOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:975 + O0O00O0O00O0OOOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'otros_img.png')#line:979 + OO00O00O00O0OO00O =os .path .join (app .config ['UPLOAD_FOLDER'],'programacion_img.png')#line:980 + O00O000OO00OO0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'ambulancias_img.jpg')#line:981 + OO0OO00OO00OO0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'mapa_camas_img.jpg')#line:982 + OOO0O000O000000OO =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:983 + O00OOOOOOO0O0OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:984 + OO0OOOO0OO000OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:985 + OO0O000OO0O0OOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:986 + O0OO0OOOO0O0O0O0O =sr .Recognizer ()#line:988 + O0O0O0000OO0O000O =""#line:990 + if request .method =="POST":#line:992 + OO0O000OO0000OO0O =request .files ['audio_data']#line:993 + with sr .AudioFile (OO0O000OO0000OO0O )as O00OO0OOOO0OO0OO0 :#line:995 + O0O0O0O000O00OO0O =O0OO0OOOO0O0O0O0O .record (O00OO0OOOO0OO0OO0 )#line:996 + try :#line:999 + O0O0O0000OO0O000O =O0OO0OOOO0O0O0O0O .recognize_google (O0O0O0O000O00OO0O ,language ='es-ES')#line:1000 + except sr .UnknownValueError :#line:1001 + O0O0O0000OO0O000O ="No se pudo reconocer el audio"#line:1002 + except sr .RequestError as OOO0O0OO0OOO0OO00 :#line:1003 + O0O0O0000OO0O000O =f"Error en la solicitud: {str(OOO0O0OO0OOO0OO00)}"#line:1004 + print (O0O0O0000OO0O000O )#line:1005 + O0OO00O0OO0OOO0O0 =O0O0O0000OO0O000O #line:1008 + O0OO00O0OO0OOO0O0 =str (O0OO00O0OO0OOO0O0 ).lower ()#line:1013 + O0OO00O0OO0OOO0O0 =O0OO00O0OO0OOO0O0 .split ()#line:1014 + print (O0OO00O0OO0OOO0O0 )#line:1015 + OO0O0O00O00OOOOO0 ={}#line:1016 + OO0O0O00O00OOOOO0 [""]=""#line:1017 + if O0OO00O0OO0OOO0O0 [0 ]!="none":#line:1018 + OOO0000O000O000O0 =1621 #line:1019 + OO0O0O0OOO000OOOO =await cargar_base_datos (O0OO00O0OO0OOO0O0 ,OOO0000O000O000O0 )#line:1020 + OO0OOO00OO00O00O0 ,OOO0OOOOO0OO0O000 ,O0O00OO0O0OO00O00 =await buscar_faq (O0OO00O0OO0OOO0O0 ,1 )#line:1021 + if OO0O0O0OOO000OOOO ==None :#line:1022 + if len (O0O00OO0O0OO00O00 )==0 :#line:1023 + return render_template ('escuchar_admision.html',user_image8 =OO0OO00OO00OO0000 ,user_image9 =O00O000OO00OO0O00 ,user_image10 =OO00O00O00O0OO00O ,user_image11 =O0O00O0O00O0OOOO0 ,result_busqueda =OO0O0O00O00OOOOO0 ,prediction_text ="No hay resultados para tu busqueda",user_image4 =OOO0O000O000000OO ,user_image5 =O00OOOOOOO0O0OO0O ,user_image6 =OO0OOOO0OO000OO0O ,user_image7 =OO0O000OO0O0OOO00 )#line:1024 + else :#line:1025 + return render_template ('escuchar_admision.html',faqs =O0O00OO0O0OO00O00 ,faq_titulo ="Preguntas y respuestas: ",user_image8 =OO0OO00OO00OO0000 ,user_image9 =O00O000OO00OO0O00 ,user_image10 =OO00O00O00O0OO00O ,user_image11 =O0O00O0O00O0OOOO0 ,result_busqueda =OO0O0O00O00OOOOO0 ,user_image4 =OOO0O000O000000OO ,user_image5 =O00OOOOOOO0O0OO0O ,user_image6 =OO0OOOO0OO000OO0O ,user_image7 =OO0O000OO0O0OOO00 )#line:1026 + elif len (OO0O0O0OOO000OOOO )>=1 :#line:1027 + O0O0O0OOOO0OO00O0 =[]#line:1028 + OOO00OOO0O0000000 =[]#line:1029 + OO0O0O00O00OOOOO0 ={}#line:1030 + for OOO0OOOOO000OOO0O in OO0O0O0OOO000OOOO :#line:1031 + OOO00OOO0O0000000 .append (OOO0OOOOO000OOO0O ["nid"])#line:1032 + for O000000OOOO0O00OO in OOO00OOO0O0000000 :#line:1033 + O0000O0O000OOO00O =aiohttp .TCPConnector (ssl =True )#line:1034 + async with aiohttp .ClientSession (connector =O0000O0O000OOO00O )as OO000OOOOOO0OOOO0 :#line:1035 + O0O0OOO000O00OOOO =await OO000OOOOOO0OOOO0 .get ('https://orva.tedcas.com/api/intervenciones/'+str (O000000OOOO0O00OO ),auth =auth )#line:1036 + O0O00OO000OO0OOOO =await O0O0OOO000O00OOOO .json ()#line:1037 + O0O00OO000OO0OOOO =O0O00OO000OO0OOOO [0 ]#line:1038 + O0OOO000OOO0OOOO0 =O0O00OO000OO0OOOO ['field_pdf']#line:1039 + O0OOO000OOO0OOOO0 =O0OOO000OOO0OOOO0 [0 ]#line:1040 + OO0O0O00O00OOOOO0 [O0O00OO000OO0OOOO ['title']]="https://orva.tedcas.com/"+str (O0OOO000OOO0OOOO0 ['url'])#line:1041 + if len (O0O00OO0O0OO00O00 )==0 :#line:1042 + return render_template ('escuchar_admision.html',user_image8 =OO0OO00OO00OO0000 ,user_image9 =O00O000OO00OO0O00 ,user_image10 =OO00O00O00O0OO00O ,user_image11 =O0O00O0O00O0OOOO0 ,result_busqueda =OO0O0O00O00OOOOO0 ,user_image4 =OOO0O000O000000OO ,user_image5 =O00OOOOOOO0O0OO0O ,user_image6 =OO0OOOO0OO000OO0O ,user_image7 =OO0O000OO0O0OOO00 )#line:1043 + else :#line:1044 + print ("render2")#line:1045 + return render_template ('buscador_admision.html',faqs =O0O00OO0O0OO00O00 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OO0O0O00O00OOOOO0 ,user_image4 =OOO0O000O000000OO ,user_image5 =O00OOOOOOO0O0OO0O ,user_image6 =OO0OOOO0OO000OO0O ,user_image7 =OO0O000OO0O0OOO00 ,user_image8 =O0O0OOOO0O00O00O0 ,user_image9 =OOOO0O0O000OOOO0O ,user_image10 =OO0O0OO00O000O00O ,user_image11 =OO0O000O000O0OOO0 ,user_image12 =O0OO0O00000OO00OO ,nid2 =0 )#line:1046 else :#line:1048 - return render_template ('videos.html',user_image7 =OO000O0OO0O0O0OOO ,titulos =O0O0OOO0000OOO0O0 )#line:1049 -@app .route ("/materiales_uro",methods =['GET','POST'])#line:1051 -async def materiales_uro ():#line:1052 - O00OOO0O000O0OOOO =request .args .get ('link2')#line:1053 - O0OO00000OO0OO00O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1054 - OOOOOOO0OO0O0O0OO =await boton_materiales (1620 ,O00OOO0O000O0OOOO )#line:1055 - if len (OOOOOOO0OO0O0O0OO [''])==0 :#line:1056 - return render_template ('materiales_uro.html',user_image7 =O0OO00000OO0OO00O ,cajas =OOOOOOO0OO0O0O0OO ,no_hay ="No hay instrumental")#line:1057 - else :#line:1058 - if len (OOOOOOO0OO0O0O0OO )==1 :#line:1059 - return render_template ('materiales_uro1.html',user_image7 =O0OO00000OO0OO00O ,cajas =OOOOOOO0OO0O0O0OO )#line:1060 - else :#line:1061 - return render_template ('materiales_uro.html',user_image7 =O0OO00000OO0OO00O ,cajas =OOOOOOO0OO0O0O0OO )#line:1062 -@app .route ("/escuchar_uro1",methods =['GET','POST'])#line:1064 -async def escuchar_uro1 ():#line:1065 - OO0O0OOO0000OOO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:1066 - O00O0O0O000OOOOOO =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:1067 - OOOO000O00O000000 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:1068 - OOOOOO0O000O0O0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:1069 - OO000O0O0O00O00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:1070 - O00OO000OOO0OO00O =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:1071 - O000OOOO0OOOO0OO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:1072 - O000000000OO0O000 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1073 - return render_template ('escuchar_uro1.html',nid2 =0 ,prediction_text ="Dale a `Escuchar´ y haz tu pregunta",user_image5 =O00OO000OOO0OO00O ,user_image6 =O000OOOO0OOOO0OO0 ,user_image7 =O000000000OO0O000 ,user_image8 =OOOO000O00O000000 ,user_image9 =OOOOOO0O000O0O0OO ,user_image10 =OO0O0OOO0000OOO0O ,user_image11 =OO000O0O0O00O00O0 ,user_image12 =O00O0O0O000OOOOOO )#line:1074 -@app .route ("/escuchar_uro",methods =['GET','POST'])#line:1076 -async def escuchar_uro ():#line:1077 - O00O0O000O0OO000O =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:1078 - OOOOOO0OO00000O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:1079 - OO00OO000000000OO =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:1080 - OOO0O0OO0O0O0O000 =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:1081 - O0O00OOO0O0O000OO =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:1082 - O0OO0000O00OOO0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:1083 - OOO00O0O0O0OO000O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:1084 - O0OO00O00OOOOO00O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1085 - global recognized_text #line:1086 - OO0OOO0O00000O0O0 =recognized_text #line:1087 - OO0OOO0O00000O0O0 =str (OO0OOO0O00000O0O0 ).lower ()#line:1088 - OO0OOO0O00000O0O0 =OO0OOO0O00000O0O0 .split ()#line:1089 - OOOOO0O000000O00O ={}#line:1090 - OOOOO0O000000O00O [""]=""#line:1091 - if OO0OOO0O00000O0O0 [0 ]!="none":#line:1092 - O00O0OO000O00O0OO =1620 #line:1093 - OOOO00OOOOOO00OOO =await cargar_base_datos (OO0OOO0O00000O0O0 ,O00O0OO000O00O0OO )#line:1094 - O00O0000OOOO0O0OO ,O00O00O0OOO0OO0O0 ,OO00OO0OOOOOOOOOO =await buscar_faq (OO0OOO0O00000O0O0 ,0 )#line:1095 - if OOOO00OOOOOO00OOO ==None :#line:1096 - if len (O00O00O0OOO0OO0O0 )==0 :#line:1097 - return render_template ('escuchar_uro.html',nid2 =0 ,result_busqueda =OOOOO0O000000O00O ,prediction_text ="No hay resultados para tu busqueda",user_image6 =OOO00O0O0O0OO000O ,user_image7 =O0OO00O00OOOOO00O ,user_image5 =O0OO0000O00OOO0O0 ,user_image8 =OO00OO000000000OO ,user_image9 =OOO0O0OO0O0O0O000 ,user_image10 =O00O0O000O0OO000O ,user_image11 =O0O00OOO0O0O000OO ,user_image12 =OOOOOO0OO00000O00 )#line:1098 - else :#line:1099 - return render_template ('escuchar_uro.html',nid2 =0 ,faqs =O00O00O0OOO0OO0O0 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OOOOO0O000000O00O ,user_image6 =OOO00O0O0O0OO000O ,user_image7 =O0OO00O00OOOOO00O ,user_image5 =O0OO0000O00OOO0O0 ,user_image8 =OO00OO000000000OO ,user_image9 =OOO0O0OO0O0O0O000 ,user_image10 =O00O0O000O0OO000O ,user_image11 =O0O00OOO0O0O000OO ,user_image12 =OOOOOO0OO00000O00 )#line:1100 - elif len (OOOO00OOOOOO00OOO )>=1 :#line:1101 - O000OOO0OOO000000 =[]#line:1102 - O00O0O00OOO0OOOOO =[]#line:1103 - OOOOO0O000000O00O ={}#line:1104 - for OOOO00OO0OOO0OOO0 in OOOO00OOOOOO00OOO :#line:1105 - O000OOO0OOO000000 .append (OOOO00OO0OOO0OOO0 ["title"])#line:1106 - O00O0O00OOO0OOOOO .append (OOOO00OO0OOO0OOO0 ["nid"])#line:1107 - for OOOOO0OO0000O0OO0 ,OOOO00OO0OOO0OOO0 in enumerate (O000OOO0OOO000000 ):#line:1108 - OOOOO0O000000O00O [O00O0O00OOO0OOOOO [OOOOO0OO0000O0OO0 ]]=OOOO00OO0OOO0OOO0 #line:1109 - if len (O00O00O0OOO0OO0O0 )==0 :#line:1111 - return render_template ('escuchar_uro.html',nid2 =0 ,result_busqueda =OOOOO0O000000O00O ,user_image6 =OOO00O0O0O0OO000O ,user_image7 =O0OO00O00OOOOO00O ,user_image5 =O0OO0000O00OOO0O0 ,user_image8 =OO00OO000000000OO ,user_image9 =OOO0O0OO0O0O0O000 ,user_image10 =O00O0O000O0OO000O ,user_image11 =O0O00OOO0O0O000OO ,user_image12 =OOOOOO0OO00000O00 )#line:1112 - else :#line:1113 - return render_template ('escuchar_uro.html',nid2 =0 ,faqs =O00O00O0OOO0OO0O0 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =OOOOO0O000000O00O ,user_image6 =OOO00O0O0O0OO000O ,user_image7 =O0OO00O00OOOOO00O ,user_image5 =O0OO0000O00OOO0O0 ,user_image8 =OO00OO000000000OO ,user_image9 =OOO0O0OO0O0O0O000 ,user_image10 =O00O0O000O0OO000O ,user_image11 =O0O00OOO0O0O000OO ,user_image12 =OOOOOO0OO00000O00 )#line:1114 - else :#line:1115 - return render_template ('escuchar_uro.html',nid2 =0 ,result_busqueda =OOOOO0O000000O00O ,prediction_text ="No te he entendido bien, dale al boton `Escuchar´ y repite tu pregunta",user_image5 =O0OO0000O00OOO0O0 ,user_image6 =OOO00O0O0O0OO000O ,user_image7 =O0OO00O00OOOOO00O ,user_image8 =OO00OO000000000OO ,user_image9 =OOO0O0OO0O0O0O000 ,user_image10 =O00O0O000O0OO000O ,user_image11 =O0O00OOO0O0O000OO ,user_image12 =OOOOOO0OO00000O00 )#line:1116 -@app .route ("/ajustes")#line:1118 -async def ajustes ():#line:1119 - OOO0O00OOO00OO000 =os .path .join (app .config ['UPLOAD_FOLDER'],'estrella.png')#line:1120 - return render_template ('ajustes.html',user_image7 =OOO0O00OOO00OO000 )#line:1121 -if __name__ =="__main__":#line:1123 - socketio .run (app ,host ="0.0.0.0",port =7860 ,allow_unsafe_werkzeug =True ,debug =True )#line:1124 + return render_template ('escuchar_admision.html',user_image8 =OO0OO00OO00OO0000 ,user_image9 =O00O000OO00OO0O00 ,user_image10 =OO00O00O00O0OO00O ,user_image11 =O0O00O0O00O0OOOO0 ,prediction_text ="No te he entendido bien, dale al boton `Escuchar´ y repite tu pregunta",result_busqueda =OO0O0O00O00OOOOO0 ,user_image4 =OOO0O000O000000OO ,user_image5 =O00OOOOOOO0O0OO0O ,user_image6 =OO0OOOO0OO000OO0O ,user_image7 =OO0O000OO0O0OOO00 )#line:1049 +@app .route ("/buscador_uro",methods =['GET','POST'])#line:1051 +async def buscador_uro ():#line:1052 + O00O0OO00OOOOOOOO =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:1053 + O00O00O00O00OOO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:1054 + OO0O00O00OOOO0O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:1055 + O0OO0OO0O0O00O0OO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1056 + OO0O000OO00OOOOOO =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:1057 + O00O00OOOO000OOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:1058 + O00O00O0000OO0000 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:1059 + O0O00O00O000000O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:1060 + O00O0OOOO0O00O0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'preguntas_respuestas.png')#line:1061 + OO0OO0O0O0OO0OOOO =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:1062 + O0O0000OO0OO0O000 =str (request .form .to_dict ())#line:1063 + O0O0000OO0OO0O000 =adaptar_salida (O0O0000OO0OO0O000 )#line:1064 + O0OOOO0000000O0O0 ={}#line:1065 + O0OOOO0000000O0O0 [""]=""#line:1066 + if len (O0O0000OO0OO0O000 )==0 :#line:1067 + return render_template ('buscador_uro.html',preguntas_respuestas =O00O0OOOO0O00O0O0 ,result_busqueda =O0OOOO0000000O0O0 ,user_image4 =O00O0OO00OOOOOOOO ,user_image5 =O00O00O00O00OOO0O ,user_image6 =OO0O00O00OOOO0O0O ,user_image7 =O0OO0OO0O0O00O0OO ,user_image8 =O00O00O0000OO0000 ,user_image9 =O0O00O00O000000O0 ,user_image10 =OO0O000OO00OOOOOO ,user_image11 =OO0OO0O0O0OO0OOOO ,user_image12 =O00O00OOOO000OOO0 ,nid2 =0 )#line:1068 + elif O0O0000OO0OO0O000 !=None or "{}":#line:1069 + OO0000000OO0O00OO =1620 #line:1070 + O00000000O00OO0O0 =await cargar_base_datos (O0O0000OO0OO0O000 ,OO0000000OO0O00OO )#line:1071 + O0OO00OOOO00O0OOO ,OOO00OOOOOO0O0OOO ,O0O0O0OOO0000OOO0 =await buscar_faq (O0O0000OO0OO0O000 ,1 )#line:1072 + if O00000000O00OO0O0 ==None :#line:1073 + if len (OOO00OOOOOO0O0OOO )==0 :#line:1074 + return render_template ('buscador_uro.html',preguntas_respuestas =O00O0OOOO0O00O0O0 ,result_busqueda =O0OOOO0000000O0O0 ,prediction_text ="No hay resultados para tu busqueda",user_image4 =O00O0OO00OOOOOOOO ,user_image5 =O00O00O00O00OOO0O ,user_image6 =OO0O00O00OOOO0O0O ,user_image7 =O0OO0OO0O0O00O0OO ,user_image8 =O00O00O0000OO0000 ,user_image9 =O0O00O00O000000O0 ,user_image10 =OO0O000OO00OOOOOO ,user_image11 =OO0OO0O0O0OO0OOOO ,user_image12 =O00O00OOOO000OOO0 ,nid2 =0 )#line:1075 + else :#line:1076 + return render_template ('buscador_uro.html',preguntas_respuestas =O00O0OOOO0O00O0O0 ,faqs =OOO00OOOOOO0O0OOO ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =O0OOOO0000000O0O0 ,user_image4 =O00O0OO00OOOOOOOO ,user_image5 =O00O00O00O00OOO0O ,user_image6 =OO0O00O00OOOO0O0O ,user_image7 =O0OO0OO0O0O00O0OO ,user_image8 =O00O00O0000OO0000 ,user_image9 =O0O00O00O000000O0 ,user_image10 =OO0O000OO00OOOOOO ,user_image11 =OO0OO0O0O0OO0OOOO ,user_image12 =O00O00OOOO000OOO0 ,nid2 =0 )#line:1077 + elif len (O00000000O00OO0O0 )>=1 :#line:1078 + OOO00OOOOOO00O0OO =[]#line:1079 + OOO0OOOO00O0000OO =[]#line:1080 + O0OOOO0000000O0O0 ={}#line:1081 + for O0OO000O00OOOO00O in O00000000O00OO0O0 :#line:1082 + OOO00OOOOOO00O0OO .append (O0OO000O00OOOO00O ["title"])#line:1083 + OOO0OOOO00O0000OO .append (O0OO000O00OOOO00O ["nid"])#line:1084 + for OOO000OO0O000O000 ,O0OO000O00OOOO00O in enumerate (OOO00OOOOOO00O0OO ):#line:1085 + O0OOOO0000000O0O0 [OOO0OOOO00O0000OO [OOO000OO0O000O000 ]]=O0OO000O00OOOO00O #line:1086 + if len (OOO00OOOOOO0O0OOO )!=0 :#line:1087 + return render_template ('buscador_uro1.html',faqs =OOO00OOOOOO0O0OOO ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =O0OOOO0000000O0O0 ,user_image4 =O00O0OO00OOOOOOOO ,user_image5 =O00O00O00O00OOO0O ,user_image6 =OO0O00O00OOOO0O0O ,user_image7 =O0OO0OO0O0O00O0OO ,user_image8 =O00O00O0000OO0000 ,user_image9 =O0O00O00O000000O0 ,user_image10 =OO0O000OO00OOOOOO ,user_image11 =OO0OO0O0O0OO0OOOO ,user_image12 =O00O00OOOO000OOO0 ,nid2 =0 )#line:1088 + else :#line:1089 + return render_template ('buscador_uro1.html',result_busqueda =O0OOOO0000000O0O0 ,user_image4 =O00O0OO00OOOOOOOO ,user_image5 =O00O00O00O00OOO0O ,user_image6 =OO0O00O00OOOO0O0O ,user_image7 =O0OO0OO0O0O00O0OO ,user_image8 =O00O00O0000OO0000 ,user_image9 =O0O00O00O000000O0 ,user_image10 =OO0O000OO00OOOOOO ,user_image11 =OO0OO0O0O0OO0OOOO ,user_image12 =O00O00OOOO000OOO0 ,nid2 =0 )#line:1090 +@app .route ("/resultado_uro",methods =['GET','POST'])#line:1092 +async def resultado_uro ():#line:1093 + OO0O0OOO00OO00OOO =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:1094 + OOOOOOOO0O0OO0O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1095 + OOO0O0O00O0O0000O =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:1096 + O0O0OO0OO0OO0O00O =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:1097 + OOOOO0O000OOO00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:1098 + OO00O0OOOOOO0OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:1099 + OOO0OOO00000000OO =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:1100 + OOO00O00O0O0O00OO =request .args .get ('link')#line:1101 + OO000OOOOOO0OOO00 ,O0O000OO00O000OOO =await cargar_tipo (OOO00O00O0O0O00OO ,1620 )#line:1102 + O00OOO0OO00O00OOO =OO000OOOOOO0OOO00 ['title']#line:1103 + if O0O000OO00O000OOO =="Intervencion":#line:1104 + print ("hola1")#line:1105 + OO000O00000O00O0O ,O0OO000O0O00OO000 =await cargar_caja (str (OOO00O00O0O0O00OO ),'Instrumental - Cajas: ')#line:1106 + return render_template ('intervencion_uro.html',user_image8 =OOOOO0O000OOO00O0 ,user_image9 =OO00O0OOOOOO0OO0O ,user_image10 =OOO0O0O00O0O0000O ,user_image11 =OOO0OOO00000000OO ,user_image12 =O0O0OO0OO0OO0O00O ,instrumental =OO000O00000O00O0O ,texto_cajas =O0OO000O0O00OO000 ,title =O00OOO0OO00O00OOO ,user_image6 =OO0O0OOO00OO00OOO ,user_image7 =OOOOOOOO0O0OO0O00 ,nid2 =OOO00O00O0O0O00OO )#line:1107 + elif O0O000OO00O000OOO =='Caja':#line:1108 + OO0OO00OO0O00OOOO ,O0OOO0OOOO0OOO0OO ,O0O00000O00O00000 =await cargar_archivo ("ubicacion","Ubicacion: ","cajas/"+str (OOO00O00O0O0O00OO ))#line:1109 + O000OO00OOO0O0O00 =await cargar_archivo ("image","Imagen: ","cajas/"+str (OOO00O00O0O0O00OO ))#line:1110 + OOO000O0O0OOO0OO0 ,OO0OOOOO0OO00000O =await cargar_archivo_grande ("title_material","Instrumental : ","cajas/"+str (OOO00O00O0O0O00OO ))#line:1111 + if len (O00OOO0OO00O00OOO )==1 :#line:1112 + return render_template ('caja_trauma1.html',title =O00OOO0OO00O00OOO ,files_instru =OOO000O0O0OOO0OO0 ,texto_instru =OO0OOOOO0OO00000O ,texto_ubi =OO0OO00OO0O00OOOO ,file_texto_ubi =O0O00000O00O00000 ,file_imagen =O000OO00OOO0O0O00 ,user_image6 =OO0O0OOO00OO00OOO ,user_image7 =OOOOOOOO0O0OO0O00 )#line:1113 + else :#line:1114 + return render_template ('caja_trauma.html',title =O00OOO0OO00O00OOO ,files_instru =OOO000O0O0OOO0OO0 ,texto_instru =OO0OOOOO0OO00000O ,texto_ubi =OO0OO00OO0O00OOOO ,file_texto_ubi =O0O00000O00O00000 ,file_imagen =O000OO00OOO0O0O00 ,user_image6 =OO0O0OOO00OO00OOO ,user_image7 =OOOOOOOO0O0OO0O00 )#line:1115 + elif O0O000OO00O000OOO =='Instrumental':#line:1116 + print ("hola2")#line:1117 + OO00O00OOO0O000O0 =await cargar_instrumental (OOO00O00O0O0O00OO ,'listado_completo_cajas/1620')#line:1118 + if len (OO00O00OOO0O000O0 )==1 :#line:1119 + return render_template ('instrumental_uro1.html',cajas =OO00O00OOO0O000O0 ,texto ='El instrumental que buscas esta presente en las siguientes cajas: ',title =O00OOO0OO00O00OOO ,user_image6 =OO0O0OOO00OO00OOO ,user_image7 =OOOOOOOO0O0OO0O00 )#line:1120 + else :#line:1121 + return render_template ('instrumental_uro.html',cajas =OO00O00OOO0O000O0 ,texto ='El instrumental que buscas esta presente en las siguientes cajas: ',title =O00OOO0OO00O00OOO ,user_image6 =OO0O0OOO00OO00OOO ,user_image7 =OOOOOOOO0O0OO0O00 )#line:1122 +@app .route ("/protocolos_uro",methods =['GET','POST'])#line:1124 +async def protocolos_uro ():#line:1125 + OOOO0OOO0OO0OOO00 =request .args .get ('link2')#line:1126 + O0O00OOOO0OO0O00O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1127 + OO0OO0O0O00O00O00 =await boton_word_ppt (1620 ,"field_protocolo",OOOO0OOO0OO0OOO00 )#line:1128 + if len (OO0OO0O0O00O00O00 )==1 :#line:1129 + return render_template ('protocolo1.html',protocolos =OO0OO0O0O00O00O00 ,user_image7 =O0O00OOOO0OO0O00O )#line:1130 + else :#line:1131 + return render_template ('protocolo.html',protocolos =OO0OO0O0O00O00O00 ,user_image7 =O0O00OOOO0OO0O00O )#line:1132 +@app .route ("/guia_visual_uro",methods =['GET','POST'])#line:1134 +async def guia_visual_uro ():#line:1135 + OOO0OOOOOO00O0O0O =request .args .get ('link2')#line:1136 + OO0OOO0O0OO00O00O =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1137 + OO00O00O00OOO0OOO =await boton_word_ppt (1620 ,"field_guia_visual",OOO0OOOOOO00O0O0O )#line:1138 + if len (OO00O00O00OOO0OOO )==1 :#line:1139 + return render_template ('guia_visual1.html',guia_visual =OO00O00O00OOO0OOO ,user_image7 =OO0OOO0O0OO00O00O )#line:1140 + else :#line:1141 + return render_template ('guia_visual.html',guia_visual =OO00O00O00OOO0OOO ,user_image7 =OO0OOO0O0OO00O00O )#line:1142 +@app .route ("/pdf_casa_uro",methods =['GET','POST'])#line:1144 +async def pdf_casa_uro ():#line:1145 + OO0O000OOOO00OOO0 =request .args .get ('link2')#line:1146 + O00OOOO0OO00OO000 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1147 + OOO00O0000O00O000 =await boton_pdf_video (1620 ,"field_pdf",OO0O000OOOO00OOO0 )#line:1148 + O00OOOO0O00O00O0O =0 #line:1149 + for O0OO00OO0OO00O00O ,OOO000OO0OOO0OO0O in OOO00O0000O00O000 .items ():#line:1150 + for O00OO0OOO0O0OO00O ,O0O000OOO000O0OOO in OOO000OO0OOO0OO0O .items ():#line:1151 + O00OOOO0O00O00O0O =O00OOOO0O00O00O0O +1 #line:1152 + if len (OOO00O0000O00O000 .items ())==1 :#line:1153 + if O00OOOO0O00O00O0O ==1 :#line:1154 + print ("bien")#line:1155 + return render_template ('pdf_casa_comercial1.html',user_image7 =O00OOOO0OO00OO000 ,titulos =OOO00O0000O00O000 )#line:1156 + else :#line:1157 + return render_template ('pdf_casa_comercial.html',user_image7 =O00OOOO0OO00OO000 ,titulos =OOO00O0000O00O000 )#line:1158 + else :#line:1159 + return render_template ('pdf_casa_comercial.html',user_image7 =O00OOOO0OO00OO000 ,titulos =OOO00O0000O00O000 )#line:1160 +@app .route ("/videos_uro",methods =['GET','POST'])#line:1162 +async def videos_uro ():#line:1163 + OO0000OO000O00000 =request .args .get ('link2')#line:1164 + OOOOO00000O0OO0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1165 + O0O0OO0000OO0OOO0 =await boton_pdf_video (1620 ,"field_video",OO0000OO000O00000 )#line:1166 + OOOOOO0O0O0OO0O0O =0 #line:1167 + for O00O00O0OOOOOOOO0 ,OOO0000O0000O0000 in O0O0OO0000OO0OOO0 .items ():#line:1168 + for OOO0000O000O00O00 ,O0O0OOO0OO0OO0OOO in OOO0000O0000O0000 .items ():#line:1169 + OOOOOO0O0O0OO0O0O =OOOOOO0O0O0OO0O0O +1 #line:1170 + if len (O0O0OO0000OO0OOO0 .items ())==1 :#line:1171 + if OOOOOO0O0O0OO0O0O ==1 :#line:1172 + return render_template ('videos1.html',user_image7 =OOOOO00000O0OO0O0 ,titulos =O0O0OO0000OO0OOO0 )#line:1173 + else :#line:1174 + return render_template ('videos.html',user_image7 =OOOOO00000O0OO0O0 ,titulos =O0O0OO0000OO0OOO0 )#line:1175 + else :#line:1176 + return render_template ('videos.html',user_image7 =OOOOO00000O0OO0O0 ,titulos =O0O0OO0000OO0OOO0 )#line:1177 +@app .route ("/materiales_uro",methods =['GET','POST'])#line:1179 +async def materiales_uro ():#line:1180 + O00OO0OO0OOO0OOO0 =request .args .get ('link2')#line:1181 + OOO00O00O00OO00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1182 + O0O00O00O000O000O =await boton_materiales (1620 ,O00OO0OO0OOO0OOO0 )#line:1183 + if len (O0O00O00O000O000O [''])==0 :#line:1184 + return render_template ('materiales_uro.html',user_image7 =OOO00O00O00OO00O0 ,cajas =O0O00O00O000O000O ,no_hay ="No hay instrumental")#line:1185 + else :#line:1186 + if len (O0O00O00O000O000O )==1 :#line:1187 + return render_template ('materiales_uro1.html',user_image7 =OOO00O00O00OO00O0 ,cajas =O0O00O00O000O000O )#line:1188 + else :#line:1189 + return render_template ('materiales_uro.html',user_image7 =OOO00O00O00OO00O0 ,cajas =O0O00O00O000O000O )#line:1190 +@app .route ("/escuchar_uro1",methods =['GET','POST'])#line:1192 +async def escuchar_uro1 ():#line:1193 + O0000O00O00O0000O =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:1194 + OOOOOO00OO0OOOOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:1195 + OO0O00OO00O0OO0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:1196 + O0O00OO00OOOOOOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:1197 + O0OOOO00OO00OOOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:1198 + OO000OO000OOOOO00 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:1199 + OO0OOOOOO0O0OOO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:1200 + O0OO0O00O0OO0OOOO =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1201 + return render_template ('escuchar_uro1.html',nid2 =0 ,prediction_text ="Dale a `Escuchar´ y haz tu pregunta",user_image5 =OO000OO000OOOOO00 ,user_image6 =OO0OOOOOO0O0OOO0O ,user_image7 =O0OO0O00O0OO0OOOO ,user_image8 =OO0O00OO00O0OO0O0 ,user_image9 =O0O00OO00OOOOOOO0 ,user_image10 =O0000O00O00O0000O ,user_image11 =O0OOOO00OO00OOOO0 ,user_image12 =OOOOOO00OO0OOOOO0 )#line:1202 +@app .route ("/escuchar_uro",methods =['GET','POST'])#line:1204 +async def escuchar_uro ():#line:1205 + O00000OOOO0O00O0O =os .path .join (app .config ['UPLOAD_FOLDER'],'lupa.png')#line:1208 + OOO0O00O00OOOOOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:1209 + O00OO0OOO00OOO00O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:1210 + O00OO00OOO0O00O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1211 + O00000O0O00OOO0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:1212 + OO00O0O00000OOO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:1213 + O0000000O0O000O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:1214 + O000OO0O00OO0000O =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:1215 + OOOOO00OO0O00OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:1216 + O00000O0O00OOO0O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'guia_visual.png')#line:1218 + OO00O0O00000OOO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'materiales.png')#line:1219 + O0000000O0O000O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'pdf_casa.jpg')#line:1220 + O000OO0O00OO0000O =os .path .join (app .config ['UPLOAD_FOLDER'],'protocolo.jpg')#line:1221 + OOOOO00OO0O00OO0O =os .path .join (app .config ['UPLOAD_FOLDER'],'visualizar_video.png')#line:1222 + OOO0O00O00OOOOOO0 =os .path .join (app .config ['UPLOAD_FOLDER'],'micro.png')#line:1223 + O00OO0OOO00OOO00O =os .path .join (app .config ['UPLOAD_FOLDER'],'ajustes.png')#line:1224 + O00OO00OOO0O00O00 =os .path .join (app .config ['UPLOAD_FOLDER'],'flecha.png')#line:1225 + O00O0O000000OOO0O =sr .Recognizer ()#line:1227 + OOOOO000000O00O00 =""#line:1229 + if request .method =="POST":#line:1231 + OO00OOOOOO0OO00OO =request .files ['audio_data']#line:1232 + with sr .AudioFile (OO00OOOOOO0OO00OO )as OO0OOO00OO0OOOO00 :#line:1234 + OO00O00O0OO0OOOOO =O00O0O000000OOO0O .record (OO0OOO00OO0OOOO00 )#line:1235 + try :#line:1238 + OOOOO000000O00O00 =O00O0O000000OOO0O .recognize_google (OO00O00O0OO0OOOOO ,language ='es-ES')#line:1239 + except sr .UnknownValueError :#line:1240 + OOOOO000000O00O00 ="No se pudo reconocer el audio"#line:1241 + except sr .RequestError as OOOO0O0O0OO0O0O00 :#line:1242 + OOOOO000000O00O00 =f"Error en la solicitud: {str(OOOO0O0O0OO0O0O00)}"#line:1243 + print (OOOOO000000O00O00 )#line:1244 + O000OO00OOO0O0OO0 =OOOOO000000O00O00 #line:1247 + O000OO00OOO0O0OO0 =str (O000OO00OOO0O0OO0 ).lower ()#line:1251 + O000OO00OOO0O0OO0 =O000OO00OOO0O0OO0 .split ()#line:1252 + O0OOOO00O000O0OO0 ={}#line:1253 + O0OOOO00O000O0OO0 [""]=""#line:1254 + if O000OO00OOO0O0OO0 [0 ]!="none":#line:1255 + OO00OOOOO000O0O0O =1620 #line:1256 + O0OO0OO0000OO0OOO =await cargar_base_datos (O000OO00OOO0O0OO0 ,OO00OOOOO000O0O0O )#line:1257 + O0OOO000O00000000 ,OOOOO000O00OOOOO0 ,O0O00OO00OO000O00 =await buscar_faq (O000OO00OOO0O0OO0 ,0 )#line:1258 + if O0OO0OO0000OO0OOO ==None :#line:1259 + if len (OOOOO000O00OOOOO0 )==0 :#line:1260 + return render_template ('escuchar_uro.html',nid2 =0 ,result_busqueda =O0OOOO00O000O0OO0 ,prediction_text ="No hay resultados para tu busqueda",user_image6 =O00OO0OOO00OOO00O ,user_image7 =O00OO00OOO0O00O00 ,user_image5 =OOO0O00O00OOOOOO0 ,user_image8 =O0000000O0O000O00 ,user_image9 =O000OO0O00OO0000O ,user_image10 =O00000O0O00OOO0O0 ,user_image11 =OOOOO00OO0O00OO0O ,user_image12 =OO00O0O00000OOO0O )#line:1261 + else :#line:1262 + return render_template ('escuchar_uro.html',nid2 =0 ,faqs =OOOOO000O00OOOOO0 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =O0OOOO00O000O0OO0 ,user_image6 =O00OO0OOO00OOO00O ,user_image7 =O00OO00OOO0O00O00 ,user_image5 =OOO0O00O00OOOOOO0 ,user_image8 =O0000000O0O000O00 ,user_image9 =O000OO0O00OO0000O ,user_image10 =O00000O0O00OOO0O0 ,user_image11 =OOOOO00OO0O00OO0O ,user_image12 =OO00O0O00000OOO0O )#line:1263 + elif len (O0OO0OO0000OO0OOO )>=1 :#line:1264 + O0O00OO0OO00O0OOO =[]#line:1265 + O0000OOOO00O0OOO0 =[]#line:1266 + O0OOOO00O000O0OO0 ={}#line:1267 + for OO0000OOO000OOOO0 in O0OO0OO0000OO0OOO :#line:1268 + O0O00OO0OO00O0OOO .append (OO0000OOO000OOOO0 ["title"])#line:1269 + O0000OOOO00O0OOO0 .append (OO0000OOO000OOOO0 ["nid"])#line:1270 + for O0OO00000000O00OO ,OO0000OOO000OOOO0 in enumerate (O0O00OO0OO00O0OOO ):#line:1271 + O0OOOO00O000O0OO0 [O0000OOOO00O0OOO0 [O0OO00000000O00OO ]]=OO0000OOO000OOOO0 #line:1272 + if len (OOOOO000O00OOOOO0 )==0 :#line:1274 + return render_template ('escuchar_uro.html',nid2 =0 ,result_busqueda =O0OOOO00O000O0OO0 ,user_image6 =O00OO0OOO00OOO00O ,user_image7 =O00OO00OOO0O00O00 ,user_image5 =OOO0O00O00OOOOOO0 ,user_image8 =O0000000O0O000O00 ,user_image9 =O000OO0O00OO0000O ,user_image10 =O00000O0O00OOO0O0 ,user_image11 =OOOOO00OO0O00OO0O ,user_image12 =OO00O0O00000OOO0O )#line:1275 + else :#line:1276 + return render_template ('buscador_uro.html',faqs =OOOOO000O00OOOOO0 ,faq_titulo ="Preguntas y respuestas: ",result_busqueda =O0OOOO00O000O0OO0 ,user_image4 =O00000OOOO0O00O0O ,user_image5 =OOO0O00O00OOOOOO0 ,user_image6 =O00OO0OOO00OOO00O ,user_image7 =O00OO00OOO0O00O00 ,user_image8 =O0000000O0O000O00 ,user_image9 =O000OO0O00OO0000O ,user_image10 =O00000O0O00OOO0O0 ,user_image11 =OOOOO00OO0O00OO0O ,user_image12 =OO00O0O00000OOO0O ,nid2 =0 )#line:1278 + else :#line:1280 + return render_template ('escuchar_uro.html',nid2 =0 ,result_busqueda =O0OOOO00O000O0OO0 ,prediction_text ="No te he entendido bien, dale al boton `Escuchar´ y repite tu pregunta",user_image5 =OOO0O00O00OOOOOO0 ,user_image6 =O00OO0OOO00OOO00O ,user_image7 =O00OO00OOO0O00O00 ,user_image8 =O0000000O0O000O00 ,user_image9 =O000OO0O00OO0000O ,user_image10 =O00000O0O00OOO0O0 ,user_image11 =OOOOO00OO0O00OO0O ,user_image12 =OO00O0O00000OOO0O )#line:1281 +@app .route ("/ajustes")#line:1283 +async def ajustes ():#line:1284 + OO00OOOOOO0OO00O0 =os .path .join (app .config ['UPLOAD_FOLDER'],'estrella.png')#line:1285 + return render_template ('ajustes.html',user_image7 =OO00OOOOOO0OO00O0 )#line:1286 +if __name__ =="__main__":#line:1288 + app .run (host ="0.0.0.0",port =7860 ,debug =True )#line:1289