~/cns-revision/generate.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
PageNumber, Header, Footer, VerticalAlign, TableOfContents
} = require('docx');
const fs = require('fs');
// ─── helpers ────────────────────────────────────────────────────────────────
const H1 = (text) => new Paragraph({
text, heading: HeadingLevel.HEADING_1,
spacing: { before: 400, after: 120 },
});
const H2 = (text) => new Paragraph({
text, heading: HeadingLevel.HEADING_2,
spacing: { before: 280, after: 100 },
});
const H3 = (text) => new Paragraph({
text, heading: HeadingLevel.HEADING_3,
spacing: { before: 200, after: 80 },
});
const BODY = (text, bold = false) => new Paragraph({
children: [new TextRun({ text, bold, size: 22, font: 'Calibri' })],
spacing: { after: 80 },
});
const BULLET = (text, level = 0) => new Paragraph({
children: [new TextRun({ text, size: 22, font: 'Calibri' })],
bullet: { level },
spacing: { after: 60 },
});
const BR = () => new Paragraph({ text: '', spacing: { after: 80 } });
// simple 2-col table
const makeTable = (headers, rows) => {
const colPct = Math.floor(100 / headers.length);
const makeCell = (text, isHeader = false) => new TableCell({
children: [new Paragraph({
children: [new TextRun({ text: String(text), bold: isHeader, size: 20, font: 'Calibri' })],
spacing: { after: 40 },
})],
shading: isHeader ? { fill: '1F3864', color: 'FFFFFF', type: ShadingType.CLEAR } : undefined,
width: { size: colPct, type: WidthType.PERCENTAGE },
margins: { top: 80, bottom: 80, left: 100, right: 100 },
});
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ children: headers.map(h => makeCell(h, true)), tableHeader: true }),
...rows.map(r => new TableRow({ children: r.map(c => makeCell(c)) })),
],
});
};
// ─── PAGE BREAK ─────────────────────────────────────────────────────────────
const PAGE_BREAK = () => new Paragraph({ pageBreakBefore: true });
// ─── CONTENT ─────────────────────────────────────────────────────────────────
const children = [
// ══════════════ TITLE PAGE ══════════════
new Paragraph({
children: [new TextRun({ text: 'CNS – Long Answer Questions', bold: true, size: 52, font: 'Calibri', color: '1F3864' })],
alignment: AlignmentType.CENTER, spacing: { before: 1200, after: 200 },
}),
new Paragraph({
children: [new TextRun({ text: 'University Exam Revision Notes', size: 32, font: 'Calibri', color: '2E74B5' })],
alignment: AlignmentType.CENTER, spacing: { after: 100 },
}),
new Paragraph({
children: [new TextRun({ text: 'Reference: Sembulingam\'s Essentials of Medical Physiology', size: 24, italics: true, font: 'Calibri', color: '595959' })],
alignment: AlignmentType.CENTER, spacing: { after: 100 },
}),
new Paragraph({
children: [new TextRun({ text: 'All 12 Questions Covered', size: 24, bold: true, font: 'Calibri', color: '70AD47' })],
alignment: AlignmentType.CENTER, spacing: { after: 600 },
}),
// Index
H1('Index of All 12 Questions'),
makeTable(
['Q.No', 'Question', 'Topic'],
[
['Q1', 'Neural connections in cerebellar cortex + Physiological basis of cerebellar dysfunction', 'Cerebellum'],
['Q2', 'Functions of basal ganglia + Disorders of basal ganglia', 'Basal Ganglia'],
['Q3', 'Connections + Functions + Disorders of cerebellum', 'Cerebellum'],
['Q4', 'Synaptic transmission + Properties of synapse', 'Synapse'],
['Q5', 'Functions of hypothalamus + Role in food intake regulation', 'Hypothalamus'],
['Q6', 'Degenerative & regenerative changes in peripheral nerve after injury', 'Nerve Injury'],
['Q7', 'Physiological basis of memory', 'Memory'],
['Q8', 'Physiological basis of Parkinson\'s disease', 'Parkinson\'s'],
['Q9', 'Pain pathway diagram + Referred pain', 'Pain'],
['Q10', 'Structure + Functions of cerebellum + Cerebellar lesions', 'Cerebellum'],
['Q11', 'Role of hypothalamus in thermoregulation', 'Hypothalamus'],
['Q12', 'Functions + Disorders of cerebellum', 'Cerebellum'],
]
),
BR(),
// ══════════════ Q1 ══════════════
PAGE_BREAK(),
H1('Q1. Neural Connections in Cerebellar Cortex + Physiological Basis of Cerebellar Dysfunction'),
H2('Structure of Cerebellar Cortex – Three Layers'),
makeTable(
['Layer', 'Position', 'Cells Present'],
[
['Molecular layer', 'Outermost', 'Stellate cells, Basket cells, Purkinje dendrites, parallel fibers'],
['Purkinje cell layer', 'Middle (one cell thick)', 'Purkinje cells – ONLY OUTPUT of cortex'],
['Granular layer', 'Innermost', 'Granule cells (most numerous in brain), Golgi cells'],
]
),
BR(),
H2('Five Neurons of Cerebellar Cortex'),
makeTable(
['Neuron', 'Type', 'Function'],
[
['Purkinje cell', 'Inhibitory (GABA)', 'Only output of cerebellar cortex → deep nuclei'],
['Granule cell', 'Excitatory (Glutamate)', 'Receives mossy fibers; sends parallel fibers to Purkinje'],
['Basket cell', 'Inhibitory (GABA)', 'Wraps around Purkinje cell bodies – inhibits them'],
['Stellate cell', 'Inhibitory (GABA)', 'Inhibits Purkinje cell dendrites'],
['Golgi cell', 'Inhibitory (GABA)', 'Feedback inhibition of granule cells'],
]
),
BR(),
H2('Afferent Fiber Types'),
BULLET('Mossy fibers – from spinal cord, pons; synapse on granule cells; excitatory'),
BULLET('Climbing fibers – from inferior olivary nucleus; directly excite Purkinje cell dendrites; powerful one-to-one connection; important for motor learning'),
BR(),
H2('Neural Circuit (Summary)'),
BODY('Mossy fibers → Granule cells → Parallel fibers → Purkinje cells → Deep nuclei (inhibitory) → Thalamus → Motor Cortex → Movement'),
BODY('Climbing fibers → Purkinje cells directly (error signal / motor learning)'),
BR(),
H2('Physiological Basis of Clinical Features'),
makeTable(
['Sign', 'Physiological Basis'],
[
['Hypotonia + Pendular knee jerk', 'Loss of cerebellar drive to gamma motor neurons → reduced spindle sensitivity → low tone'],
['Ataxia (wide-based gait)', 'Loss of comparator function – no real-time error correction of movements'],
['Intention tremor', 'No "braking" signal near target → oscillations; worsens toward target; ABSENT at rest'],
['Dysmetria (past-pointing)', 'Cannot judge range/force; overshoots (hypermetria) or undershoots (hypometria)'],
['Dysdiadochokinesia', 'Cannot time rapid agonist-antagonist switching'],
['Scanning speech', 'Incoordination of speech muscles → slow, explosive, irregular syllables'],
['Nystagmus', 'Flocculonodular lobe damage → cannot hold gaze steady'],
['Rebound phenomenon', 'No check/braking of antagonist → arm flies up when resistance removed'],
]
),
// ══════════════ Q2 ══════════════
PAGE_BREAK(),
H1('Q2. Functions of Basal Ganglia + Disorders of Basal Ganglia'),
H2('Components'),
makeTable(
['Nucleus', 'Location / Role'],
[
['Caudate + Putamen (= Striatum)', 'Main INPUT nucleus of basal ganglia'],
['Globus pallidus (GPi + GPe)', 'Main OUTPUT nucleus'],
['Subthalamic nucleus (STN)', 'Diencephalon; excitatory; regulates indirect pathway'],
['Substantia nigra pars compacta (SNc)', 'Dopaminergic; sends nigrostriatal pathway to striatum'],
['Substantia nigra pars reticulata (SNr)', 'Behaves like GPi; inhibitory output'],
]
),
BR(),
H2('Functions'),
BULLET('Motor control: planning, initiation, and execution of smooth voluntary movement'),
BULLET('Regulation of muscle tone'),
BULLET('Procedural learning and habit formation (motor skill memory)'),
BULLET('Cognitive functions: executive function, decision-making (via prefrontal cortex connections)'),
BULLET('Emotional/motivational functions via ventral striatum (nucleus accumbens) – reward and addiction'),
BULLET('Regulation of eye movements (saccades) via caudate nucleus'),
BULLET('Language fluency via supplementary motor area connections'),
BR(),
H2('Disorders of Basal Ganglia'),
makeTable(
['Disease', 'Pathology', 'Key Features'],
[
['Parkinson\'s disease', 'Degeneration of SNc dopaminergic neurons → ↓ dopamine in striatum', 'TRAP: Resting Tremor, Rigidity, Akinesia/Bradykinesia, Postural instability'],
['Huntington\'s disease', 'Autosomal dominant; GABA/cholinergic striatal neurons destroyed', 'Chorea (writhing movements), Dementia, Psychiatric symptoms'],
['Hemiballismus', 'Subthalamic nucleus (STN) lesion (usually stroke)', 'Violent, flinging movements of proximal limbs on one side'],
['Wilson\'s disease', 'Copper accumulation in basal ganglia (ceruloplasmin deficiency)', 'Tremor, rigidity, Kayser-Fleischer rings, liver cirrhosis'],
]
),
// ══════════════ Q3 ══════════════
PAGE_BREAK(),
H1('Q3. Connections + Functions + Disorders of Cerebellum'),
H2('Cerebellar Connections (Peduncles)'),
makeTable(
['Peduncle', 'Connects To', 'Direction', 'Key Pathways'],
[
['Inferior (Restiform body)', 'Medulla', 'Mixed (mainly afferent)', 'Dorsal spinocerebellar, vestibulocerebellar, olivocerebellar (climbing fibers)'],
['Middle (Brachium pontis) – LARGEST', 'Pons', 'Only AFFERENT', 'Corticopontocerebellar tract – motor cortex info to cerebellum'],
['Superior (Brachium conjunctivum)', 'Midbrain', 'Mainly EFFERENT', 'Dentatorubrothalamic tract – main OUTPUT of cerebellum'],
]
),
BR(),
H2('Functions (Summary)'),
BULLET('Coordination of voluntary movements (comparator function)'),
BULLET('Maintenance of muscle tone (via gamma motor neurons)'),
BULLET('Maintenance of posture and equilibrium (flocculonodular lobe + vestibular connections)'),
BULLET('Regulation of gait'),
BULLET('Coordination of eye movements (VOR, conjugate gaze)'),
BULLET('Motor learning (LTD at parallel fiber-Purkinje cell synapse)'),
BULLET('Planning of sequential complex movements'),
BR(),
H2('Disorders – Mnemonic: DANISH'),
makeTable(
['Letter', 'Sign', 'Quick Description'],
[
['D', 'Dysdiadochokinesia', 'Cannot do rapid alternating movements (pronation-supination test)'],
['A', 'Ataxia', 'Uncoordinated wide-based staggering gait; truncal ataxia in vermis lesions'],
['N', 'Nystagmus', 'Rhythmic eye oscillation; worst on gaze toward side of lesion'],
['I', 'Intention tremor', 'Absent at rest; appears during movement; worst near target'],
['S', 'Scanning speech', 'Slow, explosive, irregular syllables; cerebellar dysarthria'],
['H', 'Hypotonia', 'Floppy muscles; pendular knee jerk'],
]
),
BODY('Additional signs: Dysmetria, Rebound phenomenon, Decomposition of movement, Titubation'),
BODY('KEY: All signs are IPSILATERAL to the cerebellar lesion.', true),
// ══════════════ Q4 ══════════════
PAGE_BREAK(),
H1('Q4. Synaptic Transmission + Properties of Synapse'),
H2('Definition'),
BODY('A synapse is the junction between two neurons (or neuron + effector) where a nerve impulse is transmitted. Coined by Sir Charles Sherrington.'),
BR(),
H2('Types of Synapses'),
makeTable(
['Type', 'Mechanism', 'Direction', 'Examples'],
[
['Electrical synapse', 'Gap junctions; ions flow directly', 'Bidirectional', 'Cardiac muscle, smooth muscle of uterus'],
['Chemical synapse', 'Neurotransmitter released across synaptic cleft', 'Unidirectional only', 'All CNS synapses, neuromuscular junction'],
]
),
BR(),
H2('Steps of Chemical Synaptic Transmission'),
BULLET('Step 1: Action potential reaches presynaptic terminal (synaptic knob)'),
BULLET('Step 2: Voltage-gated Ca²⁺ channels open → Ca²⁺ flows IN'),
BULLET('Step 3: Ca²⁺ causes synaptic vesicles to fuse with membrane → neurotransmitter released by exocytosis'),
BULLET('Step 4: Neurotransmitter diffuses across synaptic cleft (20–40 nm)'),
BULLET('Step 5: Binds to receptors on postsynaptic membrane'),
BULLET('Step 6a: Excitatory NT (glutamate, ACh) → Na⁺ in → EPSP → depolarization'),
BULLET('Step 6b: Inhibitory NT (GABA, glycine) → Cl⁻ in or K⁺ out → IPSP → hyperpolarization'),
BULLET('Step 7: NT removed by reuptake / enzymatic degradation / diffusion'),
BR(),
H2('Summation'),
BULLET('Temporal summation: Repeated stimuli from SAME neuron → EPSPs add up over time'),
BULLET('Spatial summation: Multiple neurons fire simultaneously → EPSPs add up at same time'),
BR(),
H2('Properties of Synapse'),
makeTable(
['Property', 'Explanation'],
[
['1. Unidirectional conduction', 'Signal travels only presynaptic → postsynaptic (most important property)'],
['2. Synaptic delay', '~0.5 ms delay per synapse (time for Ca²⁺ entry, vesicle fusion, diffusion)'],
['3. Fatigue', 'Repeated stimulation depletes neurotransmitter stores → synapse tires out'],
['4. Summation', 'Temporal and spatial summation needed to reach threshold'],
['5. Facilitation', 'After activation, synapse is temporarily more excitable (residual Ca²⁺)'],
['6. Post-tetanic potentiation', 'After rapid burst of stimuli, synapse becomes more excitable temporarily'],
['7. Occlusion', 'Two pathways sharing same neuron → combined response less than expected'],
['8. Susceptibility to drugs/hypoxia', 'Chemical synapses are much more sensitive than axons to drugs and O₂ lack'],
['9. Low safety factor', 'Single EPSP usually insufficient to fire action potential; summation required'],
['10. After-discharge', 'Reverberating circuits → postsynaptic neuron continues firing after stimulus stops'],
]
),
// ══════════════ Q5 ══════════════
PAGE_BREAK(),
H1('Q5. Functions of Hypothalamus + Regulation of Food Intake'),
H2('Four Main Functions of Hypothalamus'),
BULLET('1. Thermoregulation – maintains core body temperature at 37°C'),
BULLET('2. Regulation of food intake – controls hunger and satiety'),
BULLET('3. Regulation of water balance – controls thirst and ADH secretion'),
BULLET('4. Neuroendocrine control – releasing/inhibiting hormones control pituitary gland'),
BODY('Others: sleep-wake cycle, autonomic control, emotional behavior, circadian rhythms'),
BR(),
H2('Hypothalamic Centers for Food Intake'),
makeTable(
['Center', 'Location', 'Experiment Proof', 'Function'],
[
['Feeding (Hunger) center', 'Lateral hypothalamic area (LHA)', 'Stimulation → hyperphagia; Destruction → aphagia (starvation)', 'Creates hunger; drives food-seeking behavior'],
['Satiety center', 'Ventromedial nucleus (VMN)', 'Stimulation → aphagia; Destruction → hyperphagia + obesity', 'Gives sense of fullness; inhibits feeding center'],
]
),
BR(),
H2('Signals that Control Food Intake via Arcuate Nucleus'),
makeTable(
['Signal', 'Source', 'Effect'],
[
['Leptin', 'Adipose (fat) tissue', 'STOPS eating – signals fat stores are full'],
['Insulin', 'Pancreas', 'STOPS eating – signals high blood glucose'],
['CCK (Cholecystokinin)', 'Small intestine (after meal)', 'STOPS eating – satiety signal'],
['GLP-1, PYY', 'Intestine', 'STOPS eating'],
['Ghrelin', 'Stomach (when empty)', 'STARTS eating – the "hunger hormone"'],
['NPY, AgRP', 'Arcuate nucleus', 'STARTS eating – most powerful orexigenic signals'],
]
),
BR(),
H2('Arcuate Nucleus – Key Integrating Center'),
BULLET('POMC/CART neurons → release α-MSH → stimulate MC4R → DECREASE food intake (anorexigenic)'),
BULLET('NPY/AgRP neurons → release NPY and AgRP → INCREASE food intake (orexigenic)'),
BULLET('Leptin activates POMC/CART and inhibits NPY/AgRP → net effect: reduces eating when fat stores are adequate'),
// ══════════════ Q6 ══════════════
PAGE_BREAK(),
H1('Q6. Degenerative & Regenerative Changes in Peripheral Nerve After Injury'),
H2('Types of Nerve Injury (Seddon\'s Classification)'),
makeTable(
['Type', 'Damage', 'Recovery'],
[
['Neuropraxia', 'Myelin sheath damaged only; axon intact', 'Complete and quick (weeks)'],
['Axonotmesis', 'Axon cut; endoneurium (sheath) intact', 'Good recovery at 1 mm/day along intact tubes'],
['Neurotmesis', 'Complete nerve cut including sheath', 'Poor; requires surgical repair'],
]
),
BR(),
H2('DEGENERATIVE CHANGES'),
H3('A. Wallerian Degeneration (Distal to injury) – Most important'),
BULLET('Hours: Axon distal to cut swells (separated from cell body which makes nutrients)'),
BULLET('2–3 days: Axon fragments and breaks into pieces; myelin breaks into oval droplets (ovoids)'),
BULLET('1–2 weeks: Schwann cells proliferate and clean up debris; Macrophages recruited to phagocytose myelin fragments'),
BULLET('End result: Empty endoneural tubes lined by Schwann cells (Bands of Büngner) – ready to guide regrowth'),
BR(),
H3('B. Retrograde Degeneration (Proximal to injury)'),
BULLET('Axon degenerates backwards only up to the nearest NODE OF RANVIER proximal to the injury'),
BULLET('Much less extensive than Wallerian degeneration'),
BR(),
H3('C. Changes in Cell Body – CHROMATOLYSIS'),
BULLET('Nucleus moves to the periphery of the cell (eccentric position)'),
BULLET('Nissl granules (rough ER) dissolve and disappear – called chromatolysis'),
BULLET('Cell body swells up'),
BULLET('Nucleolus enlarges (cell is working hard to make repair proteins)'),
BODY('Purpose: Cell shifts from normal function to protein synthesis mode (making actin, tubulin, NGF for regeneration)'),
BR(),
H2('REGENERATIVE CHANGES'),
H3('Steps of Nerve Regeneration'),
BULLET('Step 1: Cell body recovers – Nissl granules reappear; nucleus returns to center'),
BULLET('Step 2: Sprouting – New growth cones (sprouts) push out from the proximal stump'),
BULLET('Step 3: Guidance – Sprouts enter the Bands of Büngner; Schwann cells release NGF and other neurotrophic factors to guide the growing axon'),
BULLET('Step 4: Growth rate – Axon grows at ~1–4 mm per day (clinically: ~1 mm/day used)'),
BULLET('Step 5: Remyelination – Schwann cells wrap around new axon; new myelin is initially thinner than original'),
BULLET('Step 6: Reinnervation – Axon reaches target organ; muscle or receptor slowly regains function'),
BR(),
H2('Clinical Points'),
BULLET('Rate of regeneration ≈ 1 mm/day; so injury 10 cm from target muscle = ~100 days for nerve to arrive + time for muscle recovery'),
BULLET('Neuroma: If axon cannot find correct tube, disorganized sprouts form a painful lump'),
BULLET('Peripheral nerves CAN regenerate; CNS axons CANNOT (no Schwann cells; inhibitory environment)'),
// ══════════════ Q7 ══════════════
PAGE_BREAK(),
H1('Q7. Physiological Basis of Memory'),
H2('Definition'),
BODY('Memory is the ability to store, retain, and recall past experiences, information, and learned skills. The hippocampus plays the central role.'),
BR(),
H2('Types of Memory – Duration'),
makeTable(
['Type', 'Duration', 'Capacity', 'Mechanism'],
[
['Sensory memory', '< 1 second', 'Limited', 'Brief persistence in sensory cortex'],
['Short-term memory (STM)', 'Seconds to minutes', '7 ± 2 items', 'Reverberating circuits in prefrontal cortex'],
['Long-term memory (LTM)', 'Hours to lifetime', 'Unlimited', 'Structural synaptic changes; new protein synthesis'],
]
),
BR(),
H2('Types of Memory – Content'),
makeTable(
['Type', 'Subtypes', 'Brain Area', 'Example'],
[
['Declarative (Explicit)\n"Knowing THAT"', 'Episodic: personal events\nSemantic: general facts', 'Hippocampus (essential)', 'What you had for lunch; capital cities'],
['Non-declarative (Implicit)\n"Knowing HOW"', 'Procedural: motor skills\nConditioned reflexes\nPriming', 'Basal ganglia, Cerebellum, Amygdala (NOT hippocampus)', 'Riding a bicycle; Pavlov\'s conditioned response'],
]
),
BR(),
H2('Brain Areas for Memory'),
makeTable(
['Brain Area', 'Role'],
[
['Hippocampus', 'MOST IMPORTANT – converts STM to LTM (declarative memory consolidation)'],
['Amygdala', 'Emotional memory; fear conditioning'],
['Prefrontal cortex', 'Working memory (short-term memory)'],
['Basal ganglia', 'Habit and procedural memory'],
['Cerebellum', 'Motor skill memory'],
['Cerebral cortex', 'Long-term storage distributed across lobes'],
]
),
BODY('Key fact: Patient H.M. had both hippocampi removed → could not form NEW long-term declarative memories (anterograde amnesia) but retained old memories and motor skills.', true),
BR(),
H2('Cellular Mechanism – Long-Term Potentiation (LTP)'),
BODY('LTP is the long-lasting enhancement of synaptic transmission after repeated high-frequency stimulation. Described by Bliss and Lømo (1973).'),
BULLET('NMDA receptors are "coincidence detectors" – open only when BOTH glutamate binds AND the postsynaptic membrane is already depolarized'),
BULLET('Ca²⁺ flows in through NMDA receptors → activates CaMKII (protein kinase)'),
BULLET('Short-term LTP: More AMPA receptors inserted → synapse more sensitive'),
BULLET('Long-term LTP: Gene activation → new protein synthesis → new synaptic connections (structural change)'),
BODY('Hebb\'s rule: "Neurons that fire together, wire together"'),
BR(),
H2('Molecular Timeline of Memory'),
makeTable(
['Time Scale', 'Mechanism'],
[
['Seconds–minutes', 'Reverberating circuits (keep neurons firing in a loop)'],
['Hours', 'Protein phosphorylation (modification of existing proteins)'],
['Days–weeks', 'Gene expression via cAMP → PKA → CREB transcription factor → new protein synthesis'],
['Permanent', 'New dendritic spines grown; new synapses formed (structural plasticity)'],
]
),
// ══════════════ Q8 ══════════════
PAGE_BREAK(),
H1('Q8. Physiological Basis of Parkinson\'s Disease'),
H2('Introduction'),
BODY('Parkinson\'s disease is a progressive neurodegenerative disease. Described by James Parkinson (1817) as "the shaking palsy." Second most common neurodegenerative disease (after Alzheimer\'s). Affects 1–2% of people over 65.'),
BR(),
H2('Pathological Basis'),
BULLET('Degeneration of dopaminergic neurons in SUBSTANTIA NIGRA PARS COMPACTA (SNc)'),
BULLET('Loss of dopamine in the striatum via the nigrostriatal pathway'),
BULLET('Symptoms appear when 60–80% of SNc neurons have degenerated'),
BULLET('Microscopic hallmark: LEWY BODIES – clumps of alpha-synuclein protein inside surviving neurons'),
BR(),
H2('Physiological Basis of Symptoms – Basal Ganglia Circuit'),
BODY('Dopamine normally acts on:'),
BULLET('D1 receptors (on direct pathway): ACTIVATES direct pathway → facilitates movement'),
BULLET('D2 receptors (on indirect pathway): INHIBITS indirect pathway → facilitates movement'),
BODY('NET NORMAL EFFECT: Dopamine PROMOTES MOVEMENT by activating direct and inhibiting indirect pathways'),
BR(),
BODY('In Parkinson\'s (↓↓ Dopamine):', true),
BULLET('Direct pathway UNDERACTIVE → GPi overactive → Thalamus heavily inhibited → Motor cortex underactive'),
BULLET('Indirect pathway OVERACTIVE → STN overactive → GPi even more active → Thalamus even more inhibited'),
BULLET('FINAL RESULT: Motor cortex cannot generate sufficient drive → BRADYKINESIA, AKINESIA, RIGIDITY'),
BR(),
H2('Clinical Features – Mnemonic TRAP'),
makeTable(
['Feature', 'Description', 'Physiological Basis'],
[
['T – Tremor (Resting)', '"Pill-rolling" 4–6 Hz; PRESENT at rest; DISAPPEARS with voluntary movement; absent during sleep', 'Abnormal oscillatory activity in basal ganglia-thalamocortical loop due to dopamine loss'],
['R – Rigidity', 'Lead-pipe rigidity: uniform resistance; Cogwheel rigidity: with superimposed tremor', 'Dopamine loss → imbalance → increased corticospinal drive → both agonists and antagonists contracted simultaneously'],
['A – Akinesia/Bradykinesia', 'Akinesia: cannot START movement; Bradykinesia: SLOW movement; mask face, micrographia, hypophonia, drooling', 'Motor cortex underactivated → insufficient drive to initiate/execute movements'],
['P – Postural instability', 'Festinant gait (short, shuffling, accelerating); Simian posture (stooped, flexed); Retropulsion', 'Loss of postural righting reflexes; SMA dysfunction affecting automatic postural adjustments'],
]
),
BR(),
H2('Other Features'),
BULLET('Anosmia (loss of smell) – often an EARLY pre-motor symptom'),
BULLET('Constipation – may appear years before motor symptoms'),
BULLET('REM sleep behavior disorder'),
BULLET('Depression (30–40% of patients)'),
BULLET('Orthostatic hypotension (dizziness on standing)'),
BR(),
H2('Treatment'),
makeTable(
['Drug / Treatment', 'Mechanism'],
[
['Levodopa (L-dopa) + Carbidopa (Sinemet)', 'L-dopa → converted to dopamine in brain; Carbidopa prevents peripheral conversion; MOST effective'],
['Dopamine agonists (Pramipexole, Ropinirole)', 'Directly stimulate D1/D2 receptors'],
['MAO-B inhibitors (Selegiline)', 'Prevent breakdown of dopamine → more dopamine available'],
['Anticholinergics (Trihexyphenidyl)', 'Restore dopamine–ACh balance; mainly for tremor'],
['Deep Brain Stimulation (DBS)', 'Electrodes in STN or GPi; high-frequency stimulation inhibits overactive nuclei'],
]
),
// ══════════════ Q9 ══════════════
PAGE_BREAK(),
H1('Q9. Pain Pathway Diagram + Referred Pain'),
H2('Pain Fibers'),
makeTable(
['Fiber', 'Type', 'Speed', 'Pain Produced'],
[
['A-delta (Aδ)', 'Myelinated', '6–30 m/s', 'First pain: Fast, sharp, stabbing, well-localized'],
['C fibers', 'Unmyelinated', '0.5–2 m/s', 'Second pain: Slow, burning, dull, poorly localized'],
]
),
BR(),
H2('A. Lateral Spinothalamic Tract (Neospinothalamic) – Fast Pain'),
BULLET('1st order neuron: A-delta fibers → dorsal root → synapse in dorsal horn (Lamina I and V) – releases glutamate and substance P'),
BULLET('2nd order neuron: Crosses to OPPOSITE side via anterior white commissure → ascends as lateral spinothalamic tract → VPL nucleus of thalamus'),
BULLET('3rd order neuron: VPL thalamus → internal capsule → Primary somatosensory cortex (post-central gyrus) → conscious localization and quality of pain'),
BR(),
H2('B. Paleospinothalamic Tract – Slow Pain'),
BULLET('1st order neuron: C fibers → dorsal root → synapse in Laminae I, II (substantia gelatinosa), V → releases mainly substance P'),
BULLET('2nd order neuron: Crosses midline → ascends diffusely → synapses in reticular formation, periaqueductal gray (PAG), intralaminar thalamic nuclei'),
BULLET('3rd order neuron: Diffuse projection to limbic system, hypothalamus, association cortex → responsible for suffering, emotional component, autonomic responses'),
BR(),
H2('Endogenous Pain Suppression System'),
BULLET('PAG (Periaqueductal gray) → activates descending inhibitory pathways (activated by opioids, stress)'),
BULLET('Raphe nuclei (serotonin) → descend to dorsal horn → inhibit pain transmission'),
BULLET('Locus coeruleus (norepinephrine) → descend → inhibit pain'),
BULLET('Enkephalins (endogenous opioids) in dorsal horn → inhibit substance P release'),
BR(),
H2('Gate Control Theory – Melzack and Wall (1965)'),
BULLET('Large fibers (A-beta, touch) → activate inhibitory interneurons in substantia gelatinosa → CLOSE the gate → pain inhibited'),
BULLET('Small fibers (A-delta, C) → inhibit interneurons → OPEN the gate → pain transmitted'),
BULLET('Clinical use: TENS, acupuncture, rubbing an injury all activate large fibers → close the gate'),
BR(),
H2('REFERRED PAIN'),
H3('Definition'),
BODY('Pain perceived at a location DIFFERENT from the actual site of injury/disease. The pain originates in a viscus (organ) but is felt in a distant skin or muscle area.'),
BR(),
H3('Mechanism – Convergence-Projection Theory (Most Accepted)'),
BULLET('Visceral afferents (e.g., from heart) AND somatic afferents (e.g., from left arm skin) converge onto the SAME second-order neuron in the dorsal horn'),
BULLET('Brain "misinterprets" the signal as coming from the skin (skin pain is more common)'),
BULLET('Pain is felt in the skin area even though it is coming from the organ'),
BR(),
H3('Common Examples'),
makeTable(
['Organ', 'Pain Referred To', 'Spinal Level'],
[
['Heart (angina/MI)', 'Left arm (inner), left shoulder, jaw', 'T1–T4'],
['Diaphragm / Gallbladder', 'Right shoulder tip', 'C3, C4'],
['Appendix (early)', 'Periumbilical (navel) area', 'T10'],
['Kidney / Ureter', 'Loin to groin (ipsilateral)', 'T11–L1'],
['Pancreas', 'Epigastric radiating to back', 'T6–T9'],
['Testis', 'Periumbilical area', 'T10'],
]
),
// ══════════════ Q10 ══════════════
PAGE_BREAK(),
H1('Q10. Structure + Functions of Cerebellum + Cerebellar Lesions'),
BODY('(For Structure and Functions – see Q1 and Q3 above. This answer combines all three elements together.)', true),
BR(),
H2('Structure – Quick Summary Table'),
makeTable(
['Component', 'Details'],
[
['Weight', '~150 g; 10% of brain weight; 75% of cerebral cortex surface area'],
['Lobes', 'Flocculonodular (archicerebellum), Anterior lobe (paleocerebellum), Posterior lobe (neocerebellum)'],
['Cortex layers', 'Molecular (outer) → Purkinje cell (middle) → Granular (inner)'],
['5 Cell types', 'Purkinje (only output), Granule, Basket, Stellate, Golgi'],
['Deep nuclei (lateral→medial)', 'Dentate, Emboliform, Globose, Fastigial'],
['Input fibers', 'Mossy fibers (from cord/pons) + Climbing fibers (from inferior olive)'],
['Peduncles', 'Superior (efferent, to midbrain), Middle (afferent only, from pons), Inferior (mixed, to medulla)'],
]
),
BR(),
H2('Functions – Quick Summary'),
BULLET('Coordination of voluntary movements (comparator function)'),
BULLET('Maintenance of muscle tone (gamma motor neuron control)'),
BULLET('Posture and equilibrium (flocculonodular lobe)'),
BULLET('Gait regulation'),
BULLET('Eye movement coordination (VOR, nystagmus prevention)'),
BULLET('Motor learning (LTD at parallel fiber-Purkinje cell synapse)'),
BR(),
H2('Cerebellar Lesions – Signs and Physiological Basis'),
makeTable(
['Sign', 'Physiological Basis', 'Test Used'],
[
['Hypotonia + Pendular knee jerk', 'Loss of gamma motor neuron drive', 'Passive limb movement; knee tap'],
['Ataxia (gait)', 'Loss of error-correction comparator function', 'Walk on a straight line; heel-toe walking'],
['Intention tremor', 'No braking signal near movement endpoint', 'Finger-nose test, heel-shin test'],
['Dysmetria', 'Misjudges range/force of movement', 'Finger-nose (overshoot/undershoot)'],
['Dysdiadochokinesia', 'Cannot time agonist-antagonist switching', 'Rapid pronation-supination of forearm'],
['Scanning speech', 'Incoordination of speech muscles', 'Clinical observation'],
['Nystagmus', 'Flocculonodular lobe: cannot hold gaze steady', 'Lateral gaze test'],
['Rebound phenomenon', 'No antagonist braking', 'Holmes\' rebound test'],
]
),
BODY('KEY RULE: All cerebellar signs are IPSILATERAL (same side as lesion).', true),
BR(),
H2('Common Causes'),
makeTable(
['Cause', 'Example'],
[
['Vascular', 'PICA stroke → lateral medullary (Wallenberg\'s) syndrome'],
['Tumor', 'Medulloblastoma (children, midline), Metastases (adults)'],
['Demyelinating', 'Multiple sclerosis – Charcot\'s triad: intention tremor + nystagmus + scanning speech'],
['Hereditary', 'Friedreich\'s ataxia (autosomal recessive, childhood onset)'],
['Alcohol', 'Alcoholic cerebellar degeneration (anterior vermis)'],
['Drugs', 'Phenytoin toxicity'],
]
),
// ══════════════ Q11 ══════════════
PAGE_BREAK(),
H1('Q11. Role of Hypothalamus in Thermoregulation'),
H2('Introduction'),
BODY('The hypothalamus is the body\'s "thermostat." It maintains core body temperature at ~37°C (98.6°F) by detecting temperature changes and activating appropriate responses.'),
BR(),
H2('Thermoregulatory Centers'),
makeTable(
['Center', 'Location', 'Activated By', 'Function'],
[
['Heat LOSS center', 'Anterior hypothalamus / Preoptic area', 'Rise in body temperature', 'Triggers sweating, vasodilation, reduced metabolism'],
['Heat PRODUCTION center', 'Posterior hypothalamus', 'Fall in body temperature', 'Triggers shivering, vasoconstriction, increased metabolism'],
]
),
BR(),
H2('How Hypothalamus Detects Temperature'),
BULLET('Central thermoreceptors IN the hypothalamus: warm-sensitive neurons + cold-sensitive neurons monitor blood temperature directly'),
BULLET('Peripheral thermoreceptors in SKIN: send advance warning before core temperature changes'),
BR(),
H2('Responses to HIGH Temperature (Heat Loss Mechanisms)'),
makeTable(
['Mechanism', 'How it works', 'Importance'],
[
['Sweating', 'Sympathetic cholinergic nerves activate sweat glands; evaporation removes heat', 'MOST IMPORTANT in humans; 1L sweat = 580 kcal removed'],
['Vasodilation of skin vessels', 'Warm blood shunted to skin surface; heat lost by radiation/conduction; skin looks flushed', 'Very effective'],
['Reduced heat production', 'Metabolic rate reduced; shivering stops; thyroid activity decreases', 'Supportive'],
['Behavioral', 'Seeks cool environment; removes clothing; drinks cold water', 'Important in humans'],
]
),
BR(),
H2('Responses to LOW Temperature (Heat Production Mechanisms)'),
makeTable(
['Mechanism', 'How it works', 'Importance'],
[
['Shivering', 'Motor pathways → rapid involuntary muscle contractions → heat generated; no useful work', 'MOST IMPORTANT; can increase heat production 2–5× BMR'],
['Vasoconstriction', 'Skin blood vessels narrow (sympathetic); blood shunted to core; skin pale and cold', 'Reduces heat loss'],
['Increased metabolism', 'Hypothalamus → TSH → thyroxine → raises cellular metabolism; epinephrine also helps', 'Sustained heat production'],
['Non-shivering thermogenesis', 'Brown adipose tissue (especially in neonates): uncoupling protein-1 (thermogenin) generates heat', 'Very important in newborns'],
['Piloerection', 'Arrector pili muscles contract → hairs stand up → "goosebumps"', 'Significant only in hairy animals; minimal in humans'],
['Behavioral', 'Seeks warmth; adds clothing; curls up (reduces surface area)', 'Important in humans'],
]
),
BR(),
H2('Fever (Pyrexia) – SET POINT IS RAISED'),
BULLET('Infection → macrophages release exogenous pyrogens (LPS, toxins)'),
BULLET('These trigger release of ENDOGENOUS PYROGENS: IL-1 (most important), IL-6, TNF-α'),
BULLET('Endogenous pyrogens → hypothalamus → stimulate synthesis of Prostaglandin E2 (PGE2)'),
BULLET('PGE2 RAISES the hypothalamic set point (e.g., from 37°C to 39°C)'),
BULLET('Body now "thinks" 37°C is too cold → activates heat PRODUCTION (shivering, vasoconstriction) → person feels cold and shivers even though temperature is rising (RIGOR/CHILL)'),
BULLET('Antipyretics (Aspirin, Paracetamol): Inhibit COX enzyme → block PGE2 synthesis → set point returns to normal → heat loss (sweating) occurs → fever drops'),
BR(),
H2('Heat Stroke vs Heat Exhaustion'),
makeTable(
['Feature', 'Heat Exhaustion', 'Heat Stroke'],
[
['Mechanism', 'Salt and water depletion from excessive sweating', 'Thermoregulatory CENTER itself has FAILED'],
['Skin', 'Profuse sweating', 'Hot, DRY skin (no sweating)'],
['Temperature', 'Normal or slightly raised', 'Very high (> 40°C)'],
['Consciousness', 'Maintained', 'Often confused or unconscious'],
['Treatment', 'Rest, fluids, salt replacement', 'EMERGENCY – active cooling required'],
]
),
// ══════════════ Q12 ══════════════
PAGE_BREAK(),
H1('Q12. Functions and Disorders of Cerebellum'),
BODY('(This is a combined answer – refer to Q3 and Q10 for overlapping content. Key points summarized below.)', true),
BR(),
H2('Functions of Cerebellum – Detailed'),
makeTable(
['Function', 'Simple Explanation', 'Region Responsible'],
[
['Coordination of voluntary movements', 'Comparator: compares intended vs. actual movement; corrects errors in real-time', 'Neocerebellum (lateral hemispheres)'],
['Maintenance of muscle tone', 'Regulates gamma motor neurons → keeps muscle spindles sensitive → normal tone', 'Spinocerebellum (anterior lobe)'],
['Posture and equilibrium', 'Integrates vestibular and visual info to keep the body balanced and upright', 'Vestibulocerebellum (flocculonodular lobe)'],
['Gait regulation', 'Times left–right alternating limb movements for smooth rhythmic walking', 'Spinocerebellum'],
['Eye movement coordination', 'Controls VOR (vestibulo-ocular reflex) and conjugate gaze; prevents nystagmus', 'Flocculonodular lobe'],
['Motor learning', 'Stores timing patterns for learned motor skills via LTD at Purkinje cells', 'Lateral hemispheres + cerebellar cortex'],
['Planning of movements', 'Works with SMA and motor cortex to mentally prepare complex movements', 'Neocerebellum'],
]
),
BR(),
H2('Disorders (DANISH Mnemonic – Full Detail)'),
makeTable(
['Sign', 'Description', 'Key Test', 'Physiological Basis'],
[
['D – Dysdiadochokinesia', 'Cannot do rapid alternating movements', 'Rapid pronation-supination of forearm', 'Loss of agonist-antagonist timing'],
['A – Ataxia', 'Wide-based staggering gait; truncal ataxia (vermis lesion)', 'Walking test; Romberg (negative in cerebellar ataxia)', 'Loss of comparator/error-correction function'],
['N – Nystagmus', 'Involuntary rhythmic eye oscillation', 'Lateral gaze test', 'Flocculonodular lobe damage; gaze-holding lost'],
['I – Intention tremor', 'Tremor appears during movement; worst near target; absent at rest', 'Finger-nose test', 'No braking signal near endpoint'],
['S – Scanning speech', 'Slow, explosive, irregular syllables; cerebellar dysarthria', 'Clinical observation', 'Incoordination of speech muscles'],
['H – Hypotonia', 'Floppy muscles; pendular knee jerk', 'Passive limb movement; knee tap', 'Loss of gamma motor neuron drive; spindle less sensitive'],
]
),
BR(),
H2('Distinguish Cerebellar Tremor from Parkinsonian Tremor'),
makeTable(
['Feature', 'Cerebellar (Intention) Tremor', 'Parkinsonian (Resting) Tremor'],
[
['When present', 'DURING voluntary movement', 'AT REST'],
['During movement', 'Worsens, especially near target', 'DISAPPEARS or reduces'],
['During sleep', 'Absent', 'Absent'],
['Character', 'Oscillatory, irregular', '"Pill-rolling," 4–6 Hz, rhythmic'],
['Cause', 'Cerebellar lesion', 'Parkinson\'s disease (SNc dopamine loss)'],
]
),
BR(),
H2('Important Rule'),
BODY('Cerebellar signs are always IPSILATERAL (same side as lesion).', true),
BODY('Cerebral/UMN lesions cause CONTRALATERAL signs. Cerebellar lesions cause IPSILATERAL signs. Know the difference!'),
// ══════════════ QUICK REVISION CARD ══════════════
PAGE_BREAK(),
H1('Quick Revision Card – All Key Mnemonics and Facts'),
BR(),
makeTable(
['Topic', 'Key Mnemonic / Key Fact'],
[
['Cerebellar signs', 'DANISH: Dysdiadochokinesia, Ataxia, Nystagmus, Intention tremor, Scanning speech, Hypotonia'],
['Parkinson\'s features', 'TRAP: Tremor (resting), Rigidity, Akinesia/Bradykinesia, Postural instability'],
['Parkinson\'s pathology', 'SNc degeneration + Lewy bodies (alpha-synuclein). Symptoms at 60–80% neuron loss'],
['Synapse properties', 'Unidirectional, Synaptic delay 0.5ms, Fatigue, Summation, Facilitation, Post-tetanic potentiation'],
['Memory mechanism', 'LTP via NMDA receptors, Ca²⁺, CaMKII; Hebb\'s rule: neurons that fire together wire together'],
['Nerve regeneration', '1 mm/day; Wallerian degeneration distally; Chromatolysis in cell body; Bands of Büngner guide regrowth'],
['Hypothalamus food centers', 'LHA = Hunger/Feeding center; VMN = Satiety center; Ghrelin = hunger; Leptin = satiety'],
['Thermoregulation', 'Anterior hypothalamus = heat loss (sweating, vasodilation); Posterior = heat production (shivering, vasoconstriction)'],
['Referred pain theory', 'Convergence-projection: visceral + somatic fibers converge on same dorsal horn neuron → brain misinterprets'],
['Pain fibers', 'A-delta = fast/sharp/localized; C fibers = slow/burning/diffuse'],
['Cerebellar peduncles', 'Superior = mainly efferent; Middle = only afferent (largest); Inferior = mixed'],
['Cerebellar side rule', 'ALL cerebellar signs are IPSILATERAL to the lesion'],
]
),
BR(),
new Paragraph({
children: [new TextRun({ text: 'Reference: Sembulingam\'s Essentials of Medical Physiology | CNS Revision Notes', size: 18, italics: true, font: 'Calibri', color: '595959' })],
alignment: AlignmentType.CENTER, spacing: { before: 400 },
}),
];
// ─── BUILD DOC ────────────────────────────────────────────────────────────────
const doc = new Document({
creator: 'Orris AI',
title: 'CNS Long Answer Questions – University Exam Revision',
description: 'All 12 CNS questions with answers based on Sembulingam',
styles: {
default: {
document: { run: { font: 'Calibri', size: 22 } },
},
paragraphStyles: [
{
id: 'Heading1', name: 'Heading 1', basedOn: 'Normal',
run: { bold: true, size: 32, color: '1F3864', font: 'Calibri' },
paragraph: { spacing: { before: 400, after: 160 } },
},
{
id: 'Heading2', name: 'Heading 2', basedOn: 'Normal',
run: { bold: true, size: 26, color: '2E74B5', font: 'Calibri' },
paragraph: { spacing: { before: 280, after: 100 } },
},
{
id: 'Heading3', name: 'Heading 3', basedOn: 'Normal',
run: { bold: true, size: 24, color: '70AD47', font: 'Calibri' },
paragraph: { spacing: { before: 200, after: 80 } },
},
],
},
sections: [{
properties: {
page: { margin: { top: 1080, bottom: 1080, left: 1080, right: 1080 } },
},
headers: {
default: new Header({
children: [new Paragraph({
children: [
new TextRun({ text: 'CNS – Long Answer Questions | Sembulingam Reference ', size: 18, font: 'Calibri', color: '595959' }),
],
alignment: AlignmentType.RIGHT,
border: { bottom: { value: BorderStyle.SINGLE, size: 4, color: '2E74B5', space: 4 } },
})],
}),
},
footers: {
default: new Footer({
children: [new Paragraph({
children: [
new TextRun({ text: 'University Exam Revision | Page ', size: 18, font: 'Calibri', color: '595959' }),
new TextRun({ children: [PageNumber.CURRENT], size: 18, font: 'Calibri', color: '595959' }),
new TextRun({ text: ' of ', size: 18, font: 'Calibri', color: '595959' }),
new TextRun({ children: [PageNumber.TOTAL_PAGES], size: 18, font: 'Calibri', color: '595959' }),
],
alignment: AlignmentType.CENTER,
border: { top: { value: BorderStyle.SINGLE, size: 4, color: '2E74B5', space: 4 } },
})],
}),
},
children,
}],
});
Packer.toBuffer(doc).then(buf => {
fs.writeFileSync('/home/daytona/workspace/cns-revision/CNS_Exam_Revision_All12Questions.docx', buf);
console.log('SUCCESS: File written.');
});