Audit alchol
"AUDIT" AND "alcohol use disorders identification test" AND screening
Skip to Q9 and Q10 if total score for Q2 + Q3 = 0
| Score | Interpretation | Action |
|---|---|---|
| 0-7 | Low-risk / abstainer | Reinforce safe use |
| 8-15 | Hazardous drinking | Simple brief advice to reduce drinking |
| 16-19 | Harmful drinking | Brief counseling + continued monitoring |
| ≥20 | Likely alcohol dependence | Full diagnostic evaluation warranted |
| Tool | Questions | Time | Best Use |
|---|---|---|---|
| AUDIT | 10 | ~5 min | Primary care, general population, early detection |
| AUDIT-C | 3 | ~1 min | Quick consumption screen, elderly |
| CAGE | 4 | ~1 min | High specificity for dependence; misses early hazardous use |
| MAST | 25 | ~5-10 min | Higher predictive value; harder to administer |
| SMAST-G | 10 | ~5 min | Specifically validated for older adults |
| TWEAK | 5 | ~2 min | Obstetric/perinatal screening; score ≥2 = risk drinker |
Op induce polyneuropaghy
organophosphate induced polyneuropathy OPIDN
| Syndrome | Onset | Mechanism | Key Features |
|---|---|---|---|
| Acute Cholinergic Crisis | Minutes-hours | AChE inhibition → ACh accumulation | SLUDGE, miosis, bronchospasm, seizures, coma |
| Intermediate Syndrome | 24-96 hrs after cholinergic resolution | Excessive nicotinic receptor stimulation; possible redistribution of lipophilic OPs from adipose | Proximal limb weakness, neck flexors, cranial nerve palsies, respiratory muscle paralysis (potentially fatal) |
| OPIDN | 1-3 weeks after exposure | NTE inhibition + "aging" | Distal sensorimotor polyneuropathy; no respiratory muscle involvement |
Note: There is no evidence that peripheral nerve dysfunction follows prolonged low-level OP exposure.
| Severity | Outcome |
|---|---|
| Mild OPIDN (neuropathy only) | Good recovery after removal of exposure |
| Severe OPIDN (with myelopathy / UMN involvement) | Generally poor prognosis - UMN findings determine functional recovery |
What is the intermediate syndrome of organophosphate poisoning?
| Syndrome | Onset | Duration |
|---|---|---|
| Acute cholinergic crisis | Minutes to hours | Hours to days |
| Intermediate syndrome | 1-5 days | ~7 days to 2-3 weeks |
| Chronic toxicity | Weeks (repeated exposure) | Variable |
| OPIDN | 1-3 weeks | Months; often permanent |
Importantly, IMS reflects nicotinic (not muscarinic) excess. Signs of cholinergic excess (SLUDGE) are absent during IMS.
| Muscle Group | Clinical Consequence |
|---|---|
| Respiratory muscles | Ventilatory failure - the main cause of death |
| Neck flexors | Inability to raise head from pillow |
| Proximal limb muscles | Proximal > distal weakness of arms and legs |
| Cranial nerve-innervated muscles | Facial weakness, diplopia, dysphagia, dysarthria |
"Because organophosphorus poisoning frequently occurs in less developed parts of the world where medical resources are very limited, the development of the intermediate syndrome is frequently a lethal complication."
| Feature | Intermediate Syndrome | OPIDN |
|---|---|---|
| Onset | 1-5 days | 1-3 weeks |
| Mechanism | Nicotinic NMJ failure | NTE inhibition |
| Respiratory involvement | Yes - potentially fatal | No |
| Sensory features | No | Yes (paresthesias) |
| Pattern | Proximal > distal | Distal > proximal |
| UMN signs | No | Yes (late, if myelopathy) |
| Prognosis | Recovers in ~1 week with ventilation | Variable; may be permanent |
| Nerve gas causes it? | Not reported | Yes (high dose) |
Write a brief note on pathophysiology of neuropathic pain
The sensitized primary afferent bombards the spinal cord with continuous impulses, setting the stage for central changes.
"It is as though the brain has learned from its experience of pain, and decides not only to keep the process going, but also to enhance it and make it permanent."


| Transmitter | Receptor | Role |
|---|---|---|
| Glutamate | AMPA-R, NMDA-R | Excitatory; NMDA activation drives central sensitization |
| Substance P / CGRP | NK1, NK2, NK3; CGRP-R | Slow excitatory; neurogenic inflammation |
| GABA / Glycine | GABA-A/B | Inhibitory; loss causes disinhibition |
| Endorphins | μ-opioid receptor | Inhibitory; analgesic |
| Norepinephrine | α₂-adrenoceptors | Descending inhibition |
| Serotonin | 5HT1B/D (inhibitory), 5HT3 (excitatory) | Dual role - net inhibitory |
Nerve injury / disease
↓
PERIPHERAL SENSITIZATION
• Ectopic discharge (DRG, injured axon)
• Ion channel upregulation (Nav1.7, Nav1.8, TRPV1)
• Neuroinflammation (PGE2, bradykinin, cytokines)
• Ephaptic cross-talk
↓
Sustained afferent barrage → Dorsal Horn
↓
CENTRAL SENSITIZATION (Segmental)
• NMDA activation → Ca²⁺ influx → Wind-up
• Loss of GABAergic inhibitory interneurons
• Microglial/astrocyte activation
• A-fiber pain signaling (allodynia)
↓
SUPRASEGMENTAL SENSITIZATION
• Thalamic/cortical reorganization
• Self-sustaining pain without peripheral input
+
LOSS OF DESCENDING INHIBITION
• Reduced NE/5HT inhibitory tone
• Descending facilitation predominates
↓
NEUROPATHIC PAIN
(Burning, allodynia, hyperalgesia, spontaneous pain)
| Symptom | Underlying Mechanism |
|---|---|
| Spontaneous burning pain | Ectopic discharge from injured afferents |
| Allodynia (touch causes pain) | Loss of GABAergic gate + A-fiber rewiring to pain pathways |
| Hyperalgesia | Peripheral + central sensitization lowers threshold |
| Paroxysmal shooting pain | Ectopic bursts from DRG/demyelinated axons |
| Hyperpathia | Wind-up in dorsal horn |
| Phantom limb pain | Deafferentation + cortical reorganization |
Create a visual comparison of nociceptive vs neuropathic pain
A detailed medical educational infographic comparing nociceptive pain vs neuropathic pain side by side. Split layout with two columns. Left column titled "NOCICEPTIVE PAIN" with a warm orange/red color scheme, right column titled "NEUROPATHIC PAIN" with a blue/purple color scheme. Each column includes sections for: Definition, Mechanism (with a small anatomical illustration - left showing tissue injury with nociceptor activation, right showing damaged nerve with ectopic discharge), Cause/Etiology, Quality of Pain, Clinical Features, Examples, and Treatment Targets. Include icons: flame for nociceptive, lightning bolt for neuropathic. At the bottom, a shared row showing how they can overlap as "Mixed Pain". Clean white background, medical illustration style, clearly readable text labels, professional clinical reference card format.

| Feature | Nociceptive Pain 🔥 | Neuropathic Pain ⚡ |
|---|---|---|
| Definition | Pain from activation of nociceptors by actual/threatened tissue damage | Pain from damage or dysfunction of the somatosensory nervous system itself |
| Nervous system | Intact | Damaged or dysfunctional |
| Mechanism | Nociceptor stimulation → normal pain signal | Ectopic discharge, peripheral/central sensitization, disinhibition |
| Quality | Aching, throbbing, sharp, well-localized | Burning, shooting, stabbing, electric, often poorly localized |
| Spontaneous pain | Absent (pain = stimulus) | Present - pain without stimulus |
| Allodynia | Absent | Present (touch causes pain) |
| Hyperalgesia | Mild, proportionate | Disproportionate |
| Examples | Fracture, surgical wound, arthritis, visceral pain | Diabetic neuropathy, postherpetic neuralgia, phantom limb, trigeminal neuralgia |
| Response to NSAIDs/opioids | Good | Partial/poor |
| Key treatments | NSAIDs, paracetamol, opioids | Anticonvulsants (gabapentin, pregabalin), TCAs, SNRIs, topical agents |
| Resolves with healing? | Usually yes | Often persists independently |
Give me pdf off all topics we discuss here separately
mkdir -p /tmp/workspace/medical-notes-pdfs && ls /tmp/workspace/
cat << 'PYEOF' > /tmp/workspace/medical-notes-pdfs/make_pdf1_audit.py from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY doc = SimpleDocTemplate( "/tmp/workspace/medical-notes-pdfs/1_AUDIT_Alcohol_Screening.pdf", pagesize=A4, rightMargin=2*cm, leftMargin=2*cm, topMargin=2*cm, bottomMargin=2*cm ) styles = getSampleStyleSheet() W = A4[0] - 4*cm # Custom styles title_style = ParagraphStyle('Title', parent=styles['Title'], fontSize=20, textColor=colors.HexColor('#1a237e'), spaceAfter=6, alignment=TA_CENTER) subtitle_style = ParagraphStyle('Sub', parent=styles['Normal'], fontSize=11, textColor=colors.HexColor('#5c6bc0'), spaceAfter=10, alignment=TA_CENTER) h1_style = ParagraphStyle('H1', parent=styles['Heading1'], fontSize=14, textColor=colors.HexColor('#1a237e'), spaceBefore=14, spaceAfter=4, borderPad=4, backColor=colors.HexColor('#e8eaf6'), leading=18) h2_style = ParagraphStyle('H2', parent=styles['Heading2'], fontSize=12, textColor=colors.HexColor('#283593'), spaceBefore=8, spaceAfter=4) body_style = ParagraphStyle('Body', parent=styles['Normal'], fontSize=10, leading=14, spaceAfter=4, alignment=TA_JUSTIFY) bullet_style = ParagraphStyle('Bullet', parent=styles['Normal'], fontSize=10, leading=14, spaceAfter=3, leftIndent=14, bulletIndent=4) footer_style = ParagraphStyle('Footer', parent=styles['Normal'], fontSize=8, textColor=colors.grey, alignment=TA_CENTER) note_style = ParagraphStyle('Note', parent=styles['Normal'], fontSize=9, textColor=colors.HexColor('#b71c1c'), leading=13, borderPad=6, backColor=colors.HexColor('#ffebee'), leftIndent=8) story = [] # Header story.append(Paragraph("AUDIT", title_style)) story.append(Paragraph("Alcohol Use Disorders Identification Test", subtitle_style)) story.append(HRFlowable(width=W, thickness=2, color=colors.HexColor('#1a237e'))) story.append(Spacer(1, 8)) # Overview story.append(Paragraph("Overview", h1_style)) story.append(Paragraph( "The AUDIT was developed by the <b>World Health Organization (WHO) in the late 1980s</b> as a brief " "screening instrument for the early detection of <b>hazardous</b> (risk of harm) and <b>harmful</b> " "(presence of harm) alcohol use across a variety of clinical settings. It takes less than 5 minutes " "to administer and requires no professional training. It focuses on drinking patterns in the <b>past year</b>.", body_style)) story.append(Spacer(1, 4)) # Key facts box kf_data = [ ['Items', 'Score Range', 'Time', 'Focus Period'], ['10 questions', '0 – 40', '< 5 minutes', 'Past 12 months'], ] kf_table = Table(kf_data, colWidths=[W/4]*4) kf_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a237e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 10), ('ALIGN', (0,0), (-1,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#e8eaf6'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#9fa8da')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(kf_table) story.append(Spacer(1, 10)) # The 10 Questions story.append(Paragraph("The 10 AUDIT Questions", h1_style)) story.append(Paragraph("<b>Domain 1: Alcohol Consumption (Questions 1–3)</b>", h2_style)) q_data = [ ['Q', 'Question', 'Answer Options (Score)'], ['1', 'How often do you have a drink containing alcohol?', '(0) Never (1) Monthly or less\n(2) 2–4×/month (3) 2–3×/week (4) ≥4×/week'], ['2', 'How many drinks on a typical drinking day?', '(0) 1–2 (1) 3–4 (2) 5–6 (3) 7–9 (4) ≥10'], ['3', 'How often do you have ≥6 drinks on one occasion?', '(0) Never (1) <monthly (2) Monthly (3) Weekly (4) Daily'], ] q_table = Table(q_data, colWidths=[1*cm, 7*cm, W - 8*cm]) q_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#3949ab')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9), ('ALIGN', (0,0), (0,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#e8eaf6'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#9fa8da')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), ])) story.append(q_table) story.append(Paragraph("→ Skip to Q9 and Q10 if total score for Q2 + Q3 = 0", note_style)) story.append(Spacer(1, 6)) story.append(Paragraph("<b>Domain 2: Dependence Symptoms (Questions 4–6)</b>", h2_style)) dep_data = [ ['Q', 'Question'], ['4', 'How often in the past year were you unable to stop drinking once you had started?'], ['5', 'How often in the past year have you failed to do what was normally expected because of drinking?'], ['6', 'How often in the past year have you needed a morning drink to get going after heavy drinking?'], ] dep_table = Table(dep_data, colWidths=[1*cm, W - 1*cm]) dep_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#5c6bc0')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9), ('ALIGN', (0,0), (0,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#e8eaf6'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#9fa8da')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), ])) story.append(dep_table) story.append(Paragraph("Each scored: (0) Never (1) <monthly (2) Monthly (3) Weekly (4) Daily or almost daily", bullet_style)) story.append(Spacer(1, 6)) story.append(Paragraph("<b>Domain 3: Harmful Alcohol Use (Questions 7–10)</b>", h2_style)) harm_data = [ ['Q', 'Question', 'Special Scoring'], ['7', 'How often in the past year have you felt guilty or remorseful after drinking?', '0–4 scale'], ['8', 'How often in the past year were you unable to remember what happened the night before?', '0–4 scale'], ['9', 'Have you or someone else been injured as a result of your drinking?', '(0) No (2) Yes, not past year (4) Yes, past year'], ['10', 'Has a relative/friend/doctor been concerned about your drinking or suggested cutting down?', '(0) No (2) Yes, not past year (4) Yes, past year'], ] harm_table = Table(harm_data, colWidths=[1*cm, 8*cm, W - 9*cm]) harm_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#7986cb')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9), ('ALIGN', (0,0), (0,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#e8eaf6'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#9fa8da')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), ])) story.append(harm_table) story.append(Spacer(1, 10)) # Score Interpretation story.append(Paragraph("Score Interpretation", h1_style)) score_data = [ ['Score', 'Category', 'Interpretation', 'Action'], ['0 – 7', 'Low-risk', 'Safe/abstinent use', 'Reinforce safe drinking behaviour'], ['8 – 15', 'Hazardous', 'Risk of harm exists', 'Simple brief advice to reduce drinking'], ['16 – 19', 'Harmful', 'Harm is occurring', 'Brief counselling + continued monitoring'], ['≥ 20', 'Dependence', 'Likely alcohol dependence', 'Full diagnostic evaluation warranted'], ] score_table = Table(score_data, colWidths=[1.8*cm, 3*cm, 5*cm, W - 9.8*cm]) score_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a237e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9), ('ALIGN', (0,0), (1,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('BACKGROUND', (0,1), (-1,1), colors.HexColor('#c8e6c9')), ('BACKGROUND', (0,2), (-1,2), colors.HexColor('#fff9c4')), ('BACKGROUND', (0,3), (-1,3), colors.HexColor('#ffe0b2')), ('BACKGROUND', (0,4), (-1,4), colors.HexColor('#ffcdd2')), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#9fa8da')), ('TOPPADDING', (0,0), (-1,-1), 6), ('BOTTOMPADDING', (0,0), (-1,-1), 6), ('LEFTPADDING', (0,0), (-1,-1), 6), ('FONTNAME', (0,1), (0,-1), 'Helvetica-Bold'), ])) story.append(score_table) story.append(Spacer(1, 10)) # AUDIT-C story.append(Paragraph("AUDIT-C (Abbreviated Version)", h1_style)) story.append(Paragraph( "The <b>AUDIT-C</b> uses only Questions 1, 2, and 3. Score range: <b>0–12</b>. " "It accounts for most of the AUDIT's discriminative power in medical populations.", body_style)) auditc_data = [ ['Population', 'Positive Screen Threshold'], ['General adults – Men', '≥ 4'], ['General adults – Women', '≥ 3'], ['Older adults (≥ 65 years)', '≥ 2 (suggests further assessment)'], ] auditc_table = Table(auditc_data, colWidths=[W/2, W/2]) auditc_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#5c6bc0')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 10), ('ALIGN', (0,0), (-1,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#e8eaf6'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#9fa8da')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(auditc_table) story.append(Spacer(1, 10)) # Comparison table story.append(Paragraph("Comparison of Alcohol Screening Tools", h1_style)) comp_data = [ ['Tool', 'Items', 'Time', 'Best Use'], ['AUDIT', '10', '~5 min', 'Primary care; early hazardous/harmful detection'], ['AUDIT-C', '3', '~1 min', 'Quick consumption screen; elderly'], ['CAGE', '4', '~1 min', 'High specificity for dependence; misses early use'], ['MAST', '25', '~10 min', 'Higher predictive value; harder to administer'], ['SMAST-G', '10', '~5 min', 'Validated specifically for older adults'], ['TWEAK', '5', '~2 min', 'Obstetric/perinatal screening; score ≥2 = risk'], ] comp_table = Table(comp_data, colWidths=[2.5*cm, 1.5*cm, 2*cm, W - 6*cm]) comp_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a237e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9), ('ALIGN', (0,0), (2,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#e8eaf6'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#9fa8da')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), ])) story.append(comp_table) story.append(Spacer(1, 10)) # Clinical Pearls story.append(Paragraph("Clinical Pearls", h1_style)) pearls = [ "AUDIT sensitivity at threshold ≥8 is high (especially men). Use ≥10 for greater specificity. Lower cutoffs for women and adolescents.", "USPSTF recommends screening <b>all adults annually</b> using AUDIT, AUDIT-C, or single-question SASQ.", "A negative response to drinking questions does NOT rule out AUD - the patient may have had to quit due to alcohol problems.", "Biological markers complement AUDIT: MCV >100 fL, AST > ALT, GGT elevated, CDT >1.7% saturation.", "In the ED setting, AUDIT and AUDIT-C have superior sensitivity/specificity among brief alcohol screening tools.", ] for p in pearls: story.append(Paragraph(f"• {p}", bullet_style)) story.append(Spacer(1, 14)) story.append(HRFlowable(width=W, thickness=1, color=colors.HexColor('#9fa8da'))) story.append(Paragraph("Sources: Kaplan & Sadock's Comprehensive Textbook of Psychiatry | Textbook of Family Medicine 9e | Goldman-Cecil Medicine | Symptom to Diagnosis 4e", footer_style)) doc.build(story) print("PDF 1 created successfully.") PYEOF python3 /tmp/workspace/medical-notes-pdfs/make_pdf1_audit.py
cat << 'PYEOF' > /tmp/workspace/medical-notes-pdfs/make_pdf2_opidn.py from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY doc = SimpleDocTemplate( "/tmp/workspace/medical-notes-pdfs/2_OPIDN_Organophosphate_Polyneuropathy.pdf", pagesize=A4, rightMargin=2*cm, leftMargin=2*cm, topMargin=2*cm, bottomMargin=2*cm ) styles = getSampleStyleSheet() W = A4[0] - 4*cm title_s = ParagraphStyle('T', parent=styles['Title'], fontSize=18, textColor=colors.HexColor('#1b5e20'), spaceAfter=4, alignment=TA_CENTER) sub_s = ParagraphStyle('S', parent=styles['Normal'], fontSize=11, textColor=colors.HexColor('#388e3c'), spaceAfter=10, alignment=TA_CENTER) h1_s = ParagraphStyle('H1', parent=styles['Heading1'], fontSize=13, textColor=colors.HexColor('#1b5e20'), spaceBefore=12, spaceAfter=4, backColor=colors.HexColor('#e8f5e9'), leading=18) h2_s = ParagraphStyle('H2', parent=styles['Heading2'], fontSize=11, textColor=colors.HexColor('#2e7d32'), spaceBefore=8, spaceAfter=3) body_s = ParagraphStyle('B', parent=styles['Normal'], fontSize=10, leading=14, spaceAfter=4, alignment=TA_JUSTIFY) bullet_s = ParagraphStyle('Bl', parent=styles['Normal'], fontSize=10, leading=13, spaceAfter=3, leftIndent=14) footer_s = ParagraphStyle('F', parent=styles['Normal'], fontSize=8, textColor=colors.grey, alignment=TA_CENTER) box_s = ParagraphStyle('Box', parent=styles['Normal'], fontSize=9, textColor=colors.HexColor('#b71c1c'), leading=13, backColor=colors.HexColor('#ffebee'), leftIndent=8, spaceAfter=6) code_s = ParagraphStyle('Code', parent=styles['Normal'], fontSize=9, leading=13, backColor=colors.HexColor('#f1f8e9'), leftIndent=12, spaceAfter=4, fontName='Courier') story = [] story.append(Paragraph("OPIDN", title_s)) story.append(Paragraph("Organophosphate-Induced Delayed Polyneuropathy", sub_s)) story.append(HRFlowable(width=W, thickness=2, color=colors.HexColor('#1b5e20'))) story.append(Spacer(1, 8)) story.append(Paragraph("Definition", h1_s)) story.append(Paragraph( "OPIDN is a <b>delayed peripheral (and sometimes central) axonopathy</b> that develops after exposure " "to certain organophosphate (OP) compounds. It presents <b>1–3 weeks after acute exposure</b>, " "even in the absence of prior cholinergic toxicity, and is entirely distinct from both the acute " "cholinergic crisis and the intermediate syndrome.", body_s)) story.append(Paragraph("Three Neurological Syndromes of OP Poisoning", h1_s)) syn_data = [ ['Syndrome', 'Onset', 'Mechanism', 'Key Features'], ['Acute Cholinergic Crisis', 'Minutes–hours', 'AChE inhibition → ACh excess', 'SLUDGE, miosis, bronchospasm, seizures, coma'], ['Intermediate Syndrome', '24–96 hrs', 'Nicotinic receptor over-stimulation', 'Proximal weakness, cranial nerve palsies, respiratory paralysis (potentially fatal)'], ['OPIDN', '1–3 weeks', 'NTE inhibition + "aging"', 'Distal sensorimotor polyneuropathy; NO respiratory muscle involvement'], ] syn_table = Table(syn_data, colWidths=[3.5*cm, 2.5*cm, 4.5*cm, W-10.5*cm]) syn_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1b5e20')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#e8f5e9'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#a5d6a7')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), ('BACKGROUND', (0,3), (-1,3), colors.HexColor('#fff9c4')), ])) story.append(syn_table) story.append(Spacer(1, 8)) story.append(Paragraph("Pathophysiology", h1_s)) story.append(Paragraph("<b>NOT related to AChE inhibition.</b> Two main mechanisms:", body_s)) mech = [ "<b>1. NTE (Neuropathy Target Esterase) inhibition:</b> Certain OPs phosphorylate and inhibit NTE, an axonal membrane enzyme present in essentially all neurons. Its inhibition triggers axonal degeneration.", '<b>2. "Aging" of inhibited NTE:</b> Dealkylation locks the phosphoryl-NTE bond irreversibly. Aging must occur for full neuropathy to develop - degree of aging correlates with severity.', "<b>3. Alternative pathway:</b> Phosphorylation/activation of Ca²⁺/calmodulin kinase → enhanced proteolysis of neuronal cytoskeletal proteins → structural changes in neurofilaments → impaired axonal transport.", ] for m in mech: story.append(Paragraph(f"• {m}", bullet_s)) story.append(Spacer(1, 6)) story.append(Paragraph("Causative Agents", h1_s)) story.append(Paragraph("Not all OPs cause OPIDN - only those that strongly inhibit NTE:", body_s)) agents = ["Tri-ortho cresyl phosphate (TOCP) - prototype; caused mass 'Jake leg' paralysis epidemics from contaminated illicit alcohol", "Leptophos", "Trichlorfon", "Mipafox", "Military nerve agents (sarin, soman, tabun, VX) - at high doses"] for a in agents: story.append(Paragraph(f"• {a}", bullet_s)) story.append(Paragraph("⚠ No evidence that prolonged LOW-LEVEL OP exposure causes peripheral neuropathy.", box_s)) story.append(Paragraph("Clinical Features", h1_s)) story.append(Paragraph("<b>Early (1–3 weeks post-exposure):</b>", h2_s)) early = ["Paresthesias in the feet and calf cramps", "Progressive distal weakness spreading proximally", "Maximal deficit within 2 weeks of onset", "Quadriplegia in severe cases", "Sensory deficits on examination (despite inconspicuous complaints)", "Loss of Achilles reflex; other tendon reflexes depressed", "Cranial nerve function typically SPARED", "Respiratory muscles NOT affected"] for e in early: story.append(Paragraph(f"• {e}", bullet_s)) story.append(Paragraph("<b>Late (Upper Motor Neuron signs):</b>", h2_s)) story.append(Paragraph( "As peripheral neuropathy partially improves, <b>pyramidal (UMN) signs become unmasked</b> " "(spasticity, brisk reflexes) - reflecting concurrent spinal cord involvement (myelopathy). " "This determines functional prognosis.", body_s)) story.append(Paragraph("Electrodiagnostic Findings", h1_s)) edx_data = [ ['Parameter', 'Finding'], ['Pattern', 'Axonopathy (NOT demyelinating)'], ['EMG', 'Partial denervation of affected muscles'], ['CMAPs', 'Small compound muscle action potentials'], ['Motor conduction velocity', 'Normal or only minimally reduced'], ] edx_table = Table(edx_data, colWidths=[W/2, W/2]) edx_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#2e7d32')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9.5), ('ALIGN', (0,0), (-1,-1), 'LEFT'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#e8f5e9'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#a5d6a7')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 8), ])) story.append(edx_table) story.append(Spacer(1, 8)) story.append(Paragraph("Prognosis", h1_s)) prog_data = [ ['Severity', 'Outcome'], ['Mild OPIDN (neuropathy only)', 'Good recovery after removal of exposure'], ['Severe OPIDN (with myelopathy / UMN involvement)', 'Generally POOR - UMN findings determine functional recovery'], ] prog_table = Table(prog_data, colWidths=[W/2, W/2]) prog_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1b5e20')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9.5), ('BACKGROUND', (0,1), (-1,1), colors.HexColor('#c8e6c9')), ('BACKGROUND', (0,2), (-1,2), colors.HexColor('#ffcdd2')), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#a5d6a7')), ('TOPPADDING', (0,0), (-1,-1), 6), ('BOTTOMPADDING', (0,0), (-1,-1), 6), ('LEFTPADDING', (0,0), (-1,-1), 8), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ])) story.append(prog_table) story.append(Spacer(1, 8)) story.append(Paragraph("Treatment", h1_s)) tx = [ "<b>No specific treatment</b> exists to arrest progression or hasten recovery", "Supportive care and physiotherapy", "For acute cholinergic phase: <b>Atropine</b> (muscarinic) + <b>Pralidoxime</b> (reactivates AChE before aging) + <b>Benzodiazepines</b> (seizures) + ventilatory support", "Pralidoxime has NO effect on OPIDN once aging has occurred", "Lymphocyte NTE measurement can monitor occupational exposure and predict neuropathy", ] for t in tx: story.append(Paragraph(f"• {t}", bullet_s)) story.append(Spacer(1, 14)) story.append(HRFlowable(width=W, thickness=1, color=colors.HexColor('#a5d6a7'))) story.append(Paragraph("Sources: Bradley and Daroff's Neurology in Clinical Practice | Katzung's Basic and Clinical Pharmacology 16e | Tietz Textbook of Laboratory Medicine 7e | Frameworks for Internal Medicine", footer_s)) doc.build(story) print("PDF 2 created.") PYEOF python3 /tmp/workspace/medical-notes-pdfs/make_pdf2_opidn.py
cat << 'PYEOF' > /tmp/workspace/medical-notes-pdfs/make_pdf3_ims.py from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY doc = SimpleDocTemplate( "/tmp/workspace/medical-notes-pdfs/3_Intermediate_Syndrome_OP_Poisoning.pdf", pagesize=A4, rightMargin=2*cm, leftMargin=2*cm, topMargin=2*cm, bottomMargin=2*cm ) styles = getSampleStyleSheet() W = A4[0] - 4*cm title_s = ParagraphStyle('T', parent=styles['Title'], fontSize=18, textColor=colors.HexColor('#bf360c'), spaceAfter=4, alignment=TA_CENTER) sub_s = ParagraphStyle('S', parent=styles['Normal'], fontSize=11, textColor=colors.HexColor('#e64a19'), spaceAfter=10, alignment=TA_CENTER) h1_s = ParagraphStyle('H1', parent=styles['Heading1'], fontSize=13, textColor=colors.HexColor('#bf360c'), spaceBefore=12, spaceAfter=4, backColor=colors.HexColor('#fbe9e7'), leading=18) h2_s = ParagraphStyle('H2', parent=styles['Heading2'], fontSize=11, textColor=colors.HexColor('#d84315'), spaceBefore=8, spaceAfter=3) body_s = ParagraphStyle('B', parent=styles['Normal'], fontSize=10, leading=14, spaceAfter=4, alignment=TA_JUSTIFY) bullet_s = ParagraphStyle('Bl', parent=styles['Normal'], fontSize=10, leading=13, spaceAfter=3, leftIndent=14) footer_s = ParagraphStyle('F', parent=styles['Normal'], fontSize=8, textColor=colors.grey, alignment=TA_CENTER) warn_s = ParagraphStyle('W', parent=styles['Normal'], fontSize=9.5, textColor=colors.HexColor('#b71c1c'), leading=14, backColor=colors.HexColor('#ffebee'), leftIndent=8, spaceAfter=6, fontName='Helvetica-Bold') neg_s = ParagraphStyle('Neg', parent=styles['Normal'], fontSize=9.5, leading=14, backColor=colors.HexColor('#e3f2fd'), leftIndent=8, spaceAfter=6) story = [] story.append(Paragraph("Intermediate Syndrome (IMS)", title_s)) story.append(Paragraph("of Organophosphate Poisoning", sub_s)) story.append(HRFlowable(width=W, thickness=2, color=colors.HexColor('#bf360c'))) story.append(Spacer(1, 8)) story.append(Paragraph("Definition & Position", h1_s)) story.append(Paragraph( "The <b>Intermediate Syndrome</b> is a neuromuscular complication of organophosphate poisoning that occurs " "<b>between</b> the acute cholinergic crisis and OPIDN. It is caused primarily by <b>excessive nicotinic receptor " "stimulation</b> at the neuromuscular junction and progressive neuromuscular transmission failure. " "It occurs in up to <b>40% of patients</b> following OP ingestion.", body_s)) timeline_data = [ ['Syndrome', 'Onset', 'Duration', 'Main Risk'], ['Acute Cholinergic Crisis', 'Minutes–hours', 'Hours–days', 'Respiratory failure from bronchospasm'], ['INTERMEDIATE SYNDROME', '1–5 days', '~7 days–3 weeks', '⚠ RESPIRATORY MUSCLE PARALYSIS'], ['Chronic Toxicity', 'Weeks (repeated exposure)', 'Variable', 'Sensorimotor axonopathy'], ['OPIDN', '1–3 weeks', 'Months–permanent', 'Myelopathy; functional disability'], ] tl_table = Table(timeline_data, colWidths=[4*cm, 3*cm, 3*cm, W-10*cm]) tl_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#bf360c')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#fbe9e7'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#ffab91')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), ('BACKGROUND', (0,2), (-1,2), colors.HexColor('#ffccbc')), ('FONTNAME', (0,2), (-1,2), 'Helvetica-Bold'), ('TEXTCOLOR', (0,2), (-1,2), colors.HexColor('#bf360c')), ])) story.append(tl_table) story.append(Spacer(1, 8)) story.append(Paragraph("Pathophysiology", h1_s)) mech = [ "<b>Excessive nicotinic NMJ stimulation</b> - not related to muscarinic receptor stimulation (hence: no SLUDGE signs)", "<b>Neuromuscular transmission failure</b> - progressive decrement in NMJ transmission efficiency", "<b>Prolonged AChE inhibition</b> - severity correlates with duration of cholinesterase suppression", "<b>Lipophilic OP redistribution</b> from adipose tissue back into circulation after apparent clinical recovery, causing re-emergence of toxicity", ] for m in mech: story.append(Paragraph(f"• {m}", bullet_s)) story.append(Paragraph("⚠ IMS reflects NICOTINIC (not muscarinic) excess. Muscarinic signs (SLUDGE) are ABSENT during IMS.", warn_s)) story.append(Paragraph("Clinical Features", h1_s)) story.append(Paragraph("<b>Muscle groups affected (in order of clinical importance):</b>", h2_s)) muscle_data = [ ['Muscle Group', 'Clinical Consequence', 'Severity'], ['Respiratory muscles', 'Ventilatory failure - MAIN CAUSE OF DEATH', '⚠ Critical'], ['Neck flexors', 'Unable to raise head from pillow', 'Moderate'], ['Proximal limb muscles', 'Proximal > distal limb weakness', 'Moderate'], ['Cranial nerve muscles', 'Facial weakness, diplopia, dysphagia, dysarthria', 'Moderate'], ] m_table = Table(muscle_data, colWidths=[4*cm, 7*cm, W-11*cm]) m_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#d84315')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#fbe9e7'), colors.white]), ('BACKGROUND', (0,1), (-1,1), colors.HexColor('#ffcdd2')), ('FONTNAME', (0,1), (-1,1), 'Helvetica-Bold'), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#ffab91')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 6), ])) story.append(m_table) story.append(Spacer(1, 6)) story.append(Paragraph("<b>Key NEGATIVE features (distinguishing features):</b>", h2_s)) neg_features = [ "NO salivation, lacrimation, miosis, or bradycardia (muscarinic signs absent)", "NO sensory disturbance (distinguishes from OPIDN)", "Nerve gas poisoning has NOT been reported to cause IMS", ] for n in neg_features: story.append(Paragraph(f"✗ {n}", neg_s)) story.append(Paragraph("Diagnosis", h1_s)) diag = [ "Primarily <b>clinical</b> - based on timing of muscle weakness after OP exposure", "<b>EMG</b>: shows a <b>decremental response on repetitive nerve stimulation</b> - reflecting NMJ transmission failure (similar to myasthenic pattern)", "Often <b>missed</b> because the patient may have appeared to recover from the cholinergic crisis", "Misattribution to inadequate atropine is a common error - atropine does NOT treat IMS", ] for d in diag: story.append(Paragraph(f"• {d}", bullet_s)) story.append(Paragraph("Treatment", h1_s)) story.append(Paragraph( "<b>There is no specific antidote for IMS.</b> It is not effectively treated with the standard OP " "protocol (atropine + pralidoxime).", warn_s)) tx = [ "<b>Mechanical ventilation</b> is the mainstay - early aggressive respiratory support is life-saving", "Atropine - treats only muscarinic effects; NO effect on NMJ dysfunction", "Pralidoxime - may help if given early (before AChE aging), but by IMS onset, aging may have occurred", "Early antidote therapy at the acute stage may <b>prevent or reduce</b> IMS severity", "Symptoms resolve spontaneously in ~7 days with adequate respiratory support", ] for t in tx: story.append(Paragraph(f"• {t}", bullet_s)) story.append(Spacer(1, 8)) story.append(Paragraph("IMS vs OPIDN - Key Comparison", h1_s)) comp_data = [ ['Feature', 'IMS', 'OPIDN'], ['Onset', '1–5 days', '1–3 weeks'], ['Mechanism', 'Nicotinic NMJ failure', 'NTE inhibition'], ['Respiratory involvement', 'YES - potentially fatal', 'NO'], ['Sensory features', 'NO', 'YES (paresthesias)'], ['Weakness pattern', 'Proximal > distal', 'Distal > proximal'], ['UMN signs', 'NO', 'YES (late, if myelopathy)'], ['Prognosis', 'Recovers in ~1 week (with ventilation)', 'Variable; may be permanent'], ['Nerve gas as cause', 'NOT reported', 'YES (high dose)'], ['Treatment', 'Ventilation (supportive)', 'Supportive only'], ] comp_table = Table(comp_data, colWidths=[4.5*cm, (W-4.5*cm)/2, (W-4.5*cm)/2]) comp_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#bf360c')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#fbe9e7'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#ffab91')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 6), ('FONTNAME', (0,1), (0,-1), 'Helvetica-Bold'), ])) story.append(comp_table) story.append(Spacer(1, 14)) story.append(HRFlowable(width=W, thickness=1, color=colors.HexColor('#ffab91'))) story.append(Paragraph("Sources: Bradley and Daroff's Neurology in Clinical Practice | Tintinalli's Emergency Medicine | Katzung's Basic and Clinical Pharmacology 16e | Tietz Textbook of Laboratory Medicine 7e", footer_s)) doc.build(story) print("PDF 3 created.") PYEOF python3 /tmp/workspace/medical-notes-pdfs/make_pdf3_ims.py
cat << 'PYEOF' > /tmp/workspace/medical-notes-pdfs/make_pdf4_neuropathic.py from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY doc = SimpleDocTemplate( "/tmp/workspace/medical-notes-pdfs/4_Pathophysiology_Neuropathic_Pain.pdf", pagesize=A4, rightMargin=2*cm, leftMargin=2*cm, topMargin=2*cm, bottomMargin=2*cm ) styles = getSampleStyleSheet() W = A4[0] - 4*cm title_s = ParagraphStyle('T', parent=styles['Title'], fontSize=18, textColor=colors.HexColor('#4a148c'), spaceAfter=4, alignment=TA_CENTER) sub_s = ParagraphStyle('S', parent=styles['Normal'], fontSize=11, textColor=colors.HexColor('#7b1fa2'), spaceAfter=10, alignment=TA_CENTER) h1_s = ParagraphStyle('H1', parent=styles['Heading1'], fontSize=13, textColor=colors.HexColor('#4a148c'), spaceBefore=12, spaceAfter=4, backColor=colors.HexColor('#f3e5f5'), leading=18) h2_s = ParagraphStyle('H2', parent=styles['Heading2'], fontSize=11, textColor=colors.HexColor('#6a1b9a'), spaceBefore=8, spaceAfter=3) body_s = ParagraphStyle('B', parent=styles['Normal'], fontSize=10, leading=14, spaceAfter=4, alignment=TA_JUSTIFY) bullet_s = ParagraphStyle('Bl', parent=styles['Normal'], fontSize=10, leading=13, spaceAfter=3, leftIndent=14) subbullet_s = ParagraphStyle('SBl', parent=styles['Normal'], fontSize=9.5, leading=13, spaceAfter=2, leftIndent=28) footer_s = ParagraphStyle('F', parent=styles['Normal'], fontSize=8, textColor=colors.grey, alignment=TA_CENTER) quote_s = ParagraphStyle('Q', parent=styles['Normal'], fontSize=9.5, leading=14, backColor=colors.HexColor('#ede7f6'), leftIndent=12, rightIndent=12, spaceAfter=6, fontName='Helvetica-Oblique') code_s = ParagraphStyle('Code', parent=styles['Normal'], fontSize=8.5, leading=13, backColor=colors.HexColor('#f3e5f5'), leftIndent=12, spaceAfter=4, fontName='Courier') story = [] story.append(Paragraph("Pathophysiology of Neuropathic Pain", title_s)) story.append(Paragraph("A Brief Structured Note", sub_s)) story.append(HRFlowable(width=W, thickness=2, color=colors.HexColor('#4a148c'))) story.append(Spacer(1, 8)) story.append(Paragraph("Definition", h1_s)) story.append(Paragraph( "Neuropathic pain is pain arising from <b>damage to, or dysfunction of, any part of the peripheral " "or central somatosensory nervous system</b>. Unlike nociceptive pain (activation of intact pain fibres " "by a relevant stimulus), neuropathic pain persists or arises <b>independently of any ongoing tissue damage</b>. " "Key clinical hallmarks: spontaneous pain, <b>allodynia</b> (pain from non-painful stimuli), and " "<b>hyperalgesia</b> (exaggerated pain from painful stimuli).", body_s)) story.append(Paragraph("Overview of Mechanisms", h1_s)) mech_data = [ ['Mechanism', 'Site', 'Outcome'], ['Peripheral Sensitization', 'Peripheral nerves, DRG', 'Ectopic discharge; lowered activation threshold'], ['Central Sensitization (Segmental)', 'Dorsal horn, spinal cord', 'Wind-up; allodynia; hyperalgesia'], ['Central Sensitization (Suprasegmental)', 'Thalamus, cortex, brain', 'Self-sustaining pain; cortical reorganization'], ['Loss of Descending Inhibition', 'PAG, LC, raphe → spinal cord', 'Amplified pain signals; facilitation dominates'], ] mech_table = Table(mech_data, colWidths=[4.5*cm, 4*cm, W-8.5*cm]) mech_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#4a148c')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f3e5f5'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#ce93d8')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 6), ])) story.append(mech_table) story.append(Spacer(1, 8)) story.append(Paragraph("1. Peripheral Sensitization", h1_s)) story.append(Paragraph( "After nerve injury or disease, <b>normal transduction and conduction in primary afferent neurons " "is hijacked</b> to maintain nociceptive signalling in the absence of a relevant stimulus:", body_s)) periph = [ "<b>Ectopic discharge:</b> Injured afferents and DRG cells fire spontaneously, generating pain without a peripheral trigger", "<b>Ion channel upregulation:</b> Increased expression of Nav1.3, Nav1.7, Nav1.8 (voltage-gated Na⁺ channels) and TRPV1 lowers firing threshold", "<b>Cross-talk (ephaptic transmission):</b> Abnormal electrical coupling between adjacent neurons - Aβ (touch) fibres activate C-fibre pain pathways", "<b>Neuroinflammation:</b> Prostaglandins, bradykinin, substance P, CGRP, IL-1β, TNF-α sensitize nociceptors and lower activation threshold", ] for p in periph: story.append(Paragraph(f"• {p}", bullet_s)) story.append(Paragraph( "The sensitized primary afferent bombards the spinal cord with continuous impulses, " "setting the stage for central sensitization.", quote_s)) story.append(Paragraph("2. Central Sensitization", h1_s)) story.append(Paragraph("<b>A. Segmental (Dorsal Horn / Spinal Cord)</b>", h2_s)) seg = [ "<b>NMDA receptor activation:</b> Persistent glutamate release activates NMDA-Rs (normally Mg²⁺-blocked). Ca²⁺ influx → PKC, CaM kinase activation → phosphorylation of ion channels → lowered threshold of dorsal horn neurons", "<b>Wind-up:</b> Repeated C-fibre stimulation progressively increases dorsal horn neuron discharge (temporal summation)", "<b>Loss of inhibitory interneurons:</b> Degeneration of GABAergic/glycinergic interneurons → disinhibition → amplified pain signal; Aβ fibres gain access to pain-projecting neurons → <b>allodynia</b>", "<b>Loss of large-fibre inhibition (Gate Control):</b> Normally Aβ fibres activate inhibitory interneurons. When large fibres are damaged, this gate is lost", "<b>Glial activation:</b> Microglia and astrocytes release TNF-α, IL-6, NO → further enhance synaptic excitability", ] for s in seg: story.append(Paragraph(f"• {s}", bullet_s)) story.append(Paragraph("<b>B. Suprasegmental (Thalamus and Cortex)</b>", h2_s)) supra = [ "Thalamic relay neurons become hyperexcitable (<b>deafferentation hyperactivity</b>)", "Cortical map reorganization can generate pain in areas distant from original injury (e.g. phantom limb pain)", "The brain can maintain pain pathways <b>autonomously without ongoing peripheral input</b> (basis of fibromyalgia)", ] for s in supra: story.append(Paragraph(f"• {s}", bullet_s)) story.append(Paragraph( '"It is as though the brain has learned from its experience of pain, and decides not only to keep the ' 'process going, but also to enhance it and make it permanent." — Stahl\'s Essential Psychopharmacology', quote_s)) story.append(Paragraph("3. Loss of Descending Inhibitory Control", h1_s)) desc = [ "Brain normally sends <b>descending inhibitory signals</b> to the dorsal horn via noradrenergic (locus coeruleus) and serotonergic (raphe nuclei) pathways from the periaqueductal grey (PAG)", "In neuropathic states, the balance shifts toward <b>descending facilitation</b>, amplifying spinal pain signals", "This is the pharmacological basis for <b>SNRIs (duloxetine, venlafaxine)</b> and <b>TCAs</b> - they enhance descending noradrenergic and serotonergic inhibition", ] for d in desc: story.append(Paragraph(f"• {d}", bullet_s)) story.append(Paragraph("Key Neurotransmitters at the Dorsal Horn", h1_s)) nt_data = [ ['Transmitter', 'Receptor', 'Role'], ['Glutamate', 'AMPA-R, NMDA-R', 'Excitatory; NMDA drives central sensitization'], ['Substance P / CGRP', 'NK1, NK2, NK3; CGRP-R', 'Slow excitatory; neurogenic inflammation'], ['GABA / Glycine', 'GABA-A/B; Glycine-R', 'Inhibitory; loss → disinhibition'], ['Endorphins', 'μ-opioid receptor', 'Inhibitory; analgesic (basis of opioid therapy)'], ['Norepinephrine', 'α₂-adrenoceptors', 'Descending inhibition (basis of TCAs/SNRIs)'], ['Serotonin', '5HT1B/D (inhibitory), 5HT3 (excitatory)', 'Dual role - net inhibitory in descending pathways'], ] nt_table = Table(nt_data, colWidths=[3.5*cm, 4.5*cm, W-8*cm]) nt_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#6a1b9a')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f3e5f5'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#ce93d8')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 6), ])) story.append(nt_table) story.append(Spacer(1, 8)) story.append(Paragraph("Clinical Correlates", h1_s)) cc_data = [ ['Symptom', 'Underlying Mechanism'], ['Spontaneous burning pain', 'Ectopic discharge from injured afferents'], ['Allodynia (touch causes pain)', 'Loss of GABAergic gate + Aβ-fibre rewiring to pain pathways'], ['Hyperalgesia', 'Peripheral + central sensitization lowers threshold'], ['Paroxysmal shooting pain', 'Ectopic bursts from DRG / demyelinated axons'], ['Hyperpathia', 'Wind-up in dorsal horn'], ['Phantom limb pain', 'Deafferentation + cortical reorganization'], ] cc_table = Table(cc_data, colWidths=[W/2, W/2]) cc_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#4a148c')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f3e5f5'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#ce93d8')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 6), ])) story.append(cc_table) story.append(Spacer(1, 8)) story.append(Paragraph("Nociceptive vs Neuropathic Pain - Quick Comparison", h1_s)) noc_data = [ ['Feature', 'Nociceptive Pain', 'Neuropathic Pain'], ['Nervous system', 'Intact', 'Damaged / dysfunctional'], ['Mechanism', 'Nociceptor stimulation', 'Ectopic discharge; sensitization; disinhibition'], ['Quality', 'Aching, throbbing, sharp', 'Burning, shooting, electric, stabbing'], ['Spontaneous pain', 'Absent', 'Present'], ['Allodynia', 'Absent', 'Present'], ['Hyperalgesia', 'Proportionate', 'Disproportionate'], ['Response to NSAIDs/opioids', 'Good', 'Partial / poor'], ['Key treatments', 'NSAIDs, paracetamol, opioids', 'Gabapentin, pregabalin, TCAs, SNRIs'], ['Resolves with healing?', 'Usually yes', 'Often persists independently'], ] noc_table = Table(noc_data, colWidths=[4*cm, (W-4*cm)/2, (W-4*cm)/2]) noc_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#4a148c')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f3e5f5'), colors.white]), ('BACKGROUND', (1,1), (1,-1), colors.HexColor('#fff9c4')), ('BACKGROUND', (2,1), (2,-1), colors.HexColor('#ede7f6')), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#ce93d8')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 6), ('FONTNAME', (0,1), (0,-1), 'Helvetica-Bold'), ])) story.append(noc_table) story.append(Spacer(1, 14)) story.append(HRFlowable(width=W, thickness=1, color=colors.HexColor('#ce93d8'))) story.append(Paragraph("Sources: Stahl's Essential Psychopharmacology | Goldman-Cecil Medicine International Edition | Katzung's Basic and Clinical Pharmacology 16e | Rosen's Emergency Medicine | Rheumatology 2e (Elsevier)", footer_s)) doc.build(story) print("PDF 4 created.") PYEOF python3 /tmp/workspace/medical-notes-pdfs/make_pdf4_neuropathic.py
ls -lh /tmp/workspace/medical-notes-pdfs/*.pdf
1 AUDIT Alcohol Screening
PDF Document · PDF
2 OPIDN Organophosphate Polyneuropathy
PDF Document · PDF
3 Intermediate Syndrome OP Poisoning
PDF Document · PDF
4 Pathophysiology Neuropathic Pain
PDF Document · PDF
Pathophysiology of pain.
TRANSDUCTION → TRANSMISSION → MODULATION → PERCEPTION
(periphery) (nerve fibres) (spinal cord/ (cortex)
brain)

| Fibre Type | Diameter | Myelination | Conduction | Function |
|---|---|---|---|---|
| Aβ | Large | Heavily myelinated | Fast | Light touch/moving stimuli; does NOT produce pain normally |
| Aδ | Small | Thinly myelinated | Medium | Nociception - sharp, well-localized, fast pain ("first pain") |
| C | Smallest | Unmyelinated | Slow | Nociception - dull, diffuse, burning pain ("second pain") |
Ability to detect painful stimuli is completely abolished when conduction in Aδ and C fibres is blocked.

| Peptide | Precursor | Preferred Receptor | Location |
|---|---|---|---|
| Enkephalins | Proenkephalin | δ (delta) | Dorsal horn, brainstem |
| β-Endorphin | POMC | μ (mu) | PAG, hypothalamus |
| Dynorphins | Prodynorphin | κ (kappa) | Spinal cord, limbic system |
| Brain Region | Role |
|---|---|
| Somatosensory cortex (SI, SII) | Localization, quality, intensity (sensory-discriminative) |
| Anterior cingulate cortex (ACC) | Suffering, emotional response, motivation to escape |
| Insular cortex | Interoception; autonomic responses; emotional colouring |
| Prefrontal cortex | Cognitive evaluation; anticipation; attention |
| Hypothalamus | Autonomic and neuroendocrine stress responses |
| Amygdala | Fear and anxiety component of pain |
| Type | Site | Mechanism | Clinical Result |
|---|---|---|---|
| Peripheral sensitization | Peripheral terminals, DRG | Inflammatory mediators lower nociceptor threshold | Hyperalgesia, allodynia in injured tissue |
| Central sensitization | Dorsal horn (spinal cord) | NMDA-R activation, wind-up, loss of inhibition | Allodynia, hyperalgesia beyond injured area |
| Suprasegmental sensitization | Thalamus, cortex | Plastic changes; cortical reorganization | Chronic pain, phantom limb, fibromyalgia |
A striking example of peripheral sensitization: sunburned skin, in which severe pain is produced by a gentle slap or warm shower.
TISSUE INJURY / NOXIOUS STIMULUS
↓
TRANSDUCTION (peripheral terminals)
Nociceptor activation (TRPV1, Nav1.7/1.8, ASICs)
Aδ fibres → "fast" sharp pain
C fibres → "slow" dull/burning pain
↓
PERIPHERAL SENSITIZATION
BK, PGs, NGF, Substance P, CGRP → ↑excitability
Silent nociceptors recruited
↓
TRANSMISSION (DRG → Dorsal Horn)
Glutamate (AMPA/NMDA-R), Substance P (NK1-R)
↓
CENTRAL SENSITIZATION (Dorsal Horn)
Wind-up, NMDA activation, loss of inhibitory interneurons
↓
ASCENDING SPINOTHALAMIC TRACT
(Neospinothalamic → VPL → Somatosensory cortex)
(Paleospinothalamic → Medial thalamus → Limbic system)
↓
SUPRASPINAL MODULATION
PAG → RVM → ↓Dorsal horn (endogenous opioids, NE, 5-HT)
Gate control (Aβ → inhibitory interneurons)
↓
PERCEPTION ("Pain Matrix")
Somatosensory cortex: WHERE and HOW MUCH
Anterior cingulate: SUFFERING
Insular cortex: AUTONOMIC response
Prefrontal cortex: MEANING and CONTEXT
Generate a PDF summary of pain pathophysiology for clinical reference
cat << 'PYEOF' > /tmp/workspace/medical-notes-pdfs/make_pdf5_pain_patho.py from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, PageBreak, KeepTogether) from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY, TA_RIGHT from reportlab.platypus import Flowable import io PAGE_W, PAGE_H = A4 LM = RM = 2*cm TM = BM = 2*cm W = PAGE_W - LM - RM doc = SimpleDocTemplate( "/tmp/workspace/medical-notes-pdfs/5_Pain_Pathophysiology_Clinical_Reference.pdf", pagesize=A4, rightMargin=RM, leftMargin=LM, topMargin=TM, bottomMargin=BM, title="Pain Pathophysiology – Clinical Reference", author="Orris Medical AI" ) # ─── Colour palette ────────────────────────────────────────── C_DARK = colors.HexColor('#b71c1c') # deep red C_MID = colors.HexColor('#e53935') # mid red C_LIGHT = colors.HexColor('#ffebee') # pale blush C_ACCENT = colors.HexColor('#ff8a80') # light red C_HEAD = colors.HexColor('#212121') # near black C_SUB = colors.HexColor('#4e342e') # dark brown C_GRID = colors.HexColor('#ef9a9a') # rose grid C_ALT1 = colors.HexColor('#fff8f8') C_ALT2 = colors.white C_BOX = colors.HexColor('#fce4ec') # pink box bg C_GREY = colors.HexColor('#757575') styles = getSampleStyleSheet() def ps(name, parent='Normal', **kw): return ParagraphStyle(name, parent=styles[parent], **kw) # Styles TITLE = ps('TITLE', 'Title', fontSize=22, textColor=C_DARK, spaceAfter=2, alignment=TA_CENTER, leading=26) SUBT = ps('SUBT', 'Normal', fontSize=11, textColor=C_MID, spaceAfter=6, alignment=TA_CENTER) H1 = ps('H1', 'Heading1',fontSize=13, textColor=C_DARK, spaceBefore=12,spaceAfter=4, backColor=C_LIGHT, leading=18, leftIndent=4) H2 = ps('H2', 'Heading2',fontSize=11, textColor=C_SUB, spaceBefore=8, spaceAfter=3) BODY = ps('BODY', 'Normal', fontSize=9.5,leading=14, spaceAfter=4, alignment=TA_JUSTIFY) BULLET = ps('BULLET', 'Normal', fontSize=9.5,leading=13, spaceAfter=3, leftIndent=14) SBULL = ps('SBULL', 'Normal', fontSize=9, leading=12, spaceAfter=2, leftIndent=28) FOOT = ps('FOOT', 'Normal', fontSize=7.5,textColor=C_GREY, alignment=TA_CENTER) BOX = ps('BOX', 'Normal', fontSize=9.5,leading=14, spaceAfter=4, leftIndent=8, backColor=C_BOX, textColor=C_DARK, fontName='Helvetica-Bold') QUOTE = ps('QUOTE', 'Normal', fontSize=9, leading=13, spaceAfter=5, leftIndent=12, rightIndent=12, backColor=colors.HexColor('#fff3e0'), fontName='Helvetica-Oblique') CODE = ps('CODE', 'Normal', fontSize=8.5,leading=13, spaceAfter=4, leftIndent=10, fontName='Courier', backColor=colors.HexColor('#fafafa')) PAGETITLE = ps('PT', 'Normal', fontSize=9, textColor=C_GREY, alignment=TA_RIGHT) def hr(thick=1.5, col=C_MID): return HRFlowable(width=W, thickness=thick, color=col, spaceAfter=4) def tbl(data, colw, header_bg=C_DARK, alt1=C_ALT1, alt2=C_ALT2, fontsize=9, vpad=5): t = Table(data, colWidths=colw) style = [ ('BACKGROUND', (0,0), (-1,0), header_bg), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), fontsize), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('GRID', (0,0), (-1,-1), 0.4, C_GRID), ('TOPPADDING', (0,0), (-1,-1), vpad), ('BOTTOMPADDING',(0,0),(-1,-1), vpad), ('LEFTPADDING', (0,0), (-1,-1), 6), ('RIGHTPADDING',(0,0), (-1,-1), 4), ] for i in range(1, len(data)): bg = alt1 if i % 2 == 1 else alt2 style.append(('BACKGROUND', (0,i), (-1,i), bg)) t.setStyle(TableStyle(style)) return t story = [] # ══════════════════════════════════════ # TITLE PAGE BLOCK # ══════════════════════════════════════ story.append(Spacer(1, 0.5*cm)) story.append(Paragraph("Pathophysiology of Pain", TITLE)) story.append(Paragraph("Clinical Reference Summary", SUBT)) story.append(hr(2.5, C_DARK)) story.append(Spacer(1, 4)) # Quick-reference overview box overview_data = [ ['Four Core Processes', 'Key Structures', 'Key Mediators'], ['1. Transduction', 'Nociceptor terminals, DRG', 'TRPV1, Nav1.7/1.8, ASICs, P2X'], ['2. Transmission', 'Aδ / C fibres → Dorsal horn → STT → Thalamus', 'Glutamate, Substance P, CGRP'], ['3. Modulation', 'PAG → RVM → Dorsal horn (Gate control)', 'Enkephalins, NE, 5-HT, GABA'], ['4. Perception', 'Somatosensory cortex, ACC, Insula, PFC', 'Opioid receptors; "pain matrix"'], ] story.append(tbl(overview_data, [3.5*cm, 6.5*cm, W-10*cm], header_bg=C_DARK, fontsize=9)) story.append(Spacer(1, 6)) # ══════════════════════════════════════ # SECTION 1 – THE PAIN SENSORY SYSTEM # ══════════════════════════════════════ story.append(Paragraph("1. The Pain Sensory System", H1)) story.append(Paragraph( "Pain is an <b>unpleasant sensation</b> with a fundamental <b>duality</b>: it is both a " "<b>sensation</b> (stabbing, burning, tearing) and an <b>emotion</b> (terrifying, nauseating). " "Acute pain produces behavioural arousal, stress response (↑BP, ↑HR, ↑cortisol, ↑pupil diameter), " "and local muscle contraction. The function of the pain sensory system is to <b>protect the body " "and maintain homeostasis</b> by detecting, localising, and identifying tissue-damaging processes.", BODY)) # ══════════════════════════════════════ # SECTION 2 – PERIPHERAL MECHANISMS # ══════════════════════════════════════ story.append(Paragraph("2. Peripheral Mechanisms", H1)) story.append(Paragraph("<b>Primary Afferent Fibre Classification</b>", H2)) fibre_data = [ ['Fibre', 'Diameter', 'Myelination', 'Velocity', 'Function', 'Pain Role'], ['Aβ', 'Large', 'Heavy', 'Fast (30–70 m/s)', 'Light touch, moving stimuli', 'No pain in normal state'], ['Aδ', 'Small', 'Thin', 'Medium (5–30 m/s)', 'Sharp, well-localised pain', '"First pain" (fast, pricking)'], ['C', 'Smallest','None (unmyelinated)','Slow (<2 m/s)', 'Dull, diffuse, burning pain', '"Second pain" (slow, aching)'], ] story.append(tbl(fibre_data, [1*cm, 1.8*cm, 3.2*cm, 3*cm, 3.5*cm, W-12.5*cm])) story.append(Spacer(1, 4)) story.append(Paragraph("<b>Transduction – Converting Stimuli to Electrical Signals</b>", H2)) transducers = [ "<b>TRPV1:</b> Activated by heat (>43°C), capsaicin, acidic pH – the classic pain transducer", "<b>TRPA1:</b> Cold, mechanical stimuli, chemical irritants", "<b>Nav1.7, Nav1.8, Nav1.9:</b> Voltage-gated Na⁺ channels – drive action potential generation; Nav1.7 mutations cause congenital insensitivity to pain", "<b>ASICs (Acid-Sensing Ion Channels):</b> Activated by tissue acidosis in ischaemia/inflammation", "<b>P2X receptors:</b> Activated by ATP released from damaged cells", ] for t_item in transducers: story.append(Paragraph(f"• {t_item}", BULLET)) story.append(Paragraph("<b>Peripheral Sensitization</b>", H2)) story.append(Paragraph( "When nociceptors are exposed to <b>damaged or inflamed tissue</b>, their activation threshold " "is lowered and firing frequency increases – this is <b>peripheral sensitization</b>. " "Inflammatory mediators activate intracellular signal transduction, increasing production " "and membrane insertion of ion channels.", BODY)) sens_data = [ ['Mediator', 'Source', 'Effect on Nociceptor'], ['Bradykinin (BK)', 'Plasma kininogen (kinin cascade)', 'Direct excitation + sensitization via B1/B2 receptors'], ['Prostaglandins (PGs)', 'Arachidonic acid via COX-1/COX-2', 'Sensitize to heat and mechanical stimuli (basis of NSAID action)'], ['NGF (Nerve Growth Factor)', 'Keratinocytes, mast cells, fibroblasts', 'Upregulates TRPV1 and Nav1.8; DRG soma changes'], ['Leukotrienes', 'Lipoxygenase pathway', 'Sensitize and directly activate nociceptors'], ['Low pH / H⁺', 'Ischaemia, inflammation', 'Activates ASICs and TRPV1'], ['Histamine', 'Mast cell degranulation', 'Itch and pain at low doses'], ['ATP', 'Damaged cells', 'Activates P2X3 on nociceptors'], ] story.append(tbl(sens_data, [3.5*cm, 4*cm, W-7.5*cm], fontsize=8.5)) story.append(Spacer(1, 4)) story.append(Paragraph("<b>Silent Nociceptors</b>", H2)) story.append(Paragraph( "A large proportion of Aδ and C fibres innervating <b>viscera</b> are <b>completely insensitive " "in normal non-inflamed tissue</b> – they cannot be activated by any known mechanical or thermal " "stimulus. In the presence of inflammatory mediators, these <b>silent nociceptors</b> become " "mechanosensitive. This explains how relatively insensitive deep structures (joints, hollow viscera) " "can become the source of severe pain under pathological conditions.", BODY)) story.append(Paragraph("<b>Neurogenic Inflammation</b>", H2)) story.append(Paragraph( "When activated, primary afferent nociceptors <b>release neuropeptides peripherally</b> – an " "active tissue-protective neuroeffector function:", BODY)) neuro_inf = [ "<b>Substance P (11-amino-acid peptide):</b> Potent vasodilator; mast cell degranulation (→ histamine release); chemotactic for leukocytes; enhances vascular permeability", "<b>CGRP (Calcitonin Gene-Related Peptide):</b> Potent vasodilator; enhances and prolongs Substance P effects; involved in migraine pathophysiology", "<b>Cholecystokinin:</b> Modulates opioid-mediated analgesia", ] for n in neuro_inf: story.append(Paragraph(f"• {n}", BULLET)) story.append(Paragraph( '"Neurogenic inflammation" = local flare, oedema, and immune cell recruitment driven by the nociceptor itself.', QUOTE)) # ══════════════════════════════════════ # SECTION 3 – TRANSMISSION (ASCENDING) # ══════════════════════════════════════ story.append(Paragraph("3. Transmission – The Ascending Pain Pathway", H1)) story.append(Paragraph( "Pain is transmitted centrally via a <b>three-neuron chain</b>: primary afferent → dorsal horn → " "thalamus → cortex.", BODY)) story.append(Paragraph("<b>1st Order: Primary Afferent → Dorsal Horn</b>", H2)) first_order = [ "Cell bodies in the <b>dorsal root ganglion (DRG)</b> within vertebral foramina", "Enter spinal cord via the dorsal root; synapse in <b>Rexed laminae I, II (SG), and V</b>", "<b>Aδ fibres</b> → lamina I and V (sharp, well-localised)", "<b>C fibres</b> → lamina I and II (burning, diffuse)", "Aδ synapse releases <b>glutamate</b> (fast AMPA-mediated EPSPs)", "C fibres co-release <b>glutamate + Substance P + CGRP</b> → activates AMPA-R, NMDA-R, and NK1-R", ] for f in first_order: story.append(Paragraph(f"• {f}", BULLET)) story.append(Paragraph("<b>2nd Order: Dorsal Horn → Thalamus (Spinothalamic Tract)</b>", H2)) stt_data = [ ['Tract', 'Fibres', 'Destination', 'Function'], ['Neospinothalamic (lateral STT)', 'Mainly Aδ', 'VPL nucleus of thalamus', 'Sensory-discriminative: location, quality, intensity'], ['Paleospinothalamic (medial STT)', 'Mainly C', 'Medial thalamic nuclei, reticular formation, PAG', 'Affective-motivational: suffering, arousal'], ] story.append(tbl(stt_data, [4*cm, 2.5*cm, 4*cm, W-10.5*cm], fontsize=8.5)) story.append(Paragraph("Axons cross the <b>midline</b> via the anterior white commissure before ascending – hence contralateral pain loss with Brown-Séquard syndrome.", BODY)) story.append(Paragraph("<b>3rd Order: Thalamus → Cortex (Pain Matrix)</b>", H2)) cortex_data = [ ['Region', 'Thalamic Input', 'Function in Pain'], ['Somatosensory cortex (SI, SII)', 'VPL', 'WHERE and HOW MUCH – sensory-discriminative'], ['Anterior cingulate cortex (ACC)', 'Medial thalamus', 'SUFFERING, motivation to escape, emotional response'], ['Insular cortex', 'Medial thalamus', 'Interoception; autonomic colouring; empathy for pain'], ['Prefrontal cortex (PFC)', 'Medial thalamus', 'Cognitive evaluation; attention; anticipation of pain'], ['Hypothalamus', 'Medial thalamus', 'Neuroendocrine and autonomic stress responses'], ['Amygdala', 'Medial thalamus', 'Fear, anxiety, conditioned pain responses'], ] story.append(tbl(cortex_data, [4*cm, 3*cm, W-7*cm], fontsize=8.5)) # ══════════════════════════════════════ # SECTION 4 – MODULATION # ══════════════════════════════════════ story.append(Paragraph("4. Modulation – Pain Control Systems", H1)) story.append(Paragraph( "Pain produced by injuries of similar magnitude is <b>remarkably variable</b> across individuals and " "situations. This reflects endogenous pain-modulating circuits. There are two broad systems: " "<b>descending inhibition</b> and the <b>gate control</b> mechanism.", BODY)) story.append(Paragraph("<b>A. Descending Opioidergic Inhibitory System</b>", H2)) story.append(Paragraph( "The key circuit: <b>Frontal cortex / Hypothalamus → PAG (midbrain) → RVM (medulla) → " "Dorsal horn</b>", BODY)) desc = [ "The <b>Periaqueductal Grey (PAG)</b> receives input from the hypothalamus and frontal cortex; " "it is rich in μ-opioid receptors", "PAG activates the <b>Rostral Ventromedial Medulla (RVM)</b>, which projects via the " "<b>dorsolateral funiculus</b> to the spinal dorsal horn", "Descending fibres release <b>norepinephrine (NE)</b> and <b>serotonin (5-HT)</b>, activating " "inhibitory interneurons in the dorsal horn", "Inhibitory interneurons release <b>enkephalins, GABA, and glycine</b> to suppress " "pain-transmission neurons", "<b>Every component of this circuit contains opioid receptors</b> – basis for opioid analgesia", "<b>Placebo analgesia</b> activates this same PAG → RVM circuit (fMRI-confirmed; reversed by naloxone)", "Clinical use: <b>SNRIs and TCAs</b> enhance NE and 5-HT descending inhibition – basis for " "their efficacy in neuropathic pain", ] for d in desc: story.append(Paragraph(f"• {d}", BULLET)) story.append(Paragraph("<b>B. Gate Control Theory (Melzack & Wall, 1965)</b>", H2)) story.append(Paragraph( "Aβ fibres (light touch/vibration) activate <b>inhibitory interneurons</b> in the substantia " "gelatinosa (SG, lamina II), which suppress the dorsal horn projection neuron (T-cell, lamina V). " "C/Aδ fibres inhibit these same SG interneurons – 'opening the gate'. The brain can also send " "descending signals to close the gate.", BODY)) gate_data = [ ['Input', 'Effect on SG Interneuron', 'Gate Status', 'Result'], ['Aβ fibres (touch/vibration)', 'Activated (excitatory)', 'CLOSED', 'Pain transmission suppressed'], ['C/Aδ fibres (pain)', 'Inhibited', 'OPEN', 'Pain transmission facilitated'], ['Descending inhibitory fibres', 'Activated', 'CLOSED', 'Analgesia (opioids, TENS, acupuncture)'], ] story.append(tbl(gate_data, [4*cm, 4*cm, 2.5*cm, W-10.5*cm], fontsize=8.5)) story.append(Paragraph("<b>C. Endogenous Opioid System</b>", H2)) opioid_data = [ ['Peptide', 'Precursor', 'Preferred Receptor', 'Key Locations'], ['Enkephalins (met- & leu-)', 'Proenkephalin', 'δ (delta)', 'Dorsal horn, brainstem, limbic system'], ['β-Endorphin', 'POMC', 'μ (mu)', 'PAG, hypothalamus, pituitary'], ['Dynorphins', 'Prodynorphin', 'κ (kappa)', 'Spinal cord, limbic system, hypothalamus'], ['Endomorphins', 'Unknown precursor', 'μ (mu)', 'Spinal cord, brainstem, thalamus'], ] story.append(tbl(opioid_data, [3.5*cm, 3*cm, 3*cm, W-9.5*cm], fontsize=8.5)) story.append(Paragraph( "Released during stress, exercise, and sexual activity – explaining <b>stress-induced analgesia</b>. " "Inhibit pain by: (1) pre-synaptically reducing primary afferent transmitter release; " "(2) post-synaptically hyperpolarising dorsal horn neurons.", BODY)) # ══════════════════════════════════════ # SECTION 5 – SENSITIZATION # ══════════════════════════════════════ story.append(Paragraph("5. Sensitization – Pathological Amplification", H1)) sens2_data = [ ['Type', 'Site', 'Key Mechanism', 'Clinical Result'], ['Peripheral sensitization', 'Peripheral terminals, DRG', 'Inflammatory mediators (BK, PGs, NGF) ↑ion channel expression/insertion → ↓threshold', 'Primary hyperalgesia, allodynia at injury site'], ['Central sensitization (segmental)', 'Spinal dorsal horn', 'NMDA-R activation → Ca²⁺ influx → PKC, CaM kinase → ↑excitability; wind-up; loss of GABAergic inhibition', 'Secondary hyperalgesia, allodynia beyond injury site'], ['Suprasegmental sensitization', 'Thalamus, cortex', 'Thalamic/cortical plastic changes; deafferentation hyperactivity; cortical reorganization', 'Chronic pain, phantom limb, fibromyalgia'], ['Loss of descending inhibition', 'PAG → RVM → Dorsal horn', 'Balance shifts toward facilitation; reduced NE/5-HT tone', 'Amplified pain; central sensitivity syndromes'], ] story.append(tbl(sens2_data, [3.5*cm, 3*cm, 5*cm, W-11.5*cm], fontsize=8.5)) story.append(Spacer(1, 4)) story.append(Paragraph( "Striking example of peripheral sensitization: <b>sunburned skin</b>, in which severe pain is " "produced by a gentle slap or a warm shower. Both allodynia and hyperalgesia result from " "sensitization lowering the threshold for nociceptor and dorsal horn neuron activation.", QUOTE)) story.append(Paragraph("Wind-Up and NMDA Receptor Activation", H2)) wind_up = [ "Repeated C-fibre stimulation at low frequency causes <b>progressive increase</b> in dorsal horn neuron discharge (temporal summation) – called <b>wind-up</b>", "Mechanism: repeated Substance P release sustains membrane depolarisation; this removes the Mg²⁺ block from <b>NMDA receptors</b>", "Ca²⁺ influx through NMDA-R activates <b>PKC, CaM kinase II, and phospholipase A₂</b>", "PKC phosphorylates NMDA-R and AMPA-R → ↑conductance; inserts new AMPA-R into membrane", "Production of <b>nitric oxide (NO)</b> – diffuses retrogradely to enhance pre-synaptic glutamate release", "End result: <b>long-term potentiation (LTP)</b> at dorsal horn synapses – a cellular memory for pain", ] for w in wind_up: story.append(Paragraph(f"• {w}", BULLET)) # ══════════════════════════════════════ # SECTION 6 – PAIN TYPES # ══════════════════════════════════════ story.append(Paragraph("6. Classification of Pain", H1)) pain_types = [ ['Type', 'Definition', 'Mechanism', 'Examples'], ['Nociceptive\n(Somatic)', 'Pain from actual/threatened tissue damage; NS intact', 'Nociceptor activation; normal signalling', 'Fracture, surgical wound, osteoarthritis'], ['Nociceptive\n(Visceral)', 'Pain from visceral organs; often poorly localised, referred', 'Hollow viscus distension, ischaemia, capsule stretch', 'Appendicitis, renal colic, MI'], ['Neuropathic', 'Pain from damage/dysfunction of somatosensory NS', 'Ectopic discharge, sensitization, disinhibition', 'Diabetic neuropathy, PHN, trigeminal neuralgia'], ['Nocipastic\n(Nociplastic)', 'Pain without clear tissue/nerve damage; altered nociception', 'Suprasegmental sensitization; descending facilitation', 'Fibromyalgia, IBS, chronic widespread pain'], ['Mixed', 'Combination of above mechanisms', 'Multiple concurrent mechanisms', 'Cancer pain, low back pain with radiculopathy'], ] story.append(tbl(pain_types, [2.5*cm, 3.5*cm, 4.5*cm, W-10.5*cm], fontsize=8.5)) # ══════════════════════════════════════ # SECTION 7 – NEUROTRANSMITTERS # ══════════════════════════════════════ story.append(Paragraph("7. Key Neurotransmitters at the Dorsal Horn", H1)) nt_data = [ ['Transmitter', 'Receptor(s)', 'Role', 'Clinical Relevance'], ['Glutamate', 'AMPA-R, NMDA-R, kainate-R', 'Fast excitatory; NMDA drives central sensitization', 'Ketamine (NMDA antagonist) for refractory pain'], ['Substance P', 'NK1, NK2, NK3', 'Slow excitatory; neurogenic inflammation', 'NK1 antagonists (aprepitant) for chemotherapy nausea/pain'], ['CGRP', 'CGRP-R', 'Slow excitatory; vasodilation', 'Anti-CGRP monoclonals (erenumab) for migraine prevention'], ['GABA', 'GABA-A, GABA-B', 'Inhibitory; "inhibitory gate"', 'Gabapentinoids ↑GABA tone; benzodiazepines'], ['Glycine', 'Glycine-R (also NMDA co-agonist)', 'Inhibitory at own receptor; excitatory via NMDA', 'Strychnine (glycine antagonist) causes hyperalgesia'], ['Enkephalins', 'μ, δ opioid receptors', 'Pre- and post-synaptic inhibition', 'Basis for opioid analgesia'], ['Norepinephrine', 'α₂-adrenoceptors (inhibitory)', 'Descending inhibition', 'Basis for TCA/SNRI action; clonidine (α₂ agonist)'], ['Serotonin (5-HT)', '5HT1B/D (inhibitory), 5HT3 (excitatory)', 'Dual role; net inhibitory descending', 'SNRIs, TCAs; 5HT3 antagonists (ondansetron)'], ['Nitric oxide (NO)', 'Diffusible gas', 'Retrograde messenger; ↑pre-synaptic glutamate', 'NOS inhibitors under investigation'], ] story.append(tbl(nt_data, [2.5*cm, 3*cm, 3.5*cm, W-9*cm], fontsize=8)) # ══════════════════════════════════════ # SECTION 8 – SUMMARY DIAGRAM (text-art) # ══════════════════════════════════════ story.append(Paragraph("8. Summary: The Pain Pathway", H1)) pathway_lines = [ "TISSUE INJURY / NOXIOUS STIMULUS", " ↓", "TRANSDUCTION (peripheral nociceptor terminals)", " Stimulus → ion channel activation (TRPV1, ASICs, Nav1.7/1.8) → action potential", " Aδ → 'first pain' (sharp, fast) | C fibres → 'second pain' (dull, slow)", " ↓", "PERIPHERAL SENSITIZATION", " BK, PGs, NGF, Substance P, CGRP → ↓threshold; silent nociceptors recruited", " Neurogenic inflammation: SP + CGRP released peripherally → flare", " ↓", "TRANSMISSION (DRG → Dorsal Horn)", " Aδ: glutamate → AMPA-R (fast EPSP)", " C: glutamate + SP + CGRP → AMPA-R + NMDA-R + NK1-R (sustained excitation)", " ↓", "CENTRAL SENSITIZATION (Dorsal Horn)", " NMDA-R activation → Ca²⁺ → PKC → wind-up → LTP", " Loss of GABAergic/glycinergic interneurons → disinhibition", " ↓", "ASCENDING SPINOTHALAMIC TRACT (contralateral)", " Neospinothalamic → VPL thalamus → Somatosensory cortex (location, quality)", " Paleospinothalamic → Medial thalamus → ACC + Insula (suffering, affect)", " ↓ ↑", "PAIN PERCEPTION ('Pain Matrix') ←→ DESCENDING MODULATION", " SI/SII: WHERE, HOW MUCH PAG → RVM → Dorsal horn", " ACC: SUFFERING NE, 5-HT, enkephalins", " Insula: AUTONOMIC response Gate control (Aβ fibres)", " PFC: MEANING, CONTEXT Opioid receptors at every level", ] for line in pathway_lines: story.append(Paragraph(line, CODE)) # ══════════════════════════════════════ # SECTION 9 – CLINICAL CORRELATES # ══════════════════════════════════════ story.append(Paragraph("9. Clinical Correlates", H1)) cc_data = [ ['Symptom/Sign', 'Underlying Mechanism', 'Clinical Example'], ['Spontaneous pain', 'Ectopic discharge from injured afferents or DRG', 'Postherpetic neuralgia; phantom limb'], ['Allodynia\n(pain from non-painful stimuli)', 'Loss of GABAergic gate; Aβ-fibre rewiring to pain pathways', 'Sunburned skin; diabetic neuropathy'], ['Primary hyperalgesia', 'Peripheral sensitization at injury site', 'Tender wound; inflamed joint'], ['Secondary hyperalgesia', 'Central sensitization beyond injury', 'Area surrounding a burn; fibromyalgia'], ['Referred pain', 'Visceral and somatic afferents converge on same dorsal horn neurons', 'MI → left arm; appendicitis → periumbilical then RIF'], ['Shooting/electric pain', 'Ectopic bursts from demyelinated axons', 'Trigeminal neuralgia; MS-related pain'], ['Hyperpathia', 'Wind-up; lowered dorsal horn threshold', 'Spinal cord injury pain'], ['Phantom limb pain', 'Deafferentation; cortical reorganization', 'Post-amputation'], ['Placebo analgesia', 'Activation of PAG → RVM descending opioidergic system', 'Clinical trials; doctor-patient interaction'], ['Nocebo effect', 'Expectation-induced pain via cortical → descending facilitation', 'Pain worsened by negative suggestion'], ] story.append(tbl(cc_data, [3.5*cm, 5*cm, W-8.5*cm], fontsize=8.5)) # ══════════════════════════════════════ # FOOTER # ══════════════════════════════════════ story.append(Spacer(1, 12)) story.append(hr(1, C_GRID)) story.append(Paragraph( "Source: Harrison's Principles of Internal Medicine 22e (2025) – Chapter 14: Pain: Pathophysiology and Management | " "Stahl's Essential Psychopharmacology | Goldman-Cecil Medicine International Edition | Katzung's Basic and Clinical Pharmacology 16e", FOOT)) doc.build(story) print("PDF 5 created successfully.") PYEOF python3 /tmp/workspace/medical-notes-pdfs/make_pdf5_pain_patho.py
ls -lh /tmp/workspace/medical-notes-pdfs/5_Pain_Pathophysiology_Clinical_Reference.pdf
5 Pain Pathophysiology Clinical Reference
PDF Document · PDF