Postnatal Care Sheet Generator

Postnatal Care Sheet Generator

Your generated care sheet. Configure details in the 'Configuration' tab. You can edit this text directly.


For ${motherName} & ${newbornName} (DOB: ${dob})

Mother's Care Checklist

${motherCareList}

Newborn's Care Checklist

${newbornCareList}

Important Contacts

${contactsList}
`; sheetOutput.innerHTML = html; } async function downloadPDF() { if (!sheetOutput.innerText.trim() || sheetOutput.innerText.includes("will be generated")) { alert("Please generate a care sheet before downloading."); return; } const { jsPDF } = window.jspdf; const pdf = new jsPDF('p', 'pt', 'a4'); pdfButton.innerText = 'Generating...'; pdfButton.disabled = true; try { sheetOutput.setAttribute('contenteditable', 'false'); const canvas = await html2canvas(sheetOutput, { scale: 2 }); sheetOutput.setAttribute('contenteditable', 'true'); const imgData = canvas.toDataURL('image/png'); const imgProps = pdf.getImageProperties(imgData); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = (imgProps.height * pdfWidth) / imgProps.width; pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight); pdf.save('postnatal_care_sheet.pdf'); } catch (error) { console.error("PNCG TOOL: PDF Generation Error - ", error); alert("An error occurred while generating the PDF."); } finally { pdfButton.innerText = 'Download Care Sheet (PDF)'; pdfButton.disabled = false; } } // --- Event Listeners --- addMotherItemBtn.addEventListener('click', () => addItem(motherCareContainer, 'e.g., Pain Management')); addNewbornItemBtn.addEventListener('click', () => addItem(newbornCareContainer, 'e.g., Feeding Schedule')); addContactItemBtn.addEventListener('click', () => addItem(contactsContainer, 'e.g., Pediatrician: 555-1234')); nextButton.addEventListener('click', () => { if (currentTabIndex === 0) pncg_showTab(1); }); prevButton.addEventListener('click', () => { if (currentTabIndex === 1) { generateSheet(); pncg_showTab(0); } }); pdfButton.addEventListener('click', downloadPDF); // --- Initial Setup --- dobInput.valueAsDate = new Date(); // Mother's Care ['Perineal Care (Sitz bath, peri bottle)', 'Monitor Bleeding (Lochia)', 'Pain Management (Take prescribed meds)', 'Breast Care / Nipple Cream', 'Stay Hydrated (Drink plenty of water)', 'Monitor Mood for Postpartum Depression signs', 'Postnatal Check-up scheduled for 6 weeks'].forEach(item => addItem(motherCareContainer, '', item)); // Newborn's Care ['Track Feedings (Time & Duration/Amount)', 'Count Wet & Soiled Diapers (6+ wet/day)', 'Umbilical Cord Care (Keep clean & dry)', 'Monitor for Jaundice (Yellow skin/eyes)', 'Tummy Time (Supervised, 5 mins)', 'Pediatrician Appointment scheduled for 3-5 days old'].forEach(item => addItem(newbornCareContainer, '', item)); // Contacts ['Pediatrician: 555-0101', 'OB-GYN: 555-0102', 'Lactation Consultant: 555-0103', 'Emergency Services: 911'].forEach(item => addItem(contactsContainer, '', item)); generateSheet(); pncg_showTab(0); }); window.pncg_openTab = function(evt, tabName) { const tabs = ['pncg-tab-dashboard', 'pncg-tab-config']; const newIndex = tabs.indexOf(tabName); if (newIndex === -1) return; const currentTabIndex = Array.from(document.querySelectorAll('.pncg-tab-button')).findIndex(b => b.classList.contains('pncg-active')); if (newIndex > currentTabIndex) { document.getElementById('pncg-next-button').click(); } else if (newIndex < currentTabIndex) { document.getElementById('pncg-prev-button').click(); } }; })();
Scroll to Top