mi-proyecto/app/templates/clinical_print_entry.html

2 lines
5.2 KiB
HTML

<!doctype html><html lang="es"><head><meta charset="utf-8"><title>Evolución clínica</title><style>.print-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;border-bottom:2px solid #0f172a;padding-bottom:12px;margin-bottom:16px}.print-brand{display:flex;align-items:center;gap:14px}.print-brand img{max-height:52px;max-width:120px;object-fit:contain}.print-brand h1{margin:0 0 6px}.print-meta{text-align:right}.institution{font-size:12px;color:#64748b} body{font-family:Arial,sans-serif;color:#1f2937;margin:0;padding:24px;background:#fff}h1,h2,h3{margin:0 0 8px} .sheet{max-width:1020px;margin:0 auto}.top{display:flex;justify-content:space-between;gap:20px;border-bottom:2px solid #0f172a;padding-bottom:12px;margin-bottom:16px}.block{border:1px solid #dbe4f0;border-radius:16px;padding:14px 16px;margin-bottom:14px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.tag{display:inline-block;background:#eef6ff;color:#1456a0;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:700;margin-right:6px;margin-bottom:6px}.small{font-size:12px;color:#64748b}.vitals{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.vitals div{border:1px solid #e5e7eb;border-radius:12px;padding:8px}.actions{display:none}@media print{body{padding:0}.sheet{max-width:none}}</style></head><body><div class="sheet"><div class="print-header"><div class="print-brand">{% if site_settings.logo_path %}<img src="{{ url_for('static', filename=site_settings.logo_path) }}" alt="Logo">{% endif %}<div><div class="institution">{{ site_settings.title or app_name }}</div><div><h1>Evolución médica</h1><div class="small">Legajo {{ record.legajo_number }} · Folio {{ entry.folio_number }}</div><div class="small">Fecha {{ entry.entry_datetime.strftime('%d/%m/%Y %H:%M') if entry.entry_datetime else '' }}</div></div></div></div><div class="print-meta"><div class="tag">{{ entry.encounter_type }}</div><div class="tag">{{ entry.entry_status }}</div><div class="tag">{{ entry.visibility_scope }}</div></div></div><div class="small">Formato institucional para uso sanatorial y archivo en historia clínica electrónica.</div><div class="grid"><div class="block"><h3>Paciente</h3><div><strong>{{ patient.nombre_completo }}</strong></div><div>DNI {{ patient.documento }}</div><div>Fecha nac. {{ patient.fecha_nacimiento or '—' }}</div><div>Obra social {{ patient.obra_social.denominacion if patient.obra_social else 'Particular' }}</div></div><div class="block"><h3>Profesional</h3><div><strong>{{ entry.professional.display_name if entry.professional else entry.signed_name }}</strong></div><div>{{ entry.specialty_name or '—' }}</div><div>CIE-10 {{ entry.cie10_code or '—' }}</div><div>SNOMED {{ entry.snomed_term or entry.snomed_code or '—' }}</div></div></div><div class="block"><h3>Motivo y diagnóstico</h3><div><strong>Motivo:</strong> {{ entry.chief_complaint or '—' }}</div><div><strong>Presuntivo:</strong> {{ entry.provisional_diagnosis or '—' }}</div><div><strong>Clínico:</strong> {{ entry.diagnosis_text or '—' }}</div></div><div class="small">Formato institucional para uso sanatorial y archivo en historia clínica electrónica.</div><div class="grid"><div class="block"><h3>Subjetivo</h3><div>{{ entry.subjective|safe if entry.subjective else '—' }}</div></div><div class="block"><h3>Objetivo</h3><div>{{ entry.objective|safe if entry.objective else '—' }}</div></div><div class="block"><h3>Valoración</h3><div>{{ entry.assessment|safe if entry.assessment else '—' }}</div></div><div class="block"><h3>Plan</h3><div>{{ entry.plan|safe if entry.plan else '—' }}</div></div></div><div class="block"><h3>Tratamiento y estudios</h3><div><strong>Indicaciones:</strong> {{ entry.treatment|safe if entry.treatment else '—' }}</div><div><strong>Estudios / resultados:</strong> {{ entry.study_results|safe if entry.study_results else '—' }}</div><div><strong>Consentimiento:</strong> {{ entry.consent_reference or '—' }}</div></div><div class="block"><h3>Signos vitales</h3><div class="vitals">{% for label, key in [('TA','bp'),('FC','hr'),('FR','rr'),('Temp','temp'),('SatO2','spo2'),('Glucemia','glucose'),('Peso','weight'),('Talla','height'),('IMC','bmi')] %}<div><div class="small">{{ label }}</div><strong>{{ entry.vitals_data.get(key) or '—' }}</strong></div>{% endfor %}</div></div><div class="block"><h3>Complemento por especialidad</h3>{% if entry.structured_data %}<ul>{% for key, value in entry.structured_data.items() if value %}<li><strong>{{ key.replace('_',' ')|capitalize }}:</strong> {{ value }}</li>{% endfor %}</ul>{% else %}<div>Sin datos complementarios.</div>{% endif %}</div><div class="block"><h3>Firma institucional y auditoría</h3><div><strong>Firmante:</strong> {{ entry.signature_data.signer or entry.signed_name or '—' }}</div><div><strong>Modo:</strong> {{ entry.signature_data.mode or 'Sin firma' }}</div><div><strong>Estado certificado:</strong> {{ entry.signature_data.certificate_status or '—' }}</div><div><strong>Serial:</strong> {{ entry.signature_data.serial or '—' }}</div><div><strong>Hash:</strong> {{ entry.signed_hash or '—' }}</div><div><strong>Registró:</strong> {{ entry.created_by_user.full_name if entry.created_by_user else '—' }}</div></div><script>window.print()</script></div></body></html>