Prevalence of Psychiatric Morbidity, Stigma, and Quality of Life among Patients Attending the Dermatology Outpatient Department at a Tertiary Care Hospital prepare sociodemographic proforma for thesis for the above title of the study
| Serial No.: | _____________ |
| OPD Registration No.: | _____________ |
| Date of Interview: | _____________ |
| Interviewer's Name: | _____________ |
| Substance | Never | Currently Using | Past Use |
|---|---|---|---|
| Tobacco (smoking) | [ ] | [ ] | [ ] |
| Tobacco (smokeless/chewing) | [ ] | [ ] | [ ] |
| Alcohol | [ ] | [ ] | [ ] |
| Cannabis | [ ] | [ ] | [ ] |
| Other substances | [ ] | [ ] | [ ] |
| Tool | Administered | Score |
|---|---|---|
| Mini International Neuropsychiatric Interview (MINI) - for psychiatric diagnosis | [ ] Yes [ ] No | _____ |
| Patient Health Questionnaire (PHQ-9) - Depression | [ ] Yes [ ] No | _____ |
| Generalised Anxiety Disorder Scale (GAD-7) - Anxiety | [ ] Yes [ ] No | _____ |
| Dermatology Life Quality Index (DLQI) - QoL | [ ] Yes [ ] No | _____ |
| 6-item Stigma Scale / DESIS (Dermatology-specific stigma) | [ ] Yes [ ] No | _____ |
| Other (specify): _____________ | [ ] Yes [ ] No | _____ |
Create a Word document of this proforma for your thesis
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "Created workspace"
mkdir -p /tmp/workspace/sociodemographic-proforma && cat > /tmp/workspace/sociodemographic-proforma/create_proforma.py << 'PYEOF' from docx import Document from docx.shared import Pt, Inches, RGBColor, Cm from docx.enum.text import WD_ALIGN_PARAGRAPH from docx.enum.table import WD_TABLE_ALIGNMENT, WD_ALIGN_VERTICAL from docx.oxml.ns import qn from docx.oxml import OxmlElement import copy doc = Document() # ── Page margins ────────────────────────────────────────────── section = doc.sections[0] section.top_margin = Cm(2.5) section.bottom_margin = Cm(2.5) section.left_margin = Cm(3.0) section.right_margin = Cm(2.5) # ── Default Normal style ────────────────────────────────────── normal = doc.styles['Normal'] normal.font.name = 'Times New Roman' normal.font.size = Pt(11) def set_cell_bg(cell, hex_color): tc = cell._tc tcPr = tc.get_or_add_tcPr() shd = OxmlElement('w:shd') shd.set(qn('w:val'), 'clear') shd.set(qn('w:color'), 'auto') shd.set(qn('w:fill'), hex_color) tcPr.append(shd) def set_para_border_bottom(para): pPr = para._p.get_or_add_pPr() pBdr = OxmlElement('w:pBdr') bottom = OxmlElement('w:bottom') bottom.set(qn('w:val'), 'single') bottom.set(qn('w:sz'), '6') bottom.set(qn('w:space'), '1') bottom.set(qn('w:color'), '4472C4') pBdr.append(bottom) pPr.append(pBdr) def add_heading_styled(doc, text, level=1, color='1F3864'): p = doc.add_paragraph() p.alignment = WD_ALIGN_PARAGRAPH.LEFT run = p.add_run(text) run.bold = True if level == 0: run.font.size = Pt(13) run.font.color.rgb = RGBColor(0x1F, 0x38, 0x64) p.alignment = WD_ALIGN_PARAGRAPH.CENTER pPr = p._p.get_or_add_pPr() pBdr = OxmlElement('w:pBdr') for side in ['top','bottom']: el = OxmlElement(f'w:{side}') el.set(qn('w:val'), 'single') el.set(qn('w:sz'), '8') el.set(qn('w:space'), '4') el.set(qn('w:color'), '1F3864') pBdr.append(el) pPr.append(pBdr) elif level == 1: run.font.size = Pt(11) run.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) # Add shading via table trick: use a 1-cell table # Actually add directly with shading on paragraph — use a table row style # We'll use a 1-row 1-col table for section headings p._p.getparent().remove(p._p) tbl = doc.add_table(rows=1, cols=1) tbl.style = 'Table Grid' cell = tbl.cell(0, 0) cell.text = '' set_cell_bg(cell, '1F3864') run2 = cell.paragraphs[0].add_run(text) run2.bold = True run2.font.size = Pt(11) run2.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) run2.font.name = 'Times New Roman' cell.paragraphs[0].paragraph_format.space_before = Pt(3) cell.paragraphs[0].paragraph_format.space_after = Pt(3) cell.paragraphs[0].paragraph_format.left_indent = Pt(6) return tbl elif level == 2: run.font.size = Pt(11) run.font.color.rgb = RGBColor(0x1F, 0x38, 0x64) run.font.name = 'Times New Roman' set_para_border_bottom(p) p.paragraph_format.space_before = Pt(6) p.paragraph_format.space_after = Pt(2) return p def add_checkbox_item(doc, text, indent=True): p = doc.add_paragraph() if indent: p.paragraph_format.left_indent = Inches(0.3) p.paragraph_format.space_before = Pt(1) p.paragraph_format.space_after = Pt(1) run = p.add_run('\u2610 ' + text) run.font.name = 'Times New Roman' run.font.size = Pt(11) return p def add_field_line(doc, label, line_len=30): p = doc.add_paragraph() p.paragraph_format.left_indent = Inches(0.3) p.paragraph_format.space_before = Pt(2) p.paragraph_format.space_after = Pt(2) r1 = p.add_run(label + ': ') r1.font.name = 'Times New Roman' r1.font.size = Pt(11) r2 = p.add_run('_' * line_len) r2.font.name = 'Times New Roman' r2.font.size = Pt(11) return p def add_note(doc, text): p = doc.add_paragraph() p.paragraph_format.left_indent = Inches(0.2) p.paragraph_format.space_before = Pt(1) p.paragraph_format.space_after = Pt(1) run = p.add_run(text) run.font.name = 'Times New Roman' run.font.size = Pt(10) run.italic = True run.font.color.rgb = RGBColor(0x60, 0x60, 0x60) return p def para(doc, text, bold=False, size=11, indent=0.3, space_before=2, space_after=2, align=None): p = doc.add_paragraph() if align: p.alignment = align p.paragraph_format.left_indent = Inches(indent) p.paragraph_format.space_before = Pt(space_before) p.paragraph_format.space_after = Pt(space_after) run = p.add_run(text) run.bold = bold run.font.name = 'Times New Roman' run.font.size = Pt(size) return p # ════════════════════════════════════════════════ # TITLE PAGE AREA # ════════════════════════════════════════════════ p_title = doc.add_paragraph() p_title.alignment = WD_ALIGN_PARAGRAPH.CENTER p_title.paragraph_format.space_before = Pt(0) p_title.paragraph_format.space_after = Pt(4) r = p_title.add_run('SOCIODEMOGRAPHIC PROFORMA') r.bold = True r.font.size = Pt(15) r.font.name = 'Times New Roman' r.font.color.rgb = RGBColor(0x1F, 0x38, 0x64) p_sub = doc.add_paragraph() p_sub.alignment = WD_ALIGN_PARAGRAPH.CENTER p_sub.paragraph_format.space_before = Pt(0) p_sub.paragraph_format.space_after = Pt(2) rs = p_sub.add_run('Study Title:') rs.bold = True rs.font.size = Pt(10) rs.font.name = 'Times New Roman' rs.font.color.rgb = RGBColor(0x40, 0x40, 0x40) p_studytitle = doc.add_paragraph() p_studytitle.alignment = WD_ALIGN_PARAGRAPH.CENTER p_studytitle.paragraph_format.space_before = Pt(0) p_studytitle.paragraph_format.space_after = Pt(8) rt = p_studytitle.add_run( '"Prevalence of Psychiatric Morbidity, Stigma, and Quality of Life among Patients\n' 'Attending the Dermatology Outpatient Department at a Tertiary Care Hospital"' ) rt.bold = True rt.italic = True rt.font.size = Pt(11) rt.font.name = 'Times New Roman' rt.font.color.rgb = RGBColor(0x1F, 0x38, 0x64) # horizontal rule via border table hr_tbl = doc.add_table(rows=1, cols=1) hr_tbl.style = 'Table Grid' set_cell_bg(hr_tbl.cell(0,0), '1F3864') hr_tbl.cell(0,0).paragraphs[0].paragraph_format.space_before = Pt(1) hr_tbl.cell(0,0).paragraphs[0].paragraph_format.space_after = Pt(1) doc.add_paragraph().paragraph_format.space_after = Pt(4) # ════════════════════════════════════════════════ # SECTION A: ADMINISTRATIVE DETAILS # ════════════════════════════════════════════════ add_heading_styled(doc, 'SECTION A: ADMINISTRATIVE DETAILS', level=1) doc.add_paragraph().paragraph_format.space_after = Pt(2) admin_tbl = doc.add_table(rows=4, cols=4) admin_tbl.style = 'Table Grid' admin_data = [ ('Serial No.:', '________________', 'OPD Registration No.:', '________________'), ('Date of Interview:', '________________', 'Ward / OPD No.:', '________________'), ('Interviewer\'s Name:', '________________', 'Designation:', '________________'), ('Patient Code (for blinding):', '________________', '', ''), ] for i, row_data in enumerate(admin_data): row = admin_tbl.rows[i] for j, cell_text in enumerate(row_data): cell = row.cells[j] p = cell.paragraphs[0] run = p.add_run(cell_text) run.font.name = 'Times New Roman' run.font.size = Pt(10) if j % 2 == 0: run.bold = True cell.paragraphs[0].paragraph_format.space_before = Pt(3) cell.paragraphs[0].paragraph_format.space_after = Pt(3) if j % 2 == 0: set_cell_bg(cell, 'DDEEFF') doc.add_paragraph().paragraph_format.space_after = Pt(4) # ════════════════════════════════════════════════ # SECTION B: SOCIODEMOGRAPHIC VARIABLES # ════════════════════════════════════════════════ add_heading_styled(doc, 'SECTION B: SOCIODEMOGRAPHIC VARIABLES', level=1) doc.add_paragraph().paragraph_format.space_after = Pt(2) # Q1 Age add_heading_styled(doc, '1. Age', level=2) add_field_line(doc, 'Age in completed years', 10) # Q2 Gender add_heading_styled(doc, '2. Gender', level=2) for g in ['Male', 'Female', 'Transgender / Third gender']: add_checkbox_item(doc, g) # Q3 Marital Status add_heading_styled(doc, '3. Marital Status', level=2) for m in ['Unmarried', 'Married', 'Widowed', 'Divorced / Separated', 'Living together (cohabiting)']: add_checkbox_item(doc, m) # Q4 Religion add_heading_styled(doc, '4. Religion', level=2) for r in ['Hindu', 'Muslim', 'Christian', 'Sikh', 'Jain', 'Buddhist']: add_checkbox_item(doc, r) add_checkbox_item(doc, 'Others (specify): ____________________') # Q5 Domicile add_heading_styled(doc, '5. Domicile / Residence', level=2) for d in ['Urban', 'Semi-urban', 'Rural']: add_checkbox_item(doc, d) add_field_line(doc, 'Full Address / Area of Residence', 40) add_field_line(doc, 'Contact Number', 20) # Q6 Education add_heading_styled(doc, '6. Educational Qualification', level=2) for e in [ 'Illiterate (no formal schooling)', 'Primary (up to Class 5)', 'Middle (Class 6–8)', 'Secondary (Class 9–10 / Matriculation)', 'Higher Secondary (Class 11–12 / Intermediate)', 'Graduate', 'Postgraduate and above', 'Diploma / Vocational training', ]: add_checkbox_item(doc, e) # Q7 Occupation add_heading_styled(doc, '7. Occupational Status', level=2) for o in [ 'Unemployed (seeking work)', 'Homemaker / Housewife', 'Unskilled worker (daily wage, labourer)', 'Semi-skilled worker', 'Skilled worker / Artisan', 'Clerical / Shop owner / Farmer', 'Semi-professional', 'Professional (doctor, lawyer, engineer, etc.)', 'Student', 'Retired', ]: add_checkbox_item(doc, o) add_checkbox_item(doc, 'Others (specify): ____________________') # Q8 Income add_heading_styled(doc, '8. Monthly Family Income (in INR)', level=2) for i in ['Below ₹5,000', '₹5,001 – ₹10,000', '₹10,001 – ₹20,000', '₹20,001 – ₹30,000', '₹30,001 – ₹50,000', 'Above ₹50,000']: add_checkbox_item(doc, i) p_sec = doc.add_paragraph() p_sec.paragraph_format.left_indent = Inches(0.3) p_sec.paragraph_format.space_before = Pt(4) p_sec.paragraph_format.space_after = Pt(2) rb = p_sec.add_run('Socioeconomic Status (as per Modified Kuppuswamy / B.G. Prasad Scale):') rb.bold = True; rb.font.size = Pt(11); rb.font.name = 'Times New Roman' for s in ['Upper (Class I)', 'Upper Middle (Class II)', 'Middle (Class III)', 'Lower Middle (Class IV)', 'Lower (Class V)']: add_checkbox_item(doc, s) # Q9 Family type add_heading_styled(doc, '9. Type of Family', level=2) for f in ['Nuclear family', 'Joint family', 'Three-generation / Extended family', 'Single parent', 'Living alone']: add_checkbox_item(doc, f) # Q10 Family members add_heading_styled(doc, '10. Number of Family Members', level=2) p = doc.add_paragraph() p.paragraph_format.left_indent = Inches(0.3) p.paragraph_format.space_before = Pt(2) p.paragraph_format.space_after = Pt(2) for lbl in ['Total: ______', ' Adults: ______', ' Children (< 18 yrs): ______']: r = p.add_run(lbl + ' ') r.font.name = 'Times New Roman'; r.font.size = Pt(11) # ════════════════════════════════════════════════ # SECTION C: CLINICAL / DERMATOLOGICAL DETAILS # ════════════════════════════════════════════════ add_heading_styled(doc, 'SECTION C: CLINICAL / DERMATOLOGICAL DETAILS', level=1) doc.add_paragraph().paragraph_format.space_after = Pt(2) add_heading_styled(doc, '11. Chief Dermatological Complaint', level=2) for _ in range(2): add_field_line(doc, '', 70) add_heading_styled(doc, '12. Primary Diagnosis (confirmed by Dermatologist)', level=2) add_field_line(doc, 'Diagnosis', 50) add_heading_styled(doc, '13. Category of Skin Disease', level=2) for cat in [ 'Eczema / Dermatitis (Atopic, Contact, Seborrhoeic, etc.)', 'Psoriasis', 'Acne vulgaris / Acneiform eruptions', 'Vitiligo', 'Urticaria / Angioedema', 'Alopecia (Areata / Androgenetic / Telogen effluvium)', 'Fungal infections (Tinea, Candidiasis)', 'Bacterial skin infections', 'Sexually transmitted infections (STI)', 'Leprosy / Hansen\'s disease', 'Pruritus (primary / secondary)', 'Pigmentation disorders (Melasma, Post-inflammatory hyperpigmentation, etc.)', 'Pemphigus / Bullous disorders', 'Chronic Spontaneous Urticaria', ]: add_checkbox_item(doc, cat) add_checkbox_item(doc, 'Others (specify): ____________________') add_heading_styled(doc, '14. Duration of Current Skin Disease', level=2) for dur in ['< 1 month', '1 month – 6 months', '6 months – 1 year', '1 year – 5 years', '> 5 years']: add_checkbox_item(doc, dur) add_field_line(doc, 'Exact duration', 15) add_heading_styled(doc, '15. Visible / Cosmetically Disfiguring Lesion', level=2) p = doc.add_paragraph() p.paragraph_format.left_indent = Inches(0.3) p.paragraph_format.space_before = Pt(2) p.paragraph_format.space_after = Pt(2) r = p.add_run('\u2610 Yes \u2610 No') r.font.name = 'Times New Roman'; r.font.size = Pt(11) p2 = doc.add_paragraph() p2.paragraph_format.left_indent = Inches(0.3) p2.paragraph_format.space_before = Pt(2) p2.paragraph_format.space_after = Pt(2) rb2 = p2.add_run('Location of lesion (if visible):') rb2.bold = True; rb2.font.size = Pt(11); rb2.font.name = 'Times New Roman' for loc in ['Face / Neck', 'Scalp', 'Hands / Forearms', 'Trunk', 'Lower limbs', 'Genitalia / Groin', 'Generalised / Multiple sites']: add_checkbox_item(doc, loc) add_heading_styled(doc, '16. Course of the Disease', level=2) for c in ['Acute (< 6 weeks)', 'Chronic (> 6 weeks)', 'Relapsing / Remitting', 'Progressive']: add_checkbox_item(doc, c) add_heading_styled(doc, '17. Previous Treatment Taken', level=2) for t in [ 'No treatment taken', 'Over-the-counter / Self-medication', 'From a General Practitioner', 'From a Dermatologist', 'From alternative medicine (Ayurveda, Homeopathy, Unani, etc.)', ]: add_checkbox_item(doc, t) p_hosp = doc.add_paragraph() p_hosp.paragraph_format.left_indent = Inches(0.3) p_hosp.paragraph_format.space_before = Pt(2) p_hosp.paragraph_format.space_after = Pt(2) r = p_hosp.add_run('Previously hospitalized for skin disease: \u2610 Yes \u2610 No') r.font.name = 'Times New Roman'; r.font.size = Pt(11) add_heading_styled(doc, '18. Current Treatment', level=2) add_field_line(doc, 'Details', 50) add_heading_styled(doc, '19. Co-morbid Medical Conditions', level=2) for cm in ['None', 'Diabetes mellitus', 'Hypertension', 'Thyroid disorder', 'Autoimmune disorder']: add_checkbox_item(doc, cm) add_checkbox_item(doc, 'Others (specify): ____________________') # ════════════════════════════════════════════════ # SECTION D: PERSONAL & FAMILY PSYCHIATRIC HISTORY # ════════════════════════════════════════════════ add_heading_styled(doc, 'SECTION D: PERSONAL AND FAMILY PSYCHIATRIC HISTORY', level=1) doc.add_paragraph().paragraph_format.space_after = Pt(2) add_heading_styled(doc, '20. Past Psychiatric History', level=2) add_checkbox_item(doc, 'No psychiatric illness in the past') add_checkbox_item(doc, 'Previously diagnosed with: ____________________') p_psych = doc.add_paragraph() p_psych.paragraph_format.left_indent = Inches(0.3) p_psych.paragraph_format.space_before = Pt(2) p_psych.paragraph_format.space_after = Pt(2) r = p_psych.add_run('Previously on psychiatric medication: \u2610 Yes \u2610 No') r.font.name = 'Times New Roman'; r.font.size = Pt(11) p_hosp2 = doc.add_paragraph() p_hosp2.paragraph_format.left_indent = Inches(0.3) p_hosp2.paragraph_format.space_before = Pt(2) p_hosp2.paragraph_format.space_after = Pt(2) r2 = p_hosp2.add_run('Previously hospitalized for psychiatric illness: \u2610 Yes \u2610 No') r2.font.name = 'Times New Roman'; r2.font.size = Pt(11) add_heading_styled(doc, '21. Family History of Psychiatric Illness', level=2) p_fam = doc.add_paragraph() p_fam.paragraph_format.left_indent = Inches(0.3) p_fam.paragraph_format.space_before = Pt(2) p_fam.paragraph_format.space_after = Pt(2) r = p_fam.add_run('\u2610 No \u2610 Yes') r.font.name = 'Times New Roman'; r.font.size = Pt(11) add_field_line(doc, 'Relation', 20) add_field_line(doc, 'Diagnosis (if known)', 30) add_heading_styled(doc, '22. Family History of Skin Disease', level=2) p_fams = doc.add_paragraph() p_fams.paragraph_format.left_indent = Inches(0.3) p_fams.paragraph_format.space_before = Pt(2) p_fams.paragraph_format.space_after = Pt(2) r = p_fams.add_run('\u2610 No \u2610 Yes') r.font.name = 'Times New Roman'; r.font.size = Pt(11) add_field_line(doc, 'Relation', 20) add_field_line(doc, 'Diagnosis (if known)', 30) # ════════════════════════════════════════════════ # SECTION E: SUBSTANCE USE HISTORY # ════════════════════════════════════════════════ add_heading_styled(doc, 'SECTION E: SUBSTANCE USE HISTORY', level=1) doc.add_paragraph().paragraph_format.space_after = Pt(2) add_heading_styled(doc, '23. Substance Use (Current or Past)', level=2) sub_tbl = doc.add_table(rows=6, cols=4) sub_tbl.style = 'Table Grid' sub_headers = ['Substance', 'Never Used', 'Currently Using', 'Past Use (Not Current)'] for j, h in enumerate(sub_headers): cell = sub_tbl.cell(0, j) run = cell.paragraphs[0].add_run(h) run.bold = True; run.font.size = Pt(10); run.font.name = 'Times New Roman' set_cell_bg(cell, '1F3864') run.font.color.rgb = RGBColor(0xFF,0xFF,0xFF) cell.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER substances = [ 'Tobacco (smoking)', 'Tobacco (smokeless / chewing)', 'Alcohol', 'Cannabis', 'Other substances (specify)', ] for i, sub in enumerate(substances): row = sub_tbl.rows[i+1] row.cells[0].paragraphs[0].add_run(sub).font.size = Pt(10) row.cells[0].paragraphs[0].runs[-1].font.name = 'Times New Roman' for j in range(1,4): row.cells[j].paragraphs[0].add_run('\u2610').font.size = Pt(12) row.cells[j].paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER add_field_line(doc, 'If Alcohol – AUDIT Score', 10) add_field_line(doc, 'If Tobacco – Fagerstrom Score', 10) # ════════════════════════════════════════════════ # SECTION F: PSYCHOSOCIAL HISTORY # ════════════════════════════════════════════════ add_heading_styled(doc, 'SECTION F: PSYCHOSOCIAL HISTORY', level=1) doc.add_paragraph().paragraph_format.space_after = Pt(2) add_heading_styled(doc, '24. Significant Life Events in Past 6 Months (Stressors)', level=2) add_checkbox_item(doc, 'None') for ev in [ 'Bereavement / Death of a close one', 'Job loss / Financial crisis', 'Marital conflict / Separation', 'Physical illness in self or family member', 'Academic failure', ]: add_checkbox_item(doc, ev) add_checkbox_item(doc, 'Others (specify): ____________________') add_heading_styled(doc, '25. Perceived Social Support', level=2) p_ss = doc.add_paragraph() p_ss.paragraph_format.left_indent = Inches(0.3) p_ss.paragraph_format.space_before = Pt(2) p_ss.paragraph_format.space_after = Pt(2) r = p_ss.add_run('\u2610 Good \u2610 Moderate \u2610 Poor') r.font.name = 'Times New Roman'; r.font.size = Pt(11) add_note(doc, '(To be formally assessed with Multidimensional Scale of Perceived Social Support – MSPSS if included in the study)') add_heading_styled(doc, '26. Functional Impairment Due to Skin Disease', level=2) for fi in [ 'No impairment', 'Mild – does not significantly affect daily activities', 'Moderate – affects daily activities / social interactions', 'Severe – prevents routine functioning / employment / schooling', ]: add_checkbox_item(doc, fi) # ════════════════════════════════════════════════ # SECTION G: TOOLS TO BE ADMINISTERED # ════════════════════════════════════════════════ add_heading_styled(doc, 'SECTION G: TOOLS TO BE ADMINISTERED (Investigator\'s Use Only)', level=1) doc.add_paragraph().paragraph_format.space_after = Pt(2) tools_tbl = doc.add_table(rows=7, cols=3) tools_tbl.style = 'Table Grid' tools_headers = ['Assessment Tool', 'Administered', 'Score / Result'] for j, h in enumerate(tools_headers): cell = tools_tbl.cell(0, j) run = cell.paragraphs[0].add_run(h) run.bold = True; run.font.size = Pt(10); run.font.name = 'Times New Roman' set_cell_bg(cell, '1F3864') run.font.color.rgb = RGBColor(0xFF,0xFF,0xFF) cell.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER tools_data = [ 'Mini International Neuropsychiatric Interview (MINI) – Psychiatric diagnosis', 'Patient Health Questionnaire (PHQ-9) – Depression', 'Generalised Anxiety Disorder Scale (GAD-7) – Anxiety', 'Dermatology Life Quality Index (DLQI) – Quality of Life', 'Dermatology-specific Stigma Scale (DESIS / 6-item Stigma Scale)', 'Other (specify): ______________________________', ] for i, tool in enumerate(tools_data): row = tools_tbl.rows[i+1] row.cells[0].paragraphs[0].add_run(tool).font.size = Pt(10) row.cells[0].paragraphs[0].runs[-1].font.name = 'Times New Roman' row.cells[1].paragraphs[0].add_run('\u2610 Yes \u2610 No').font.size = Pt(10) row.cells[1].paragraphs[0].runs[-1].font.name = 'Times New Roman' row.cells[1].paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER row.cells[2].paragraphs[0].add_run('___________').font.size = Pt(10) row.cells[2].paragraphs[0].runs[-1].font.name = 'Times New Roman' row.cells[2].paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER # ════════════════════════════════════════════════ # SECTION H: INFORMED CONSENT # ════════════════════════════════════════════════ doc.add_paragraph().paragraph_format.space_after = Pt(4) add_heading_styled(doc, 'SECTION H: INFORMED CONSENT', level=1) doc.add_paragraph().paragraph_format.space_after = Pt(2) p_ic = doc.add_paragraph() p_ic.paragraph_format.left_indent = Inches(0.3) p_ic.paragraph_format.space_before = Pt(2) p_ic.paragraph_format.space_after = Pt(2) r = p_ic.add_run('Written Informed Consent obtained: \u2610 Yes \u2610 No') r.font.name = 'Times New Roman'; r.font.size = Pt(11) add_field_line(doc, 'Consent form serial number / code', 20) add_field_line(doc, 'IEC / Ethics Approval No.', 30) # ════════════════════════════════════════════════ # INVESTIGATOR REMARKS # ════════════════════════════════════════════════ doc.add_paragraph().paragraph_format.space_after = Pt(4) add_heading_styled(doc, "INVESTIGATOR'S REMARKS / ADDITIONAL OBSERVATIONS", level=1) doc.add_paragraph().paragraph_format.space_after = Pt(2) for _ in range(3): add_field_line(doc, '', 80) # Signature block doc.add_paragraph().paragraph_format.space_after = Pt(10) sig_tbl = doc.add_table(rows=2, cols=3) sig_tbl.style = 'Table Grid' sig_data = [ ('Signature of Investigator', 'Date', 'Supervisor\'s Initials'), ('_____________________', '_____________________', '_____________________'), ] for i, row_data in enumerate(sig_data): row = sig_tbl.rows[i] for j, text in enumerate(row_data): cell = row.cells[j] run = cell.paragraphs[0].add_run(text) run.font.name = 'Times New Roman' run.font.size = Pt(10) if i == 0: run.bold = True set_cell_bg(cell, 'DDEEFF') cell.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER cell.paragraphs[0].paragraph_format.space_before = Pt(5) cell.paragraphs[0].paragraph_format.space_after = Pt(5) # ════════════════════════════════════════════════ # NOTES FOR INVESTIGATOR # ════════════════════════════════════════════════ doc.add_paragraph().paragraph_format.space_after = Pt(6) add_heading_styled(doc, 'NOTES FOR THE INVESTIGATOR', level=1) doc.add_paragraph().paragraph_format.space_after = Pt(2) notes = [ '1. All information collected is strictly confidential and for research purposes only.', '2. Socioeconomic classification should follow the Modified Kuppuswamy Scale (updated for current year INR values).', '3. Skin disease categorisation must be confirmed with the treating dermatologist before data entry.', '4. Psychiatric diagnosis must be based on standardised tools (MINI / ICD-11 / DSM-5 criteria), not self-report alone.', '5. Proforma should be completed on the same day as the OPD visit wherever possible.', '6. If a patient declines any section, note it as "Refused" rather than leaving it blank.', '7. Scores from assessment tools (Section G) should be entered after administration, not during patient interview.', ] for note in notes: add_note(doc, note) # ════════════════════════════════════════════════ # SAVE # ════════════════════════════════════════════════ out_path = '/tmp/workspace/sociodemographic-proforma/Sociodemographic_Proforma_Psychiatry_Dermatology.docx' doc.save(out_path) print(f"Saved: {out_path}") PYEOF echo "Script written successfully"
cd /tmp/workspace/sociodemographic-proforma && python3 create_proforma.py 2>&1
python3 -c " from docx import Document doc = Document('/tmp/workspace/sociodemographic-proforma/Sociodemographic_Proforma_Psychiatry_Dermatology.docx') print(f'Paragraphs: {len(doc.paragraphs)}') print(f'Tables: {len(doc.tables)}') for i, p in enumerate(doc.paragraphs[:15]): if p.text.strip(): print(f' [{i}] {p.text[:80]}') "
Sociodemographic Proforma Psychiatry Dermatology
Word Document · DOCX
| Section | Content |
|---|---|
| A - Administrative Details | Serial No., OPD Reg. No., Date, Interviewer, Patient Code - formatted as a coloured table |
| B - Sociodemographic Variables | Age, Gender, Marital Status, Religion, Domicile, Education, Occupation, Monthly Income, Socioeconomic Status (Kuppuswamy), Family Type, Family Size |
| C - Dermatological Details | Chief complaint, Diagnosis, Disease category (14 options), Duration, Lesion visibility & location, Course, Treatment history, Co-morbidities |
| D - Psychiatric History | Personal past history, Family psychiatric history, Family skin disease history |
| E - Substance Use | Table format - Tobacco, Alcohol, Cannabis with Never/Current/Past columns + AUDIT & Fagerstrom score fields |
| F - Psychosocial History | Life stressors, Perceived social support, Functional impairment |
| G - Tools to be Administered | MINI, PHQ-9, GAD-7, DLQI, DESIS - administered/score table |
| H - Informed Consent | Consent, IEC approval number |
| Remarks & Signature Block | Investigator, date, supervisor initials |
| Investigator Notes | 7 numbered instructions |
Study of sociodemographic profile,psychiatric morbidity and impulsivity among deliberate self harm patients in a tertiary care hospital prepare a sociodemographic proforma for thesis according to above title of thesis
ls -la /tmp/workspace/ 2>/dev/null && echo "OK"
mkdir -p /tmp/workspace/dsh-proforma && cat > /tmp/workspace/dsh-proforma/create_dsh_proforma.py << 'PYEOF' from docx import Document from docx.shared import Pt, Inches, RGBColor, Cm from docx.enum.text import WD_ALIGN_PARAGRAPH from docx.oxml.ns import qn from docx.oxml import OxmlElement doc = Document() # ── Page margins ────────────────────────────────────────────── section = doc.sections[0] section.top_margin = Cm(2.5) section.bottom_margin = Cm(2.5) section.left_margin = Cm(3.0) section.right_margin = Cm(2.5) # ── Default Normal style ────────────────────────────────────── normal = doc.styles['Normal'] normal.font.name = 'Times New Roman' normal.font.size = Pt(11) # ── Helper functions ────────────────────────────────────────── def set_cell_bg(cell, hex_color): tc = cell._tc tcPr = tc.get_or_add_tcPr() shd = OxmlElement('w:shd') shd.set(qn('w:val'), 'clear') shd.set(qn('w:color'), 'auto') shd.set(qn('w:fill'), hex_color) tcPr.append(shd) def section_heading(doc, text): """Dark maroon banner heading for each section.""" tbl = doc.add_table(rows=1, cols=1) tbl.style = 'Table Grid' cell = tbl.cell(0, 0) set_cell_bg(cell, '7B0000') run = cell.paragraphs[0].add_run(text) run.bold = True run.font.size = Pt(11) run.font.name = 'Times New Roman' run.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) cell.paragraphs[0].paragraph_format.space_before = Pt(3) cell.paragraphs[0].paragraph_format.space_after = Pt(3) cell.paragraphs[0].paragraph_format.left_indent = Pt(6) doc.add_paragraph().paragraph_format.space_after = Pt(2) return tbl def subsection(doc, text): """Blue underlined subquestion heading.""" p = doc.add_paragraph() p.paragraph_format.left_indent = Inches(0.0) p.paragraph_format.space_before = Pt(5) p.paragraph_format.space_after = Pt(2) run = p.add_run(text) run.bold = True run.font.size = Pt(11) run.font.name = 'Times New Roman' run.font.color.rgb = RGBColor(0x1A, 0x37, 0x6C) # Bottom border pPr = p._p.get_or_add_pPr() pBdr = OxmlElement('w:pBdr') bottom = OxmlElement('w:bottom') bottom.set(qn('w:val'), 'single') bottom.set(qn('w:sz'), '4') bottom.set(qn('w:space'), '1') bottom.set(qn('w:color'), '7B0000') pBdr.append(bottom) pPr.append(pBdr) return p def chk(doc, text, indent=0.3): p = doc.add_paragraph() p.paragraph_format.left_indent = Inches(indent) p.paragraph_format.space_before = Pt(1) p.paragraph_format.space_after = Pt(1) run = p.add_run('\u2610 ' + text) run.font.name = 'Times New Roman' run.font.size = Pt(11) return p def field(doc, label, line_len=30, indent=0.3): p = doc.add_paragraph() p.paragraph_format.left_indent = Inches(indent) p.paragraph_format.space_before = Pt(2) p.paragraph_format.space_after = Pt(2) r1 = p.add_run(label + ': ' if label else '') r1.font.name = 'Times New Roman' r1.font.size = Pt(11) r1.bold = bool(label) r2 = p.add_run('_' * line_len) r2.font.name = 'Times New Roman' r2.font.size = Pt(11) return p def yesno(doc, label, indent=0.3): p = doc.add_paragraph() p.paragraph_format.left_indent = Inches(indent) p.paragraph_format.space_before = Pt(2) p.paragraph_format.space_after = Pt(2) r1 = p.add_run(label + ' ') r1.font.name = 'Times New Roman'; r1.font.size = Pt(11); r1.bold = True r2 = p.add_run('\u2610 Yes \u2610 No') r2.font.name = 'Times New Roman'; r2.font.size = Pt(11) return p def note(doc, text): p = doc.add_paragraph() p.paragraph_format.left_indent = Inches(0.3) p.paragraph_format.space_before = Pt(1) p.paragraph_format.space_after = Pt(1) run = p.add_run(text) run.font.name = 'Times New Roman' run.font.size = Pt(9.5) run.italic = True run.font.color.rgb = RGBColor(0x55, 0x55, 0x55) return p def inline_row(doc, items, indent=0.3): """Items is list of (label, line_len) pairs on same line.""" p = doc.add_paragraph() p.paragraph_format.left_indent = Inches(indent) p.paragraph_format.space_before = Pt(2) p.paragraph_format.space_after = Pt(2) for label, ll in items: r1 = p.add_run(label + ': ') r1.font.name = 'Times New Roman'; r1.font.size = Pt(11); r1.bold = True r2 = p.add_run('_'*ll + ' ') r2.font.name = 'Times New Roman'; r2.font.size = Pt(11) return p def spacer(doc, pt=4): p = doc.add_paragraph() p.paragraph_format.space_after = Pt(pt) return p # ════════════════════════════════════════════════════════════════ # TITLE BLOCK # ════════════════════════════════════════════════════════════════ p_title = doc.add_paragraph() p_title.alignment = WD_ALIGN_PARAGRAPH.CENTER r = p_title.add_run('SOCIODEMOGRAPHIC PROFORMA') r.bold = True; r.font.size = Pt(16); r.font.name = 'Times New Roman' r.font.color.rgb = RGBColor(0x7B, 0x00, 0x00) p_sub = doc.add_paragraph() p_sub.alignment = WD_ALIGN_PARAGRAPH.CENTER rs = p_sub.add_run('Study Title:') rs.bold = True; rs.font.size = Pt(10); rs.font.name = 'Times New Roman' rs.font.color.rgb = RGBColor(0x44, 0x44, 0x44) p_st = doc.add_paragraph() p_st.alignment = WD_ALIGN_PARAGRAPH.CENTER p_st.paragraph_format.space_after = Pt(6) rt = p_st.add_run( '"Study of Sociodemographic Profile, Psychiatric Morbidity and Impulsivity\n' 'among Deliberate Self Harm Patients in a Tertiary Care Hospital"' ) rt.bold = True; rt.italic = True; rt.font.size = Pt(11.5) rt.font.name = 'Times New Roman' rt.font.color.rgb = RGBColor(0x7B, 0x00, 0x00) # Divider table hr = doc.add_table(rows=1, cols=1) hr.style = 'Table Grid' set_cell_bg(hr.cell(0,0), '7B0000') hr.cell(0,0).paragraphs[0].paragraph_format.space_before = Pt(1) hr.cell(0,0).paragraphs[0].paragraph_format.space_after = Pt(1) spacer(doc, 6) # ════════════════════════════════════════════════════════════════ # SECTION A: ADMINISTRATIVE DETAILS # ════════════════════════════════════════════════════════════════ section_heading(doc, 'SECTION A: ADMINISTRATIVE DETAILS') adm = doc.add_table(rows=4, cols=4) adm.style = 'Table Grid' adm_data = [ ('Serial No.', '________________', 'IP / OPD Reg. No.', '________________'), ('Date of Interview', '________________', 'Ward / Unit', '________________'), ('Interviewer\'s Name', '________________', 'Designation', '________________'), ('Patient Code (blinded)', '________________', 'IEC / Ethics Ref. No.', '________________'), ] for i, row_data in enumerate(adm_data): row = adm.rows[i] for j, txt in enumerate(row_data): cell = row.cells[j] run = cell.paragraphs[0].add_run(txt) run.font.name = 'Times New Roman'; run.font.size = Pt(10) if j % 2 == 0: run.bold = True set_cell_bg(cell, 'F2DEDE') cell.paragraphs[0].paragraph_format.space_before = Pt(3) cell.paragraphs[0].paragraph_format.space_after = Pt(3) spacer(doc, 6) # ════════════════════════════════════════════════════════════════ # SECTION B: SOCIODEMOGRAPHIC VARIABLES # ════════════════════════════════════════════════════════════════ section_heading(doc, 'SECTION B: SOCIODEMOGRAPHIC VARIABLES') subsection(doc, '1. Age') inline_row(doc, [('Age in completed years', 8)]) subsection(doc, '2. Gender') for g in ['Male', 'Female', 'Transgender / Third gender']: chk(doc, g) subsection(doc, '3. Marital Status') for m in ['Never married (Single)', 'Married', 'Separated', 'Divorced', 'Widowed', 'Living together (cohabiting)']: chk(doc, m) subsection(doc, '4. Religion') for r in ['Hindu', 'Muslim', 'Christian', 'Sikh', 'Jain', 'Buddhist']: chk(doc, r) chk(doc, 'Others (specify): ____________________') subsection(doc, '5. Domicile / Residence') for d in ['Urban', 'Semi-urban', 'Rural']: chk(doc, d) field(doc, 'District / Area of Residence', 40) field(doc, 'Contact Number', 20) subsection(doc, '6. Educational Qualification') for e in [ 'Illiterate (no formal schooling)', 'Primary (up to Class 5)', 'Middle (Class 6–8)', 'Secondary (Class 9–10 / Matriculation)', 'Higher Secondary (Class 11–12 / Intermediate)', 'Graduate', 'Postgraduate and above', 'Diploma / Vocational training', ]: chk(doc, e) subsection(doc, '7. Occupational Status') for o in [ 'Unemployed (seeking work)', 'Homemaker / Housewife', 'Student', 'Unskilled worker (daily wage, labourer)', 'Semi-skilled worker', 'Skilled worker / Artisan', 'Clerical / Shop owner / Farmer', 'Semi-professional', 'Professional (doctor, lawyer, engineer, etc.)', 'Retired', ]: chk(doc, o) chk(doc, 'Others (specify): ____________________') subsection(doc, '8. Monthly Family Income (in INR)') for inc in ['Below ₹5,000', '₹5,001 – ₹10,000', '₹10,001 – ₹20,000', '₹20,001 – ₹30,000', '₹30,001 – ₹50,000', 'Above ₹50,000']: chk(doc, inc) p_ses = doc.add_paragraph() p_ses.paragraph_format.left_indent = Inches(0.3) p_ses.paragraph_format.space_before = Pt(4) p_ses.paragraph_format.space_after = Pt(2) rb = p_ses.add_run('Socioeconomic Status (Modified Kuppuswamy / B.G. Prasad Scale):') rb.bold = True; rb.font.size = Pt(11); rb.font.name = 'Times New Roman' for s in ['Upper (Class I)', 'Upper Middle (Class II)', 'Middle (Class III)', 'Lower Middle (Class IV)', 'Lower (Class V)']: chk(doc, s) subsection(doc, '9. Type of Family') for f in ['Nuclear', 'Joint', 'Three-generation / Extended', 'Single parent', 'Living alone']: chk(doc, f) subsection(doc, '10. Number of Family Members') inline_row(doc, [('Total', 6), ('Adults', 6), ('Children (< 18 yrs)', 6)]) subsection(doc, '11. Living Arrangement at Present') for la in ['With parents', 'With spouse', 'With spouse and children', 'With siblings', 'With extended family', 'In hostel / PG', 'Alone']: chk(doc, la) chk(doc, 'Others (specify): ____________________') # ════════════════════════════════════════════════════════════════ # SECTION C: CLINICAL DETAILS OF DSH EPISODE # ════════════════════════════════════════════════════════════════ section_heading(doc, 'SECTION C: CLINICAL DETAILS OF THE DSH EPISODE') subsection(doc, '12. Mode / Method of Deliberate Self Harm') for method in [ 'Poisoning – Organophosphate / Pesticide', 'Poisoning – Medication overdose (specify drug below)', 'Poisoning – Household chemical / Corrosive', 'Poisoning – Other (specify below)', 'Self-cutting / Laceration', 'Hanging (attempted)', 'Drowning (attempted)', 'Burns / Self-immolation', 'Jumping from height (attempted)', 'Blunt self-injury', ]: chk(doc, method) chk(doc, 'Others (specify): ____________________') field(doc, 'Drug / Substance name (if poisoning)', 35) subsection(doc, '13. Number of Previous DSH Episodes') for n in ['First episode (Index episode)', '2nd episode', '3rd episode', '4 or more episodes']: chk(doc, n) field(doc, 'Total number of previous episodes', 8) subsection(doc, '14. Intent of the Current DSH Episode') for intent in [ 'No intent to die (gesture / cry for help)', 'Ambivalent (unsure about intent to die)', 'Clear suicidal intent', 'To escape from an intolerable situation', 'To manipulate others / get attention', 'Unable to state / unclear', ]: chk(doc, intent) subsection(doc, '15. Precipitating / Triggering Factor for Current Episode') for pf in [ 'Interpersonal conflict (family)', 'Interpersonal conflict (partner / spouse)', 'Interpersonal conflict (other)', 'Academic failure / pressure', 'Financial crisis / debt', 'Job loss / unemployment', 'Physical illness (self or family member)', 'Substance intoxication at the time of act', 'Legal / criminal problem', 'Bereavement', 'Recent humiliation / abuse', 'No identifiable precipitant', ]: chk(doc, pf) chk(doc, 'Others (specify): ____________________') subsection(doc, '16. Lethality / Medical Severity of DSH Episode') for sev in ['Mild (required minor treatment)', 'Moderate (required hospital admission)', 'Severe (required ICU / emergency intervention)', 'Extreme (life-threatening / required resuscitation)']: chk(doc, sev) subsection(doc, '17. Was the Act Planned or Impulsive?') p_plan = doc.add_paragraph() p_plan.paragraph_format.left_indent = Inches(0.3) p_plan.paragraph_format.space_before = Pt(2) p_plan.paragraph_format.space_after = Pt(2) r = p_plan.add_run('\u2610 Planned (premeditated) \u2610 Impulsive (unplanned, spur of the moment)') r.font.name = 'Times New Roman'; r.font.size = Pt(11) subsection(doc, '18. Time Between Impulse / Decision and Act') for t in ['< 5 minutes', '5–30 minutes', '30 minutes – 2 hours', '2–24 hours', '> 24 hours']: chk(doc, t) subsection(doc, '19. Was Anyone Present at the Time of the Act?') p_pres = doc.add_paragraph() p_pres.paragraph_format.left_indent = Inches(0.3) p_pres.paragraph_format.space_before = Pt(2) p_pres.paragraph_format.space_after = Pt(2) r = p_pres.add_run('\u2610 Yes \u2610 No \u2610 Unknown / not disclosed') r.font.name = 'Times New Roman'; r.font.size = Pt(11) subsection(doc, '20. Did the Patient Seek Help After the Act?') p_help = doc.add_paragraph() p_help.paragraph_format.left_indent = Inches(0.3) p_help.paragraph_format.space_before = Pt(2) p_help.paragraph_format.space_after = Pt(2) r = p_help.add_run('\u2610 Yes – self-presented \u2610 Brought by family / others \u2610 No / found accidentally') r.font.name = 'Times New Roman'; r.font.size = Pt(11) subsection(doc, '21. History of Physical / Sexual Abuse') p_abuse = doc.add_paragraph() p_abuse.paragraph_format.left_indent = Inches(0.3) p_abuse.paragraph_format.space_before = Pt(2) p_abuse.paragraph_format.space_after = Pt(2) r = p_abuse.add_run('\u2610 None \u2610 Physical abuse \u2610 Sexual abuse \u2610 Emotional abuse \u2610 Multiple types') r.font.name = 'Times New Roman'; r.font.size = Pt(10) # ════════════════════════════════════════════════════════════════ # SECTION D: PSYCHIATRIC HISTORY # ════════════════════════════════════════════════════════════════ section_heading(doc, 'SECTION D: PSYCHIATRIC HISTORY') subsection(doc, '22. Past Psychiatric Diagnosis (if any)') chk(doc, 'No prior psychiatric diagnosis') for dx in [ 'Depressive disorder', 'Bipolar affective disorder', 'Schizophrenia / Psychotic disorder', 'Anxiety disorder', 'Personality disorder', 'Substance use disorder', 'Adjustment disorder', ]: chk(doc, dx) chk(doc, 'Others (specify): ____________________') yesno(doc, '23. Previously on psychiatric medication:') field(doc, ' If yes, specify medication', 35) yesno(doc, '24. Previous psychiatric hospitalization:') field(doc, ' If yes, number of times', 8) subsection(doc, '25. Family History of Psychiatric Illness') p_fpsy = doc.add_paragraph() p_fpsy.paragraph_format.left_indent = Inches(0.3) p_fpsy.paragraph_format.space_before = Pt(2) p_fpsy.paragraph_format.space_after = Pt(2) r = p_fpsy.add_run('\u2610 No \u2610 Yes') r.font.name = 'Times New Roman'; r.font.size = Pt(11) field(doc, 'Relation', 20) field(doc, 'Diagnosis (if known)', 30) subsection(doc, '26. Family History of Suicidal Behaviour / DSH') p_fsh = doc.add_paragraph() p_fsh.paragraph_format.left_indent = Inches(0.3) p_fsh.paragraph_format.space_before = Pt(2) p_fsh.paragraph_format.space_after = Pt(2) r = p_fsh.add_run('\u2610 No \u2610 Yes – completed suicide \u2610 Yes – attempted suicide / DSH') r.font.name = 'Times New Roman'; r.font.size = Pt(11) field(doc, 'Relation', 20) # ════════════════════════════════════════════════════════════════ # SECTION E: SUBSTANCE USE HISTORY # ════════════════════════════════════════════════════════════════ section_heading(doc, 'SECTION E: SUBSTANCE USE HISTORY') subsection(doc, '27. Current or Past Substance Use') sub_tbl = doc.add_table(rows=7, cols=5) sub_tbl.style = 'Table Grid' sub_headers = ['Substance', 'Never Used', 'Currently Using', 'Past Use\n(Not Current)', 'Age of Onset'] for j, h in enumerate(sub_headers): cell = sub_tbl.cell(0, j) run = cell.paragraphs[0].add_run(h) run.bold = True; run.font.size = Pt(9.5); run.font.name = 'Times New Roman' set_cell_bg(cell, '7B0000') run.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) cell.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER subs = ['Tobacco (smoking)', 'Tobacco (smokeless / chewing)', 'Alcohol', 'Cannabis', 'Opioids', 'Other (specify)'] for i, sub in enumerate(subs): row = sub_tbl.rows[i+1] row.cells[0].paragraphs[0].add_run(sub).font.size = Pt(10) row.cells[0].paragraphs[0].runs[-1].font.name = 'Times New Roman' for j in range(1, 4): row.cells[j].paragraphs[0].add_run('\u2610').font.size = Pt(12) row.cells[j].paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER row.cells[4].paragraphs[0].add_run('______').font.size = Pt(10) row.cells[4].paragraphs[0].runs[-1].font.name = 'Times New Roman' row.cells[4].paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER field(doc, 'If Alcohol – AUDIT Score', 10) field(doc, 'If Tobacco – Fagerstrom Score', 10) yesno(doc, '28. Was the patient intoxicated at the time of the DSH act?') # ════════════════════════════════════════════════════════════════ # SECTION F: MEDICAL HISTORY # ════════════════════════════════════════════════════════════════ section_heading(doc, 'SECTION F: MEDICAL AND NEUROLOGICAL HISTORY') subsection(doc, '29. Co-morbid Physical Illness') chk(doc, 'None') for cm in ['Chronic pain / Fibromyalgia', 'Epilepsy / Seizure disorder', 'Diabetes mellitus', 'Hypertension', 'Thyroid disorder', 'Malignancy / Cancer', 'HIV / Chronic infectious disease']: chk(doc, cm) chk(doc, 'Others (specify): ____________________') subsection(doc, '30. History of Head Injury / Neurological Disorder') p_head = doc.add_paragraph() p_head.paragraph_format.left_indent = Inches(0.3) p_head.paragraph_format.space_before = Pt(2) p_head.paragraph_format.space_after = Pt(2) r = p_head.add_run('\u2610 No \u2610 Yes (specify): ____________________________') r.font.name = 'Times New Roman'; r.font.size = Pt(11) # ════════════════════════════════════════════════════════════════ # SECTION G: PSYCHOSOCIAL HISTORY # ════════════════════════════════════════════════════════════════ section_heading(doc, 'SECTION G: PSYCHOSOCIAL HISTORY') subsection(doc, '31. Significant Life Events in Past 6 Months (Stressors)') chk(doc, 'None reported') for ev in [ 'Bereavement / Death of a close one', 'Marital conflict / Domestic violence', 'Separation / Divorce proceedings', 'Academic failure / Examination pressure', 'Job loss / Financial debt', 'Legal / Criminal problem', 'Physical / Sexual assault', 'Humiliation / Public shaming', ]: chk(doc, ev) chk(doc, 'Others (specify): ____________________') subsection(doc, '32. Perceived Social Support') p_ss = doc.add_paragraph() p_ss.paragraph_format.left_indent = Inches(0.3) p_ss.paragraph_format.space_before = Pt(2) p_ss.paragraph_format.space_after = Pt(2) r = p_ss.add_run('\u2610 Good \u2610 Moderate \u2610 Poor \u2610 Absent / None') r.font.name = 'Times New Roman'; r.font.size = Pt(11) note(doc, '(Formally assess with Multidimensional Scale of Perceived Social Support – MSPSS if included in study)') subsection(doc, '33. Recent Interpersonal Relationship Status') for rel in ['Stable and supportive', 'Strained / Conflicted', 'Recent loss of relationship', 'Not in a relationship', 'Refused to disclose']: chk(doc, rel) subsection(doc, '34. History of Childhood Adversity') for ca in ['None reported', 'Physical abuse in childhood', 'Sexual abuse in childhood', 'Emotional neglect', 'Parental loss / Separation', 'Poverty / Deprivation']: chk(doc, ca) # ════════════════════════════════════════════════════════════════ # SECTION H: TOOLS TO BE ADMINISTERED # ════════════════════════════════════════════════════════════════ section_heading(doc, 'SECTION H: ASSESSMENT TOOLS TO BE ADMINISTERED (Investigator\'s Use Only)') tools_tbl = doc.add_table(rows=9, cols=3) tools_tbl.style = 'Table Grid' tool_headers = ['Assessment Tool', 'Administered', 'Score / Result'] for j, h in enumerate(tool_headers): cell = tools_tbl.cell(0, j) run = cell.paragraphs[0].add_run(h) run.bold = True; run.font.size = Pt(10); run.font.name = 'Times New Roman' set_cell_bg(cell, '7B0000') run.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) cell.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER tools = [ 'Mini International Neuropsychiatric Interview (MINI) – Psychiatric diagnosis (ICD / DSM)', 'Columbia Suicide Severity Rating Scale (C-SSRS) – Suicidal ideation & behaviour', 'Beck Scale for Suicidal Ideation (BSS) – Severity of suicidal ideation', 'Barratt Impulsiveness Scale-11 (BIS-11) – Impulsivity assessment', 'Beck Depression Inventory-II (BDI-II) – Depression severity', 'Beck Hopelessness Scale (BHS) – Hopelessness', 'Presumptive Stressful Life Events Scale (PSLES) – Life events', 'Other (specify): ______________________________', ] for i, tool in enumerate(tools): row = tools_tbl.rows[i+1] row.cells[0].paragraphs[0].add_run(tool).font.size = Pt(9.5) row.cells[0].paragraphs[0].runs[-1].font.name = 'Times New Roman' row.cells[1].paragraphs[0].add_run('\u2610 Yes \u2610 No').font.size = Pt(10) row.cells[1].paragraphs[0].runs[-1].font.name = 'Times New Roman' row.cells[1].paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER row.cells[2].paragraphs[0].add_run('___________').font.size = Pt(10) row.cells[2].paragraphs[0].runs[-1].font.name = 'Times New Roman' row.cells[2].paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER spacer(doc, 4) # ════════════════════════════════════════════════════════════════ # SECTION I: INFORMED CONSENT # ════════════════════════════════════════════════════════════════ section_heading(doc, 'SECTION I: INFORMED CONSENT') p_ic = doc.add_paragraph() p_ic.paragraph_format.left_indent = Inches(0.0) p_ic.paragraph_format.space_before = Pt(2) p_ic.paragraph_format.space_after = Pt(2) r = p_ic.add_run('Written Informed Consent obtained: \u2610 Yes \u2610 No') r.font.name = 'Times New Roman'; r.font.size = Pt(11) p_guard = doc.add_paragraph() p_guard.paragraph_format.left_indent = Inches(0.0) p_guard.paragraph_format.space_before = Pt(2) p_guard.paragraph_format.space_after = Pt(2) r2 = p_guard.add_run('If patient unable to consent, guardian consent obtained: \u2610 Yes \u2610 No \u2610 N/A') r2.font.name = 'Times New Roman'; r2.font.size = Pt(11) field(doc, 'Consent form serial number / code', 25, indent=0.0) spacer(doc, 4) # ════════════════════════════════════════════════════════════════ # INVESTIGATOR REMARKS # ════════════════════════════════════════════════════════════════ section_heading(doc, "INVESTIGATOR'S REMARKS / CLINICAL OBSERVATIONS") for _ in range(3): field(doc, '', 85, indent=0.0) spacer(doc, 8) sig_tbl = doc.add_table(rows=2, cols=3) sig_tbl.style = 'Table Grid' sig_data_r = [ ('Signature of Investigator', 'Date of Interview', 'Supervisor\'s Initials'), ('_____________________', '_____________________', '_____________________'), ] for i, row_data in enumerate(sig_data_r): row = sig_tbl.rows[i] for j, text in enumerate(row_data): cell = row.cells[j] run = cell.paragraphs[0].add_run(text) run.font.name = 'Times New Roman'; run.font.size = Pt(10) if i == 0: run.bold = True set_cell_bg(cell, 'F2DEDE') cell.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER cell.paragraphs[0].paragraph_format.space_before = Pt(5) cell.paragraphs[0].paragraph_format.space_after = Pt(5) spacer(doc, 6) # ════════════════════════════════════════════════════════════════ # NOTES FOR INVESTIGATOR # ════════════════════════════════════════════════════════════════ section_heading(doc, 'NOTES FOR THE INVESTIGATOR') notes_list = [ '1. All information is strictly confidential and for research purposes only.', '2. "Deliberate Self Harm" (DSH) includes any intentional self-injurious act regardless of suicidal intent (ICD-10/11 definition).', '3. Psychiatric diagnosis must be established using MINI / DSM-5 / ICD-11 criteria – not clinical impression alone.', '4. Impulsivity must be formally assessed using the Barratt Impulsiveness Scale-11 (BIS-11); do not rate subjectively.', '5. Section C (DSH details) should be completed based on both patient self-report AND medical records.', '6. Socioeconomic status to be classified by the Modified Kuppuswamy Scale (update income cutoffs for current year).', '7. If the patient is in acute crisis or medically unstable, defer interview until clinical stabilisation.', '8. If any item is refused or inaccessible, record as "Refused" / "Not available" – do NOT leave blank.', '9. Guardian / caregiver interview may supplement patient self-report, especially for young patients or those with psychosis.', ] for n in notes_list: note(doc, n) # ════════════════════════════════════════════════════════════════ # SAVE # ════════════════════════════════════════════════════════════════ out_path = '/tmp/workspace/dsh-proforma/Sociodemographic_Proforma_DSH_Impulsivity.docx' doc.save(out_path) print(f"Saved: {out_path}") PYEOF echo "Script written."
cd /tmp/workspace/dsh-proforma && python3 create_dsh_proforma.py 2>&1
python3 -c " from docx import Document doc = Document('/tmp/workspace/dsh-proforma/Sociodemographic_Proforma_DSH_Impulsivity.docx') print(f'Paragraphs: {len(doc.paragraphs)}') print(f'Tables: {len(doc.tables)}') for p in doc.paragraphs[:20]: if p.text.strip(): print(f' {p.text[:90]}') "
Sociodemographic Proforma DSH Impulsivity
Word Document · DOCX
| Section | Content |
|---|---|
| A - Administrative Details | Serial No., IP/OPD Reg. No., Date, Ward, Interviewer, Patient Code, IEC Ref. No. - colour-coded table |
| B - Sociodemographic Variables | Age, Gender, Marital Status, Religion, Domicile, Education, Occupation, Monthly Income, SES (Kuppuswamy), Family type, Family size, Living arrangement |
| C - DSH Episode Details | Method of DSH (10 options), Number of previous episodes, Intent of act, Precipitating factors (12 options), Lethality / medical severity, Planned vs. impulsive, Time between impulse and act, Presence of others, Help-seeking, History of abuse |
| D - Psychiatric History | Past diagnoses, Previous medication, Previous hospitalization, Family psychiatric history, Family history of suicidal behaviour / DSH |
| E - Substance Use | 5-column table (substance, never, current, past, age of onset) for 6 substances + AUDIT / Fagerstrom scores + intoxication at time of act |
| F - Medical History | Co-morbid illnesses, Head injury / neurological disorder |
| G - Psychosocial History | Stressors (8 events), Perceived social support, Relationship status, Childhood adversity |
| H - Assessment Tools | MINI, C-SSRS, BIS-11 (impulsivity), BDI-II, BHS (hopelessness), BSS, PSLES - all in administered/score table |
| I - Consent + Remarks + Notes | Consent, guardian consent, remarks, signature block, 9 investigator notes |