Fix: PDF formulario de ingreso con nuevo diseño y encabezado
This commit is contained in:
@@ -347,36 +347,36 @@ export function HistoriaClinica({
|
||||
|
||||
const edad = paciente.fechaNacimiento ? calcularEdad(paciente.fechaNacimiento) : '';
|
||||
const fechaFormateada = internacion.fechaIngresoClinica ? formatDateDDMMYYYY(internacion.fechaIngresoClinica) : 'N/A';
|
||||
const fechaHospital = internacion.fechaIngresoHospital ? formatDateDDMMYYYY(internacion.fechaIngresoHospital) : '';
|
||||
|
||||
// Header
|
||||
page.drawRectangle({ x: 0, y: height - 80, width, height: 80, color: colorPrimary });
|
||||
page.drawText('FORMULARIO DE INGRESO', { x: 180, y: height - 45, size: 20, font: fontBold, color: rgb(1, 1, 1) });
|
||||
page.drawText('Historia Clínica Electrónica - Servicio de Clínica Médica', { x: 110, y: height - 65, size: 10, font, color: rgb(0.85, 0.85, 0.85) });
|
||||
page.drawText('Hospital Santojanni', { x: 50, y: height - 90, size: 9, font, color: colorGray });
|
||||
page.drawRectangle({ x: 0, y: height - 100, width, height: 100, color: colorPrimary });
|
||||
page.drawText('HOSPITAL DONACIÓN F. SANTOJANNI – DIVISIÓN CLÍNICA MÉDICA', { x: 60, y: height - 35, size: 14, font: fontBold, color: rgb(1, 1, 1) });
|
||||
page.drawText('HISTORIA CLÍNICA DE INGRESO', { x: 170, y: height - 55, size: 12, font: fontBold, color: rgb(1, 1, 1) });
|
||||
|
||||
let y = height - 125;
|
||||
let y = height - 140;
|
||||
|
||||
// Datos del Paciente
|
||||
// Datos Filiatorios
|
||||
page.drawRectangle({ x: 45, y: y - 8, width: 505, height: 24, color: colorLightGray });
|
||||
page.drawText('DATOS DEL PACIENTE', { x: 50, y: y, size: 12, font: fontBold, color: colorPrimary });
|
||||
page.drawText('DATOS FILIATORIOS', { x: 50, y: y, size: 12, font: fontBold, color: colorPrimary });
|
||||
y -= 35;
|
||||
|
||||
page.drawText('Cama:', { x: 50, y, size: 10, font: fontBold, color: colorGray });
|
||||
page.drawText(cama?.numero || 'N/A', { x: 120, y, size: 10, font, color: colorText });
|
||||
page.drawText('Fecha de Ingreso:', { x: 280, y, size: 10, font: fontBold, color: colorGray });
|
||||
page.drawText(fechaFormateada, { x: 390, y, size: 10, font, color: colorText });
|
||||
// Primera línea: Fechas y cama
|
||||
const fechaIngresoHospText = fechaHospital ? `Fecha ingreso al hospital: ${fechaHospital}` : '';
|
||||
const fechaIngresoClinText = fechaFormateada ? `Fecha ingreso a clínica: ${fechaFormateada}` : '';
|
||||
const camaText = `Cama: ${cama?.numero || 'N/A'}`;
|
||||
|
||||
page.drawText(fechaIngresoHospText, { x: 50, y, size: 10, font: fontBold, color: colorGray });
|
||||
page.drawText(fechaIngresoClinText, { x: 260, y, size: 10, font: fontBold, color: colorGray });
|
||||
y -= 18;
|
||||
page.drawText(camaText, { x: 50, y, size: 10, font: fontBold, color: colorGray });
|
||||
y -= 25;
|
||||
|
||||
page.drawText('Apellido:', { x: 50, y, size: 10, font: fontBold, color: colorGray });
|
||||
page.drawText(paciente.apellido || '', { x: 120, y, size: 10, font, color: colorText });
|
||||
page.drawText('Nombre:', { x: 280, y, size: 10, font: fontBold, color: colorGray });
|
||||
page.drawText(paciente.nombre || '', { x: 350, y, size: 10, font, color: colorText });
|
||||
y -= 25;
|
||||
|
||||
page.drawText('DNI:', { x: 50, y, size: 10, font: fontBold, color: colorGray });
|
||||
page.drawText(paciente.dni || '', { x: 120, y, size: 10, font, color: colorText });
|
||||
page.drawText('Edad:', { x: 280, y, size: 10, font: fontBold, color: colorGray });
|
||||
page.drawText(edad ? `${edad} años` : '', { x: 330, y, size: 10, font, color: colorText });
|
||||
// Segunda línea: Apellido, Nombre y DNI
|
||||
page.drawText(`Apellido y Nombre: ${paciente.apellido || ''}, ${paciente.nombre || ''}`, { x: 50, y, size: 10, font: fontBold, color: colorGray });
|
||||
y -= 18;
|
||||
page.drawText(`DNI: ${paciente.dni || ''}`, { x: 50, y, size: 10, font: fontBold, color: colorGray });
|
||||
page.drawText(`Edad: ${edad ? `${edad} años` : ''}`, { x: 280, y, size: 10, font: fontBold, color: colorGray });
|
||||
y -= 40;
|
||||
|
||||
// Datos Clínicos
|
||||
|
||||
Reference in New Issue
Block a user