Carregando indicadores...
DASHBOARD ASSISTENCIAL

Indicadores de Conformidade

Monitoramento em tempo real dos bundles de prevenção — VAP, Quedas e Lesões por Pressão.

 Visão Geral — Todos os Protocolos
Total de registros
Broncoaspiração/VAP
Quedas avaliadas
Avaliações LPP
Bundle VAP ✓
Bundle SSKIN ✓
🫁
Broncoaspiração / VAP — Bundle de Prevenção
Adesão ao bundle VAP e conformidade dos 5 itens
Registros
Bundle VAP completo
Em VM
Cabeceira 30–45°
Higiene oral CHX
Pressão do cuff
Conformidade dos itens do Bundle VAP
Adesão por item (metas)
Aguardando dados...
🚶
Prevenção de Quedas — Escala de Morse
Estratificação de risco e taxa de ocorrência
Registros
Alto risco (Morse ≥ 45)
Risco médio (25–44)
Baixo risco (< 25)
Quedas ocorridas
Score médio Morse
Distribuição de risco — Escala de Morse
Scores de Morse individuais (últimos 20)
🩺
Lesão por Pressão — Escala de Braden / Bundle SSKIN
Estratificação de risco e conformidade do bundle
Registros
Risco grave (Braden ≤ 9)
Alto risco (10–12)
Bundle SSKIN completo
LPP presente
Score médio Braden
Distribuição de risco — Escala de Braden
Conformidade Bundle SSKIN por item
Aguardando dados...
🏥
Comparativo por Unidade
Volume de registros por hospital em todos os protocolos
`; const win = window.open('', '_blank'); if (!win) { alert('Pop-up bloqueado. Permita pop-ups para este site.'); return; } win.document.write(html); win.document.close(); } // ── RELATÓRIOS INDIVIDUAIS ──────────────────────────────────────── function getPeriodoLabel() { const ini = document.getElementById('dash-data-ini').value; const fim = document.getElementById('dash-data-fim').value; if (ini && fim) return `${new Date(ini+'T12:00').toLocaleDateString('pt-BR')} a ${new Date(fim+'T12:00').toLocaleDateString('pt-BR')}`; if (ini) return `A partir de ${new Date(ini+'T12:00').toLocaleDateString('pt-BR')}`; return new Date().toLocaleDateString('pt-BR', { month: 'long', year: 'numeric' }); } function gerarRelatorioVAP() { const h = document.getElementById('dash-hospital').value || 'Todas as Unidades'; const b = filtrar(_bronco); const periodo = getPeriodoLabel(); const gerado = new Date().toLocaleDateString('pt-BR') + ' às ' + new Date().toLocaleTimeString('pt-BR',{hour:'2-digit',minute:'2-digit'}); const COR = '#26215C'; const TEAL = '#0891b2'; const pct2 = (v,t) => t ? Math.round(v/t*100) : 0; const bN = b.length; const bBun = pct2(b.filter(r=>r.bundle_vap_realizado).length, bN); const bCab = pct2(b.filter(r=>r.bundle_vap_cabeceira).length, bN); const bHig = pct2(b.filter(r=>r.bundle_vap_higiene_oral).length, bN); const bCuff = pct2(b.filter(r=>r.bundle_vap_cuff).length, bN); const bPau = pct2(b.filter(r=>r.bundle_vap_pausa_sedacao).length, bN); const bSBT = pct2(b.filter(r=>r.bundle_vap_sbt).length, bN); const row = (l,v,m,ok) => `${l}${v}%${m}${ok?'✅ Meta':'⚠️ Abaixo'}`; const html = `Bundle VAP — ${h}
BUNDLE VAP — BRONCOASPIRAÇÃO

${h}

Período: ${periodo} | Gerado: ${gerado}
${bN}
Registros
${bBun}%
Bundle completo
${bCab}%
Cabeceira 30–45°
${bHig}%
Higiene oral
${bCuff}%
Pressão cuff

🫁 Conformidade do Bundle VAP

${row('Bundle VAP completo',bBun,'≥ 85%',bBun>=85)} ${row('Cabeceira elevada 30–45°',bCab,'≥ 95%',bCab>=95)} ${row('Higiene oral com clorexidina',bHig,'≥ 90%',bHig>=90)} ${row('Pressão do cuff verificada',bCuff,'≥ 90%',bCuff>=90)} ${row('Pausa diária de sedação',bPau,'≥ 80%',bPau>=80)} ${row('Teste respiração espontânea (SBT)',bSBT,'≥ 80%',bSBT>=80)}
IndicadorResultadoMetaStatus

Análise e Plano de Ação

`; const w = window.open('','_blank'); if (!w) { alert('Pop-up bloqueado'); return; } w.document.write(html); w.document.close(); } function gerarRelatorioQueda() { const h = document.getElementById('dash-hospital').value || 'Todas as Unidades'; const q = filtrar(_queda); const periodo = getPeriodoLabel(); const gerado = new Date().toLocaleDateString('pt-BR') + ' às ' + new Date().toLocaleTimeString('pt-BR',{hour:'2-digit',minute:'2-digit'}); const COR = '#92400E'; const AMBER = '#D97706'; const pct2 = (v,t) => t ? Math.round(v/t*100) : 0; const qN = q.length; const qAlto = q.filter(r=>r.morse_risco==='Alto'||Number(r.escala_morse)>=45).length; const qOc = pct2(q.filter(r=>r.ocorreu_queda).length, qN); const qMed = qN ? (q.reduce((s,r)=>s+Number(r.escala_morse||0),0)/qN).toFixed(1) : '—'; const row = (l,v,m,ok) => `${l}${v}${m}${ok?'✅ Meta':'⚠️ Abaixo'}`; const html = `Quedas — ${h}
PREVENÇÃO DE QUEDAS — ESCALA DE MORSE

${h}

Período: ${periodo} | Gerado: ${gerado}
${qN}
Registros
${pct2(qAlto,qN)}%
Alto risco (≥45)
${qOc}%
Quedas ocorridas
${qMed}
Score médio

🚶 Indicadores — Escala de Morse

${row('Taxa de quedas ocorridas',qOc+'%','≤ 10%',qOc<=10)} ${row('Pacientes alto risco identificados',pct2(qAlto,qN)+'%','100%',qAlto===qN||qN===0)}
IndicadorResultadoMetaStatus

Análise e Plano de Ação

`; const w = window.open('','_blank'); if (!w) { alert('Pop-up bloqueado'); return; } w.document.write(html); w.document.close(); } function gerarRelatorioLPP() { const h = document.getElementById('dash-hospital').value || 'Todas as Unidades'; const l = filtrar(_lpp); const periodo = getPeriodoLabel(); const gerado = new Date().toLocaleDateString('pt-BR') + ' às ' + new Date().toLocaleTimeString('pt-BR',{hour:'2-digit',minute:'2-digit'}); const COR = '#9D174D'; const PINK = '#BE185D'; const pct2 = (v,t) => t ? Math.round(v/t*100) : 0; const lN = l.length; const lBun = pct2(l.filter(r=>r.bundle_sskin_completo).length, lN); const lLPP = pct2(l.filter(r=>r.lpp_presente).length, lN); const lGrave= pct2(l.filter(r=>Number(r.escala_braden)<=9).length, lN); const lMed = lN ? (l.reduce((s,r)=>s+Number(r.escala_braden||0),0)/lN).toFixed(1) : '—'; const row = (l2,v,m,ok) => `${l2}${v}${m}${ok?'✅ Meta':'⚠️ Abaixo'}`; const html = `LPP — ${h}
LESÃO POR PRESSÃO — BUNDLE SSKIN / ESCALA DE BRADEN

${h}

Período: ${periodo} | Gerado: ${gerado}
${lN}
Registros
${lBun}%
Bundle SSKIN
${lLPP}%
LPP presente
${lGrave}%
Risco grave
${lMed}
Score médio Braden

🩺 Indicadores — Escala de Braden / Bundle SSKIN

${row('Bundle SSKIN completo',lBun+'%','≥ 85%',lBun>=85)} ${row('Prevalência de LPP',lLPP+'%','≤ 5%',lLPP<=5)} ${row('Risco grave identificado (Braden ≤9)',lGrave+'%','100%',true)}
IndicadorResultadoMetaStatus

Análise e Plano de Ação

`; const w = window.open('','_blank'); if (!w) { alert('Pop-up bloqueado'); return; } w.document.write(html); w.document.close(); } // ── EXPORTAR PPT ────────────────────────────────────────────────── async function exportarPPT(btn) { if (typeof PptxGenJS === 'undefined') { alert('Biblioteca PPT não carregada. Aguarde e tente novamente.'); return; } const orig = btn.innerHTML; btn.innerHTML = '⏳ Gerando...'; btn.disabled = true; try { const h = document.getElementById('dash-hospital').value || 'Todas as Unidades'; const b = filtrar(_bronco), q = filtrar(_queda), l = filtrar(_lpp); const periodo = new Date().toLocaleDateString('pt-BR', { month: 'long', year: 'numeric' }); const COR = '0A2463', TEAL = '0891B2', BRANCO = 'FFFFFF'; const pct2 = (v,t) => t ? Math.round(v/t*100) : 0; const pptx = new PptxGenJS(); pptx.layout = 'LAYOUT_WIDE'; // Slide 1 — Capa const s1 = pptx.addSlide(); s1.background = { color: COR }; s1.addText('❤️', { x:.2, y:.2, w:1, h:1, fontSize: 40, align:'center' }); s1.addText('QUALICORE', { x:.5, y:.2, w:12.3, h:.5, fontSize:10, bold:true, color:'BAE6FD', align:'center', charSpacing:3 }); s1.addText('Dashboard Assistencial', { x:.5, y:.9, w:12.3, h:.7, fontSize:22, bold:true, color:BRANCO, align:'center' }); s1.addText(`Indicadores de Conformidade — ${h}`, { x:.5, y:1.6, w:12.3, h:.5, fontSize:14, color:'94A3B8', align:'center' }); s1.addText(`Período: ${periodo}`, { x:.5, y:2.2, w:12.3, h:.4, fontSize:11, color:'64748B', align:'center' }); // Slide 2 — Visão Geral const s2 = pptx.addSlide(); s2.addText('Visão Geral — Todos os Protocolos', { x:.4, y:.15, w:12.3, h:.5, fontSize:16, bold:true, color:COR }); const kpisG = [ { v:b.length+q.length+l.length, l:'Total de registros' }, { v:b.length, l:'Broncoaspiração/VAP' }, { v:q.length, l:'Quedas avaliadas' }, { v:l.length, l:'Avaliações LPP' }, { v:b.length ? pct2(b.filter(r=>r.bundle_vap_realizado).length,b.length)+'%':'—', l:'Bundle VAP ✓' }, { v:l.length ? pct2(l.filter(r=>r.bundle_sskin_completo).length,l.length)+'%':'—', l:'Bundle SSKIN ✓' }, ]; kpisG.forEach((k,i) => { const bw = 2.0, x = .4 + i*bw; s2.addShape(pptx.ShapeType.roundRect, { x, y:.85, w:bw-.15, h:1.4, fill:{ color:'F0F9FF' }, rectRadius:.08 }); s2.addText(String(k.v), { x, y:.95, w:bw-.15, h:.7, fontSize:28, bold:true, color:TEAL, align:'center' }); s2.addText(k.l, { x, y:1.7, w:bw-.15, h:.4, fontSize:10, color:'475569', align:'center', wrap:true }); }); // Slide 3 — Bronco const s3 = pptx.addSlide(); s3.addText('🫁 Broncoaspiração / VAP — Bundle de Prevenção', { x:.4, y:.15, w:12.3, h:.5, fontSize:15, bold:true, color:COR }); if (b.length) { const bItems = [ { l:'Bundle VAP', v:pct2(b.filter(r=>r.bundle_vap_realizado).length,b.length), meta:85 }, { l:'Cabeceira 30–45°', v:pct2(b.filter(r=>r.cabeceira_elevada).length,b.length), meta:95 }, { l:'Higiene oral CHX', v:pct2(b.filter(r=>r.higiene_oral_realizada).length,b.length), meta:90 }, { l:'Pressão do cuff', v:pct2(b.filter(r=>r.pressao_cuff_verificada).length,b.length), meta:90 }, ]; bItems.forEach((item,i) => { const y = .85 + i*.55; const color = item.v>=item.meta ? '059669' : item.v>=item.meta*.8 ? 'D97706' : 'B91C1C'; s3.addText(item.l, { x:.4, y, w:3.5, h:.4, fontSize:11, color:'374151' }); s3.addText(item.v+'%', { x:3.9, y, w:1, h:.4, fontSize:11, bold:true, color }); s3.addShape(pptx.ShapeType.roundRect, { x:5.0, y:y+.1, w:7.3, h:.2, fill:{ color:'E2E8F0' }, rectRadius:.05 }); if (item.v>0) s3.addShape(pptx.ShapeType.roundRect, { x:5.0, y:y+.1, w:Math.max(.1,7.3*item.v/100), h:.2, fill:{ color }, rectRadius:.05 }); s3.addText(`Meta: ${item.meta}%`, { x:12.3, y, w:1.0, h:.4, fontSize:9, color:'94A3B8', align:'right' }); }); } else { s3.addText('Nenhum registro disponível', { x:.4, y:2, w:12.3, h:.5, fontSize:14, color:'94A3B8', align:'center' }); } // Slide 4 — Quedas + LPP const s4 = pptx.addSlide(); s4.addText('🚶 Prevenção de Quedas', { x:.4, y:.1, w:6, h:.4, fontSize:14, bold:true, color:COR }); s4.addText('🩺 Lesão por Pressão (LPP)', { x:6.8, y:.1, w:6, h:.4, fontSize:14, bold:true, color:COR }); if (q.length) { [ { l:'Alto risco', v:pct2(q.filter(r=>r.morse_risco==='Alto'||Number(r.escala_morse)>=45).length,q.length) }, { l:'Risco médio', v:pct2(q.filter(r=>r.morse_risco==='Médio').length,q.length) }, { l:'Quedas ocorridas', v:pct2(q.filter(r=>r.ocorreu_queda).length,q.length) }, ].forEach((item,i) => { const y = .7+i*.55; s4.addText(item.l, { x:.4, y, w:3, h:.4, fontSize:11, color:'374151' }); s4.addText(item.v+'%', { x:3.4, y, w:1, h:.4, fontSize:11, bold:true, color:'D97706' }); }); } if (l.length) { [ { l:'Bundle SSKIN', v:pct2(l.filter(r=>r.bundle_sskin_completo).length,l.length), meta:85 }, { l:'LPP presente', v:pct2(l.filter(r=>r.lpp_presente).length,l.length), meta:5, inverse:true }, { l:'Risco grave', v:pct2(l.filter(r=>Number(r.escala_braden)<=9).length,l.length) }, ].forEach((item,i) => { const y = .7+i*.55; const ok = item.inverse ? item.v<=item.meta : item.v>=(item.meta||0); s4.addText(item.l, { x:6.8, y, w:3.5, h:.4, fontSize:11, color:'374151' }); s4.addText(item.v+'%', { x:10.3, y, w:1, h:.4, fontSize:11, bold:true, color: ok?'059669':'B91C1C' }); }); } await pptx.writeFile({ fileName: `Dashboard_Assistencial_${h.replace(/\s/g,'_')}.pptx` }); } catch(e) { alert('Erro ao gerar PPT: ' + e.message); } btn.innerHTML = orig; btn.disabled = false; } // ── INIT ────────────────────────────────────────────────────────── window.addEventListener('scroll', () => { document.getElementById('navbar').classList.toggle('scrolled', window.scrollY > 50); }); document.getElementById('navToggle').addEventListener('click', () => { document.getElementById('navLinks').classList.toggle('open'); }); document.querySelectorAll('.nav-links a').forEach(a => a.addEventListener('click', () => document.getElementById('navLinks').classList.remove('open')) ); carregarDados();