Post-Surgery Rehabilitation Progress Tracker

Log your daily progress to track your recovery journey. You can download a summary to share with your healthcare provider.

5

Completed Exercises Today

No entries yet. Add one from the 'Log Today's Entry' tab.

`; return; } let tableHTML = ``; [...rehabData].reverse().forEach(entry => { // Show most recent first tableHTML += ``; }); tableHTML += `
Date Pain ROM (°) Notes
${new Date(entry.date).toLocaleDateString()} ${entry.pain} ${entry.rom} ${entry.notes || '-'}
`; container.innerHTML = tableHTML; } function downloadPdf() { const { jsPDF } = window.jspdf; const doc = new jsPDF(); // Header doc.setFontSize(22); doc.setFont('helvetica', 'bold'); doc.text('Rehabilitation Progress Report', 105, 20, { align: 'center' }); doc.setFontSize(11); doc.text(`Report Generated: ${new Date().toLocaleDateString()}`, 105, 28, { align: 'center' }); // Charts if (painChart && romChart) { doc.setFontSize(16); doc.text('Progress Charts', 14, 45); const painImg = painChart.toBase64Image(); const romImg = romChart.toBase64Image(); doc.addImage(painImg, 'PNG', 14, 50, 90, 60); doc.addImage(romImg, 'PNG', 108, 50, 90, 60); } // Log Table if (rehabData.length > 0) { doc.addPage(); doc.setFontSize(16); doc.text('Detailed Log Entries', 14, 20); const tableData = rehabData.map(entry => [ new Date(entry.date).toLocaleDateString(), entry.pain, entry.rom, entry.exercises.join(', ') || '-', entry.notes || '-' ]); doc.autoTable({ startY: 25, head: [['Date', 'Pain', 'ROM (°)', 'Exercises', 'Notes']], body: tableData, theme: 'grid', headStyles: { fillColor: [79, 70, 229] } }); } doc.save('Rehab-Progress-Report.pdf'); } // --- EVENT LISTENERS --- Object.keys(tabButtons).forEach(key => { tabButtons[key].addEventListener('click', () => switchTab(key)); }); painSlider.addEventListener('input', (e) => painDisplay.textContent = e.target.value); saveBtn.addEventListener('click', saveEntry); downloadBtn.addEventListener('click', downloadPdf); // --- INITIALIZATION --- document.getElementById('entry-date').valueAsDate = new Date(); populateExerciseChecklist(); populateExerciseGuide(); });
Scroll to Top