Can u create a simple differentiation chart between DMD vs SMA peads only including exam specific points for the final MBBS professional exam YR 5.

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
I now have comprehensive data from authoritative textbooks. Let me compile the differentiation chart.

DMD vs SMA - Differentiation Chart (Final MBBS Year 5)

Sources: Tietz Textbook of Laboratory Medicine 7th Ed; Bradley & Daroff's Neurology in Clinical Practice; Campbell's Operative Orthopaedics 15th Ed 2026

QUICK MEMORY AID

  • DMD = Dystrophin absent, Delayed walk, Dilated cardiomyopathy, CK Dramatically high
  • SMA = SMN1 gone, Spinal anterior horn, Sensation intact, Sitting/walking defines type

FeatureDMD (Duchenne Muscular Dystrophy)SMA (Spinal Muscular Atrophy)
Full nameDuchenne Muscular DystrophySpinal Muscular Atrophy (SMA5q)
PathologyMyopathy - muscle cell diseaseNeuropathy - anterior horn cell degeneration
Site of lesionMuscle (sarcolemma/cytoskeleton)Spinal cord anterior horn cells + lower brainstem motor neurons
GeneDMD gene - Xp21.2SMN1 gene - chromosome 5q11.2-13.3
ProteinDystrophin (400 kD) - absentSMN protein - absent/reduced
InheritanceX-linked recessiveAutosomal recessive (95% of cases)
Sex affectedMales only (females are carriers; rarely manifesting carriers)Both males and females equally
Incidence1 in 3,500 live male births (most common severe NMD)1 in 6,000-10,000 live births
Age of onset2-5 years (mean diagnosis ~41 months)Varies by type (see below)
Onset patternNormal early milestones, then progressive weakness from ~3-5 yearsDepends on type - can be prenatal (Type 0) to adulthood (Type IV)
Pattern of weaknessProximal > distal; lower limb first, then upper limbProximal > distal; symmetric; lower limbs worse
ReflexesReduced/absent (late)Absent (early, even in mild forms)
SensationNormalNormal (pure motor disease)
FasciculationsAbsentPresent (tongue fasciculations classic in Type I)
Calf pseudohypertrophyPresent (classic - firm, rubbery calves due to fat/fibrosis replacing muscle)Absent
Gower's signPresent (classic sign - uses hands to climb up thighs)Usually absent
Facial musclesUsually sparedInvolved in Type I (bulbar weakness)
Cardiac involvementDilated cardiomyopathy (DCM) - nearly universal; conduction abnormalitiesGenerally absent (except in rare forms)
Cognitive/IQPresent - non-progressive cognitive impairment, lower IQ; associated with dystrophin isoform expressionNormal intelligence
Respiratory failureLate complication (chronic respiratory insufficiency develops in ALL patients)Can be early (Type I respiratory failure <1 year); Type II in 3rd decade
ScoliosisCommon; worsens respiratory functionCommon in Type II and III
CK levelMassively elevated (>10x normal; often 50-100x)Normal or mildly elevated
Muscle biopsyFiber necrosis, fibrosis, variation in size, fat replacement; dystrophin absent on immunohistochemistry (IHC)Grouped atrophy of type 1 fibres; type 2 fibre hypertrophy; no dystrophin defect
EMG findingsMyopathic (short duration, low amplitude, polyphasic)Neurogenic (fibrillations, fasciculations, large motor units)
Nerve conductionNormalNormal motor NCV; may show denervation changes
Key investigationGenetic testing (deletion/duplication in DMD gene); CK; muscle biopsy + IHCGenetic testing (SMN1 deletion/copy number); SMN1 MLPA; EMG

SMA Types - Exam Summary Table

TypeSynonymOnsetMax FunctionSurvival
Type 0-PrenatalNone (hypotonia at birth)Weeks to 6 months
Type IWerdnig-Hoffmann<6 monthsCannot sit<1 year (median)
Type IIIntermediate7-18 monthsSits, cannot walkInto 3rd decade
Type IIIKugelberg-Welander>18 monthsWalks (may lose later)Normal
Type IVAdult SMA20s-30sAmbulatoryNormal

DMD Disease Progression - Exam Summary

StageAgeKey Event
Pre-symptomatic0-2 yearsNormal milestones; CK already elevated
Early symptomatic2-5 yearsToe walking, Gower's sign, calf pseudohypertrophy
Progressive weakness5-10 yearsProximal > distal weakness, scoliosis starts
Loss of ambulation10-15 yearsWheelchair dependent
Cardiorespiratory failureLate teens/20sPrimary cause of death

High-Yield Exam Mnemonics & Differentiators

"The 3 Cs of DMD"
  1. CK - massively high (>10x normal)
  2. Calf pseudohypertrophy
  3. Cardiomyopathy (dilated)
"SMA Think Neuron"
  • Anterior horn cell death = LMN signs only
  • Fasciculations + flaccid paralysis + absent reflexes + normal sensation
  • No cardiac, no cognitive involvement
  • Sensation ALWAYS intact (only motor neurons die)
Key discriminators in one-line MCQ traps:
Clue in questionThink
"Calf pseudohypertrophy"DMD
"Gower's sign"DMD
"CK >10,000 U/L"DMD
"Dilated cardiomyopathy in a child"DMD
"Low IQ + muscle weakness"DMD
"Tongue fasciculations in an infant"SMA Type I
"Cannot sit by 9 months, hypotonia"SMA Type I
"Floppy baby + absent reflexes"SMA (or consider)
"Both sexes affected, AR inheritance"SMA
"Grouped atrophy on biopsy"SMA
"Dystrophin absent on IHC"DMD

Treatment - Exam Points

TreatmentDMDSMA
Disease-modifyingExon-skipping (eteplirsen); gene therapy trialsNusinersen (intrathecal antisense oligonucleotide); Onasemnogene abeparvovec (gene therapy); Risdiplam (oral SMN2 splicing modifier)
SteroidsDeflazacort / prednisolone - slow progressionNot used
CardiacACE inhibitors, beta-blockers, diuretics (for DCM)Not routinely needed
RespiratoryNIV (non-invasive ventilation)NIV in Types I and II
OrthopaedicSpinal fusion for scoliosis; Achilles tendon releaseSpinal fusion for scoliosis (Types II/III)

Core sources: Tietz Textbook of Laboratory Medicine 7th Ed; Bradley & Daroff's Neurology in Clinical Practice; Campbell's Operative Orthopaedics 15th Ed 2026

Make it a very condensed table with subheadings and easy remebering points

DMD vs SMA - Condensed Exam Chart


🧬 BASICS

FeatureDMDSMA
PathologyMyopathyNeuropathy (anterior horn cell)
Gene / ProteinDMD Xp21 / Dystrophin absentSMN1 5q / SMN protein absent
InheritanceX-linked recessiveAutosomal recessive
Who gets itMales onlyBoth sexes
Incidence1 in 3,500 males1 in 6,000-10,000

🩺 CLINICAL

FeatureDMDSMA
Onset2-5 yrs (diagnosis ~41 mo)Type-dependent (birth β†’ adult)
Weakness patternProximal > distal, LL firstProximal > distal, symmetric
ReflexesReduced (late)Absent (early)
SensationNormalNormal
Fasciculations❌ Absentβœ… Present (tongue in Type I)
Gower's signβœ… Classic❌ Absent
Calf pseudohypertrophyβœ… Classic (fat + fibrosis)❌ Absent
CardiacDCM - nearly universalNormal
IntelligenceLow IQ (non-progressive)Normal
Facial weaknessSparedType I only
Respiratory failureLate (all patients eventually)Early in Type I (<1 yr)
ScoliosisYes (worsens respiratory)Yes (Types II-III)

πŸ”¬ INVESTIGATIONS

TestDMDSMA
CKMassively high (>10-50x normal)Normal / mildly elevated
Muscle biopsyNecrosis, fat replacement; dystrophin absent on IHCGrouped atrophy type I fibres; type II hypertrophy
EMGMyopathic (short, low amplitude)Neurogenic (fibrillations, large units)
GeneticsDMD gene deletion/duplicationSMN1 deletion (MLPA)

πŸ’Š TREATMENT

TreatmentDMDSMA
Steroidsβœ… Deflazacort / prednisolone❌ Not used
Disease-modifyingEteplirsen (exon-skipping)Nusinersen (intrathecal) / Risdiplam (oral) / Gene therapy
CardiacACE-I + beta-blockersNot needed
RespiratoryNIVNIV (Types I-II)

πŸ“Š SMA TYPES - ONE LOOK

TypeNameOnsetMax functionSurvival
0-PrenatalNoneWeeks
IWerdnig-Hoffmann<6 moCannot sit<1 yr
IIIntermediate7-18 moSits, not walk3rd decade
IIIKugelberg-Welander>18 moWalksNormal
IVAdult20s-30sAmbulatoryNormal

⚑ INSTANT RECALL

DMD = "3 Cs + X"
Calf hypertrophy Β· Cardiomyopathy Β· CK sky-high Β· X-linked
SMA = "FANS"
Fasciculations Β· Anterior horn Β· Normal intellect + sensation Β· SMN1 gone

🎯 MCQ TRAPS

If question says...Answer
Calf pseudohypertrophyDMD
Gower's signDMD
Dilated cardiomyopathy in a childDMD
Low IQ + muscle weaknessDMD
Tongue fasciculations in an infantSMA Type I
Floppy baby + absent reflexes + normal CKSMA
Grouped atrophy on biopsySMA
Dystrophin absent on IHCDMD
Both sexes, AR, proximal weaknessSMA
Cannot sit by 9 monthsSMA Type I

make more chunkings in table , make it more exam specific

DMD vs SMA β€” Final MBBS Exam Chart


1️⃣ IDENTITY

DMDSMA
Disease typeMyopathyMotor neuron disease
GeneDMD β€” Xp21.2SMN1 β€” Chr 5q13
Protein lostDystrophinSMN protein
InheritanceX-linked recessiveAutosomal recessive
SexMales onlyBoth sexes
CarrierFemales (asymptomatic)Both (1 in 35 population)
Incidence1 in 3,500 males1 in 6,000–10,000

2️⃣ ONSET & PROGRESSION

DMDSMA
Age of onset2–5 yrsBirth β†’ adulthood (type-dependent)
Early clueToe walking, delayed walkFloppy infant / hypotonia
CourseSteadily progressiveProgressive (may plateau briefly)
Wheelchair10–15 yrsType I: never walks; Type III: may lose walking later
DeathLate teens–20s (cardiorespiratory)Type I: <1 yr; Type III–IV: normal lifespan

3️⃣ MOTOR SIGNS

DMDSMA
Weakness patternProximal > distal, LL β†’ ULProximal > distal, symmetric
ToneHypotonia (later)Profound hypotonia (early)
ReflexesReduced lateAbsent early
FasciculationsβŒβœ… Tongue + limbs (classic)
Gower's signβœ… Classic❌
Calf pseudohypertrophyβœ… Firm, rubbery❌
Facial weakness❌ Sparedβœ… Type I (bulbar)
Neck flexor weaknessLateEarly & prominent

4️⃣ NON-MOTOR FEATURES

DMDSMA
Intelligence / IQLow (non-progressive cognitive impairment)Normal
SensationNormalNormal
CardiacDCM (dilated cardiomyopathy) β€” universalAbsent (usually)
RespiratoryLate; affects all patientsEarly in Type I; NIV-dependent
ScoliosisYes (accelerates after wheelchair)Yes (Types II–III, severe)
Joint contracturesYes (Achilles tendon, hips, knees)Yes (hip dislocation in Type II)
TongueNormalFasciculating + atrophied

5️⃣ INVESTIGATIONS

TestDMDSMA
CK (creatine kinase)>10–50Γ— normal (hallmark)Normal or mildly elevated
EMGMyopathic (short, low amplitude, polyphasic)Neurogenic (fibrillations, fasciculations, large MUPs)
NCVNormalNormal
Muscle biopsyNecrosis, fibrosis, fat replacementGrouped atrophy (type I↓, type II hypertrophy)
IHC stainingDystrophin absentDystrophin present
Genetic testDMD gene deletion/duplication (MLPA)SMN1 deletion (MLPA β€” gold standard)
Newborn screenElevated CK on blood spotSMN1 copy number

6️⃣ BIOPSY FINDINGS (Exam Favourite)

FindingDMDSMA
Key patternEndomysial fibrosis, fat infiltrationGrouped fibre atrophy
Fibre necrosisβœ… Present❌
Regenerating fibresβœ… Present❌
Fibre type groupingβŒβœ… (reinnervation pattern)
Dystrophin on IHC❌ Absentβœ… Normal

7️⃣ SMA TYPES β€” ONE GLANCE

TypeAliasOnsetBest Motor MilestoneSurvival
0Severe prenatalFetalNone (resp. failure at birth)Weeks
IWerdnig-Hoffmann<6 monthsCannot sit<1 year
IIIntermediate7–18 monthsSits, cannot walk3rd decade
IIIKugelberg-Welander>18 monthsWalks (may lose it)Normal
IVAdult SMA20s–30sAmbulatoryNormal
Exam rule: Type I = sits never Β· Type II = sits yes, walks never Β· Type III = walks yes

8️⃣ DMD DISEASE STAGES

StageAgeLandmark
Silent0–2 yrsCK already very high; normal milestones
Early2–5 yrsToe walk, Gower's sign, calf hypertrophy
Ambulatory5–10 yrsProximal weakness, lumbar lordosis
Non-ambulatory10–15 yrsWheelchair (key exam age)
LateTeens–20sDCM + respiratory failure = cause of death

9️⃣ TREATMENT

DMDSMA
Steroidsβœ… Deflazacort / prednisolone (slow progression)❌
Disease-modifyingEteplirsen (exon 51 skipping)Nusinersen (intrathecal) Β· Risdiplam (oral) Β· Onasemnogene (gene Rx)
CardiacACE-I + Ξ²-blockers + diureticsNot needed
RespiratoryNon-invasive ventilation (NIV)NIV in Types I–II
OrthopaedicSpinal fusion (scoliosis), Achilles releaseSpinal fusion (Types II–III)
Genetic counsellingCarrier females, prenatal testingCarrier couples (AR), prenatal/NBS

πŸ”Ÿ INSTANT MEMORY HOOKS

DMD = "3C + X + G"
LetterMeaning
CCalf pseudohypertrophy
CCardiomyopathy (DCM)
CCK through the roof
XX-linked (males only)
GGower's sign
SMA = "FANGS"
LetterMeaning
FFasciculations (tongue!)
AAnterior horn cell
NNormal IQ + sensation
GGrouped atrophy (biopsy)
SSMN1 deleted

🎯 MCQ RAPID FIRE

Stem clueDiagnosis
Firm calves + proximal weakness + male childDMD
Uses hands to stand up from floorDMD (Gower's)
CK 20,000 U/L in a 4-year-old boyDMD
Dilated cardiomyopathy + muscle disease in childDMD
Cognitive delay + muscle weaknessDMD
Floppy infant + tongue fasciculationsSMA Type I
Cannot sit at 9 months + absent reflexes + normal CKSMA Type I
Child sits but never walks, both sexesSMA Type II
Teenager walks but has proximal weaknessSMA Type III
Grouped atrophy on biopsySMA
Dystrophin absent on IHCDMD
Normal CK + neurogenic EMG + floppy babySMA
AR inheritance + motor only + normal intellectSMA

make the exact content but even more chunkings easy to remeber

DMD vs SMA β€” Ultimate Exam Chart


🧬 CHUNK 1 β€” WHO GETS IT?

DMDSMA
Disease categoryMyopathyMotor Neuron Disease
SexMales ONLYBoth sexes
InheritanceX-linked recessiveAutosomal recessive
GeneDMD geneSMN1 gene
ChromosomeXp21.25q13
Protein lostDystrophinSMN protein
πŸ’‘ Hook: DMD = X = eXclusively males | SMA = 5 = both 5ex-es

πŸ“ CHUNK 2 β€” WHERE IS THE LESION?

DMDSMA
SiteMuscle fibre (sarcolemma)Spinal anterior horn cells
Neuron typeNOT a neuron problemLower motor neuron ONLY
Upper motor signs?NoNo
Sensory involvement?NoNo
πŸ’‘ Hook: DMD = Muscle dies | SMA = Motor neuron dies

πŸ“Š CHUNK 3 β€” HOW COMMON?

DMDSMA
Incidence1 in 3,500 males1 in 6,000–10,000
Most common typeOnly one type of DMDType I = 50% of all SMA
Carrier frequencyFemale carriers1 in 35 general population
Spontaneous mutation30% casesRare

⏰ CHUNK 4 β€” WHEN DOES IT START?

DMDSMA
Onset age2–5 yearsBirth β†’ adulthood
First clueToe walking, falls oftenFloppy baby / hypotonia
Diagnosis ageMean 41 monthsType I: <6 months
Early milestonesInitially normalDelayed from birth (Type I)
πŸ’‘ Hook: DMD starts after walking | SMA Type I never even reaches walking

🦡 CHUNK 5 β€” MOTOR SIGNS

SignDMDSMA
Weakness patternProximal > distalProximal > distal
Limbs affected firstLower limbs firstLower limbs worse
ToneHypotonia (later)Profound hypotonia (early)
ReflexesReduced (late)Absent early
Fasciculations❌ ABSENTβœ… PRESENT
Gower's signβœ… CLASSIC❌
Calf pseudohypertrophyβœ… CLASSIC❌
Facial weakness❌ Sparedβœ… Type I only
TongueNormalFasciculating + wasted
Neck flexorsWeak (late)Weak early
πŸ’‘ Hook: Calves big + Gower's = DMD every time

🧠 CHUNK 6 β€” BRAIN & HEART & LUNGS

FeatureDMDSMA
IntelligenceLOW IQ (non-progressive)NORMAL
CardiacDCM β€” universalAbsent
ArrhythmiaYes (conduction defects)No
Respiratory failureLate (ALL patients)Early in Type I
Cause of deathCardiorespiratory failureRespiratory failure (Type I)
πŸ’‘ Hook: SMA = pure motor, NOTHING else affected (no heart, no brain)

🦴 CHUNK 7 β€” ORTHOPAEDIC FEATURES

FeatureDMDSMA
ScoliosisYes (post-wheelchair)Yes (Types II–III, severe)
ContracturesAchilles tendon, hips, kneesHip dislocation (Type II)
Lumbar lordosisβœ… Early signLess prominent
Joint laxityLessMore in Type II

πŸ”¬ CHUNK 8 β€” BLOOD TESTS

TestDMDSMA
CK level>10–50Γ— normalNormal / mildly raised
CK valueOften 10,000–50,000 U/L<500 U/L
CK on newborn screenElevated on blood spotNormal
Other enzymesLDH, AST, ALT mildly raisedNormal
πŸ’‘ Hook: CK sky-high = DMD. Normal CK + floppy = think SMA

⚑ CHUNK 9 β€” EMG & NCV

TestDMDSMA
EMG patternMyopathicNeurogenic
MUP sizeShort, low amplitude, polyphasicLarge, long duration
FibrillationsAbsentβœ… Present
Fasciculations on EMGAbsentβœ… Present
NCVNormalNormal
πŸ’‘ Hook: Myopathic EMG = muscle disease (DMD) | Neurogenic EMG = nerve/neuron disease (SMA)

πŸ”­ CHUNK 10 β€” MUSCLE BIOPSY

FindingDMDSMA
PatternRandom scattered necrosisGrouped fibre atrophy
Fibre necrosisβœ… Present❌
Fibre regenerationβœ… Present❌
Fat + fibrosisβœ… Late feature❌
Fibre type groupingβŒβœ… (reinnervation)
Type I fibresVariableAtrophied & grouped
Type II fibresVariableHypertrophied (compensatory)
Dystrophin on IHC❌ ABSENTβœ… Normal
πŸ’‘ Hook: Grouped atrophy = neuron died, muscle regrouped = SMA

πŸ§ͺ CHUNK 11 β€” GENETIC TESTS

DMDSMA
Gold standard testMLPA / PCR for DMD geneMLPA for SMN1 deletion
Confirm diagnosisDystrophin absent on IHCSMN1 copy number = 0
Prenatal testCVS / amniocentesisCVS / amniocentesis
Carrier testingFemale relativesBoth parents (AR)
Newborn screeningCK on dried blood spotSMN1 copy number

πŸ’Š CHUNK 12 β€” TREATMENT (Steroids)

DMDSMA
Steroids used?βœ… YES β€” first-line❌ NO
DrugDeflazacort / Prednisoloneβ€”
PurposeSlow muscle weaknessβ€”
Side effectsWeight gain, osteoporosis, growth delayβ€”

πŸ’Š CHUNK 13 β€” TREATMENT (Disease-Modifying)

DrugDMDSMA
NusinersenβŒβœ… Intrathecal (antisense oligo)
RisdiplamβŒβœ… Oral (SMN2 splicing modifier)
OnasemnogeneβŒβœ… IV gene therapy (one-time)
Eteplirsenβœ… Exon 51 skipping❌
Atalurenβœ… Nonsense mutation only❌
πŸ’‘ Hook: SMA has 3 drugs (N-R-O) | DMD has exon-skipping therapy

πŸ’Š CHUNK 14 β€” TREATMENT (Supportive)

SupportDMDSMA
Cardiac drugsACE-I + Ξ²-blockers + diureticsNot needed
RespiratoryNIV (non-invasive ventilation)NIV (Types I–II)
Spinal surgeryFusion for scoliosisFusion (Types II–III)
Physiotherapyβœ… Maintain ambulationβœ… Prevent contractures
Achilles releaseβœ… YesLess often

πŸ“‹ CHUNK 15 β€” SMA TYPES TABLE

TypeNameOnsetBest MilestoneSurvival
0PrenatalIn wombNoneWeeks
IWerdnig-Hoffmann<6 monthsCannot sit<1 year
IIIntermediate7–18 monthsSits, no walk3rd decade
IIIKugelberg-Welander>18 monthsWalksNormal
IVAdult20s–30sAmbulatoryNormal
πŸ’‘ Rule of thumb: Sit = Type II and above Β· Walk = Type III and above

πŸ“‹ CHUNK 16 β€” DMD STAGES TABLE

StageAgeKey Event
Silent0–2 yrsCK already high, no symptoms
Early2–5 yrsToe-walk, Gower's, calf hypertrophy
Progressive5–10 yrsProximal weakness, lordosis, scoliosis
Wheelchair10–15 yrsLoss of ambulation ← exam favourite
TerminalTeens–20sDCM + respiratory failure = death

⚑ CHUNK 17 β€” MEMORY MNEMONICS

DMD = "3C + X + G"
Letter=
Calf hypertrophy← exam classic
Cardiomyopathy (DCM)← universal
CK sky high← >10x normal
X-linked males only← no female patients
Gower's sign← uses hands to rise

SMA = "FANGS"
Letter=
Fasciculations (tongue)← LMN sign
Anterior horn cell← neuron dies
Normal IQ + sensation← only motor
Grouped atrophy (biopsy)← pathology key
SMN1 deleted← chr 5q

🎯 CHUNK 18 β€” MCQ RAPID FIRE

If you see this...Answer
Firm calves + proximal weakness, 4yr boyDMD
Child climbs up his own legs to standDMD (Gower's)
CK = 20,000 U/L in a toddlerDMD
Dilated cardiomyopathy + muscle diseaseDMD
Low IQ + proximal weakness in childDMD
X-linked + dystrophin absentDMD
Floppy infant + tongue fasciculationsSMA Type I
Cannot sit at 9 months, absent reflexes, normal CKSMA Type I
Both sexes, AR, sits but never walksSMA Type II
Teenager walks but proximal leg weaknessSMA Type III
Grouped atrophy on biopsySMA
Dystrophin absent on IHCDMD
Neurogenic EMG + normal CK + floppySMA
AR + motor only + normal intellectSMA
Nusinersen prescribedSMA
Deflazacort prescribedDMD

make even more chunkings in the motor signs group it and regenrate again. and also give the meaning of abbreveiations

DMD vs SMA β€” Ultimate Exam Chart (Final MBBS Yr 5)

πŸ“– ABBREVIATIONS GUIDE

AbbreviationFull Meaning
DMDDuchenne Muscular Dystrophy
SMASpinal Muscular Atrophy
SMN1Survival Motor Neuron 1 gene
CKCreatine Kinase (muscle enzyme)
DCMDilated Cardiomyopathy
IHCImmunohistochemistry
NIVNon-Invasive Ventilation
EMGElectromyography
NCVNerve Conduction Velocity
MUPMotor Unit Potential
MLPAMultiplex Ligation-dependent Probe Amplification (genetic test)
LMNLower Motor Neuron
UMNUpper Motor Neuron
LLLower Limbs
ULUpper Limbs
ARAutosomal Recessive
XLRX-Linked Recessive
CVSChorionic Villus Sampling (prenatal test)
NBSNewborn Screening
ACE-IAngiotensin Converting Enzyme Inhibitor
NIVNon-Invasive Ventilation (e.g. BiPAP/CPAP)
LDHLactate Dehydrogenase
AST/ALTLiver enzymes (also elevated in muscle disease)
snRNPSmall Nuclear Ribonucleoprotein (involved in mRNA splicing)

🧬 CHUNK 1 β€” WHO GETS IT?

DMDSMA
Disease categoryMyopathy (muscle disease)Motor Neuron Disease
Sex affectedMales ONLYBoth males and females
InheritanceX-Linked Recessive (XLR)Autosomal Recessive (AR)
CarrierFemales (usually asymptomatic)Both parents carry one faulty copy
Spontaneous mutation30% of cases (no family history)Rare
πŸ’‘ Hook: DMD = X chromosome = eXclusively males | SMA = chromosome 5 = both 5eXes (both sexes)

πŸ”¬ CHUNK 2 β€” GENETICS

DMDSMA
Gene mutatedDMD geneSMN1 gene
Chromosome locationXp21.25q13
Protein lostDystrophin (400 kDa structural protein)SMN protein (mRNA splicing protein)
Function of proteinStabilises muscle cell membraneAssembles spliceosome (mRNA processing)
Type of mutationDeletion / duplication of exonsHomozygous deletion of SMN1
πŸ’‘ Hook: Dystrophin = structural (like scaffolding for muscle) | SMN = factory worker (makes mRNA machinery)

πŸ“ CHUNK 3 β€” WHERE IS THE LESION?

DMDSMA
Primary siteMuscle fibre (sarcolemma/cytoskeleton)Spinal cord anterior horn cells
Neuron involved?NoYes β€” Lower Motor Neuron (LMN)
Upper motor signs?NoNo
Sensory involvement?NoNo β€” pure motor disease
Bulbar involvement?NoYes β€” Type I (tongue, swallowing)
πŸ’‘ Hook: DMD = Muscle dies | SMA = Motor neuron dies β†’ muscle then wastes secondarily

πŸ“Š CHUNK 4 β€” HOW COMMON?

DMDSMA
Incidence1 in 3,500 males1 in 6,000–10,000 births
Most common typeSingle phenotype (only DMD)Type I = 50% of all SMA cases
Carrier frequency (population)β€”1 in 35 general population
Leading cause of...Most common severe NMD in humansLeading genetic cause of infant mortality
(NMD = Neuromuscular Disease)

⏰ CHUNK 5 β€” WHEN DOES IT START?

DMDSMA
Onset age2–5 yearsBirth to adulthood (depends on type)
Mean diagnosis age41 months (~3.5 years)Type I: <6 months
Early milestonesInitially NORMALDelayed from birth (Type I)
First parent complaint"He walks funny / keeps falling""My baby is floppy / not moving"
Pre-symptomatic clueCK already elevated before symptomsReduced fetal movements (Type 0)
πŸ’‘ Hook: DMD starts AFTER walking begins | SMA Type I never even reaches walking

🦡 CHUNK 6A β€” MOTOR SIGNS: WEAKNESS

SignDMDSMA
PatternProximal > DistalProximal > Distal
Limb onsetLower limbs first, then upper limbsLower limbs worse than upper
SymmetrySymmetricSymmetric
ProgressionSteady downhillProgressive (may briefly plateau)
Axial musclesWeak (lordosis)Weak (poor head control)
πŸ’‘ Both are proximal - but DMD is a muscle problem, SMA is a neuron problem

πŸ’ͺ CHUNK 6B β€” MOTOR SIGNS: TONE & REFLEXES

SignDMDSMA
Muscle toneHypotonia (develops later)Profound hypotonia from early on
Deep tendon reflexesReduced (only late in disease)Absent early β€” hallmark
Ankle reflexesLost firstLost earliest
Knee reflexesLost laterAlso absent
πŸ’‘ Hook: Absent reflexes early = think SMA (anterior horn cells gone = no reflex arc)

🫨 CHUNK 6C β€” MOTOR SIGNS: INVOLUNTARY MOVEMENTS

SignDMDSMA
Fasciculations❌ ABSENTβœ… PRESENT β€” LMN sign
Tongue fasciculationsβŒβœ… Classic in Type I β€” look for this!
Limb fasciculationsβŒβœ… Present
Fibrillations (EMG)βŒβœ… On EMG only
Muscle crampsOccasionallyLess common
πŸ’‘ Hook: Twitching tongue in a floppy baby = SMA Type I until proven otherwise

🚢 CHUNK 6D β€” MOTOR SIGNS: CLASSIC CLINICAL SIGNS

SignDMDSMA
Gower's signβœ… CLASSIC β€” uses hands to climb up thighs to stand❌ Absent
Calf pseudohypertrophyβœ… CLASSIC β€” firm, rubbery (fat + fibrosis, not real muscle)❌ Absent
Lumbar lordosisβœ… Early sign (compensates for weak hip extensors)Less prominent
Waddling gaitβœ… Present❌
Trendelenburg gaitβœ… Present❌
πŸ’‘ Hook: Big calves that are WEAK = pseudohypertrophy = DMD (real hypertrophy = strong calves)

πŸ—£οΈ CHUNK 6E β€” MOTOR SIGNS: FACE & BULBAR

SignDMDSMA
Facial muscles❌ Sparedβœ… Involved in Type I
TongueNormalFasciculating + wasted (Type I)
SwallowingNormalDysphagia in Type I β€” aspiration risk
Feeding difficultyUncommonβœ… Common in Type I
Neck flexorsWeak (late)Weak early β€” poor head control
Head controlNormal initiallyLost early in Type I

🧠 CHUNK 7 β€” BRAIN & COGNITION

FeatureDMDSMA
Intelligence (IQ)LOW β€” non-progressive cognitive impairmentNORMAL
Cause of low IQDystrophin isoforms expressed in brainNot applicable
Learning disabilityPresent in many patientsAbsent
Behaviour problemsYes (ADHD, autism-like features)No
πŸ’‘ Hook: SMA = ONLY motor neurons affected β€” brain completely normal

❀️ CHUNK 8 β€” CARDIAC FEATURES

FeatureDMDSMA
Cardiac involvementβœ… Universal β€” affects ALL patients❌ Generally absent
Type of heart diseaseDilated Cardiomyopathy (DCM)None
MechanismCardiac fibrosis (dystrophin absent in heart)Not applicable
Arrhythmiaβœ… Conduction defects❌
Heart failureβœ… Left ventricular dilation β†’ CCF❌
When does it appearFrom early teens onwardβ€”
Cause of death contributionMajor (alongside respiratory)Not applicable
(CCF = Congestive Cardiac Failure)
πŸ’‘ Hook: Heart has dystrophin too β€” no dystrophin = heart also destroyed in DMD

🫁 CHUNK 9 β€” RESPIRATORY FEATURES

FeatureDMDSMA
Respiratory failureLate complication β€” affects ALL patientsEarly in Type I (<1 year)
MechanismRespiratory muscle weakness + scoliosisIntercostal + diaphragm weakness
Type I SMAβ€”Respiratory failure = cause of death <1 yr
ManagementNIV (Non-Invasive Ventilation)NIV in Types I and II
TracheostomyConsidered lateType I β€” sometimes needed

🦴 CHUNK 10 β€” ORTHOPAEDIC FEATURES

FeatureDMDSMA
Scoliosisβœ… Yes β€” worsens after wheelchairβœ… Yes β€” severe in Types II–III
ContracturesAchilles tendon, hip flexors, knee flexorsHip dislocation in Type II
Lumbar lordosisβœ… Prominent early signLess common
Fracturesβœ… Due to steroid use + immobilityYes β€” due to muscle weakness
Hip dislocationLess commonβœ… Common in Type II

🩸 CHUNK 11 β€” BLOOD TESTS

TestDMDSMA
CK (Creatine Kinase)>10–50Γ— normalNormal or mildly elevated
Typical CK value10,000–50,000 U/L<500 U/L
CK at birthAlready elevated (pre-symptomatic!)Normal
LDHMildly elevatedNormal
AST / ALTMildly elevated (from muscle, not liver!)Normal
πŸ’‘ Hook: Raised AST/ALT in a child with weakness = check CK first β€” it may be muscle, not liver!

⚑ CHUNK 12 β€” EMG FINDINGS

(EMG = Electromyography β€” measures electrical activity of muscles)
FindingDMDSMA
EMG patternMyopathicNeurogenic
Motor Unit Potential (MUP) sizeSmall, short, low amplitudeLarge, long duration
Polyphasic potentialsβœ… YesLess
Fibrillations❌ Absentβœ… Present (denervation)
Fasciculations on EMG❌ Absentβœ… Present
Recruitment patternEarly recruitmentReduced recruitment
πŸ’‘ Hook: Myopathic = small units (fewer fibres working) | Neurogenic = large units (surviving neurons take over)

πŸ”Œ CHUNK 13 β€” NERVE CONDUCTION (NCV)

(NCV = Nerve Conduction Velocity β€” measures how fast nerves carry signals)
FindingDMDSMA
Motor NCVNormalNormal
Sensory NCVNormalNormal
F-wavesNormalMay be abnormal
InterpretationNerves intact β€” muscle is the problemNerves intact β€” neurons are dying
πŸ’‘ Normal NCV in both β€” the problem is upstream (neuron body in SMA) or downstream (muscle in DMD)

πŸ”­ CHUNK 14 β€” MUSCLE BIOPSY: GROSS PATTERN

FindingDMDSMA
Overall patternRandom scattered necrosisGrouped fibre atrophy
Fat infiltrationβœ… Late feature❌
Fibrosisβœ… Endomysial fibrosis❌
Inflammationβœ… Mild inflammatory infiltrate❌

πŸ”­ CHUNK 15 β€” MUSCLE BIOPSY: FIBRE CHANGES

FindingDMDSMA
Fibre necrosisβœ… Present❌ Absent
Fibre regenerationβœ… Present (basophilic fibres)❌ Absent
Variation in fibre sizeβœ… YesLess
Type I fibre atrophyVariableβœ… Grouped β€” hallmark
Type II fibre hypertrophyVariableβœ… Compensatory
Fibre type groupingβŒβœ… Reinnervation pattern

πŸ”­ CHUNK 16 β€” MUSCLE BIOPSY: SPECIAL STAINS

Stain / TestDMDSMA
Dystrophin IHC❌ ABSENT β€” diagnosticβœ… Normal / Present
ATPase stainShows fibre size variationShows grouped atrophy
H&E stainNecrosis + regenerationGrouped atrophy
Modified Gomori trichromeFibrosis prominentLess prominent
(IHC = Immunohistochemistry = using antibodies to detect specific proteins in tissue)
πŸ’‘ Exam rule: Dystrophin absent on IHC = DMD diagnosed

πŸ§ͺ CHUNK 17 β€” GENETIC TESTS

DMDSMA
Gold standardMLPA / PCR for DMD gene deletionsMLPA for SMN1 copy number
What is testedExon deletion/duplication in DMD geneSMN1 = 0 copies confirms SMA
Confirm diagnosisDystrophin absent on IHC (muscle)SMN1 deletion
Prenatal testingCVS or amniocentesisCVS or amniocentesis
Carrier testingFemale relativesBoth parents tested (AR)
(MLPA = Multiplex Ligation-dependent Probe Amplification β€” detects gene copy numbers) (CVS = Chorionic Villus Sampling β€” early prenatal tissue test)

πŸ’Š CHUNK 18 β€” STEROIDS

DMDSMA
Used?βœ… YES β€” first-line treatment❌ NO
Drug of choiceDeflazacort (preferred) / Prednisoloneβ€”
PurposeSlow muscle weakness, delay wheelchairβ€”
Side effectsWeight gain, Cushingoid features, osteoporosis, growth delayβ€”
When started~4–5 years of ageβ€”

πŸ’Š CHUNK 19 β€” DISEASE-MODIFYING THERAPIES

DrugFor DMD?For SMA?How given?
NusinersenβŒβœ…Intrathecal injection (into spinal fluid)
RisdiplamβŒβœ…Oral (daily syrup)
Onasemnogene abeparvovecβŒβœ…IV β€” one-time gene therapy
Eteplirsenβœ… Exon 51 skipping❌IV infusion
Atalurenβœ… Nonsense mutations only❌Oral
(Intrathecal = injected into spinal canal/cerebrospinal fluid space) (Exon skipping = makes ribosome skip over faulty exon to produce partial but functional dystrophin)
πŸ’‘ Hook: SMA has 3 drugs β€” Nusinersen Β· Risdiplam Β· Onasemnogene = "NRO"

πŸ’Š CHUNK 20 β€” SUPPORTIVE TREATMENT

SupportDMDSMA
Cardiac drugsACE-I + Beta-blockers + Diuretics (for DCM/CCF)Not needed
RespiratoryNIV (BiPAP/CPAP) when FVC dropsNIV essential in Types I–II
Spinal surgeryFusion for progressive scoliosisFusion for Types II–III scoliosis
Achilles tendon releaseβœ… For contracturesLess common
Physiotherapyβœ… Maintain ambulation as long as possibleβœ… Prevent contractures, positioning
Nutritional supportFor weight/growth (steroid side effects)Gastrostomy in Type I (feeding difficulty)
Genetic counsellingβœ… Female carriers, prenatal testingβœ… Both parents, prenatal/NBS

πŸ“‹ CHUNK 21 β€” SMA TYPES FULL TABLE

TypeAlias / NameOnset AgeBest Motor Milestone Ever AchievedSurvival
0Severe prenatalIn wombNone β€” respiratory failure at birthWeeks to 6 months
IWerdnig-Hoffmann<6 monthsCannot sit<1 year
IIIntermediate SMA7–18 monthsCan sit, cannot walkInto 3rd decade
IIIKugelberg-Welander>18 monthsCan walk (may lose it later)Normal
IVAdult SMA20s–30sFully ambulatoryNormal
πŸ’‘ Exam rule: Type I = never sits | Type II = sits only | Type III = walks | Type IV = adult onset

πŸ“‹ CHUNK 22 β€” DMD DISEASE STAGES

StageAgeKey Event / Landmark
Silent0–2 yrsCK already sky-high, child looks normal
Early symptomatic2–5 yrsToe walking, falls, Gower's sign, calf hypertrophy
Progressive5–10 yrsProximal weakness, lordosis, scoliosis starting
Loss of ambulation10–15 yrsWheelchair bound ← most exam-tested fact
TerminalLate teens–20sDCM + respiratory failure = primary cause of death

⚑ CHUNK 23 β€” MEMORY MNEMONICS

DMD = "3C + X + G"
LetterMeaning
CCalf pseudohypertrophy (big but weak calves)
CCardiomyopathy β€” Dilated (DCM) universal
CCK β€” sky high (>10x normal)
XX-linked β€” males only
GGower's sign (uses hands to get up)

SMA = "FANGS"
LetterMeaning
FFasciculations β€” especially tongue
AAnterior horn cell death
NNormal IQ, Normal sensation β€” only motor
GGrouped atrophy on biopsy
SSMN1 gene deleted on chromosome 5

🎯 CHUNK 24 β€” MCQ RAPID FIRE

If question stem says...Your answer
Firm calves + proximal weakness + 4-yr-old boyDMD
Child uses hands to climb up his own legs to standDMD β€” Gower's sign
CK = 20,000 U/L in a toddlerDMD
Dilated cardiomyopathy + muscle weakness in a childDMD
Low IQ + proximal muscle weakness in boyDMD
X-linked inheritance + dystrophin absent on IHCDMD
Deflazacort prescribed for muscle diseaseDMD
Floppy infant + tongue fasciculations + absent reflexesSMA Type I
Cannot sit at 9 months + normal CKSMA Type I
Both sexes affected + AR + sits but never walksSMA Type II
Teenager with proximal leg weakness, walks but strugglesSMA Type III
Grouped atrophy of type I fibres on biopsySMA
Dystrophin absent on immunohistochemistryDMD
Neurogenic EMG + normal CK + floppy babySMA
AR inheritance + pure motor + normal intellect + normal sensationSMA
Nusinersen / Risdiplam prescribedSMA
Myopathic EMG + massively raised CKDMD
Reduced fetal movements + hypotonia at birth + respiratory failureSMA Type 0

Generate a PDF quick reference card for this DMD vs SMA chart, Make it more condensed , remove not asked details in meq, seq and MCQ, make it a must know pdf

Reading File
Running Command

ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "created"

Writing File

~/dmd_sma_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.lib.styles import ParagraphStyle
from reportlab.platypus import (
    SimpleDocTemplate, Table, TableStyle, Paragraph,
    Spacer, HRFlowable
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT
from reportlab.platypus import KeepTogether

# ── Output path ──────────────────────────────────────────────────────────────
OUTPUT = "/tmp/workspace/DMD_vs_SMA_Quick_Reference.pdf"

# ── Colour palette ────────────────────────────────────────────────────────────
C_DMD      = colors.HexColor("#1A3C6E")   # deep navy  – DMD column
C_SMA      = colors.HexColor("#7B1F1F")   # deep red   – SMA column
C_HEAD_BG  = colors.HexColor("#0D1B2A")   # almost black – main title bar
C_SEC_BG   = colors.HexColor("#E8EDF4")   # light steel – section sub-header
C_ROW_ALT  = colors.HexColor("#F5F7FA")   # very light blue – alternate rows
C_WHITE    = colors.white
C_YELLOW   = colors.HexColor("#FFF4CC")   # mnemonic boxes
C_GREEN    = colors.HexColor("#D6F0D6")   # memory hooks
C_RED_LIGHT= colors.HexColor("#FDECEA")   # MCQ box
C_BORDER   = colors.HexColor("#BBCDE5")

# ── Page setup ────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=10*mm, rightMargin=10*mm,
    topMargin=10*mm,  bottomMargin=10*mm,
)
W = A4[0] - 20*mm   # usable width

# ── Paragraph styles ─────────────────────────────────────────────────────────
def PS(name, size, bold=False, color=colors.black, align=TA_LEFT, leading=None):
    return ParagraphStyle(
        name, fontSize=size,
        fontName="Helvetica-Bold" if bold else "Helvetica",
        textColor=color, alignment=align,
        leading=leading or size*1.25,
        spaceAfter=0, spaceBefore=0,
    )

title_s   = PS("title",  13, bold=True,  color=C_WHITE,  align=TA_CENTER, leading=16)
sec_s     = PS("sec",     8, bold=True,  color=C_DMD,    align=TA_LEFT)
cell_bold = PS("cb",      7, bold=True,  color=colors.black)
cell_norm = PS("cn",      7,             color=colors.black)
cell_dmd  = PS("cdmd",    7, bold=True,  color=C_DMD)
cell_sma  = PS("csma",    7, bold=True,  color=C_SMA)
hook_s    = PS("hook",    7, bold=False, color=colors.HexColor("#1A472A"))
mcq_q     = PS("mcqq",   7,             color=colors.black)
mcq_a     = PS("mcqa",   7, bold=True,  color=C_DMD)
footer_s  = PS("foot",   6,             color=colors.grey, align=TA_CENTER)

# ── Helpers ───────────────────────────────────────────────────────────────────
def B(txt):   return Paragraph(txt, cell_bold)
def N(txt):   return Paragraph(txt, cell_norm)
def D(txt):   return Paragraph(txt, cell_dmd)
def S(txt):   return Paragraph(txt, cell_sma)
def H(txt):   return Paragraph(txt, hook_s)

def section_header(text):
    tbl = Table([[Paragraph(text, sec_s)]], colWidths=[W])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), C_SEC_BG),
        ("TOPPADDING",    (0,0), (-1,-1), 3),
        ("BOTTOMPADDING", (0,0), (-1,-1), 3),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("BOX", (0,0), (-1,-1), 0.5, C_BORDER),
    ]))
    return tbl

def make_table(headers, rows, col_widths, alt=True):
    """Build a styled comparison table."""
    data = [headers] + rows
    tbl  = Table(data, colWidths=col_widths, repeatRows=1)
    style = [
        # Header row
        ("BACKGROUND",    (0,0), (-1,0),  C_DMD),
        ("TEXTCOLOR",     (0,0), (-1,0),  C_WHITE),
        ("FONTNAME",      (0,0), (-1,0),  "Helvetica-Bold"),
        ("FONTSIZE",      (0,0), (-1,0),  7.5),
        ("ALIGN",         (0,0), (-1,0),  "CENTER"),
        ("TOPPADDING",    (0,0), (-1,0),  3),
        ("BOTTOMPADDING", (0,0), (-1,0),  3),
        # Body rows
        ("FONTSIZE",      (0,1), (-1,-1), 7),
        ("TOPPADDING",    (0,1), (-1,-1), 2),
        ("BOTTOMPADDING", (0,1), (-1,-1), 2),
        ("LEFTPADDING",   (0,0), (-1,-1), 4),
        ("RIGHTPADDING",  (0,0), (-1,-1), 4),
        ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
        ("GRID",          (0,0), (-1,-1), 0.4, C_BORDER),
    ]
    if alt:
        for i in range(1, len(data)):
            if i % 2 == 0:
                style.append(("BACKGROUND", (0,i), (-1,i), C_ROW_ALT))
    tbl.setStyle(TableStyle(style))
    return tbl

def hook_box(text, bg=C_GREEN):
    tbl = Table([[H(text)]], colWidths=[W])
    tbl.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), bg),
        ("TOPPADDING",    (0,0), (-1,-1), 3),
        ("BOTTOMPADDING", (0,0), (-1,-1), 3),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("BOX",           (0,0), (-1,-1), 0.5, colors.HexColor("#7CB87C")),
    ]))
    return tbl

def sp(h=2): return Spacer(1, h*mm)

# ── Column widths ─────────────────────────────────────────────────────────────
CW3 = [W*0.32, W*0.34, W*0.34]   # Feature | DMD | SMA
CW2 = [W*0.32, W*0.68]           # two-col (abbrev etc.)
CW4 = [W*0.18, W*0.20, W*0.25, W*0.15, W*0.22]  # SMA types

# =============================================================================
story = []

# ── MAIN TITLE ────────────────────────────────────────────────────────────────
title_tbl = Table(
    [[Paragraph("DMD  vs  SMA  β€”  Quick Reference Card", title_s),
      Paragraph("Final MBBS Yr 5  |  Paediatrics", PS("sub",8,color=C_WHITE,align=TA_CENTER))]],
    colWidths=[W*0.65, W*0.35]
)
title_tbl.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), C_HEAD_BG),
    ("TOPPADDING",    (0,0), (-1,-1), 5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("LEFTPADDING",   (0,0), (-1,-1), 8),
    ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
]))
story += [title_tbl, sp(2)]

# ── ABBREVIATIONS (compact inline) ───────────────────────────────────────────
story.append(section_header("ABBREVIATIONS"))
abbr_data = [
    [B("DMD"),  N("Duchenne Muscular Dystrophy"),   B("SMA"),  N("Spinal Muscular Atrophy")],
    [B("CK"),   N("Creatine Kinase"),               B("DCM"),  N("Dilated Cardiomyopathy")],
    [B("IHC"),  N("Immunohistochemistry"),          B("NIV"),  N("Non-Invasive Ventilation")],
    [B("EMG"),  N("Electromyography"),              B("NCV"),  N("Nerve Conduction Velocity")],
    [B("MLPA"), N("Multiplex Ligation Probe Ampl."),B("LMN"),  N("Lower Motor Neuron")],
    [B("XLR"),  N("X-Linked Recessive"),            B("AR"),   N("Autosomal Recessive")],
    [B("MUP"),  N("Motor Unit Potential"),          B("NBS"),  N("Newborn Screening")],
    [B("ACE-I"),N("ACE Inhibitor (cardiac drug)"),  B("CVS"),  N("Chorionic Villus Sampling")],
]
abbr_tbl = Table(abbr_data, colWidths=[W*0.1, W*0.4, W*0.1, W*0.4])
abbr_tbl.setStyle(TableStyle([
    ("FONTSIZE",      (0,0), (-1,-1), 7),
    ("TOPPADDING",    (0,0), (-1,-1), 1.5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 1.5),
    ("LEFTPADDING",   (0,0), (-1,-1), 4),
    ("GRID",          (0,0), (-1,-1), 0.3, C_BORDER),
    *[("BACKGROUND", (0,i), (-1,i), C_ROW_ALT) for i in range(0,8,2)],
]))
story += [abbr_tbl, sp(2)]

# ── CHUNK 1: IDENTITY ─────────────────────────────────────────────────────────
story.append(section_header("1. IDENTITY β€” Who Gets It?"))
rows = [
    [B("Disease type"),   D("Myopathy (muscle)"),               S("Motor neuron disease")],
    [B("Gene / Chr"),     D("DMD gene β€” Xp21.2"),               S("SMN1 gene β€” Chr 5q13")],
    [B("Protein lost"),   D("Dystrophin (structural)"),         S("SMN protein (mRNA splicing)")],
    [B("Inheritance"),    D("X-Linked Recessive (XLR)"),        S("Autosomal Recessive (AR)")],
    [B("Sex affected"),   D("Males ONLY"),                      S("Both sexes")],
    [B("Incidence"),      D("1 in 3,500 males"),                S("1 in 6,000–10,000")],
    [B("Spontaneous mut"),D("30% cases"),                       S("Rare")],
]
story.append(make_table([B("Feature"), D("DMD"), S("SMA")], rows, CW3))
story.append(hook_box("Hook: DMD = X = eXclusively males  |  SMA = chromosome 5 = both sexes"))
story.append(sp(2))

# ── CHUNK 2: LESION SITE ──────────────────────────────────────────────────────
story.append(section_header("2. SITE OF LESION"))
rows = [
    [B("Primary site"),   D("Muscle fibre (sarcolemma)"),       S("Spinal anterior horn cells")],
    [B("Neuron involved"),D("NO"),                              S("YES β€” LMN only")],
    [B("UMN signs"),      D("Absent"),                         S("Absent")],
    [B("Sensation"),      D("Normal"),                         S("Normal β€” PURE motor")],
    [B("Bulbar"),         D("Spared"),                         S("Type I β€” tongue/swallowing")],
]
story.append(make_table([B("Feature"), D("DMD"), S("SMA")], rows, CW3))
story.append(hook_box("Hook: DMD = Muscle dies  |  SMA = Motor neuron dies β†’ muscle wastes secondarily"))
story.append(sp(2))

# ── CHUNK 3: ONSET & PROGRESSION ─────────────────────────────────────────────
story.append(section_header("3. ONSET & PROGRESSION"))
rows = [
    [B("Onset age"),      D("2–5 yrs (mean dx 41 mo)"),        S("Birth β†’ adulthood")],
    [B("First clue"),     D("Toe walking, falls"),              S("Floppy baby / hypotonia")],
    [B("Early milestones"),D("Initially NORMAL"),              S("Delayed from birth (Type I)")],
    [B("Wheelchair"),     D("10–15 yrs ← KEY exam fact"),      S("Type I: never walks")],
    [B("Cause of death"), D("DCM + respiratory failure"),      S("Resp failure (Type I <1 yr)")],
]
story.append(make_table([B("Feature"), D("DMD"), S("SMA")], rows, CW3))
story.append(sp(2))

# ── CHUNK 4A: MOTOR β€” WEAKNESS ────────────────────────────────────────────────
story.append(section_header("4A. MOTOR SIGNS β€” Weakness Pattern"))
rows = [
    [B("Pattern"),        D("Proximal > Distal"),              S("Proximal > Distal")],
    [B("Limb onset"),     D("Lower limbs first"),              S("Lower limbs worse")],
    [B("Axial muscles"),  D("Weak (lordosis early)"),          S("Weak (poor head control)")],
    [B("Progression"),    D("Steady downhill"),                S("Progressive / brief plateau")],
]
story.append(make_table([B("Feature"), D("DMD"), S("SMA")], rows, CW3))
story.append(sp(1))

# ── CHUNK 4B: MOTOR β€” TONE & REFLEXES ────────────────────────────────────────
story.append(section_header("4B. MOTOR SIGNS β€” Tone & Reflexes"))
rows = [
    [B("Muscle tone"),    D("Hypotonia (develops later)"),     S("Profound hypotonia β€” EARLY")],
    [B("DTRs"),           D("Reduced late"),                   S("ABSENT EARLY β€” hallmark")],
    [B("Ankle reflex"),   D("Lost late"),                      S("Lost earliest")],
]
story.append(make_table([B("Feature"), D("DMD"), S("SMA")], rows, CW3))
story.append(hook_box("Hook: Absent reflexes EARLY = SMA (anterior horn gone = no reflex arc)"))
story.append(sp(1))

# ── CHUNK 4C: MOTOR β€” INVOLUNTARY ─────────────────────────────────────────────
story.append(section_header("4C. MOTOR SIGNS β€” Involuntary Movements"))
rows = [
    [B("Fasciculations"), D("ABSENT"),                         S("PRESENT β€” LMN sign")],
    [B("Tongue fascicula"),D("Absent"),                        S("Classic Type I β€” KEY SIGN")],
    [B("Fibrillations EMG"),D("Absent"),                       S("Present on EMG")],
]
story.append(make_table([B("Feature"), D("DMD"), S("SMA")], rows, CW3))
story.append(hook_box("Hook: Twitching tongue + floppy baby = SMA Type I until proven otherwise"))
story.append(sp(1))

# ── CHUNK 4D: MOTOR β€” CLASSIC SIGNS ──────────────────────────────────────────
story.append(section_header("4D. MOTOR SIGNS β€” Classic Clinical Signs"))
rows = [
    [B("Gower's sign"),   D("CLASSIC β€” hands climb up thighs"),S("ABSENT")],
    [B("Calf pseudohypert"),D("CLASSIC β€” firm, rubbery calves"),S("ABSENT")],
    [B("Lumbar lordosis"), D("Early sign"),                    S("Less prominent")],
    [B("Waddling gait"),  D("Present"),                       S("Absent (can't walk Type I-II)")],
]
story.append(make_table([B("Feature"), D("DMD"), S("SMA")], rows, CW3))
story.append(hook_box("Hook: Big calves that are WEAK = pseudohypertrophy = DMD (fat + fibrosis, not muscle)"))
story.append(sp(1))

# ── CHUNK 4E: MOTOR β€” FACE & BULBAR ──────────────────────────────────────────
story.append(section_header("4E. MOTOR SIGNS β€” Face & Bulbar"))
rows = [
    [B("Facial muscles"), D("Spared"),                         S("Involved β€” Type I")],
    [B("Tongue"),         D("Normal"),                         S("Fasciculating + wasted")],
    [B("Swallowing"),     D("Normal"),                         S("Dysphagia β€” aspiration risk")],
    [B("Head control"),   D("Normal initially"),               S("LOST EARLY β€” Type I")],
]
story.append(make_table([B("Feature"), D("DMD"), S("SMA")], rows, CW3))
story.append(sp(2))

# ── CHUNK 5: NON-MOTOR ────────────────────────────────────────────────────────
story.append(section_header("5. NON-MOTOR FEATURES"))
rows = [
    [B("Intelligence"),   D("LOW IQ β€” non-progressive"),       S("NORMAL β€” brain unaffected")],
    [B("Sensation"),      D("Normal"),                         S("Normal")],
    [B("Cardiac β€” DCM"),  D("UNIVERSAL β€” all patients"),       S("Absent")],
    [B("Arrhythmia"),     D("Conduction defects"),             S("Absent")],
    [B("Respiratory"),    D("Late β€” affects ALL"),             S("Early in Type I (<1 yr)")],
    [B("Scoliosis"),      D("Post-wheelchair"),                S("Severe Types II–III")],
    [B("Contractures"),   D("Achilles, hips, knees"),          S("Hip dislocation Type II")],
]
story.append(make_table([B("Feature"), D("DMD"), S("SMA")], rows, CW3))
story.append(hook_box("Hook: SMA = ONLY motor neurons. Heart, brain, sensation β€” all NORMAL"))
story.append(sp(2))

# ── CHUNK 6: INVESTIGATIONS ───────────────────────────────────────────────────
story.append(section_header("6. INVESTIGATIONS"))
rows = [
    [B("CK level"),       D(">10–50Γ— normal (10,000–50,000)"), S("Normal / mildly raised")],
    [B("CK at birth"),    D("Already elevated!"),              S("Normal")],
    [B("LDH/AST/ALT"),    D("Mildly raised (from muscle)"),    S("Normal")],
    [B("EMG pattern"),    D("MYOPATHIC β€” small, polyphasic"),  S("NEUROGENIC β€” large MUPs")],
    [B("Fibrillations"),  D("Absent"),                         S("Present on EMG")],
    [B("NCV"),            D("Normal"),                         S("Normal")],
    [B("Biopsy pattern"), D("Random necrosis + fat replacement"),S("GROUPED fibre atrophy")],
    [B("Fibre necrosis"), D("Present"),                        S("Absent")],
    [B("Type II fibres"), D("Variable"),                       S("Hypertrophied (compensatory)")],
    [B("Dystrophin IHC"), D("ABSENT β€” diagnostic"),            S("Present / Normal")],
    [B("Genetic test"),   D("MLPA β€” DMD gene deletion"),       S("MLPA β€” SMN1 copy number=0")],
]
story.append(make_table([B("Test"), D("DMD"), S("SMA")], rows, CW3))
story.append(hook_box("Hook: CK sky-high = DMD  |  Normal CK + floppy baby + absent reflexes = SMA  |  Grouped atrophy on biopsy = SMA"))
story.append(sp(2))

# ── CHUNK 7: TREATMENT ────────────────────────────────────────────────────────
story.append(section_header("7. TREATMENT"))
rows = [
    [B("Steroids"),       D("Deflazacort / Prednisolone"),     S("NOT used")],
    [B("Nusinersen"),     D("No"),                             S("YES β€” intrathecal injection")],
    [B("Risdiplam"),      D("No"),                             S("YES β€” oral daily")],
    [B("Onasemnogene"),   D("No"),                             S("YES β€” IV one-time gene therapy")],
    [B("Eteplirsen"),     D("YES β€” exon 51 skipping"),         S("No")],
    [B("Cardiac"),        D("ACE-I + Beta-blockers + Diuretics"),S("Not needed")],
    [B("Respiratory"),    D("NIV (late)"),                     S("NIV Types I–II (early)")],
    [B("Spinal surgery"), D("Fusion for scoliosis"),           S("Fusion Types II–III")],
]
story.append(make_table([B("Drug / Rx"), D("DMD"), S("SMA")], rows, CW3))
story.append(hook_box("SMA drugs = NRO: Nusinersen Β· Risdiplam Β· Onasemnogene  |  DMD = Deflazacort + Exon-skipping"))
story.append(sp(2))

# ── CHUNK 8: SMA TYPES ────────────────────────────────────────────────────────
story.append(section_header("8. SMA TYPES β€” One Glance"))
sma_hdr = [B("Type"), B("Alias"), B("Onset"), B("Best Milestone"), B("Survival")]
sma_rows = [
    [B("0"),  N("Prenatal"),           N("In womb"),      N("None β€” resp failure at birth"), N("Weeks")],
    [B("I"),  D("Werdnig-Hoffmann"),   N("<6 months"),    N("Cannot sit"),                   N("<1 year")],
    [B("II"), N("Intermediate"),       N("7–18 months"),  N("Sits β€” cannot walk"),            N("3rd decade")],
    [B("III"),N("Kugelberg-Welander"), N(">18 months"),   N("Walks (may lose later)"),        N("Normal")],
    [B("IV"), N("Adult SMA"),          N("20s–30s"),       N("Ambulatory"),                   N("Normal")],
]
sma_tbl = Table([sma_hdr]+sma_rows, colWidths=CW4)
sma_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0),  C_SMA),
    ("TEXTCOLOR",     (0,0), (-1,0),  C_WHITE),
    ("FONTNAME",      (0,0), (-1,0),  "Helvetica-Bold"),
    ("FONTSIZE",      (0,0), (-1,-1), 7),
    ("ALIGN",         (0,0), (-1,0),  "CENTER"),
    ("TOPPADDING",    (0,0), (-1,-1), 2),
    ("BOTTOMPADDING", (0,0), (-1,-1), 2),
    ("LEFTPADDING",   (0,0), (-1,-1), 4),
    ("GRID",          (0,0), (-1,-1), 0.4, C_BORDER),
    ("BACKGROUND",    (0,2), (-1,2),  C_ROW_ALT),
    ("BACKGROUND",    (0,4), (-1,4),  C_ROW_ALT),
    # Highlight Type I row
    ("BACKGROUND",    (0,1), (-1,1),  colors.HexColor("#FDECEA")),
]))
story += [sma_tbl]
story.append(hook_box("Rule: Type I = never sits  |  Type II = sits only  |  Type III = walks  |  IV = adult onset"))
story.append(sp(2))

# ── CHUNK 9: DMD STAGES ───────────────────────────────────────────────────────
story.append(section_header("9. DMD DISEASE STAGES"))
dmd_rows = [
    [B("Silent"),       N("0–2 yrs"),        N("CK already sky-high β€” NO symptoms yet")],
    [B("Early"),        N("2–5 yrs"),        N("Toe walking Β· Falls Β· Gower's sign Β· Calf hypertrophy")],
    [B("Progressive"),  N("5–10 yrs"),       N("Proximal weakness Β· Lordosis Β· Scoliosis starts")],
    [B("Wheelchair"),   D("10–15 yrs"),      D("Loss of ambulation  ← MOST EXAM-TESTED FACT")],
    [B("Terminal"),     N("Teens–20s"),      N("DCM + Respiratory failure = Cause of death")],
]
dmd_tbl = Table([[B("Stage"), B("Age"), B("Key Event")]]+dmd_rows,
                colWidths=[W*0.15, W*0.13, W*0.72])
dmd_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0),  C_DMD),
    ("TEXTCOLOR",     (0,0), (-1,0),  C_WHITE),
    ("FONTNAME",      (0,0), (-1,0),  "Helvetica-Bold"),
    ("FONTSIZE",      (0,0), (-1,-1), 7),
    ("TOPPADDING",    (0,0), (-1,-1), 2),
    ("BOTTOMPADDING", (0,0), (-1,-1), 2),
    ("LEFTPADDING",   (0,0), (-1,-1), 4),
    ("GRID",          (0,0), (-1,-1), 0.4, C_BORDER),
    ("BACKGROUND",    (0,2), (-1,2),  C_ROW_ALT),
    ("BACKGROUND",    (0,4), (-1,4),  C_ROW_ALT),
    # Highlight wheelchair row
    ("BACKGROUND",    (0,4), (-1,4),  colors.HexColor("#FFF4CC")),
]))
story += [dmd_tbl, sp(2)]

# ── CHUNK 10: MNEMONICS ────────────────────────────────────────────────────────
story.append(section_header("10. MEMORY MNEMONICS"))
mnem_data = [
    [Paragraph("<b>DMD = \"3C + X + G\"</b>", PS("mn",8,bold=True,color=C_DMD)),
     Paragraph("<b>SMA = \"FANGS\"</b>", PS("mn2",8,bold=True,color=C_SMA))],
    [
        Table([
            [B("C"), N("Calf pseudohypertrophy β€” big but WEAK")],
            [B("C"), N("Cardiomyopathy β€” DCM universal")],
            [B("C"), N("CK β€” sky high (>10Γ— normal)")],
            [B("X"), N("X-linked β€” males only")],
            [B("G"), N("Gower's sign β€” uses hands to stand")],
        ], colWidths=[W*0.03, W*0.44]),
        Table([
            [B("F"), N("Fasciculations β€” tongue esp. Type I")],
            [B("A"), N("Anterior horn cell β€” LMN death")],
            [B("N"), N("Normal IQ + Normal sensation")],
            [B("G"), N("Grouped atrophy on biopsy")],
            [B("S"), N("SMN1 deleted β€” Chr 5q13")],
        ], colWidths=[W*0.03, W*0.44]),
    ]
]
mnem_tbl = Table(mnem_data, colWidths=[W*0.5, W*0.5])
mnem_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (0,0), colors.HexColor("#D6E4F0")),
    ("BACKGROUND",    (1,0), (1,0), colors.HexColor("#FDECEA")),
    ("BACKGROUND",    (0,1), (0,1), colors.HexColor("#EBF5FB")),
    ("BACKGROUND",    (1,1), (1,1), colors.HexColor("#FEF9F9")),
    ("TOPPADDING",    (0,0), (-1,-1), 3),
    ("BOTTOMPADDING", (0,0), (-1,-1), 3),
    ("LEFTPADDING",   (0,0), (-1,-1), 5),
    ("BOX",           (0,0), (-1,-1), 0.5, C_BORDER),
    ("INNERGRID",     (0,0), (-1,-1), 0.3, C_BORDER),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ("ALIGN",         (0,0), (-1,0), "CENTER"),
]))
story += [mnem_tbl, sp(2)]

# ── CHUNK 11: MCQ RAPID FIRE ──────────────────────────────────────────────────
story.append(section_header("11. MCQ / MEQ RAPID FIRE β€” Must Know"))
mcq_items = [
    ("Firm calves + proximal weakness + 4yr boy",                    "DMD"),
    ("Child uses hands to climb up his own legs to stand",           "DMD β€” Gower's sign"),
    ("CK = 20,000 U/L in a toddler",                                "DMD"),
    ("Dilated cardiomyopathy + muscle weakness in a child",          "DMD"),
    ("Low IQ + proximal weakness in boy",                            "DMD"),
    ("Dystrophin absent on IHC / muscle biopsy",                     "DMD"),
    ("Deflazacort prescribed for muscle disease",                    "DMD"),
    ("Floppy infant + tongue fasciculations + absent reflexes",      "SMA Type I"),
    ("Cannot sit at 9 months + normal CK + absent DTRs",            "SMA Type I"),
    ("Both sexes + AR + sits but NEVER walks",                       "SMA Type II"),
    ("Teenager walks but has proximal leg weakness",                 "SMA Type III"),
    ("Grouped atrophy of type I fibres on biopsy",                   "SMA"),
    ("Neurogenic EMG + normal CK + floppy baby",                     "SMA"),
    ("AR inheritance + pure motor + normal IQ + normal sensation",   "SMA"),
    ("Nusinersen / Risdiplam prescribed",                            "SMA"),
    ("Myopathic EMG + massively raised CK",                         "DMD"),
    ("Reduced fetal movements + hypotonia at birth + resp failure",  "SMA Type 0"),
    ("Normal CK + no sensation loss + absent reflexes + infant",     "SMA"),
]
mcq_data = [[B("If question says..."), B("Answer")]]
for q, a in mcq_items:
    col = C_DMD if "DMD" in a else C_SMA
    mcq_data.append([
        Paragraph(q, mcq_q),
        Paragraph(a, PS("ans", 7, bold=True, color=col))
    ])
mcq_tbl = Table(mcq_data, colWidths=[W*0.68, W*0.32])
mcq_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0),  colors.HexColor("#2C3E50")),
    ("TEXTCOLOR",     (0,0), (-1,0),  C_WHITE),
    ("FONTNAME",      (0,0), (-1,0),  "Helvetica-Bold"),
    ("FONTSIZE",      (0,0), (-1,-1), 7),
    ("TOPPADDING",    (0,0), (-1,-1), 2),
    ("BOTTOMPADDING", (0,0), (-1,-1), 2),
    ("LEFTPADDING",   (0,0), (-1,-1), 4),
    ("GRID",          (0,0), (-1,-1), 0.3, C_BORDER),
    *[("BACKGROUND", (0,i), (-1,i), C_ROW_ALT) for i in range(1,len(mcq_data),2)],
]))
story += [mcq_tbl, sp(2)]

# ── FOOTER ─────────────────────────────────────────────────────────────────────
story.append(HRFlowable(width=W, thickness=0.5, color=C_BORDER))
story.append(sp(1))
story.append(Paragraph(
    "Sources: Tietz Textbook of Laboratory Medicine 7e  |  Bradley & Daroff's Neurology in Clinical Practice  |  "
    "Campbell's Operative Orthopaedics 15e 2026  β€”  For educational use: Final MBBS Yr 5",
    footer_s
))

# ── BUILD ─────────────────────────────────────────────────────────────────────
doc.build(story)
print("PDF built:", OUTPUT)
Running Command

cd /tmp/workspace && python dmd_sma_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/DMD_vs_SMA_Quick_Reference.pdf

Your PDF is ready! Download it here:

DMD vs SMA Quick Reference

PDF Document Β· PDF


What's inside the PDF (11 chunked sections):
#Section
1Abbreviations guide (all terms explained)
2Identity β€” Who gets it (gene, protein, inheritance)
3Site of lesion
4Onset & progression
4A-4EMotor signs split into 5 mini-tables (weakness / tone & reflexes / involuntary / classic signs / face & bulbar)
5Non-motor features (brain, heart, lungs, bones)
6Investigations (CK, EMG, biopsy, genetics)
7Treatment (all drugs colour-coded)
8SMA Types table (0-IV at a glance)
9DMD disease stages
10Mnemonics β€” 3C+X+G (DMD) and FANGS (SMA)
11MCQ/MEQ rapid fire (18 high-yield stems with answers)
Design features: Navy = DMD, Red = SMA, colour-coded throughout, green hook boxes for memory, alternating row shading for fast reading. Fits on A4, print-ready.

please do not confuse by telling the investigations and treatmeent one in one line. BCS it confusing make it more organised even to answer the seq and seq

Writing File

~/dmd_sma_pdf_v2.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.lib.styles import ParagraphStyle
from reportlab.platypus import (
    SimpleDocTemplate, Table, TableStyle, Paragraph,
    Spacer, HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT

OUTPUT = "/tmp/workspace/DMD_vs_SMA_QuickRef_v2.pdf"

# ── Colours ───────────────────────────────────────────────────────────────────
C_DMD      = colors.HexColor("#1A3C6E")
C_SMA      = colors.HexColor("#7B1F1F")
C_HEAD_BG  = colors.HexColor("#0D1B2A")
C_SEC_BG   = colors.HexColor("#E8EDF4")
C_ROW_ALT  = colors.HexColor("#F5F7FA")
C_WHITE    = colors.white
C_GREEN    = colors.HexColor("#D6F0D6")
C_YELLOW   = colors.HexColor("#FFF9E6")
C_BORDER   = colors.HexColor("#BBCDE5")
C_INV_HDR  = colors.HexColor("#1B4F72")   # investigations header
C_TX_HDR   = colors.HexColor("#4A235A")   # treatment header
C_ORANGE   = colors.HexColor("#F5CBA7")   # highlight important rows

# ── Page ──────────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT, pagesize=A4,
    leftMargin=10*mm, rightMargin=10*mm,
    topMargin=10*mm,  bottomMargin=10*mm,
)
W = A4[0] - 20*mm

# ── Styles ────────────────────────────────────────────────────────────────────
def PS(name, size, bold=False, color=colors.black, align=TA_LEFT, leading=None):
    return ParagraphStyle(
        name, fontSize=size,
        fontName="Helvetica-Bold" if bold else "Helvetica",
        textColor=color, alignment=align,
        leading=leading or size*1.3,
        spaceAfter=0, spaceBefore=0,
    )

title_s   = PS("title", 13, bold=True, color=C_WHITE,  align=TA_CENTER)
sub_s     = PS("sub",    8, bold=False, color=C_WHITE,  align=TA_CENTER)
sec_s     = PS("sec",    8, bold=True,  color=C_DMD)
cb        = lambda t: Paragraph(t, PS("cb", 7, bold=True))
cn        = lambda t: Paragraph(t, PS("cn", 7))
cd        = lambda t: Paragraph(t, PS("cd", 7, bold=True, color=C_DMD))
cs        = lambda t: Paragraph(t, PS("cs", 7, bold=True, color=C_SMA))
hook_s    = PS("hook", 7, color=colors.HexColor("#1A472A"))
foot_s    = PS("foot", 6, color=colors.grey, align=TA_CENTER)

def sp(h=2): return Spacer(1, h*mm)

def sec_hdr(text, color=C_SEC_BG, text_color=C_DMD):
    tbl = Table([[Paragraph(text, PS("sh", 8, bold=True, color=text_color))]], colWidths=[W])
    tbl.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), color),
        ("TOPPADDING",    (0,0), (-1,-1), 3),
        ("BOTTOMPADDING", (0,0), (-1,-1), 3),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("BOX",           (0,0), (-1,-1), 0.5, C_BORDER),
    ]))
    return tbl

def inv_hdr(text):
    """Dark blue header for investigation sub-sections"""
    tbl = Table([[Paragraph(text, PS("ih", 7.5, bold=True, color=C_WHITE))]], colWidths=[W])
    tbl.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), C_INV_HDR),
        ("TOPPADDING",    (0,0), (-1,-1), 2.5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 2.5),
        ("LEFTPADDING",   (0,0), (-1,-1), 8),
    ]))
    return tbl

def tx_hdr(text):
    """Purple header for treatment sub-sections"""
    tbl = Table([[Paragraph(text, PS("th", 7.5, bold=True, color=C_WHITE))]], colWidths=[W])
    tbl.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), C_TX_HDR),
        ("TOPPADDING",    (0,0), (-1,-1), 2.5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 2.5),
        ("LEFTPADDING",   (0,0), (-1,-1), 8),
    ]))
    return tbl

def make_table(headers, rows, col_widths, hdr_color=C_DMD, highlights=None):
    data = [headers] + rows
    tbl  = Table(data, colWidths=col_widths, repeatRows=1)
    style = [
        ("BACKGROUND",    (0,0), (-1,0),  hdr_color),
        ("TEXTCOLOR",     (0,0), (-1,0),  C_WHITE),
        ("FONTNAME",      (0,0), (-1,0),  "Helvetica-Bold"),
        ("FONTSIZE",      (0,0), (-1,0),  7.5),
        ("ALIGN",         (0,0), (-1,0),  "CENTER"),
        ("TOPPADDING",    (0,0), (-1,0),  3),
        ("BOTTOMPADDING", (0,0), (-1,0),  3),
        ("FONTSIZE",      (0,1), (-1,-1), 7),
        ("TOPPADDING",    (0,1), (-1,-1), 2),
        ("BOTTOMPADDING", (0,1), (-1,-1), 2),
        ("LEFTPADDING",   (0,0), (-1,-1), 4),
        ("RIGHTPADDING",  (0,0), (-1,-1), 4),
        ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
        ("GRID",          (0,0), (-1,-1), 0.4, C_BORDER),
    ]
    for i in range(1, len(data)):
        if i % 2 == 0:
            style.append(("BACKGROUND", (0,i), (-1,i), C_ROW_ALT))
    if highlights:
        for row_idx, bg in highlights:
            style.append(("BACKGROUND", (0, row_idx), (-1, row_idx), bg))
    tbl.setStyle(TableStyle(style))
    return tbl

def hook_box(text, bg=C_GREEN):
    tbl = Table([[Paragraph(text, hook_s)]], colWidths=[W])
    tbl.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), bg),
        ("TOPPADDING",    (0,0), (-1,-1), 3),
        ("BOTTOMPADDING", (0,0), (-1,-1), 3),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("BOX",           (0,0), (-1,-1), 0.5, colors.HexColor("#7CB87C")),
    ]))
    return tbl

# ── Column presets ────────────────────────────────────────────────────────────
CW3  = [W*0.30, W*0.35, W*0.35]
CW3b = [W*0.32, W*0.34, W*0.34]

# =============================================================================
story = []

# ── TITLE ─────────────────────────────────────────────────────────────────────
title_tbl = Table(
    [[Paragraph("DMD  vs  SMA β€” Quick Reference Card", title_s),
      Paragraph("Final MBBS Yr 5  |  Paediatrics", sub_s)]],
    colWidths=[W*0.65, W*0.35]
)
title_tbl.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), C_HEAD_BG),
    ("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 += [title_tbl, sp(2)]

# ── ABBREVIATIONS ─────────────────────────────────────────────────────────────
story.append(sec_hdr("ABBREVIATIONS β€” Know These First"))
abbr = [
    [cb("DMD"), cn("Duchenne Muscular Dystrophy"),    cb("SMA"),  cn("Spinal Muscular Atrophy")],
    [cb("CK"),  cn("Creatine Kinase (muscle enzyme)"),cb("DCM"),  cn("Dilated Cardiomyopathy")],
    [cb("IHC"), cn("Immunohistochemistry"),           cb("NIV"),  cn("Non-Invasive Ventilation")],
    [cb("EMG"), cn("Electromyography"),               cb("NCV"),  cn("Nerve Conduction Velocity")],
    [cb("MUP"), cn("Motor Unit Potential"),           cb("DTR"),  cn("Deep Tendon Reflex")],
    [cb("LMN"), cn("Lower Motor Neuron"),             cb("UMN"),  cn("Upper Motor Neuron")],
    [cb("XLR"), cn("X-Linked Recessive"),             cb("AR"),   cn("Autosomal Recessive")],
    [cb("MLPA"),cn("Multiplex Ligation Probe Amplification (gene test)"), cb("CVS"), cn("Chorionic Villus Sampling")],
    [cb("ACE-I"),cn("ACE Inhibitor"),                 cb("NBS"),  cn("Newborn Screening")],
]
at = Table(abbr, colWidths=[W*0.09, W*0.41, W*0.09, W*0.41])
at.setStyle(TableStyle([
    ("FONTSIZE",      (0,0),(-1,-1), 7),
    ("TOPPADDING",    (0,0),(-1,-1), 1.5),
    ("BOTTOMPADDING", (0,0),(-1,-1), 1.5),
    ("LEFTPADDING",   (0,0),(-1,-1), 4),
    ("GRID",          (0,0),(-1,-1), 0.3, C_BORDER),
    *[("BACKGROUND",  (0,i),(-1,i), C_ROW_ALT) for i in range(0,9,2)],
]))
story += [at, sp(2)]

# ── 1. IDENTITY ───────────────────────────────────────────────────────────────
story.append(sec_hdr("1.  IDENTITY β€” Who Gets It?"))
rows = [
    [cb("Disease type"),   cd("Myopathy β€” muscle disease"),         cs("Motor Neuron Disease")],
    [cb("Gene"),           cd("DMD gene"),                          cs("SMN1 gene")],
    [cb("Chromosome"),     cd("Xp21.2"),                            cs("5q13")],
    [cb("Protein lost"),   cd("Dystrophin (structural protein)"),   cs("SMN protein (mRNA splicing)")],
    [cb("Inheritance"),    cd("X-Linked Recessive (XLR)"),          cs("Autosomal Recessive (AR)")],
    [cb("Sex affected"),   cd("Males ONLY"),                        cs("Both sexes equally")],
    [cb("Incidence"),      cd("1 in 3,500 males"),                  cs("1 in 6,000–10,000")],
    [cb("Spontaneous mut"),cd("30% β€” no family history"),           cs("Rare")],
]
story.append(make_table([cb("Feature"), cd("DMD"), cs("SMA")], rows, CW3))
story.append(hook_box("Hook: DMD = X = eXclusively males  |  SMA = Chr 5 = both 5eXes"))
story.append(sp(2))

# ── 2. SITE OF LESION ─────────────────────────────────────────────────────────
story.append(sec_hdr("2.  SITE OF LESION"))
rows = [
    [cb("Primary site"),    cd("Muscle fibre β€” sarcolemma"),       cs("Spinal anterior horn cells")],
    [cb("Neuron involved?"),cd("NO"),                              cs("YES β€” LMN only")],
    [cb("UMN signs?"),      cd("Absent"),                         cs("Absent")],
    [cb("Sensory loss?"),   cd("NO β€” normal sensation"),          cs("NO β€” PURE motor disease")],
    [cb("Bulbar involved?"),cd("NO β€” face spared"),               cs("YES β€” Type I (tongue, swallow)")],
]
story.append(make_table([cb("Feature"), cd("DMD"), cs("SMA")], rows, CW3))
story.append(hook_box("Hook: DMD = Muscle dies  |  SMA = Motor neuron dies β†’ muscle wastes secondary"))
story.append(sp(2))

# ── 3. ONSET & PROGRESSION ────────────────────────────────────────────────────
story.append(sec_hdr("3.  ONSET & PROGRESSION"))
rows = [
    [cb("Onset age"),       cd("2–5 yrs (mean diagnosis 41 mo)"),   cs("Birth β†’ adulthood (type-dependent)")],
    [cb("First clue"),      cd("Toe walking, frequent falls"),       cs("Floppy baby / hypotonia")],
    [cb("Early milestones"),cd("Initially NORMAL"),                 cs("Delayed from birth (Type I)")],
    [cb("Wheelchair age"),  cd("10–15 yrs  ← KEY EXAM FACT"),       cs("Type I: never walks; Type III: may lose walking")],
    [cb("Cause of death"),  cd("DCM + Respiratory failure"),        cs("Respiratory failure (Type I <1 yr)")],
]
story.append(make_table([cb("Feature"), cd("DMD"), cs("SMA")], rows, CW3,
             highlights=[(4, C_ORANGE)]))
story.append(sp(2))

# ── 4. MOTOR SIGNS (5 sub-chunks) ─────────────────────────────────────────────
story.append(sec_hdr("4.  MOTOR SIGNS"))
story.append(sp(1))

# 4A Weakness
story.append(inv_hdr("  4A.  Weakness Pattern"))
rows = [
    [cb("Pattern"),         cd("Proximal > Distal"),              cs("Proximal > Distal")],
    [cb("Limb onset"),      cd("Lower limbs FIRST, then upper"),  cs("Lower limbs worse than upper")],
    [cb("Axial muscles"),   cd("Weak β€” lumbar lordosis early"),   cs("Weak β€” poor head control early")],
    [cb("Progression"),     cd("Steady downhill"),                cs("Progressive / brief plateau possible")],
]
story.append(make_table([cb("Feature"), cd("DMD"), cs("SMA")], rows, CW3))
story.append(sp(1))

# 4B Tone & Reflexes
story.append(inv_hdr("  4B.  Tone & Deep Tendon Reflexes (DTRs)"))
rows = [
    [cb("Muscle tone"),     cd("Hypotonia β€” develops LATER"),     cs("Profound hypotonia β€” FROM BIRTH (Type I)")],
    [cb("DTRs overall"),    cd("Reduced β€” LATE in disease"),      cs("ABSENT β€” EARLY hallmark sign")],
    [cb("Ankle reflex"),    cd("Lost late"),                      cs("LOST EARLIEST")],
    [cb("Knee reflex"),     cd("Lost later"),                     cs("Also absent")],
]
story.append(make_table([cb("Feature"), cd("DMD"), cs("SMA")], rows, CW3))
story.append(hook_box("Hook: Absent reflexes EARLY = SMA. Anterior horn cell gone = no reflex arc."))
story.append(sp(1))

# 4C Involuntary
story.append(inv_hdr("  4C.  Involuntary Movements"))
rows = [
    [cb("Fasciculations"),     cd("ABSENT"),                     cs("PRESENT β€” LMN sign")],
    [cb("Tongue fascicul."),   cd("Absent"),                     cs("CLASSIC in Type I  ← KEY exam sign")],
    [cb("Fibrillations (EMG)"),cd("Absent"),                     cs("Present on EMG")],
    [cb("Muscle cramps"),      cd("Occasionally"),               cs("Less common")],
]
story.append(make_table([cb("Feature"), cd("DMD"), cs("SMA")], rows, CW3))
story.append(hook_box("Hook: Twitching tongue + floppy baby = SMA Type I until proven otherwise"))
story.append(sp(1))

# 4D Classic signs
story.append(inv_hdr("  4D.  Classic Clinical Signs"))
rows = [
    [cb("Gower's sign"),          cd("CLASSIC β€” hands climb thighs to stand"), cs("ABSENT")],
    [cb("Calf pseudohypertrophy"),cd("CLASSIC β€” firm, rubbery (fat+fibrosis)"), cs("ABSENT")],
    [cb("Lumbar lordosis"),       cd("Early prominent sign"),                  cs("Less prominent")],
    [cb("Waddling gait"),         cd("Present"),                              cs("Types I-II cannot walk")],
    [cb("Trendelenburg gait"),    cd("Present"),                              cs("Absent")],
]
story.append(make_table([cb("Feature"), cd("DMD"), cs("SMA")], rows, CW3))
story.append(hook_box("Hook: Big calves that are WEAK = pseudohypertrophy = DMD  (fat+fibrosis replacing muscle)"))
story.append(sp(1))

# 4E Face & Bulbar
story.append(inv_hdr("  4E.  Face & Bulbar Signs"))
rows = [
    [cb("Facial muscles"),  cd("SPARED"),                        cs("Involved β€” Type I only")],
    [cb("Tongue"),          cd("Normal"),                        cs("Fasciculating + wasted (Type I)")],
    [cb("Swallowing"),      cd("Normal"),                        cs("Dysphagia β€” aspiration risk (Type I)")],
    [cb("Feeding"),         cd("Normal"),                        cs("Difficulty feeding β€” Type I")],
    [cb("Head control"),    cd("Normal initially"),              cs("LOST EARLY β€” Type I")],
]
story.append(make_table([cb("Feature"), cd("DMD"), cs("SMA")], rows, CW3))
story.append(sp(2))

# ── 5. NON-MOTOR FEATURES ────────────────────────────────────────────────────
story.append(sec_hdr("5.  NON-MOTOR FEATURES"))
story.append(sp(1))

story.append(inv_hdr("  5A.  Cognition & Intelligence"))
rows = [
    [cb("Intelligence / IQ"),cd("LOW β€” non-progressive cognitive impairment"), cs("NORMAL β€” brain unaffected")],
    [cb("Why low IQ?"),      cd("Dystrophin isoforms expressed in brain"),     cs("Not applicable")],
    [cb("Behaviour"),        cd("ADHD, autism-like features possible"),         cs("Normal behaviour")],
]
story.append(make_table([cb("Feature"), cd("DMD"), cs("SMA")], rows, CW3))
story.append(sp(1))

story.append(inv_hdr("  5B.  Cardiac"))
rows = [
    [cb("Cardiac involvement"),cd("UNIVERSAL β€” affects ALL patients"),           cs("ABSENT (generally)")],
    [cb("Type"),               cd("Dilated Cardiomyopathy (DCM)"),               cs("None")],
    [cb("Mechanism"),          cd("Cardiac fibrosis β€” dystrophin absent in heart"),cs("Not applicable")],
    [cb("Arrhythmia"),         cd("Conduction defects"),                         cs("Absent")],
    [cb("Heart failure"),      cd("LV dilation β†’ Congestive Heart Failure"),      cs("Absent")],
]
story.append(make_table([cb("Feature"), cd("DMD"), cs("SMA")], rows, CW3))
story.append(hook_box("Hook: Heart also has dystrophin β†’ no dystrophin = heart destroyed too in DMD"))
story.append(sp(1))

story.append(inv_hdr("  5C.  Respiratory"))
rows = [
    [cb("Respiratory failure"),cd("Late β€” affects ALL patients eventually"),    cs("EARLY in Type I (<1 yr)")],
    [cb("Mechanism"),          cd("Resp. muscle weakness + scoliosis"),         cs("Intercostal + diaphragm weakness")],
    [cb("Type I SMA"),         cd("β€”"),                                         cs("Resp. failure = cause of death <1 yr")],
]
story.append(make_table([cb("Feature"), cd("DMD"), cs("SMA")], rows, CW3))
story.append(sp(1))

story.append(inv_hdr("  5D.  Orthopaedic / Skeletal"))
rows = [
    [cb("Scoliosis"),         cd("Yes β€” worsens post-wheelchair"),             cs("Yes β€” severe in Types II–III")],
    [cb("Contractures"),      cd("Achilles tendon, hip flexors, knees"),       cs("Hip dislocation β€” Type II")],
    [cb("Lumbar lordosis"),   cd("Prominent early"),                           cs("Less common")],
    [cb("Fractures"),         cd("Steroid-related + immobility"),              cs("Muscle weakness-related")],
]
story.append(make_table([cb("Feature"), cd("DMD"), cs("SMA")], rows, CW3))
story.append(sp(2))

# ═══════════════════════════════════════════════════════════════════
# ── 6. INVESTIGATIONS β€” FULLY EXPANDED, SEQ-READY ─────────────────
# ═══════════════════════════════════════════════════════════════════
story.append(sec_hdr("6.  INVESTIGATIONS  (SEQ / MEQ Ready)", color=colors.HexColor("#D0E4F7"), text_color=C_INV_HDR))
story.append(sp(1))

# 6A Blood
story.append(inv_hdr("  6A.  Blood Tests"))
rows = [
    [cb("CK β€” Creatine Kinase"),
     cd("MASSIVELY elevated\n>10–50Γ— normal\nTypical: 10,000–50,000 U/L\nAlready HIGH at birth (before symptoms!)"),
     cs("Normal OR mildly elevated\nUsually <500 U/L\nNormal at birth")],
    [cb("LDH\n(Lactate Dehydrogenase)"),
     cd("Mildly elevated\n(from dying muscle cells)"),
     cs("Normal")],
    [cb("AST / ALT\n(liver enzymes)"),
     cd("Mildly elevated\nCAUSE = muscle, NOT liver!\nAlways check CK if raised in a child"),
     cs("Normal")],
]
bt = Table([[cb("Test"), cd("DMD β€” What to Write"), cs("SMA β€” What to Write")]] + rows,
           colWidths=[W*0.28, W*0.36, W*0.36], repeatRows=1)
bt.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), C_INV_HDR),
    ("TEXTCOLOR",     (0,0),(-1,0), C_WHITE),
    ("FONTNAME",      (0,0),(-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),7),
    ("TOPPADDING",    (0,0),(-1,-1),3),
    ("BOTTOMPADDING", (0,0),(-1,-1),3),
    ("LEFTPADDING",   (0,0),(-1,-1),4),
    ("VALIGN",        (0,0),(-1,-1),"TOP"),
    ("GRID",          (0,0),(-1,-1),0.4, C_BORDER),
    ("BACKGROUND",    (0,2),(-1,2), C_ROW_ALT),
]))
story += [bt, sp(1)]

# 6B EMG
story.append(inv_hdr("  6B.  EMG β€” Electromyography"))
rows = [
    [cb("Overall pattern"),  cd("MYOPATHIC"),                       cs("NEUROGENIC")],
    [cb("MUP size"),         cd("Small, short, low amplitude"),     cs("Large, long duration MUPs")],
    [cb("Polyphasic MUPs"),  cd("YES β€” characteristic"),           cs("Less prominent")],
    [cb("Fibrillations"),    cd("ABSENT"),                          cs("PRESENT β€” denervation sign")],
    [cb("Fasciculations"),   cd("ABSENT"),                          cs("PRESENT")],
    [cb("Recruitment"),      cd("Early recruitment (many small units)"),cs("Reduced recruitment (fewer large units)")],
]
story.append(make_table([cb("EMG Finding"), cd("DMD"), cs("SMA")], rows, CW3, hdr_color=C_INV_HDR))
story.append(hook_box("Hook: Myopathic = small units (fewer fibres work)  |  Neurogenic = large units (surviving neurons compensate)"))
story.append(sp(1))

# 6C NCV
story.append(inv_hdr("  6C.  Nerve Conduction Velocity (NCV)"))
rows = [
    [cb("Motor NCV"),      cd("NORMAL"),                cs("NORMAL")],
    [cb("Sensory NCV"),    cd("NORMAL"),                cs("NORMAL")],
    [cb("Interpretation"), cd("Nerves intact β€” muscle is the problem"), cs("Nerves intact β€” neuron BODY is dying (not the nerve)")],
]
story.append(make_table([cb("NCV Finding"), cd("DMD"), cs("SMA")], rows, CW3, hdr_color=C_INV_HDR))
story.append(sp(1))

# 6D Muscle Biopsy β€” Pattern
story.append(inv_hdr("  6D.  Muscle Biopsy β€” Gross Histological Pattern"))
rows = [
    [cb("Overall pattern"),  cd("Random scattered necrosis"),         cs("GROUPED fibre atrophy")],
    [cb("Fat infiltration"), cd("YES β€” late feature"),               cs("NO")],
    [cb("Fibrosis"),         cd("Endomysial fibrosis β€” YES"),        cs("NO")],
    [cb("Inflammation"),     cd("Mild inflammatory infiltrate"),      cs("NO")],
]
story.append(make_table([cb("Finding"), cd("DMD"), cs("SMA")], rows, CW3, hdr_color=C_INV_HDR))
story.append(sp(1))

# 6E Muscle Biopsy β€” Fibres
story.append(inv_hdr("  6E.  Muscle Biopsy β€” Individual Fibre Changes"))
rows = [
    [cb("Fibre necrosis"),       cd("PRESENT β€” hallmark"),           cs("ABSENT")],
    [cb("Fibre regeneration"),   cd("PRESENT β€” basophilic fibres"),  cs("ABSENT")],
    [cb("Fibre size variation"), cd("YES β€” marked"),                 cs("Less prominent")],
    [cb("Type I fibres"),        cd("Variable atrophy"),             cs("GROUPED ATROPHY β€” hallmark")],
    [cb("Type II fibres"),       cd("Variable"),                     cs("HYPERTROPHIED β€” compensatory")],
    [cb("Fibre type grouping"),  cd("ABSENT"),                       cs("PRESENT β€” reinnervation pattern")],
]
story.append(make_table([cb("Fibre Finding"), cd("DMD"), cs("SMA")], rows, CW3, hdr_color=C_INV_HDR))
story.append(sp(1))

# 6F Biopsy β€” Special Stains
story.append(inv_hdr("  6F.  Muscle Biopsy β€” Special Stains (IHC)"))
rows = [
    [cb("Dystrophin IHC"),       cd("ABSENT β€” DIAGNOSTIC"),          cs("PRESENT / Normal")],
    [cb("H&E stain"),            cd("Necrosis + regeneration"),       cs("Grouped atrophy")],
    [cb("Modified Gomori"),      cd("Fibrosis prominent"),            cs("Less prominent")],
    [cb("ATPase stain"),         cd("Fibre size variation"),          cs("Grouped atrophy of Type I")],
]
story.append(make_table([cb("Stain / Test"), cd("DMD"), cs("SMA")], rows, CW3, hdr_color=C_INV_HDR))
story.append(hook_box("Biopsy Exam Rule: Grouped atrophy = SMA (neuron died β†’ muscle regrouped)  |  Dystrophin absent = DMD"))
story.append(sp(1))

# 6G Genetic
story.append(inv_hdr("  6G.  Genetic Testing"))
rows = [
    [cb("Gold standard test"),  cd("MLPA / PCR\n(DMD gene deletion / duplication)"),  cs("MLPA for SMN1\n(copy number = 0 confirms SMA)")],
    [cb("Confirm diagnosis"),   cd("Dystrophin absent on IHC\n+ gene test"),          cs("SMN1 deletion confirmed")],
    [cb("Prenatal test"),       cd("CVS or amniocentesis"),                           cs("CVS or amniocentesis")],
    [cb("Carrier testing"),     cd("Female relatives (XLR)"),                         cs("Both parents (AR)")],
    [cb("Newborn screening"),   cd("CK on dried blood spot"),                         cs("SMN1 copy number")],
]
story.append(make_table([cb("Genetic Test"), cd("DMD"), cs("SMA")], rows, CW3, hdr_color=C_INV_HDR))
story.append(sp(2))

# ═══════════════════════════════════════════════════════════════════
# ── 7. TREATMENT β€” FULLY EXPANDED, SEQ-READY ──────────────────────
# ═══════════════════════════════════════════════════════════════════
story.append(sec_hdr("7.  TREATMENT  (SEQ / MEQ Ready)", color=colors.HexColor("#EDE0F5"), text_color=C_TX_HDR))
story.append(sp(1))

# 7A Steroids
story.append(tx_hdr("  7A.  Corticosteroids"))
rows = [
    [cb("Used?"),          cd("YES β€” FIRST LINE in DMD"),              cs("NO β€” not used in SMA")],
    [cb("Drug of choice"), cd("Deflazacort (preferred)\nor Prednisolone"), cs("β€”")],
    [cb("Purpose"),        cd("Slows muscle weakness\nDelays wheelchair by ~2 yrs"), cs("β€”")],
    [cb("Start age"),      cd("~4–5 years of age"),                    cs("β€”")],
    [cb("Side effects"),   cd("Weight gain, Cushingoid features\nOsteoporosis, Growth delay"), cs("β€”")],
]
st = Table([[cb("Point"), cd("DMD"), cs("SMA")]] + rows,
           colWidths=CW3, repeatRows=1)
st.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), C_TX_HDR),
    ("TEXTCOLOR",     (0,0),(-1,0), C_WHITE),
    ("FONTNAME",      (0,0),(-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),7),
    ("TOPPADDING",    (0,0),(-1,-1),3),
    ("BOTTOMPADDING", (0,0),(-1,-1),3),
    ("LEFTPADDING",   (0,0),(-1,-1),4),
    ("VALIGN",        (0,0),(-1,-1),"TOP"),
    ("GRID",          (0,0),(-1,-1),0.4, C_BORDER),
    *[("BACKGROUND",  (0,i),(-1,i), C_ROW_ALT) for i in range(1,6,2)],
]))
story += [st, sp(1)]

# 7B Disease-modifying
story.append(tx_hdr("  7B.  Disease-Modifying Therapies"))
dm_hdr = [cb("Drug"), cb("For DMD?"), cb("For SMA?"), cb("Route"), cb("Mechanism")]
dm_rows = [
    [cd("Deflazacort / Prednisolone"),
     cd("YES β€” 1st line"),
     cs("NO"),
     cn("Oral"),
     cn("Corticosteroid β€” slows degeneration")],
    [cs("Nusinersen"),
     cd("NO"),
     cs("YES"),
     cn("Intrathecal\n(into spinal fluid)"),
     cn("Antisense oligonucleotide\nIncreases full-length SMN protein from SMN2")],
    [cs("Risdiplam"),
     cd("NO"),
     cs("YES"),
     cn("Oral daily\n(syrup)"),
     cn("SMN2 splicing modifier\nIncreases functional SMN protein")],
    [cs("Onasemnogene\nabeparvovec"),
     cd("NO"),
     cs("YES"),
     cn("IV β€” ONE TIME\ngene therapy"),
     cn("Delivers functional SMN1 gene\nvia AAV9 vector")],
    [cd("Eteplirsen"),
     cd("YES\n(exon 51 del.)"),
     cs("NO"),
     cn("IV infusion"),
     cn("Exon 51 skipping\nRestores partial dystrophin")],
    [cd("Ataluren"),
     cd("YES\n(nonsense mut.)"),
     cs("NO"),
     cn("Oral"),
     cn("Read-through of premature\nstop codon")],
]
dm_cw = [W*0.22, W*0.12, W*0.10, W*0.16, W*0.40]
dm_t = Table([dm_hdr]+dm_rows, colWidths=dm_cw, repeatRows=1)
dm_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), C_TX_HDR),
    ("TEXTCOLOR",     (0,0),(-1,0), C_WHITE),
    ("FONTNAME",      (0,0),(-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),7),
    ("TOPPADDING",    (0,0),(-1,-1),2.5),
    ("BOTTOMPADDING", (0,0),(-1,-1),2.5),
    ("LEFTPADDING",   (0,0),(-1,-1),4),
    ("VALIGN",        (0,0),(-1,-1),"TOP"),
    ("GRID",          (0,0),(-1,-1),0.4, C_BORDER),
    *[("BACKGROUND",  (0,i),(-1,i), C_ROW_ALT) for i in range(1,7,2)],
    # SMA drugs highlight
    ("BACKGROUND",    (0,2),(-1,2), colors.HexColor("#FDECEA")),
    ("BACKGROUND",    (0,3),(-1,3), colors.HexColor("#FDECEA")),
    ("BACKGROUND",    (0,4),(-1,4), colors.HexColor("#FDECEA")),
]))
story += [dm_t]
story.append(hook_box("SMA drugs = NRO: Nusinersen Β· Risdiplam Β· Onasemnogene  |  DMD = Deflazacort (steroid) + Eteplirsen/Ataluren (gene-level)"))
story.append(sp(1))

# 7C Cardiac treatment
story.append(tx_hdr("  7C.  Cardiac Treatment"))
rows = [
    [cb("Indication"),        cd("DCM present in ALL DMD patients"),  cs("NOT needed (no cardiac disease)")],
    [cb("ACE Inhibitor"),     cd("YES β€” start early (enalapril)"),    cs("β€”")],
    [cb("Beta-blocker"),      cd("YES β€” carvedilol / metoprolol"),    cs("β€”")],
    [cb("Diuretics"),         cd("YES β€” for heart failure / oedema"), cs("β€”")],
    [cb("When to start"),     cd("From ~10 yrs or when DCM detected"),cs("β€”")],
]
ct = Table([[cb("Drug / Point"), cd("DMD"), cs("SMA")]] + rows, colWidths=CW3, repeatRows=1)
ct.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), C_TX_HDR),
    ("TEXTCOLOR",     (0,0),(-1,0), C_WHITE),
    ("FONTNAME",      (0,0),(-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),7),
    ("TOPPADDING",    (0,0),(-1,-1),3),
    ("BOTTOMPADDING", (0,0),(-1,-1),3),
    ("LEFTPADDING",   (0,0),(-1,-1),4),
    ("VALIGN",        (0,0),(-1,-1),"TOP"),
    ("GRID",          (0,0),(-1,-1),0.4, C_BORDER),
    *[("BACKGROUND",  (0,i),(-1,i), C_ROW_ALT) for i in range(1,6,2)],
]))
story += [ct, sp(1)]

# 7D Respiratory treatment
story.append(tx_hdr("  7D.  Respiratory Treatment"))
rows = [
    [cb("Non-invasive ventilation (NIV)"),cd("YES β€” when FVC drops\n(BiPAP / CPAP)"),       cs("YES β€” Types I–II\nearly and essential")],
    [cb("Tracheostomy"),                  cd("Considered very late"),                        cs("Type I β€” sometimes needed")],
    [cb("Cough assist device"),           cd("YES β€” for secretion clearance"),               cs("YES β€” Type I")],
    [cb("Chest physiotherapy"),           cd("YES"),                                         cs("YES")],
]
rt = Table([[cb("Respiratory Rx"), cd("DMD"), cs("SMA")]] + rows, colWidths=CW3, repeatRows=1)
rt.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), C_TX_HDR),
    ("TEXTCOLOR",     (0,0),(-1,0), C_WHITE),
    ("FONTNAME",      (0,0),(-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),7),
    ("TOPPADDING",    (0,0),(-1,-1),3),
    ("BOTTOMPADDING", (0,0),(-1,-1),3),
    ("LEFTPADDING",   (0,0),(-1,-1),4),
    ("VALIGN",        (0,0),(-1,-1),"TOP"),
    ("GRID",          (0,0),(-1,-1),0.4, C_BORDER),
    *[("BACKGROUND",  (0,i),(-1,i), C_ROW_ALT) for i in range(1,5,2)],
]))
story += [rt, sp(1)]

# 7E Orthopaedic
story.append(tx_hdr("  7E.  Orthopaedic / Supportive Treatment"))
rows = [
    [cb("Spinal fusion"),         cd("YES β€” for progressive scoliosis"),  cs("YES β€” Types II–III")],
    [cb("Achilles tendon release"),cd("YES β€” for contractures"),          cs("Less common")],
    [cb("Physiotherapy"),         cd("Maintain ambulation as long as possible"), cs("Prevent contractures, positioning")],
    [cb("Nutritional support"),   cd("For steroid side effects\n(weight/growth monitoring)"), cs("Gastrostomy tube β€” Type I\n(feeding difficulty)")],
    [cb("Genetic counselling"),   cd("Female carriers β€” prenatal testing"), cs("Both parents β€” prenatal / NBS")],
]
ot = Table([[cb("Support"), cd("DMD"), cs("SMA")]] + rows, colWidths=CW3, repeatRows=1)
ot.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), C_TX_HDR),
    ("TEXTCOLOR",     (0,0),(-1,0), C_WHITE),
    ("FONTNAME",      (0,0),(-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),7),
    ("TOPPADDING",    (0,0),(-1,-1),3),
    ("BOTTOMPADDING", (0,0),(-1,-1),3),
    ("LEFTPADDING",   (0,0),(-1,-1),4),
    ("VALIGN",        (0,0),(-1,-1),"TOP"),
    ("GRID",          (0,0),(-1,-1),0.4, C_BORDER),
    *[("BACKGROUND",  (0,i),(-1,i), C_ROW_ALT) for i in range(1,6,2)],
]))
story += [ot, sp(2)]

# ── 8. SMA TYPES ─────────────────────────────────────────────────────────────
story.append(sec_hdr("8.  SMA TYPES β€” One Glance"))
sma_hdr = [cb("Type"), cb("Alias / Name"), cb("Onset Age"), cb("Best Milestone EVER"), cb("Survival")]
sma_rows = [
    [cb("0"),  cn("Prenatal / Severe"),        cn("In womb"),        cn("NONE β€” resp. failure at birth"), cn("Weeks")],
    [cb("I"),  cd("Werdnig-Hoffmann"),          cn("<6 months"),      cn("Cannot sit"),                   cn("<1 year")],
    [cb("II"), cn("Intermediate SMA"),          cn("7–18 months"),    cn("Sits β€” cannot walk"),            cn("3rd decade")],
    [cb("III"),cn("Kugelberg-Welander"),        cn(">18 months"),     cn("Walks (may lose later)"),        cn("Normal")],
    [cb("IV"), cn("Adult SMA"),                 cn("20s–30s"),        cn("Ambulatory"),                    cn("Normal")],
]
sma_cw = [W*0.07, W*0.24, W*0.15, W*0.30, W*0.24]
sma_t = Table([sma_hdr]+sma_rows, colWidths=sma_cw)
sma_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), C_SMA),
    ("TEXTCOLOR",     (0,0),(-1,0), C_WHITE),
    ("FONTNAME",      (0,0),(-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),7),
    ("TOPPADDING",    (0,0),(-1,-1),2.5),
    ("BOTTOMPADDING", (0,0),(-1,-1),2.5),
    ("LEFTPADDING",   (0,0),(-1,-1),4),
    ("GRID",          (0,0),(-1,-1),0.4, C_BORDER),
    ("BACKGROUND",    (0,2),(-1,2), C_ROW_ALT),
    ("BACKGROUND",    (0,4),(-1,4), C_ROW_ALT),
    ("BACKGROUND",    (0,1),(-1,1), colors.HexColor("#FDECEA")),  # Type I highlight
]))
story += [sma_t]
story.append(hook_box("Rule: Type I = never sits  |  Type II = sits only  |  Type III = walks  |  Type IV = adult onset"))
story.append(sp(2))

# ── 9. DMD STAGES ────────────────────────────────────────────────────────────
story.append(sec_hdr("9.  DMD DISEASE STAGES"))
dmd_rows = [
    [cb("Silent"),       cn("0–2 yrs"),      cn("CK already sky-high β€” child looks COMPLETELY NORMAL")],
    [cb("Early"),        cn("2–5 yrs"),      cn("Toe walking Β· Frequent falls Β· Gower's sign Β· Calf hypertrophy appears")],
    [cb("Progressive"),  cn("5–10 yrs"),     cn("Proximal weakness Β· Lumbar lordosis Β· Scoliosis begins Β· CK still very high")],
    [cb("Wheelchair"),   cd("10–15 yrs"),    cd("LOSS OF AMBULATION  ← MOST TESTED EXAM FACT")],
    [cb("Terminal"),     cn("Late teens–20s"),cn("DCM + Respiratory failure = Primary cause of death")],
]
dmd_t = Table([[cb("Stage"), cb("Age"), cb("Key Event / Landmark")]]+dmd_rows,
              colWidths=[W*0.14, W*0.13, W*0.73])
dmd_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), C_DMD),
    ("TEXTCOLOR",     (0,0),(-1,0), C_WHITE),
    ("FONTNAME",      (0,0),(-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),7),
    ("TOPPADDING",    (0,0),(-1,-1),2.5),
    ("BOTTOMPADDING", (0,0),(-1,-1),2.5),
    ("LEFTPADDING",   (0,0),(-1,-1),4),
    ("GRID",          (0,0),(-1,-1),0.4, C_BORDER),
    ("BACKGROUND",    (0,2),(-1,2), C_ROW_ALT),
    ("BACKGROUND",    (0,4),(-1,4), C_YELLOW),  # wheelchair
]))
story += [dmd_t, sp(2)]

# ── 10. MNEMONICS ─────────────────────────────────────────────────────────────
story.append(sec_hdr("10.  MEMORY MNEMONICS"))
m1 = Table([
    [Paragraph("DMD = \"3C + X + G\"", PS("m1h",8,bold=True,color=C_DMD))],
    [Table([
        [cb("C"), cn("Calf pseudohypertrophy β€” big but WEAK")],
        [cb("C"), cn("Cardiomyopathy (DCM) β€” universal")],
        [cb("C"), cn("CK β€” sky high >10Γ— normal")],
        [cb("X"), cn("X-linked β€” males ONLY")],
        [cb("G"), cn("Gower's sign β€” hands climb thighs")],
    ], colWidths=[W*0.04, W*0.43])],
], colWidths=[W*0.47])
m1.setStyle(TableStyle([
    ("BACKGROUND",(0,0),(-1,0),colors.HexColor("#D6E4F0")),
    ("BACKGROUND",(0,1),(-1,1),colors.HexColor("#EBF5FB")),
    ("TOPPADDING",(0,0),(-1,-1),3),("BOTTOMPADDING",(0,0),(-1,-1),3),
    ("LEFTPADDING",(0,0),(-1,-1),5),
    ("BOX",(0,0),(-1,-1),0.5,C_BORDER),
]))

m2 = Table([
    [Paragraph("SMA = \"FANGS\"", PS("m2h",8,bold=True,color=C_SMA))],
    [Table([
        [cb("F"), cn("Fasciculations β€” tongue esp. Type I")],
        [cb("A"), cn("Anterior horn cell death β€” LMN")],
        [cb("N"), cn("Normal IQ + Normal sensation")],
        [cb("G"), cn("Grouped atrophy on biopsy")],
        [cb("S"), cn("SMN1 deleted β€” Chr 5q13")],
    ], colWidths=[W*0.04, W*0.43])],
], colWidths=[W*0.47])
m2.setStyle(TableStyle([
    ("BACKGROUND",(0,0),(-1,0),colors.HexColor("#FDECEA")),
    ("BACKGROUND",(0,1),(-1,1),colors.HexColor("#FEF9F9")),
    ("TOPPADDING",(0,0),(-1,-1),3),("BOTTOMPADDING",(0,0),(-1,-1),3),
    ("LEFTPADDING",(0,0),(-1,-1),5),
    ("BOX",(0,0),(-1,-1),0.5,C_BORDER),
]))

mnem_outer = Table([[m1, Spacer(W*0.06,1), m2]], colWidths=[W*0.47, W*0.06, W*0.47])
mnem_outer.setStyle(TableStyle([("VALIGN",(0,0),(-1,-1),"TOP")]))
story += [mnem_outer, sp(2)]

# ── 11. MCQ RAPID FIRE ────────────────────────────────────────────────────────
story.append(sec_hdr("11.  MCQ / SEQ / MEQ RAPID FIRE"))
mcq_items = [
    ("Firm calves + proximal weakness + 4yr boy",                      "DMD",        C_DMD),
    ("Child uses hands to climb up legs to stand",                     "DMD β€” Gower's sign", C_DMD),
    ("CK = 20,000 U/L in a toddler",                                  "DMD",        C_DMD),
    ("Dilated cardiomyopathy + muscle weakness in a child",            "DMD",        C_DMD),
    ("Low IQ + proximal weakness in a boy",                            "DMD",        C_DMD),
    ("Dystrophin absent on IHC",                                       "DMD",        C_DMD),
    ("Deflazacort prescribed for a child with muscle disease",         "DMD",        C_DMD),
    ("Myopathic EMG + massively raised CK",                           "DMD",        C_DMD),
    ("Floppy infant + tongue fasciculations + absent reflexes",        "SMA Type I", C_SMA),
    ("Cannot sit at 9 months + normal CK + absent DTRs",              "SMA Type I", C_SMA),
    ("Both sexes affected + AR + sits but NEVER walks",               "SMA Type II",C_SMA),
    ("Teenager walks but has proximal leg weakness, normal CK",        "SMA Type III",C_SMA),
    ("Grouped atrophy of type I fibres on biopsy",                    "SMA",        C_SMA),
    ("Neurogenic EMG + normal CK + floppy baby",                      "SMA",        C_SMA),
    ("Pure motor + normal IQ + normal sensation + AR inheritance",    "SMA",        C_SMA),
    ("Nusinersen / Risdiplam prescribed",                             "SMA",        C_SMA),
    ("Reduced fetal movements + hypotonia at birth + resp failure",   "SMA Type 0", C_SMA),
    ("Normal CK + no sensation loss + absent reflexes + infant",      "SMA",        C_SMA),
]
mcq_data = [[cb("If question / stem says..."), cb("Answer")]]
for q, a, c in mcq_items:
    mcq_data.append([
        Paragraph(q, PS("mq",7)),
        Paragraph(a, PS("ma",7,bold=True,color=c))
    ])
mcq_t = Table(mcq_data, colWidths=[W*0.70, W*0.30], repeatRows=1)
mcq_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), colors.HexColor("#2C3E50")),
    ("TEXTCOLOR",     (0,0),(-1,0), C_WHITE),
    ("FONTNAME",      (0,0),(-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),7),
    ("TOPPADDING",    (0,0),(-1,-1),2),
    ("BOTTOMPADDING", (0,0),(-1,-1),2),
    ("LEFTPADDING",   (0,0),(-1,-1),4),
    ("VALIGN",        (0,0),(-1,-1),"MIDDLE"),
    ("GRID",          (0,0),(-1,-1),0.3, C_BORDER),
    *[("BACKGROUND",  (0,i),(-1,i), C_ROW_ALT) for i in range(1,len(mcq_data),2)],
]))
story += [mcq_t, sp(2)]

# ── FOOTER ─────────────────────────────────────────────────────────────────────
story.append(HRFlowable(width=W, thickness=0.5, color=C_BORDER))
story.append(sp(1))
story.append(Paragraph(
    "Sources: Tietz Textbook of Laboratory Medicine 7e  |  "
    "Bradley & Daroff's Neurology in Clinical Practice  |  "
    "Campbell's Operative Orthopaedics 15e 2026   β€”   For educational use Β· Final MBBS Yr 5",
    foot_s
))

doc.build(story)
print("PDF built:", OUTPUT)
Running Command

cd /tmp/workspace && python dmd_sma_pdf_v2.py 2>&1

Running Command

ls -lh /tmp/workspace/DMD_vs_SMA_QuickRef_v2.pdf

Your updated PDF is ready:

DMD vs SMA QuickRef v2

PDF Document Β· PDF


What changed in v2 β€” the key improvements:

Investigations β€” now split into 7 separate sub-sections:

Sub-sectionWhat it covers
6A. Blood TestsCK (with exact values + when it rises), LDH, AST/ALT separately explained
6B. EMGFull breakdown β€” MUP size, polyphasic, fibrillations, fasciculations, recruitment β€” each on its own row
6C. NCVSeparate table β€” motor NCV, sensory NCV, interpretation
6D. Biopsy β€” Gross PatternNecrosis vs grouped atrophy, fat, fibrosis, inflammation
6E. Biopsy β€” Fibre ChangesType I vs Type II fibres, necrosis, regeneration β€” each separate
6F. Biopsy β€” Special StainsDystrophin IHC, H&E, Gomori, ATPase β€” each on its own row
6G. Genetic TestingGold standard, prenatal, carrier, NBS β€” all separate rows

Treatment β€” now split into 5 separate sub-sections:

Sub-sectionWhat it covers
7A. CorticosteroidsDrug, dose timing, purpose, side effects β€” each row separate
7B. Disease-ModifyingEach drug (Nusinersen, Risdiplam, Onasemnogene, Eteplirsen, Ataluren) with route + mechanism
7C. CardiacACE-I, beta-blocker, diuretics, when to start β€” all separate
7D. RespiratoryNIV, tracheostomy, cough assist β€” all separate
7E. Orthopaedic / SupportiveSpinal fusion, physio, nutrition, genetic counselling
This is a shared conversation. Sign in to Orris to start your own chat.