Depression Severity Scale (PHQ-9)

Depression Severity Scale (PHQ-9)

A tool to help screen for depression severity.

Over the last 2 weeks, how often have you been bothered by any of the following problems?

Important Disclaimer: This tool is for informational screening purposes only and is based on the PHQ-9 questionnaire. It is not a substitute for a professional diagnosis. If you are concerned about your mental health, please consult a qualified healthcare provider.

Total Score (out of 27)

${interpretation}

${suicideWarning} `; resultsSection.classList.remove('hidden'); window.scrollTo(0, resultsSection.offsetTop - 20); }; // --- 6. PDF GENERATION --- const handlePdfDownload = () => { const { jsPDF } = window.jspdf; const contentToPrint = document.getElementById('printable-content'); const buttonContainer = document.getElementById('pdf-button-container'); if (!contentToPrint) return; buttonContainer.classList.add('hide-for-pdf'); html2canvas(contentToPrint, { scale: 2, useCORS: true }).then(canvas => { buttonContainer.classList.remove('hide-for-pdf'); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'portrait', unit: 'pt', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = pdf.internal.pageSize.getHeight(); const canvasWidth = canvas.width; const canvasHeight = canvas.height; const ratio = canvasWidth / pdfWidth; const calculatedHeight = canvasHeight / ratio; pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, calculatedHeight); pdf.save('Depression_Severity_Report.pdf'); }).catch(err => { buttonContainer.classList.remove('hide-for-pdf'); showError('An error occurred while generating the PDF.'); }); }; // --- 7. EVENT LISTENERS --- calculateBtn.addEventListener('click', calculateScore); downloadPdfBtn.addEventListener('click', handlePdfDownload); // --- INITIALIZE --- initQuestions(); });
Scroll to Top