diff --git a/MODELO_INGRESO.pdf b/MODELO_INGRESO.pdf index 5bd3402..f71baa5 100644 Binary files a/MODELO_INGRESO.pdf and b/MODELO_INGRESO.pdf differ diff --git a/src/sections/HistoriaClinica.tsx b/src/sections/HistoriaClinica.tsx index 1b1a125..f3e5449 100644 --- a/src/sections/HistoriaClinica.tsx +++ b/src/sections/HistoriaClinica.tsx @@ -112,6 +112,25 @@ function calcularEstadoLaboratorio(parametro: string, valor: string): 'Normal' | return 'Normal'; } +function wrapText(text: string, font: any, fontSize: number, maxWidth: number): string[] { + const words = text.split(' '); + const lines: string[] = []; + let currentLine = ''; + + for (const word of words) { + const testLine = currentLine ? `${currentLine} ${word}` : word; + const testWidth = font.widthOfTextAtSize(testLine, fontSize); + if (testWidth > maxWidth && currentLine) { + lines.push(currentLine); + currentLine = word; + } else { + currentLine = testLine; + } + } + if (currentLine) lines.push(currentLine); + return lines; +} + export function HistoriaClinica({ internacion, paciente, @@ -311,28 +330,104 @@ export function HistoriaClinica({