Give a detailed overview of sexual dysfunctions, their etiological basis, psychological basis, presentation and a detailed management. Make it conceptual and easy to understand. Include relevant examples. Refer from standard textbooks, journals. Take aspects of management from Indian Psychiatric Society Clinical Practice Guidelines as well.
"sexual dysfunction" AND management
Indian Psychiatric Society Clinical Practice Guidelines sexual dysfunction
https://pmc.ncbi.nlm.nih.gov/articles/PMC5310110
| Phase | Male | Female |
|---|---|---|
| Desire/Arousal | Male Hypoactive Sexual Desire Disorder (MHSDD) | Female Sexual Interest/Arousal Disorder (FSIAD) |
| Arousal/Erection | Erectile Disorder (ED) | (incorporated into FSIAD) |
| Orgasm | Delayed Ejaculation (DE) | Female Orgasmic Disorder (FOD) |
| Ejaculation | Premature (Early) Ejaculation (PE) | - |
| Pain/Penetration | - | Genitopelvic Pain/Penetration Disorder (GPPPD) |
| Substance-induced | Substance/Medication-Induced Sexual Dysfunction | Same |
Example: A man who has never been able to maintain an erection from the time he became sexually active = Lifelong Erectile Disorder. A man who develops ED after starting an antihypertensive = Acquired Erectile Disorder (medication-induced, situational).
Clinical pearl: ED in a young man with no other apparent cause should trigger a cardiovascular workup. ED often precedes symptomatic coronary artery disease by 3-5 years - it is an early warning sign of systemic endothelial dysfunction.
| Drug Class | Effect |
|---|---|
| SSRIs/SNRIs | Impair all phases; sertraline, paroxetine, fluoxetine have highest rates (70-80%) |
| Antipsychotics | Via hyperprolactinemia; also sedation |
| Antihypertensives (beta-blockers, thiazides) | ED, decreased desire |
| Antiandrogens (spironolactone, finasteride) | Decreased desire, ED |
| Opioids | Decreased desire, ED (via hypogonadism) |
| Tobacco | Linear dose-response increase in ED |
| Alcohol | Moderate use may reduce ED; heavy use increases it and impairs orgasm |
Example: A man has one episode of ED after a stressful day at work. He is so worried it will happen again that the next time he attempts sex, he monitors himself constantly. The anxious observation itself prevents arousal - confirming his fear and worsening the cycle.
| Feature | Psychogenic | Organic |
|---|---|---|
| Onset | Sudden | Gradual, insidious |
| Morning/nocturnal erections | Preserved | Absent/reduced |
| Masturbatory erections | Preserved | Impaired |
| Situationality | Often situational | Usually global |
| Age/comorbidities | Younger, fewer comorbidities | Older, vascular risk factors |
Detailed history + physical exam + basic investigations
↓
Is the dysfunction due to poor sexual knowledge?
YES → Sex Education; Reassess
↓
Ascertain type + probable etiology
↓
Organic Mixed/Psychogenic
↓ ↓
Refer to Comorbid psychiatric disorder?
specialist ↓
YES → Treat comorbidity first
NO → Assess motivation
↓
Low motivation → Pharmacotherapy first
High motivation → Combined Pharm + Psychotherapy
| Drug | Dose | Onset | Duration | Notes |
|---|---|---|---|---|
| Sildenafil (Viagra) | 25-100 mg PRN | 30-60 min | 4-6 h | Affected by fatty meals |
| Tadalafil (Cialis) | 10-20 mg PRN; 2.5-5 mg daily | 30-60 min | 36 h | Can be taken daily |
| Vardenafil | 5-20 mg PRN | 30 min | 4-5 h | - |
| Avanafil | 50-200 mg PRN | 15-30 min | 6-12 h | Fastest onset |
| Dysfunction | Key Presentation | Main Etiology | First-line Management |
|---|---|---|---|
| MHSDD | Low desire, absent fantasies | Testosterone deficiency, depression, relationship issues | Treat comorbidity; testosterone if deficient; couple therapy |
| FSIAD | Low interest + arousal | Post-menopause, OCP, depression, trauma | Psychotherapy, mindfulness; flibanserin/bremelanotide if HSDD |
| Erectile Disorder | Failure to obtain/maintain erection | Vasculogenic > neurogenic > endocrine | PDE-5 inhibitors; address CVD risk factors; sensate focus |
| Premature Ejaculation | Ejaculation within ~1 minute | Psychogenic (mainly); thyroid dysfunction | SSRIs (paroxetine); dapoxetine on-demand; squeeze technique |
| Delayed Ejaculation | Cannot ejaculate with partner | SSRIs, antipsychotics, psychogenic | Switch/reduce offending drug; stop-start technique; psychotherapy |
| FOD | Absent/delayed/reduced orgasm | SSRIs, inadequate stimulation, trauma | Directed masturbation; reduce/switch SSRI; psychoeducation |
| GPPPD/Vaginismus | Pain, spasm, fear of penetration | Atrophy, trauma, conditioned anxiety | Dilators + CBT + pelvic floor PT; topical estrogen |
Create a quick-reference PDF guide for diagnostic criteria and first-line management of each dysfunction
ls -la /tmp/workspace/ 2>/dev/null || echo "workspace empty or missing"
mkdir -p /tmp/workspace/sexual-dysfunction-guide
~/sexual-dysfunction-guide/build_guide.py
"""
Quick-Reference PDF Guide: Sexual Dysfunctions
Diagnostic Criteria & First-Line Management
Uses reportlab for a clean, clinical-style layout.
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether, PageBreak
)
from reportlab.platypus.flowables import BalancedColumns
from reportlab.lib.colors import HexColor, white, black
import os
OUTPUT_PATH = "/tmp/workspace/sexual-dysfunction-guide/Sexual_Dysfunction_Quick_Reference.pdf"
# ── Colour palette ──────────────────────────────────────────────────────────
C_NAVY = HexColor("#1A2E4A") # header background
C_TEAL = HexColor("#1B7A8A") # section headers
C_LIGHT_BLUE= HexColor("#D6EAF0") # table row alt
C_MINT = HexColor("#E8F5F2") # management cell bg
C_AMBER = HexColor("#FFF3CD") # DSM criteria cell bg
C_ORANGE = HexColor("#E07B39") # accent strip
C_GREY_LIGHT= HexColor("#F4F6F8")
C_GREY = HexColor("#7F8C8D")
C_RED_SOFT = HexColor("#F9EBEA")
C_GREEN_SOFT= HexColor("#EAF7F0")
# ── Document setup ───────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
OUTPUT_PATH,
pagesize=A4,
leftMargin=15*mm,
rightMargin=15*mm,
topMargin=18*mm,
bottomMargin=18*mm,
title="Sexual Dysfunctions – Quick Reference Guide",
author="Orris Medical Reference",
subject="Psychiatry – Sexual Dysfunctions"
)
W = A4[0] - 30*mm # usable page width
# ── Styles ───────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, **kw)
sTitle = S("sTitle", fontName="Helvetica-Bold", fontSize=20, textColor=white, alignment=TA_CENTER, spaceAfter=2)
sSubtitle = S("sSubtitle", fontName="Helvetica", fontSize=10, textColor=HexColor("#BDC8D8"), alignment=TA_CENTER)
sSectionH = S("sSectionH", fontName="Helvetica-Bold", fontSize=12, textColor=white, spaceBefore=6, spaceAfter=3)
sDxHead = S("sDxHead", fontName="Helvetica-Bold", fontSize=10, textColor=C_NAVY, spaceBefore=4, spaceAfter=2)
sBody = S("sBody", fontName="Helvetica", fontSize=8.5,leading=12, textColor=HexColor("#2C3E50"), spaceAfter=2)
sBold = S("sBold", fontName="Helvetica-Bold", fontSize=8.5,leading=12, textColor=C_NAVY)
sBullet = S("sBullet", fontName="Helvetica", fontSize=8, leading=11, textColor=HexColor("#2C3E50"), leftIndent=8, bulletIndent=0)
sSmall = S("sSmall", fontName="Helvetica-Oblique",fontSize=7.5,textColor=C_GREY, spaceAfter=1)
sLabel = S("sLabel", fontName="Helvetica-Bold", fontSize=7.5,textColor=C_TEAL, spaceAfter=1)
sFooter = S("sFooter", fontName="Helvetica-Oblique",fontSize=7, textColor=C_GREY, alignment=TA_CENTER)
sWarning = S("sWarning", fontName="Helvetica-Bold", fontSize=8, textColor=HexColor("#8B0000"))
sTableHdr = S("sTableHdr", fontName="Helvetica-Bold", fontSize=8, textColor=white, alignment=TA_CENTER)
sTableCell= S("sTableCell",fontName="Helvetica", fontSize=8, leading=10, textColor=HexColor("#2C3E50"))
sTableBold= S("sTableBold",fontName="Helvetica-Bold", fontSize=8, leading=10, textColor=C_NAVY)
def P(text, style=sBody):
return Paragraph(text, style)
def B(text):
return P(text, sBold)
def bullet(items, style=sBullet):
return [P(f"• {i}", style) for i in items]
def HR(color=C_TEAL, thickness=0.8):
return HRFlowable(width="100%", thickness=thickness, color=color, spaceAfter=4, spaceBefore=2)
def spacer(h=4):
return Spacer(1, h*mm)
# ── Page header/footer callbacks ─────────────────────────────────────────────
def on_page(canvas, doc):
canvas.saveState()
# Footer
canvas.setFont("Helvetica-Oblique", 7)
canvas.setFillColor(C_GREY)
canvas.drawString(15*mm, 10*mm, "Quick-Reference Guide | Sexual Dysfunctions | DSM-5 / IPS CPG 2017")
canvas.drawRightString(A4[0]-15*mm, 10*mm, f"Page {doc.page}")
# Thin top rule on pages > 1
if doc.page > 1:
canvas.setStrokeColor(C_TEAL)
canvas.setLineWidth(0.5)
canvas.line(15*mm, A4[1]-13*mm, A4[0]-15*mm, A4[1]-13*mm)
canvas.restoreState()
# ═══════════════════════════════════════════════════════════════════════════════
# CONTENT BUILDER
# ═══════════════════════════════════════════════════════════════════════════════
story = []
# ── COVER HEADER BLOCK ────────────────────────────────────────────────────────
cover_data = [[
P("SEXUAL DYSFUNCTIONS", sTitle),
]]
cover_table = Table([[P("SEXUAL DYSFUNCTIONS", sTitle)]], colWidths=[W])
cover_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), C_NAVY),
("ROWPADDING", (0,0), (-1,-1), 10),
("TOPPADDING", (0,0), (-1,-1), 14),
("BOTTOMPADDING",(0,0),(-1,-1),6),
("ROUNDEDCORNERS",[4]),
]))
story.append(cover_table)
subtitle_data = [[P("Quick-Reference Guide | Diagnostic Criteria & First-Line Management", sSubtitle)]]
sub_table = Table(subtitle_data, colWidths=[W])
sub_table.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), C_TEAL),
("ROWPADDING", (0,0),(-1,-1), 5),
]))
story.append(sub_table)
story.append(spacer(3))
# Source line
story.append(P("Based on: DSM-5 | ICD-10/11 | Kaplan & Sadock's Comprehensive Textbook of Psychiatry (10th ed.) | IPS Clinical Practice Guidelines 2017 (Avasthi et al.)", sSmall))
story.append(HR(C_ORANGE, 1.2))
story.append(spacer(2))
# ── CLASSIFICATION TABLE ───────────────────────────────────────────────────────
def section_header(text):
t = Table([[P(f" {text}", sSectionH)]], colWidths=[W])
t.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), C_TEAL),
("ROWPADDING", (0,0),(-1,-1), 5),
("ROUNDEDCORNERS",[3]),
]))
return t
story.append(section_header("CLASSIFICATION (DSM-5)"))
story.append(spacer(2))
cls_headers = ["Phase", "Male", "Female", "Both Sexes"]
cls_data = [
[P(h, sTableHdr) for h in cls_headers],
[P("Desire / Interest", sTableBold), P("Male HSDD (MHSDD)", sTableCell),
P("Female Sexual Interest/Arousal Disorder (FSIAD)", sTableCell), P("—", sTableCell)],
[P("Arousal / Erection", sTableBold), P("Erectile Disorder (ED)", sTableCell),
P("(merged into FSIAD in DSM-5)", sTableCell), P("—", sTableCell)],
[P("Orgasm", sTableBold), P("Delayed Ejaculation (DE)", sTableCell),
P("Female Orgasmic Disorder (FOD)", sTableCell), P("—", sTableCell)],
[P("Ejaculation", sTableBold), P("Premature Ejaculation (PE)", sTableCell),
P("—", sTableCell), P("—", sTableCell)],
[P("Pain / Penetration", sTableBold), P("—", sTableCell),
P("Genitopelvic Pain/Penetration Disorder (GPPPD)", sTableCell), P("—", sTableCell)],
[P("Substance/Med-induced", sTableBold), P("Any phase", sTableCell),
P("Any phase", sTableCell), P("Substance/Medication-\nInduced SD", sTableCell)],
]
cls_col = [28*mm, 43*mm, 68*mm, 36*mm]
cls_table = Table(cls_data, colWidths=cls_col)
cls_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), C_NAVY),
("BACKGROUND", (0,1), (-1,1), C_LIGHT_BLUE),
("BACKGROUND", (0,2), (-1,2), white),
("BACKGROUND", (0,3), (-1,3), C_LIGHT_BLUE),
("BACKGROUND", (0,4), (-1,4), white),
("BACKGROUND", (0,5), (-1,5), C_LIGHT_BLUE),
("BACKGROUND", (0,6), (-1,6), white),
("GRID", (0,0), (-1,-1), 0.5, HexColor("#BBCDD8")),
("ROWPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("FONTSIZE", (0,0), (-1,-1), 8),
]))
story.append(cls_table)
story.append(spacer(2))
story.append(P("Specifiers (all disorders): <b>Lifelong vs. Acquired</b> | <b>Generalized vs. Situational</b> | Severity: Mild / Moderate / Severe | Duration: ≥ 6 months | Distress criterion required", sSmall))
story.append(spacer(4))
# ═══════════════════════════════════════════════════════════════════════════════
# DYSFUNCTION CARDS
# ═══════════════════════════════════════════════════════════════════════════════
def card(
number, name, code_dsm, code_icd,
dx_criteria, # list of strings
key_features, # list of strings
etiology_org, # list of strings
etiology_psy, # list of strings
first_line_pharm, # list of (drug, detail) tuples
first_line_nonpharm,# list of strings
red_flags=None, # list of strings or None
note=None
):
"""Build a KeepTogether card for one dysfunction."""
elements = []
# ── Card title bar
title_row = [[
P(f" {number}. {name}", S("ct", fontName="Helvetica-Bold", fontSize=11,
textColor=white, leading=14)),
P(f"DSM-5: {code_dsm} | ICD-10: {code_icd}",
S("cc", fontName="Helvetica", fontSize=8, textColor=HexColor("#CCE0E8"),
alignment=4)), # RIGHT
]]
title_t = Table(title_row, colWidths=[W*0.62, W*0.38])
title_t.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), C_NAVY),
("ROWPADDING", (0,0),(-1,-1), 6),
("TOPPADDING", (0,0),(-1,-1), 8),
("BOTTOMPADDING",(0,0),(-1,-1), 8),
("VALIGN", (0,0),(-1,-1), "MIDDLE"),
]))
elements.append(title_t)
# ── Two-column body: left = DX, right = Management
# LEFT column content
left = []
left.append(P("<b><font color='#1B7A8A'>▸ DIAGNOSTIC CRITERIA (DSM-5)</font></b>", sBody))
left.append(spacer(1))
for c in dx_criteria:
left.append(P(f"<font color='#1A2E4A'>◆</font> {c}", sBullet))
left.append(spacer(2))
left.append(P("<b><font color='#1B7A8A'>▸ KEY CLINICAL FEATURES</font></b>", sBody))
for f in key_features:
left.append(P(f"• {f}", sBullet))
left.append(spacer(2))
left.append(P("<b><font color='#1B7A8A'>▸ ETIOLOGY</font></b>", sBody))
left.append(P("<u>Organic:</u>", sLabel))
for e in etiology_org:
left.append(P(f"• {e}", sBullet))
left.append(P("<u>Psychological:</u>", sLabel))
for e in etiology_psy:
left.append(P(f"• {e}", sBullet))
# RIGHT column content
right = []
right.append(P("<b><font color='#1B7A8A'>▸ FIRST-LINE PHARMACOTHERAPY</font></b>", sBody))
right.append(spacer(1))
for drug, detail in first_line_pharm:
right.append(P(f"<b>{drug}</b>", sBullet))
right.append(P(f" {detail}", S("ind", fontName="Helvetica", fontSize=7.5,
leading=10, textColor=C_GREY, leftIndent=14)))
right.append(spacer(2))
right.append(P("<b><font color='#1B7A8A'>▸ FIRST-LINE NON-PHARMACOLOGICAL</font></b>", sBody))
right.append(spacer(1))
for n in first_line_nonpharm:
right.append(P(f"• {n}", sBullet))
if red_flags:
right.append(spacer(2))
rf_items = " ".join([f"⚠ {r}" for r in red_flags])
right.append(P(f"<b><font color='#C0392B'>RED FLAGS:</font></b> {rf_items}", sWarning))
if note:
right.append(spacer(1))
right.append(P(f"<i>{note}</i>", sSmall))
# Wrap in left/right tables to equalise padding
def col_wrap(content, bg):
t = Table([[c] for c in content],
colWidths=[W*0.46 - 6*mm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), bg),
("LEFTPADDING", (0,0),(-1,-1), 5),
("RIGHTPADDING", (0,0),(-1,-1), 5),
("TOPPADDING", (0,0),(-1,-1), 2),
("BOTTOMPADDING", (0,0),(-1,-1), 2),
]))
return t
body_row = [[col_wrap(left, C_AMBER), col_wrap(right, C_MINT)]]
body_t = Table(body_row, colWidths=[W*0.48, W*0.52])
body_t.setStyle(TableStyle([
("VALIGN", (0,0),(-1,-1), "TOP"),
("LEFTPADDING", (0,0),(-1,-1), 3),
("RIGHTPADDING", (0,0),(-1,-1), 3),
("TOPPADDING", (0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("BOX", (0,0),(-1,-1), 0.5, HexColor("#BBCDD8")),
("LINEABOVE", (0,0),(-1,0), 1.5, C_TEAL),
]))
elements.append(body_t)
elements.append(spacer(3))
return KeepTogether(elements)
# ─────────────────────────────────────────────────────────────────────────────
# CARD 1: Male HSDD
# ─────────────────────────────────────────────────────────────────────────────
story.append(section_header("SEXUAL DYSFUNCTIONS — INDIVIDUAL DISORDER CARDS"))
story.append(spacer(2))
story.append(card(
number="1",
name="Male Hypoactive Sexual Desire Disorder (MHSDD)",
code_dsm="302.71 (F52.0)",
code_icd="F52.0",
dx_criteria=[
"Persistently/recurrently deficient or absent sexual/erotic thoughts, fantasies, and desire for sexual activity",
"Duration ≥ 6 months",
"Causes marked distress in individual",
"Not due to another disorder, medical condition, substance, or relationship problem alone",
],
key_features=[
"Rarely initiates sex; minimal response to partner's initiation",
"May still have erections with masturbation (desire absent, function intact)",
"Often comorbid with depression; bimodal prevalence (young & elderly men)",
"Distinguish from reduced activity due to partner unavailability (fantasies preserved)",
],
etiology_org=[
"Testosterone deficiency (hypogonadism)",
"Hyperprolactinemia (pituitary tumour, antipsychotics)",
"Thyroid dysfunction, chronic illness, medications (opioids, antidepressants)",
],
etiology_psy=[
"Depression (dopamine depletion)",
"Relationship conflict / unexpressed hostility toward partner",
"History of trauma; fear of intimacy; prolonged abstinence",
"Comorbid anxiety disorder",
],
first_line_pharm=[
("Treat primary disorder first",
"Treat depression (avoid SSRIs if possible; prefer bupropion) or anxiety"),
("Testosterone replacement",
"Only if biochemically confirmed hypogonadism (total T < threshold); monitor PSA, Hct"),
("Cabergoline",
"If hyperprolactinemia confirmed; dopamine agonist normalises prolactin"),
("Bupropion SR (off-label)",
"Dopamine/norepinephrine reuptake inhibitor; improves desire & arousal"),
],
first_line_nonpharm=[
"Psychoeducation: address misconceptions, normalise sexual response",
"Sex education (especially in Indian context – first-line per IPS CPG)",
"Couples therapy: address relationship dissatisfaction",
"CBT: challenge avoidance, negative cognitions, low self-esteem",
"Sensate focus exercises to rebuild sexual connection",
],
red_flags=["New-onset low desire: screen for prolactinoma (check prolactin + MRI)", "Concurrent depression needs independent treatment"],
note="IPS CPG: Always assess for cultural factors, Dhat beliefs, and sexual knowledge gaps before pharmacotherapy."
))
# ─────────────────────────────────────────────────────────────────────────────
# CARD 2: FSIAD
# ─────────────────────────────────────────────────────────────────────────────
story.append(card(
number="2",
name="Female Sexual Interest/Arousal Disorder (FSIAD)",
code_dsm="302.72 (F52.22)",
code_icd="F52.0 / F52.2",
dx_criteria=[
"≥3 of 6 symptoms for ≥6 months: (1) reduced interest in sex; (2) reduced erotic thoughts/fantasies; (3) reduced initiation/receptiveness; (4) absent/reduced excitement or pleasure during sex; (5) absent/reduced interest in response to erotic cues; (6) absent/reduced genital or non-genital sensations during sex",
"Causes marked distress",
"Not better explained by another disorder, medical condition, medication, or severe relationship distress",
],
key_features=[
"Merges prior HSDD and FSAD (DSM-5): recognises that female desire is often responsive, not spontaneous",
"Most common female sexual dysfunction; prevalence 17–50%",
"HSDD with distress ~10% of women; peaks in middle years",
"Depression positively associated; partner's sexual function highly correlated",
],
etiology_org=[
"Oestrogen deficiency: peri/post-menopause, surgical menopause, postpartum, lactation",
"Oral contraceptives: raise SHBG → lower free testosterone",
"SSRIs/SNRIs (70–80% incidence of sexual side effects)",
"Antipsychotics (hyperprolactinemia), antihypertensives",
"Diabetes, vascular disease (impair vaginal engorgement)",
],
etiology_psy=[
"Depression and anxiety (most common psychological contributors)",
"Negative body image; history of sexual trauma or abuse",
"Relationship dissatisfaction, poor communication",
"Inadequate sexual stimulation (often miscategorised as disorder)",
"Cultural guilt, religious prohibitions on female sexual pleasure",
],
first_line_pharm=[
("Flibanserin 100 mg nocte",
"5-HT1A agonist / 5-HT2A antagonist; FDA-approved for premenopausal HSDD; separate alcohol by ≥2 h"),
("Bremelanotide 1.75 mg SC",
"MC4 agonist; inject 45 min pre-sex; ≤8×/month; caution in hypertension; main SE: nausea"),
("Transdermal testosterone (off-label)",
"Postmenopausal HSDD; shown to improve all sexual domains; monitor for androgenic SE"),
("Bupropion SR (off-label)",
"Improves arousal, orgasm, and satisfaction in premenopausal women"),
("Topical oestrogen (if hypoestrogenic)",
"Vaginal cream/ring/tablet for atrophy-driven symptoms; minimal systemic absorption"),
],
first_line_nonpharm=[
"Psychoeducation about responsive vs spontaneous desire in women",
"Mindfulness-Based Cognitive Therapy (MBCT) – especially post-trauma",
"Sensate focus (graded touching exercises, removes performance pressure)",
"Couples therapy: communication skills, partner involvement",
"CBT for trauma-related cognitions, body image, guilt",
"Review and switch medications causing sexual side effects",
],
note="IPS CPG: Inadequate stimulation is very common. Rule this out before diagnosing a disorder."
))
# ─────────────────────────────────────────────────────────────────────────────
# CARD 3: Erectile Disorder
# ─────────────────────────────────────────────────────────────────────────────
story.append(card(
number="3",
name="Erectile Disorder (ED)",
code_dsm="302.72 (F52.21)",
code_icd="F52.2",
dx_criteria=[
"≥1 of 3 symptoms on almost all/all (75–100%) occasions, ≥6 months: (1) marked difficulty obtaining an erection; (2) marked difficulty maintaining an erection until completion of activity; (3) marked decrease in erectile rigidity",
"Causes marked distress",
"Not better explained by non-sexual mental disorder, severe relationship distress, or other significant stressors, medical condition, or substances",
],
key_features=[
"Most common male sexual dysfunction; prevalence 52% (Massachusetts Male Aging Study)",
"Psychogenic: sudden onset, situational, morning erections preserved, younger age",
"Organic: insidious onset, global (not situational), morning erections absent, cardiovascular risk factors",
"ED in young men = early cardiovascular sentinel event (often precedes CAD by 3–5 years)",
"Mixed etiology is very common in clinical practice",
],
etiology_org=[
"Vasculogenic (most common): atherosclerosis, hypertension, diabetes → endothelial dysfunction",
"Neurogenic: MS, Parkinson's, spinal cord injury, radical prostatectomy, DM neuropathy",
"Endocrine: hypogonadism, hyperprolactinemia, thyroid dysfunction",
"Medications: antihypertensives (thiazides, β-blockers), antidepressants, antipsychotics, opioids",
"Lifestyle: tobacco (linear dose-response), heavy alcohol, obesity, OSA",
],
etiology_psy=[
"Performance anxiety with spectatoring (commonest psychological mechanism)",
"Depression (dopamine depletion) and anxiety (sympathetic override of parasympathetic arousal)",
"Relationship conflict; fear of intimacy; prior traumatic sexual experience",
"First organic episode → psychological anxiety → self-perpetuating cycle",
],
first_line_pharm=[
("PDE-5 Inhibitors (first-line)",
"Block PDE-5 enzyme → ↑cGMP → cavernosal smooth muscle relaxation → erection"),
(" Sildenafil 25–100 mg PRN",
"Take 30–60 min before; affected by fatty meals; duration 4–6 h"),
(" Tadalafil 10–20 mg PRN / 2.5–5 mg daily",
"Duration 36 h ('weekend pill'); daily dosing available; not food-affected"),
(" Vardenafil 5–20 mg PRN",
"Onset 30 min; duration 4–5 h"),
(" Avanafil 50–200 mg PRN",
"Fastest onset 15–30 min; duration 6–12 h"),
("CI: Organic nitrates (risk of severe hypotension)",
"Absolute contraindication with any nitrate preparation"),
("Testosterone (if hypogonadal)",
"Restores androgen milieu; PDE-5I often still needed concurrently"),
],
first_line_nonpharm=[
"Modify cardiovascular risk factors: weight loss, exercise, Mediterranean diet, quit smoking",
"Review and switch offending medications (e.g., change antihypertensive class)",
"CPAP for obstructive sleep apnoea (improves erectile function)",
"Sensate focus: removes spectatoring, rebuilds sexual confidence",
"CBT for performance anxiety; psychoeducation for couple",
"Vacuum Erection Device (VED): second-line mechanical option",
"Penile implant (inflatable prosthesis): third-line surgical option",
],
red_flags=["Absent morning erections in young man: urgent endocrine + vascular workup", "New-onset ED + chest pain: cardiovascular evaluation before PDE-5I"],
note="IPS CPG: For organic ED, refer to urologist/endocrinologist. Maintain psychiatric liaison for mixed etiology."
))
story.append(PageBreak())
# ─────────────────────────────────────────────────────────────────────────────
# CARD 4: Premature Ejaculation
# ─────────────────────────────────────────────────────────────────────────────
story.append(card(
number="4",
name="Premature (Early) Ejaculation (PE)",
code_dsm="302.75 (F52.4)",
code_icd="F52.4",
dx_criteria=[
"Ejaculation within approximately 1 minute of vaginal penetration and before the person wishes it",
"Present on almost all/all (75–100%) occasions, ≥6 months",
"Causes marked distress",
"Not better explained by non-sexual mental disorder, relationship distress, or medical condition/substance",
"Three core criteria: (1) brief latency; (2) loss of control; (3) distress to patient/partner",
],
key_features=[
"Most common male sexual complaint globally (~30%); comorbid in ~1/3 of men with ED",
"Subtypes: lifelong vs acquired; global vs situational",
"Many cases represent normal biological variation — psychoeducation and reassurance are highly effective",
"Lifelong PE: consistent since first sexual experience; likely neurobiological serotonin threshold",
"Acquired PE: often secondary to ED, thyroid disease, prostatitis, or relationship distress",
],
etiology_org=[
"Thyroid dysfunction (hyperthyroidism: reversible cause — always check TSH)",
"Urethritis / prostatitis (acquired PE)",
"Comorbid ED (anxiety about erection hastens ejaculation)",
"Penile hypersensitivity (proposed in lifelong PE)",
],
etiology_psy=[
"Conditioned response: early sexual experiences in high-anxiety/rushed contexts",
"Performance anxiety; fear of detection; inadequate sexual education",
"Relationship stress; poor communication with partner",
"Anxiety disorders (especially generalised anxiety)",
],
first_line_pharm=[
("SSRIs — daily (first-line)",
"Central serotonergic inhibition of ejaculatory reflex; full effect in 2–3 weeks"),
(" Paroxetine 10–40 mg/day",
"Most effective SSRI for PE; delayed ejaculation is a known side effect utilised therapeutically"),
(" Sertraline 50–200 mg/day",
"Well tolerated; alternative first-line"),
(" Fluoxetine 20–40 mg/day / Escitalopram 10–20 mg/day",
"Other options; long half-life of fluoxetine is an advantage"),
("Dapoxetine 30–60 mg on-demand",
"Short-acting SSRI; take 1–3 h before sex; only SSRI specifically approved for PE in many countries"),
("Topical lidocaine–prilocaine (EMLA spray/cream)",
"Apply 20–30 min pre-sex; reduces penile sensitivity; improves latency and control"),
("Clomipramine 12.5–50 mg/day",
"TCA alternative if SSRIs fail; 5-HT reuptake inhibition"),
("Tramadol (third-line, off-label)",
"Opioid + serotonergic mechanisms; risk of dependence — use with caution"),
],
first_line_nonpharm=[
"Psychoeducation and reassurance (many cases resolve with education alone)",
"Squeeze technique: stimulate to near-ejaculation, apply pressure at coronal ridge for 30 sec",
"Stop-Start technique (Semans): pause all stimulation at near-ejaculation; repeat 3× then allow orgasm",
"Sensate focus: reduces performance anxiety, improves ejaculatory awareness",
"Couples therapy: PE is a dyadic problem; partner involvement improves outcomes",
"If PE + ED: treat ED first with PDE-5I; PE may resolve",
],
note="If PE is acquired + associated with hyperthyroidism: treating thyroid disorder resolves PE."
))
# ─────────────────────────────────────────────────────────────────────────────
# CARD 5: Delayed Ejaculation
# ─────────────────────────────────────────────────────────────────────────────
story.append(card(
number="5",
name="Delayed Ejaculation (DE)",
code_dsm="302.74 (F52.32)",
code_icd="F52.3",
dx_criteria=[
"Either (1) marked delay in ejaculation OR (2) marked infrequency/absence of ejaculation, on almost all/all occasions, ≥6 months",
"Causes marked distress",
"Not better explained by another disorder, medication, medical condition, or inadequate stimulation",
],
key_features=[
"Least common male ejaculatory disorder; incidence rising with SSRI use",
"Classic pattern: can ejaculate with masturbation, cannot intravaginally (situational subtype)",
"Lifelong DE: often psychosexual — idiosyncratic masturbatory style, rarely attainable with partner",
"Acquired DE: usually medication-induced (SSRIs, antipsychotics, opioids)",
"Anejaculation: complete inability to ejaculate (severe form)",
],
etiology_org=[
"SSRIs / SNRIs (very common cause)",
"Antipsychotics (alpha-1 blockade impairs emission)",
"Opioids, excessive alcohol",
"Spinal cord injury, pelvic surgery, diabetic autonomic neuropathy",
"Hypogonadism, hypothyroidism",
],
etiology_psy=[
"Performance anxiety drawing attention away from erotic stimulation",
"Idiosyncratic masturbatory style (specific fantasy/technique not replicable with partner)",
"Ambivalence about parenthood (partner trying to conceive)",
"Fear of loss of control; hostility toward partner",
"Psychosexual developmental conflicts",
],
first_line_pharm=[
("Reduce/withdraw offending drug",
"If SSRI/antipsychotic is cause: lower dose, switch to non-serotonergic agent (bupropion, mirtazapine)"),
("Bupropion (if switching antidepressant)",
"Dopamine/NE reuptake inhibitor; not associated with ejaculatory delay"),
("Cyproheptadine 4–12 mg PRN",
"5-HT2 antagonist; taken 1–2 h before sex to reverse SSRI-induced DE (short-term)"),
("Amantadine 100–200 mg PRN",
"Dopamine agonist properties; off-label for drug-induced DE"),
("Cabergoline / testosterone",
"If hyperprolactinemia or hypogonadism respectively confirmed"),
],
first_line_nonpharm=[
"Psychoeducation: explain mechanism, normalise the experience",
"Graduated extravaginal ejaculation → progressively closer to vaginal entry (bridging technique)",
"Partner-assisted stimulation to point of near-ejaculation before penetration",
"Address idiosyncratic masturbatory style: vary technique, reduce frequency before sex",
"Psychodynamic/CBT therapy for ambivalence, partner hostility, or trauma",
"Stop-start technique adapted for DE: focus on erotic sensations rather than on achieving orgasm",
],
note="Many DE cases improve when the offending medication is changed. Always review drug list first."
))
story.append(PageBreak())
# ─────────────────────────────────────────────────────────────────────────────
# CARD 6: Female Orgasmic Disorder
# ─────────────────────────────────────────────────────────────────────────────
story.append(card(
number="6",
name="Female Orgasmic Disorder (FOD)",
code_dsm="302.73 (F52.31)",
code_icd="F52.3",
dx_criteria=[
"≥1 of 3 on almost all/all (75–100%) occasions, ≥6 months: (1) marked delay in orgasm; (2) marked infrequency or absence of orgasm; (3) markedly reduced intensity of orgasmic sensations",
"Causes marked distress",
"Not better explained by another disorder, medical condition, medications, or inadequate stimulation",
],
key_features=[
"Primary (lifelong) FOD: has never experienced orgasm by any means",
"Secondary (acquired) FOD: previously orgasmic; most commonly drug-induced",
"Situational FOD: orgasmic with masturbation but not with partner (very common, often normal)",
"Many women require direct clitoral stimulation not provided by coital activity alone",
"SSRIs are the commonest acquired cause — always take detailed drug history",
],
etiology_org=[
"SSRIs/SNRIs: most common drug cause (70–80% rate)",
"Antipsychotics, benzodiazepines",
"Spinal cord injury, pelvic surgery, MS",
"Menopause (reduced vaginal blood flow, atrophy)",
"Diabetes (autonomic neuropathy)",
],
etiology_psy=[
"Anxiety and fear of 'losing control'",
"Religious/moral guilt about sexual pleasure",
"Negative body image and self-consciousness",
"History of sexual trauma or abuse",
"Inadequate sexual knowledge or stimulation technique",
"Partner communication failure",
],
first_line_pharm=[
("Switch/reduce SSRI if causative",
"Switch to bupropion, mirtazapine, vilazodone, or vortioxetine (lower sexual SE profile)"),
("Bupropion SR (off-label)",
"Improves orgasm frequency and intensity; useful add-on or substitute"),
("Sildenafil (off-label)",
"PDE-5I increases clitoral blood flow; evidence for SSRI-induced anorgasmia in women"),
("Bremelanotide (off-label)",
"MC4 receptor agonist; may facilitate orgasm by enhancing arousal"),
("EROS device",
"FDA-approved medical device; small vacuum pump over clitoris increases blood flow → orgasm aid"),
],
first_line_nonpharm=[
"Directed masturbation program (most evidence-based approach for primary FOD)",
"Psychoeducation: anatomy (clitoral role), normal variation in orgasmic response",
"Sensate focus: graduated touching, removes orgasm as goal",
"Vibrator use: most effective tool for women with primary anorgasmia",
"CBT: address guilt, shame, trauma-related beliefs, fear of losing control",
"Communication skills training with partner",
],
note="Situational FOD (orgasmic alone, not with partner) is very common and not always pathological — assess distress carefully."
))
# ─────────────────────────────────────────────────────────────────────────────
# CARD 7: GPPPD (Vaginismus / Dyspareunia)
# ─────────────────────────────────────────────────────────────────────────────
story.append(card(
number="7",
name="Genitopelvic Pain/Penetration Disorder (GPPPD)",
code_dsm="302.76 (F52.6)",
code_icd="F52.5 / N94.1 / N94.2",
dx_criteria=[
"Persistent/recurrent difficulties with ≥1 of 4, ≥6 months:",
"(1) Difficulty with vaginal penetration during intercourse",
"(2) Marked vulvovaginal/pelvic pain during intercourse or penetration attempts",
"(3) Marked fear/anxiety about vulvovaginal/pelvic pain in anticipation of, during, or as a result of vaginal penetration",
"(4) Marked tensing/tightening of pelvic floor muscles during attempted vaginal penetration",
"Causes marked distress",
],
key_features=[
"Merges vaginismus + dyspareunia from DSM-IV (they co-occur and share pathophysiology)",
"Vaginismus component: involuntary pelvic floor spasm — often a conditioned reflex",
"Vicious cycle: pain → fear → muscle spasm → more pain → avoidance → worsening anxiety",
"May prevent pelvic examination and tampon use (not only intercourse)",
"Dyspareunia: pain localised (superficial = vestibular; deep = endometriosis, PID)",
"Always rule out organic pelvic pathology before diagnosing psychogenic",
],
etiology_org=[
"Postmenopausal/surgical menopause: vaginal atrophy, inadequate lubrication",
"Endometriosis, pelvic inflammatory disease",
"Vulvodynia / vestibulodynia (chronic vulvar pain without identifiable lesion)",
"Pelvic adhesions, ovarian cysts, uterine fibroids",
"Urogenital infections, STIs",
"Anatomical abnormalities, post-surgical scarring",
],
etiology_psy=[
"History of sexual trauma, rape, childhood sexual abuse (strongest association with vaginismus)",
"Conservative upbringing: sex perceived as sinful, dirty, or inevitably painful",
"Negative first sexual experience",
"Relationship conflict, fear of pregnancy, fear of intimacy",
"Conditioned anxiety response (classical conditioning of pain/spasm)",
"Partner pressure, guilt, performance anxiety",
],
first_line_pharm=[
("Topical oestrogen (vaginal cream/ring/tablet)",
"Postmenopausal atrophic dyspareunia; minimal systemic absorption; highly effective"),
("Ospemifene 60 mg daily (oral SERM)",
"Moderate-severe dyspareunia in postmenopausal women; alternative to topical oestrogen"),
("Topical lidocaine 2–4% gel",
"Vulvodynia/vestibulodynia; apply 20 min before sex; reduces superficial pain"),
("Botulinum toxin A injection (specialist)",
"Refractory vaginismus; injection into levator ani/bulbocavernosus muscles under GA"),
("Amitriptyline / gabapentin (low dose)",
"Neuropathic component of vestibulodynia/vulvodynia; specialist-initiated"),
],
first_line_nonpharm=[
"Vaginal dilators: graduated sizes (1→5); self-inserted with relaxation; most evidence-based non-pharm Rx",
"Pelvic floor physiotherapy: biofeedback, myofascial release, Kegel training",
"CBT: desensitisation of fear/avoidance, cognitive restructuring of pain catastrophising",
"Sensate focus: ban on penetration; graduated non-genital → genital touching",
"Systematic desensitisation: paired relaxation with hierarchical exposure to penetration cues",
"Couples therapy: partner education, communication, guilt-free rebuilding of intimacy",
"Treat identifiable organic cause (endometriosis → gynaecology referral; atrophy → topical oestrogen)",
],
red_flags=["Deep dyspareunia: refer to gynaecology to exclude endometriosis / PID / ovarian pathology", "Vaginismus preventing pelvic exam: gentle examination under relaxation; avoid forced examination"],
note="IPS CPG: Vaginismus has excellent prognosis with combined dilator + psychotherapy. Early intervention prevents chronicity."
))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# IPS CPG MANAGEMENT ALGORITHM
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_header("IPS CPG 2017 — MANAGEMENT ALGORITHM (Avasthi et al.)"))
story.append(spacer(2))
algo_text = [
P("<b>Step 1.</b> Detailed psychosexual history + physical examination + basic investigations (FBS/HbA1c, lipids, testosterone, prolactin, TFTs)", sBody),
spacer(1),
P("<b>Step 2.</b> Assess sexual knowledge: Is dysfunction due to poor sexual knowledge or poor relationship quality?", sBody),
P(" → <b>YES</b>: Sex Education first → Reassess", sBody),
spacer(1),
P("<b>Step 3.</b> Ascertain type of dysfunction and probable etiology", sBody),
spacer(1),
]
algo_table_data = [
[P("ORGANIC ETIOLOGY", sTableHdr), P("MIXED / PSYCHOGENIC ETIOLOGY", sTableHdr)],
[
P("• Refer to relevant specialist (endocrinologist, urologist, gynaecologist)\n• Maintain psychiatric liaison\n• Treat organic cause\n• Identify any additional psychological component", sTableCell),
P("• Screen for comorbid psychiatric disorder (depression, anxiety)\n → If present: treat primary disorder first\n• Assess motivation and psychological sophistication\n → Low motivation: start pharmacotherapy; gradually engage in psychotherapy\n → High motivation: combined pharmacotherapy + psychotherapy from outset", sTableCell),
],
]
algo_t = Table(algo_table_data, colWidths=[W*0.48, W*0.52])
algo_t.setStyle(TableStyle([
("BACKGROUND", (0,0),(0,0), C_TEAL),
("BACKGROUND", (1,0),(1,0), C_NAVY),
("BACKGROUND", (0,1),(0,1), C_RED_SOFT),
("BACKGROUND", (1,1),(1,1), C_GREEN_SOFT),
("GRID", (0,0),(-1,-1), 0.5, HexColor("#BBCDD8")),
("VALIGN", (0,0),(-1,-1), "TOP"),
("ROWPADDING", (0,0),(-1,-1), 7),
("FONTSIZE", (0,0),(-1,-1), 8),
]))
story.append(algo_t)
story.append(spacer(2))
story.append(P("<b>Step 4. Treatment Selection:</b> Explain all available modalities → patient/couple chooses → agree on treatment goals before starting", sBody))
story.append(spacer(1))
tx_cols = [
[P("<b><font color='#1B7A8A'>GENERAL MEASURES</font></b>", sBody)],
[P("• Sex education and psychoeducation", sBullet)],
[P("• Relaxation exercises", sBullet)],
[P("• Lifestyle modification (exercise, diet, substance cessation)", sBullet)],
[P("• Screening questionnaires: IIEF-5 (ED), DSDS (female HSDD), SKAQ (Hindi — North Indian)", sBullet)],
]
story.append(P("<b>General Measures (apply to all patients):</b>", sBody))
for row in tx_cols[1:]:
story.append(row[0])
story.append(spacer(2))
story.append(P("<b>Specific Measures:</b>", sBody))
spec_data = [
[P("NON-PHARMACOLOGICAL", sTableHdr), P("PHARMACOLOGICAL", sTableHdr)],
[
P("Psychodynamic therapy\nCBT (individual)\nCouples / relational therapy\nMasters & Johnson Dual-Sex Therapy\nSensate focus exercises\nSystematic desensitisation\nDirected masturbation (FOD)\nSqueeze/Stop-Start technique (PE)\nVaginal dilators (GPPPD)\nMindfulness-Based Therapy (FSIAD, FOD)\nPelvic floor physiotherapy (GPPPD)\nSex communication skills training", sTableCell),
P("Erectile Disorder: PDE-5 inhibitors (sildenafil, tadalafil, vardenafil, avanafil)\nPE: SSRIs (paroxetine, sertraline), dapoxetine, topical anaesthetics\nFemale HSDD: flibanserin, bremelanotide, off-label testosterone\nDE: switch/reduce offending drug, cyproheptadine, bupropion\nFOD: switch SSRI, bupropion, sildenafil off-label\nGPPPD: topical oestrogen, ospemifene, topical lidocaine, botox (specialist)\nAll: treat underlying endocrine/vascular cause", sTableCell),
],
]
spec_t = Table(spec_data, colWidths=[W*0.46, W*0.54])
spec_t.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,0), C_NAVY),
("BACKGROUND", (0,1),(0,1), C_MINT),
("BACKGROUND", (1,1),(1,1), C_AMBER),
("GRID", (0,0),(-1,-1), 0.5, HexColor("#BBCDD8")),
("VALIGN", (0,0),(-1,-1), "TOP"),
("ROWPADDING", (0,0),(-1,-1), 7),
("FONTSIZE", (0,0),(-1,-1), 8),
]))
story.append(spec_t)
story.append(spacer(3))
# ═══════════════════════════════════════════════════════════════════════════════
# DRUG-INDUCED SD MANAGEMENT
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_header("MANAGING PSYCHOTROPIC-INDUCED SEXUAL DYSFUNCTION"))
story.append(spacer(2))
drug_data = [
[P("STRATEGY", sTableHdr), P("DETAILS", sTableHdr), P("NOTES", sTableHdr)],
[P("1. Wait & watch", sTableBold), P("Some tolerance develops over 4–8 weeks", sTableCell), P("Only for mild cases", sTableCell)],
[P("2. Dose reduction", sTableBold), P("Lowest effective dose minimises sexual SE", sTableCell), P("Must balance psychiatric stability", sTableCell)],
[P("3. Add-on agents", sTableBold), P("Bupropion (most evidence); sildenafil (men AND women); buspirone; amantadine", sTableCell), P("Sildenafil RCT evidence in women on SSRIs", sTableCell)],
[P("4. Drug holiday", sTableBold), P("Brief planned discontinuation before sex (only short half-life agents: paroxetine)", sTableCell), P("Risk: discontinuation SE, relapse — use cautiously", sTableCell)],
[P("5. Switch to non-offending agent", sTableBold), P("Bupropion / mirtazapine / vilazodone / vortioxetine (low dose) / moclobemide", sTableCell), P("Most effective long-term strategy", sTableCell)],
[P("Antipsychotic-induced:", sTableBold), P("Switch to aripiprazole or quetiapine (lower prolactin effect); or add aripiprazole to reduce hyperprolactinemia", sTableCell), P("Prolactin level guides decision", sTableCell)],
]
drug_t = Table(drug_data, colWidths=[W*0.22, W*0.48, W*0.30])
drug_t.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,0), C_NAVY),
("BACKGROUND", (0,1),(-1,1), C_GREY_LIGHT),
("BACKGROUND", (0,2),(-1,2), white),
("BACKGROUND", (0,3),(-1,3), C_GREY_LIGHT),
("BACKGROUND", (0,4),(-1,4), white),
("BACKGROUND", (0,5),(-1,5), C_GREY_LIGHT),
("BACKGROUND", (0,6),(-1,6), C_RED_SOFT),
("GRID", (0,0),(-1,-1), 0.5, HexColor("#BBCDD8")),
("ROWPADDING", (0,0),(-1,-1), 5),
("VALIGN", (0,0),(-1,-1), "MIDDLE"),
("FONTSIZE", (0,0),(-1,-1), 8),
]))
story.append(drug_t)
story.append(spacer(2))
antidepressant_note = (
"<b>SSRI Sexual SE rates:</b> Sertraline, venlafaxine, citalopram, paroxetine, fluoxetine → 70–80% | "
"Imipramine, phenelzine, duloxetine, fluvoxamine → 25–45% | "
"<b>No significant difference from placebo:</b> Bupropion, vilazodone, vortioxetine"
)
story.append(P(antidepressant_note, sSmall))
story.append(spacer(4))
# ═══════════════════════════════════════════════════════════════════════════════
# QUICK-REFERENCE SUMMARY TABLE
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_header("AT-A-GLANCE SUMMARY"))
story.append(spacer(2))
sum_data = [
[P(h, sTableHdr) for h in ["Dysfunction", "Duration", "Prevalence", "Key Organic Cause", "Key Psychological Cause", "First-Line Pharm", "First-Line Non-Pharm"]],
[P("MHSDD", sTableBold), P("≥6 mo", sTableCell), P("2% (young); 40% (>65 yr)", sTableCell), P("Low T, hyperprolactin", sTableCell), P("Depression, relationship conflict", sTableCell), P("Testosterone (if deficient); bupropion", sTableCell), P("Sex education; couples therapy", sTableCell)],
[P("FSIAD", sTableBold), P("≥6 mo", sTableCell), P("17–50%", sTableCell), P("Estrogen deficiency; OCP; SSRIs", sTableCell), P("Depression; trauma; inadequate stimulation", sTableCell), P("Flibanserin; bremelanotide", sTableCell), P("Mindfulness; sensate focus", sTableCell)],
[P("ED", sTableBold), P("≥6 mo", sTableCell), P("52% (all ages)", sTableCell), P("Vasculogenic (most common)", sTableCell), P("Performance anxiety; spectatoring", sTableCell), P("PDE-5 inhibitors (sildenafil, tadalafil)", sTableCell), P("CVD risk factor modification; sensate focus", sTableCell)],
[P("PE", sTableBold), P("≥6 mo", sTableCell), P("~30% men", sTableCell), P("Hyperthyroidism; urethritis", sTableCell), P("Conditioned anxiety; rushed early sex", sTableCell), P("Paroxetine/SSRIs daily; dapoxetine PRN; topical EMLA", sTableCell), P("Squeeze/stop-start technique", sTableCell)],
[P("DE", sTableBold), P("≥6 mo", sTableCell), P("Increasing (SSRI era)", sTableCell), P("SSRIs; pelvic surgery; DM neuropathy", sTableCell), P("Idiosyncratic masturbation; ambivalence", sTableCell), P("Switch to bupropion; cyproheptadine PRN", sTableCell), P("Extravaginal bridging; psychotherapy", sTableCell)],
[P("FOD", sTableBold), P("≥6 mo", sTableCell), P("5–10%", sTableCell), P("SSRIs; pelvic surgery; menopause", sTableCell), P("Guilt; fear of losing control; trauma", sTableCell), P("Switch SSRI; bupropion; sildenafil off-label", sTableCell), P("Directed masturbation; vibrator; CBT", sTableCell)],
[P("GPPPD", sTableBold), P("≥6 mo", sTableCell), P("Variable", sTableCell), P("Vaginal atrophy; endometriosis; vulvodynia", sTableCell), P("Trauma; conditioned pain fear; guilt", sTableCell), P("Topical estrogen; ospemifene; topical lidocaine", sTableCell), P("Vaginal dilators; pelvic floor PT; CBT", sTableCell)],
]
col_w = [W*0.09, W*0.06, W*0.10, W*0.15, W*0.17, W*0.23, W*0.20]
sum_t = Table(sum_data, colWidths=col_w)
sum_t.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,0), C_NAVY),
("BACKGROUND", (0,1),(-1,1), C_LIGHT_BLUE),
("BACKGROUND", (0,2),(-1,2), white),
("BACKGROUND", (0,3),(-1,3), C_LIGHT_BLUE),
("BACKGROUND", (0,4),(-1,4), white),
("BACKGROUND", (0,5),(-1,5), C_LIGHT_BLUE),
("BACKGROUND", (0,6),(-1,6), white),
("BACKGROUND", (0,7),(-1,7), C_LIGHT_BLUE),
("GRID", (0,0),(-1,-1), 0.5, HexColor("#BBCDD8")),
("ROWPADDING", (0,0),(-1,-1), 4),
("VALIGN", (0,0),(-1,-1), "TOP"),
("FONTSIZE", (0,0),(-1,-1), 7.5),
]))
story.append(sum_t)
story.append(spacer(3))
# ─────────────────────────────────────────────────────────────────────────────
# REFERENCES FOOTER
# ─────────────────────────────────────────────────────────────────────────────
story.append(HR(C_ORANGE, 1.5))
story.append(spacer(1))
refs = [
"1. Kaplan & Sadock's Comprehensive Textbook of Psychiatry, 10th ed. — Chapter 33.17c (Ponce Martinez, El Haddad, Clayton). Wolters Kluwer.",
"2. Kaplan & Sadock's Synopsis of Psychiatry, 12th ed. — Chapter 16. Wolters Kluwer.",
"3. Avasthi A, Grover S, Sathyanarayana Rao TS. Clinical Practice Guidelines for Management of Sexual Dysfunction. Indian J Psychiatry. 2017;59(Suppl 1):S91–S115.",
"4. Salonia A et al. EAU Guidelines on Sexual and Reproductive Health: Male Sexual Dysfunction 2021. Eur Urol. 2021;80(3):333–357. [PMID 34183196]",
"5. Sathyanarayana Rao TS et al. IPS CPG for Sexual Disorders in Elderly. Indian J Psychiatry. 2018;60(Suppl 3):S398–S402.",
"6. Zulfikaroglu E. Vaginismus treatment: systematic review and meta-analysis. J Sex Med. 2026. [PMID 41148166]",
]
for r in refs:
story.append(P(r, sFooter))
# ─────────────────────────────────────────────────────────────────────────────
# BUILD
# ─────────────────────────────────────────────────────────────────────────────
doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
print(f"PDF created: {OUTPUT_PATH}")
print(f"Size: {os.path.getsize(OUTPUT_PATH):,} bytes")
cd /tmp/workspace/sexual-dysfunction-guide && python build_guide.py 2>&1
Sexual Dysfunction Quick Reference
PDF Document · PDF
explain male and female sexual cycles in simple terms which can be easily remembered and explained as a part of sex education. Also a detailed overview of management of Dhat syndrome
Dhat syndrome management treatment IPS guidelines India 2024
"Dhat syndrome" AND treatment
https://pmc.ncbi.nlm.nih.gov/articles/PMC5310110
Desire → Excitement → Plateau → Orgasm → Resolution

D - Desire E - Excitement P - Plateau O - Orgasm R - Resolution
Analogy: Think of a stove. Men's desire is more like a gas stove - it ignites quickly when you want it. Women's desire is more like an induction stove - it heats up beautifully, but it needs contact with the right surface (context, relationship, stimulation) to get started. Both cook food perfectly well.
| What happens | Why |
|---|---|
| Penis becomes erect | Parasympathetic nerves release nitric oxide (NO) → blood flows into corpus cavernosum |
| Scrotal skin tightens | Cremasteric reflex |
| Testes begin to elevate | Preparation for ejaculation |
| Heart rate and breathing increase | General sympathetic arousal |
| Pre-ejaculatory fluid appears | Cowper's glands secrete - lubricates and neutralises urine acidity |
| What happens | Why |
|---|---|
| Clitoris and labia swell | Same NO mechanism - blood engorgement of erectile tissue |
| Vagina lubricates | Transudation (fluid seeps through vaginal walls from increased blood flow) |
| Vagina lengthens and expands | "Tenting" - upper vagina widens to accommodate |
| Nipples may erect | Smooth muscle contraction in areola |
| Heart rate and breathing increase | Same as men |
Simple analogy for both: The genitals are like sponges. In the excitement phase, blood rushes in and fills the sponge. In men this creates an erection. In women this creates swelling and lubrication. It is the same biological process in both sexes - just with different anatomy.
Analogy: The plateau is like a spring being coiled tighter and tighter. The tension builds toward a tipping point.
Key education point - the clitoris: The clitoris is not just the small visible tip. It has internal branches ("roots") that wrap around the vagina. Vaginal stimulation can indirectly stimulate the internal clitoris - which is why some women orgasm from penetration while others need direct external stimulation. Both are completely normal.
| Phase | Men | Women | Key Difference |
|---|---|---|---|
| Desire | Mostly spontaneous | Often responsive/contextual | Women need right context; neither is wrong |
| Excitement | Erection; pre-ejaculate | Lubrication; vaginal expansion; clitoral swelling | Same mechanism (parasympathetic + NO), different anatomy |
| Plateau | Full erection; testicular elevation | Orgasmic platform forms; clitoral retraction | Women's plateau typically longer |
| Orgasm | Emission (sympathetic) then ejaculation (somatic); 3-7 contractions | 5-15 rhythmic contractions; clitoris is primary organ | Women: no ejaculation required; multiple orgasms possible |
| Resolution | Refractory period (mandatory) | No refractory period; multiple orgasms possible | Major biological difference |
| Model | Author | Phases | Best used for |
|---|---|---|---|
| Linear 4-phase | Masters & Johnson (1966) | Excitement → Plateau → Orgasm → Resolution | Basic sex ed; understanding physical responses |
| Triphasic | Kaplan (1974) | Desire → Excitement → Orgasm | Clinical psychiatry - maps onto DSM-5 dysfunctions |
| Non-linear / Circular | Basson (2002) | Desire can follow arousal; emotional intimacy drives the cycle | Female sexuality - explains why low spontaneous desire ≠ disorder |
Simple message: Stress and anxiety are the enemies of arousal. Safety and trust are the friends of good sexual response. This is why sex education cannot be separated from emotional health education.
Present with Dhat symptoms
↓
STEP 1: Rule out organic cause
(UTI, STI, phosphaturia, infective discharge)
↓
Organic cause found?
YES → Treat organic cause → Reassess
↓
Symptoms persist after treatment / No organic cause
↓
STEP 2: Assess comorbid psychiatric disorders
↓
Comorbidity primary and/or severe?
YES → Treat psychiatric disorder FIRST
↓
Comorbid ED or PE present?
YES → Treat Dhat FIRST, then address ED/PE
↓
STEP 3: Provide Sex Education and Psychoeducation
(Core treatment)
↓
Residual anxiety/depressive symptoms impeding therapy?
YES → Short-term anxiolytics/antidepressants
↓
STEP 4: Address associated sexual dysfunctions
STEP 5: Follow-up and reassessment
How to deliver sex education effectively (IPS CPG + clinical practice):
- Individual sessions initially, later group sessions if available
- Use simple diagrams of male anatomy (vas deferens, testes, seminal vesicles, urethra - showing they are separate from the urinary system)
- Non-judgemental, empathetic tone - never ridicule the belief
- Practical demonstrations (acid test for phosphaturia) where possible
- Written material in the patient's language (Hindi-medium SKAQ validated for North Indian population)
- Involve the partner or trusted family member if the patient agrees
| Feature | Details |
|---|---|
| Core belief | Semen loss (via urine/masturbation/nocturnal emission) depletes vital essence and causes illness |
| Population | Young men; rural; low-SES; Indian subcontinent; recently married/unmarried |
| Presentation | Somatic (fatigue, weakness) + psychological (depression, anxiety) + sexual (ED, PE, low desire) |
| Key comorbidity | Depression (40-66%); anxiety (21-38%); sexual dysfunctions (30-40%) |
| First step | Rule out UTI, STI, phosphaturia (acid test) |
| Primary treatment | Sex education and psychoeducation (IPS CPG) - NOT pharmacotherapy |
| Pharmacotherapy | Only for comorbid depression/anxiety; least dose, least time |
| Prognosis | Excellent: 88% good outcome at 1 year with proper management |
| Female equivalent | Leucorrhoea attributed to vital essence loss; managed identically |