Spaces:
Running
Running
Update index.html
Browse files- index.html +224 -122
index.html
CHANGED
|
@@ -5,146 +5,248 @@
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
<title>Algoritmo DM2 – Guía Clínica</title>
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
</head>
|
| 9 |
-
<body class="
|
| 10 |
-
<
|
| 11 |
-
<
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
<div>
|
| 19 |
-
<label for="condicion" class="block mb-1 font-medium">Condición clínica predominante</label>
|
| 20 |
-
<select id="condicion" class="w-full rounded-lg border-gray-300 p-2">
|
| 21 |
-
<option value="ninguna">Ninguna / No prioritaria</option>
|
| 22 |
-
<option value="ecv">Enfermedad Cardiovascular (ECV)</option>
|
| 23 |
-
<option value="ic">Insuficiencia Cardiaca (IC)</option>
|
| 24 |
-
<option value="erc">Enfermedad Renal Crónica (ERC)</option>
|
| 25 |
-
<option value="obesidad">Obesidad</option>
|
| 26 |
-
<option value="fragilidad">Fragilidad</option>
|
| 27 |
-
</select>
|
| 28 |
-
</div>
|
| 29 |
-
<div>
|
| 30 |
-
<label for="hba1c" class="block mb-1 font-medium">HbA1c (o GME equivalente)</label>
|
| 31 |
-
<select id="hba1c" class="w-full rounded-lg border-gray-300 p-2">
|
| 32 |
-
<option value="<7">< 7 % (GME < 153 mg/dl)</option>
|
| 33 |
-
<option value="7-9">7 – 9 % (GME 153‑212 mg/dl)</option>
|
| 34 |
-
<option value=">9">> 9 % (GME > 212 mg/dl)</option>
|
| 35 |
-
</select>
|
| 36 |
-
</div>
|
| 37 |
-
</section>
|
| 38 |
-
|
| 39 |
-
<!-- Resultados -->
|
| 40 |
-
<section class="space-y-6">
|
| 41 |
-
<!-- Resultado por condición -->
|
| 42 |
-
<div id="resultado-condicion" class="hidden bg-white rounded-2xl shadow p-4">
|
| 43 |
-
<h2 class="text-xl font-semibold mb-2 flex items-center"><span class="mr-2">📋</span>Manejo según condición clínica</h2>
|
| 44 |
-
<p id="texto-condicion" class="leading-relaxed"></p>
|
| 45 |
</div>
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
</div>
|
| 52 |
|
| 53 |
-
<!--
|
| 54 |
-
<div id="
|
| 55 |
-
<
|
| 56 |
-
|
|
|
|
|
|
|
| 57 |
</div>
|
| 58 |
-
</section>
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
-
<!-- Lógica embebida -->
|
| 66 |
<script type="module">
|
| 67 |
-
|
| 68 |
-
const
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
ic: 'Iniciar/añadir SGLT2‑i. Ajustar diuréticos/IECA según IC.',
|
| 82 |
-
erc: 'Priorizar SGLT2‑i con beneficio renal. Ajustar dosis según FG.',
|
| 83 |
-
obesidad: 'Añadir o intensificar GLP‑1 RA; considerar cirugía bariátrica.',
|
| 84 |
-
fragilidad: 'Preferir iDPP‑4 o insulinas basales de acción larga con bajo riesgo de hipoglucemia.',
|
| 85 |
-
ninguna: '',
|
| 86 |
};
|
| 87 |
|
| 88 |
-
const
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
};
|
| 93 |
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
};
|
| 104 |
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
// Mostrar manejo por condición
|
| 118 |
-
txtCond.textContent = manejoCondicion[condicion] ?? '';
|
| 119 |
-
resCond.classList.remove('hidden');
|
| 120 |
-
|
| 121 |
-
// Familias según condición
|
| 122 |
-
(familiasPorClave[condicion] ?? []).forEach(fam => {
|
| 123 |
-
const li = document.createElement('li');
|
| 124 |
-
li.textContent = fam;
|
| 125 |
-
listaFamilias.appendChild(li);
|
| 126 |
-
});
|
| 127 |
-
if (listaFamilias.childElementCount) resFamilias.classList.remove('hidden');
|
| 128 |
-
} else {
|
| 129 |
-
// Mostrar manejo por HbA1c
|
| 130 |
-
txtHbA1c.textContent = manejoHbA1c[hba1c] ?? '';
|
| 131 |
-
resHbA1c.classList.remove('hidden');
|
| 132 |
-
|
| 133 |
-
// Familias según HbA1c
|
| 134 |
-
(familiasPorClave[hba1c] ?? []).forEach(fam => {
|
| 135 |
-
const li = document.createElement('li');
|
| 136 |
-
li.textContent = fam;
|
| 137 |
-
listaFamilias.appendChild(li);
|
| 138 |
-
});
|
| 139 |
-
if (listaFamilias.childElementCount) resFamilias.classList.remove('hidden');
|
| 140 |
-
}
|
| 141 |
}
|
| 142 |
|
| 143 |
-
|
| 144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
|
| 146 |
-
|
| 147 |
-
|
| 148 |
</script>
|
| 149 |
</body>
|
| 150 |
</html>
|
|
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
<title>Algoritmo DM2 – Guía Clínica</title>
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link
|
| 9 |
+
rel="stylesheet"
|
| 10 |
+
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
| 11 |
+
/>
|
| 12 |
+
<link
|
| 13 |
+
href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap"
|
| 14 |
+
rel="stylesheet"
|
| 15 |
+
/>
|
| 16 |
+
<style>
|
| 17 |
+
body {
|
| 18 |
+
background-color: #f8fafc;
|
| 19 |
+
font-family: "Montserrat", sans-serif;
|
| 20 |
+
}
|
| 21 |
+
.custom-select {
|
| 22 |
+
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
|
| 23 |
+
background-position: right 0.5rem center;
|
| 24 |
+
background-repeat: no-repeat;
|
| 25 |
+
background-size: 1.5em 1.5em;
|
| 26 |
+
-webkit-appearance: none;
|
| 27 |
+
-moz-appearance: none;
|
| 28 |
+
appearance: none;
|
| 29 |
+
padding-right: 2.5rem;
|
| 30 |
+
width: 100%;
|
| 31 |
+
padding-top: 0.5rem;
|
| 32 |
+
padding-bottom: 0.5rem;
|
| 33 |
+
padding-left: 0.75rem;
|
| 34 |
+
border-radius: 0.375rem;
|
| 35 |
+
border: 1px solid #d1d5db;
|
| 36 |
+
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
| 37 |
+
transition: border-color 0.2s, box-shadow 0.2s;
|
| 38 |
+
font-size: 0.875rem;
|
| 39 |
+
line-height: 1.25rem;
|
| 40 |
+
}
|
| 41 |
+
.custom-select:focus {
|
| 42 |
+
outline: none;
|
| 43 |
+
border-color: #3b82f6;
|
| 44 |
+
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
|
| 45 |
+
}
|
| 46 |
+
#algo-display {
|
| 47 |
+
background-color: white;
|
| 48 |
+
border: 1px solid #e5e7eb;
|
| 49 |
+
border-radius: 0.5rem;
|
| 50 |
+
padding: 1.5rem;
|
| 51 |
+
margin-top: 1rem;
|
| 52 |
+
min-height: 300px;
|
| 53 |
+
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
|
| 54 |
+
overflow-y: auto;
|
| 55 |
+
line-height: 1.6;
|
| 56 |
+
}
|
| 57 |
+
</style>
|
| 58 |
</head>
|
| 59 |
+
<body class="min-h-screen bg-gray-50">
|
| 60 |
+
<div class="mx-auto max-w-2xl p-6 my-8 bg-white rounded-xl shadow-md">
|
| 61 |
+
<div class="text-center mb-6">
|
| 62 |
+
<h1 class="text-xl font-bold text-pink-800 flex items-center justify-center">
|
| 63 |
+
<i class="fas fa-syringe mr-3 text-teal-600"></i>Algoritmo Tratamiento DM2
|
| 64 |
+
</h1>
|
| 65 |
+
<p class="text-gray-600 mt-2 text-sm leading-relaxed">
|
| 66 |
+
Basado en redGDPS 2023 | Hospital de Alcañiz
|
| 67 |
+
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
</div>
|
| 69 |
|
| 70 |
+
<div
|
| 71 |
+
class="bg-pink-50 p-6 rounded-lg mb-6 border border-pink-100 shadow-inner space-y-4"
|
| 72 |
+
>
|
| 73 |
+
<!-- Condición clínica predominante -->
|
| 74 |
+
<div>
|
| 75 |
+
<label
|
| 76 |
+
for="conditionSelector"
|
| 77 |
+
class="block text-xs font-medium text-gray-600 mb-1"
|
| 78 |
+
>Condición clínica predominante (prioritario)</label
|
| 79 |
+
>
|
| 80 |
+
<select id="conditionSelector" class="custom-select text-sm">
|
| 81 |
+
<option value="">-- Ninguna / No aplica --</option>
|
| 82 |
+
<option value="ECV">Enfermedad cardiovascular (ASCVD)</option>
|
| 83 |
+
<option value="IC">Insuficiencia cardiaca</option>
|
| 84 |
+
<option value="ERC">Enfermedad renal crónica</option>
|
| 85 |
+
<option value="RCV">Elevado riesgo cardiovascular (≥3 FRCV)</option>
|
| 86 |
+
<option value="OB">Obesidad (IMC >35 kg/m<sup>2</sup>)</option>
|
| 87 |
+
<option value="FR">Fragilidad geriátrica</option>
|
| 88 |
+
</select>
|
| 89 |
+
</div>
|
| 90 |
+
|
| 91 |
+
<!-- Control glucémico -->
|
| 92 |
+
<div>
|
| 93 |
+
<label
|
| 94 |
+
for="controlSelector"
|
| 95 |
+
class="block text-xs font-medium text-gray-600 mb-1"
|
| 96 |
+
>Grado de control glucémico (HbA1c / GME)</label
|
| 97 |
+
>
|
| 98 |
+
<select id="controlSelector" class="custom-select text-sm">
|
| 99 |
+
<option value="">-- Seleccione HbA1c --</option>
|
| 100 |
+
<option value="<7">HbA1c <7 % (<154 mg/dl)</option>
|
| 101 |
+
<option value="7-9">HbA1c 7–9 % (154‑212 mg/dl)</option>
|
| 102 |
+
<option value=">9">HbA1c >9 % (>212 mg/dl)</option>
|
| 103 |
+
<option value="SYM">Hiperglucemia sintomática</option>
|
| 104 |
+
</select>
|
| 105 |
+
</div>
|
| 106 |
</div>
|
| 107 |
|
| 108 |
+
<!-- Resultado -->
|
| 109 |
+
<div id="algo-display" class="text-gray-800">
|
| 110 |
+
<div class="text-center py-10 text-gray-400">
|
| 111 |
+
<i class="fas fa-notes-medical text-4xl mb-3"></i>
|
| 112 |
+
<p>Seleccione una situación clínica y el grado de control.</p>
|
| 113 |
+
</div>
|
| 114 |
</div>
|
|
|
|
| 115 |
|
| 116 |
+
<!-- Enlace al PDF completo -->
|
| 117 |
+
<div class="text-center mt-6">
|
| 118 |
+
<a
|
| 119 |
+
href="./Algoritmo_DM2_ESP_2023.pdf"
|
| 120 |
+
target="_blank"
|
| 121 |
+
class="text-sm text-pink-700 hover:underline"
|
| 122 |
+
><i class="fas fa-file-pdf mr-1"></i>Ver algoritmo completo (PDF)</a
|
| 123 |
+
>
|
| 124 |
+
</div>
|
| 125 |
+
</div>
|
| 126 |
|
|
|
|
| 127 |
<script type="module">
|
| 128 |
+
// Mapas simplificados basados en redGDPS 2023
|
| 129 |
+
const conditionMap = {
|
| 130 |
+
ECV:
|
| 131 |
+
"Añada <span class=\"font-semibold\">iSGLT2</span> y/o <span class=\"font-semibold\">arGLP‑1</span> con evidencia en reducción de eventos cardiovasculares, independientemente de HbA1c. Considere mantener metformina si se tolera.",
|
| 132 |
+
IC:
|
| 133 |
+
"Priorice <span class=\"font-semibold\">iSGLT2</span> (dapagliflozina, empagliflozina) con o sin metformina. Evite tiazolidinedionas si IC avanzada. Valore añadir arGLP‑1 si HbA1c fuera de objetivo.",
|
| 134 |
+
ERC:
|
| 135 |
+
"Indique <span class=\"font-semibold\">iSGLT2</span> (FG ≥20 ml/min) y/o <span class=\"font-semibold\">arGLP‑1</span> (FG ≥15 ml/min). Ajuste/retire metformina si FG <45 ml/min.",
|
| 136 |
+
RCV:
|
| 137 |
+
"Si riesgo cardiovascular elevado, utilice <span class=\"font-semibold\">iSGLT2</span> y/o <span class=\"font-semibold\">arGLP‑1</span> con metformina como base.",
|
| 138 |
+
OB:
|
| 139 |
+
"Para IMC >35 kg/m<sup>2</sup> prefiera <span class=\"font-semibold\">arGLP‑1</span>; considere cirugía bariátrica. Valore iSGLT2 si esteatosis hepática.",
|
| 140 |
+
FR:
|
| 141 |
+
"Desintensifique o simplifique. Evite hipoglucemias. Prefiera <span class=\"font-semibold\">iDPP‑4</span>; considere retirar SU y repaglinida."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
};
|
| 143 |
|
| 144 |
+
const controlMap = {
|
| 145 |
+
"<7":
|
| 146 |
+
"Refuerce medidas no farmacológicas (alimentación, ejercicio, sueño) y mantenga <span class=\"font-semibold\">metformina</span> si se tolera. Reevaluar en 3–6 meses.",
|
| 147 |
+
"7-9":
|
| 148 |
+
"Inicie <span class=\"font-semibold\">terapia dual</span>: Metformina + otro ADNI según perfil (iSGLT2, arGLP‑1, iDPP‑4, pioglitazona o SU).",
|
| 149 |
+
">9":
|
| 150 |
+
"Considere <span class=\"font-semibold\">terapia triple</span> o <span class=\"font-semibold\">insulinización basal</span> si HbA1c >9 % pese a doble terapia.",
|
| 151 |
+
SYM:
|
| 152 |
+
"Ante síntomas cardinales (poliuria, polidipsia, pérdida de peso), inicie <span class=\"font-semibold\">insulina</span> ± metformina y añada arGLP‑1 o iSGLT2 según tolerancia."
|
| 153 |
};
|
| 154 |
|
| 155 |
+
// Diccionario de nombres de fármacos por familia
|
| 156 |
+
const drugFamilyNames = {
|
| 157 |
+
iSGLT2: [
|
| 158 |
+
"Dapagliflozina",
|
| 159 |
+
"Empagliflozina",
|
| 160 |
+
"Canagliflozina",
|
| 161 |
+
"Ertugliflozina"
|
| 162 |
+
],
|
| 163 |
+
"arGLP‑1": [
|
| 164 |
+
"Semaglutida",
|
| 165 |
+
"Liraglutida",
|
| 166 |
+
"Dulaglutida",
|
| 167 |
+
"Exenatida XR"
|
| 168 |
+
],
|
| 169 |
+
metformina: ["Metformina"],
|
| 170 |
+
"iDPP‑4": [
|
| 171 |
+
"Sitagliptina",
|
| 172 |
+
"Saxagliptina",
|
| 173 |
+
"Linagliptina",
|
| 174 |
+
"Alogliptina"
|
| 175 |
+
],
|
| 176 |
+
insulina: [
|
| 177 |
+
"Insulina glargina",
|
| 178 |
+
"Insulina degludec",
|
| 179 |
+
"Insulina detemir"
|
| 180 |
+
],
|
| 181 |
+
pioglitazona: ["Pioglitazona"],
|
| 182 |
+
SU: ["Gliclazida", "Glimepirida", "Glibenclamida"],
|
| 183 |
+
repaglinida: ["Repaglinida"]
|
| 184 |
};
|
| 185 |
|
| 186 |
+
const conditionSelector = document.getElementById("conditionSelector");
|
| 187 |
+
const controlSelector = document.getElementById("controlSelector");
|
| 188 |
+
const display = document.getElementById("algo-display");
|
| 189 |
+
|
| 190 |
+
function extractFamilies(text) {
|
| 191 |
+
const familiesFound = new Set();
|
| 192 |
+
Object.keys(drugFamilyNames).forEach((family) => {
|
| 193 |
+
// Buscar la palabra exacta (ignorando mayúsculas/minúsculas y signos especiales)
|
| 194 |
+
const regex = new RegExp(family.replace(/[-‑]/g, "[-‑]"), "i");
|
| 195 |
+
if (regex.test(text)) familiesFound.add(family);
|
| 196 |
+
});
|
| 197 |
+
return familiesFound;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
}
|
| 199 |
|
| 200 |
+
function buildDrugListHTML(families) {
|
| 201 |
+
let list = "<ul class='list-disc ml-4'>";
|
| 202 |
+
families.forEach((f) => {
|
| 203 |
+
const names = drugFamilyNames[f];
|
| 204 |
+
if (!names) return;
|
| 205 |
+
list += `<li><span class='font-semibold'>${f}:</span> ${names.join(", ")}</li>`;
|
| 206 |
+
});
|
| 207 |
+
list += "</ul>";
|
| 208 |
+
return list;
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
function updateDisplay() {
|
| 212 |
+
const cond = conditionSelector.value;
|
| 213 |
+
const ctrl = controlSelector.value;
|
| 214 |
+
|
| 215 |
+
console.log("Condición seleccionada:", cond);
|
| 216 |
+
console.log("Grado de control seleccionado:", ctrl);
|
| 217 |
+
|
| 218 |
+
let html = "";
|
| 219 |
+
let combinedText = ""; // Para extraer familias
|
| 220 |
+
|
| 221 |
+
if (cond && conditionMap[cond]) {
|
| 222 |
+
html += `<h2 class='text-base font-bold mb-2 text-pink-700'><i class='fas fa-stethoscope mr-2'></i>Manejo según condición clínica</h2><p class='mb-4'>${conditionMap[cond]}</p>`;
|
| 223 |
+
combinedText += conditionMap[cond] + " ";
|
| 224 |
+
console.log("Recomendaci��n condición:", conditionMap[cond]);
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
if (ctrl && controlMap[ctrl]) {
|
| 228 |
+
html += `<h2 class='text-base font-bold mb-2 text-pink-700'><i class='fas fa-vials mr-2'></i>Manejo según HbA1c / GME</h2><p class='mb-4'>${controlMap[ctrl]}</p>`;
|
| 229 |
+
combinedText += controlMap[ctrl] + " ";
|
| 230 |
+
console.log("Recomendación HbA1c:", controlMap[ctrl]);
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
// Tercer bloque: lista de fármacos sugeridos
|
| 234 |
+
const families = extractFamilies(combinedText);
|
| 235 |
+
console.log("Familias detectadas:", Array.from(families));
|
| 236 |
+
if (families.size) {
|
| 237 |
+
html += `<h2 class='text-base font-bold mb-2 text-pink-700'><i class='fas fa-pills mr-2'></i>Fármacos sugeridos</h2>${buildDrugListHTML(families)}`;
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
if (!html) {
|
| 241 |
+
html =
|
| 242 |
+
"<div class='text-center py-10 text-gray-400'><i class='fas fa-notes-medical text-4xl mb-3'></i><p>Seleccione una situación clínica y el grado de control.</p></div>";
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
display.innerHTML = html;
|
| 246 |
+
}
|
| 247 |
|
| 248 |
+
conditionSelector.addEventListener("change", updateDisplay);
|
| 249 |
+
controlSelector.addEventListener("change", updateDisplay);
|
| 250 |
</script>
|
| 251 |
</body>
|
| 252 |
</html>
|