teach me TEF as a neonatologist

Reading File
Finding Sources
Finding Sources
Searching PubMed

tracheoesophageal fistula esophageal atresia neonatal management

Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Loading Image
Loading Image
Reading File
Finding Sources
I now have comprehensive information to deliver a thorough neonatology-focused teaching on TEF. Let me compile everything.

Tracheoesophageal Fistula (TEF) - A Neonatologist's Guide


1. Embryology - Why Does This Happen?

During the 4th gestational week, the primitive foregut must divide into the respiratory tract anteriorly and the esophagus posteriorly. This division is driven by:
  • Lateral tracheoesophageal folds growing toward the midline
  • Formation of a tracheoesophageal septum
  • Sonic hedgehog (SHH) signaling - one of the critical pathways for foregut separation
When this process fails - whether due to incomplete fusion of the folds, defective septum formation, or genetic disruption of SHH signaling - you get TEF, EA, or both.
  • The Developing Human (Clinically Oriented Embryology), p. 576
  • Sleisenger and Fordtran's Gastrointestinal and Liver Disease, p. 708

2. Epidemiology

ParameterValue
Incidence1 in 1,500 - 4,000 live births
SexMild male predominance
Low birth weight~33% of affected neonates
Associated anomalies60 - 70% of cases

3. Classification - The 5 Anatomic Types

This is the most important diagram to memorize:
TEF anatomic variants and incidence - 5 types illustrated with esophagus and trachea
Anatomic variants of EA/TEF - Sabiston Textbook of Surgery, p. 2678
TypeDescriptionIncidence
APure EA - no fistula, isolated atresia7%
BProximal TEF + distal EA (rare)2%
C (Gross C)Proximal EA (blind pouch) + distal TEF86% - THE classic type
DEA with both proximal and distal TEF1%
E (H-type)TEF without EA - patent esophagus4%
Type C is what you'll encounter on the NICU floor. The proximal blind pouch ends roughly 1-2 vertebral bodies above the distal TEF, which inserts into the membranous trachea just proximal to the carina.

4. Associated Anomalies - VACTERL

Always screen for the VACTERL association (10% of cases - non-random, non-genetic clustering):
LetterAnomaly
VVertebral defects
AAnorectal malformations
CCardiac defects (most lethal - screen first!)
TTracheal anomalies / tracheomalacia
EEsophageal atresia
RRenal/urologic anomalies
LLimb defects (radial ray)
Your mandatory workup: Echocardiogram + renal ultrasound in every baby diagnosed with EA/TEF. Cardiac anomalies are the #1 determinant of survival.
  • Sabiston Textbook of Surgery, p. 2678

5. Prenatal Clues

  • Polyhydramnios - especially prominent in isolated EA (86% of cases). The fetus cannot swallow and recycle amniotic fluid; fluid accumulates because it cannot reach the stomach/intestine for absorption.
  • Absent or small gastric bubble on fetal ultrasound
  • Dilated upper esophageal pouch may be visible on fetal MRI

6. Clinical Presentation in the Neonate

Type C (EA + distal TEF) - what you see on day 1:

  • Excessive drooling / frothy secretions - the blind pouch fills and overflows
  • Choking, coughing, cyanosis with first feeding - classic triad
  • Failure to pass OG tube - the tube coils back at the thoracic inlet (T2-T4)
  • Acute gastric distention - inspiratory air enters via the distal TEF into the stomach
  • Respiratory distress - from aspiration pneumonitis (gastric reflux through the TEF into the lungs, including acid and bile)
  • Apnea and cyanosis - from vagal reflex or aspiration

H-type TEF (Type E) - often missed at birth:

  • No EA, so the OG tube passes fine
  • Presents in infancy or even adulthood
  • Recurrent aspiration pneumonia
  • Feeding-induced choking and coughing
  • Can mimic asthma or recurrent bronchiolitis

7. Diagnosis

Bedside / First-Line

1. Attempt to pass OG tube + CXR
  • The tube coils in the proximal pouch at the thoracic inlet (T2-T4)
  • Presence of distal bowel gas = Type C (distal TEF present) - air goes stomach via the fistula
  • Gasless abdomen = isolated EA (Type A) - no fistula, no air reaching GI tract
CXR showing coiled OG tube at thoracic inlet (arrow) confirming EA; surgical intraoperative view showing TEF encircled with blue vessel loop; thoracoscopic anastomosis
Figure 117.4 - Sabiston Textbook of Surgery, p. 2678. (A) Coiled OG tube at thoracic inlet confirms EA. (B) Intraoperative view: TEF with blue vessel loop, proximal pouch nearby. (C) Thoracoscopic anastomosis.
2. Do NOT do oral contrast study - high aspiration risk, contraindicated.
3. Echocardiogram - mandatory for cardiac anomalies and to determine aortic arch sidedness (right-sided arch changes surgical approach).
4. Renal ultrasound - for VACTERL workup.
5. Bronchoscopy - for H-type TEF (methylene blue via esophagoscopy + bronchoscopic visualization). Also used preoperatively to locate fistula and assess tracheomalacia.

8. Neonatal Stabilization (Your Immediate Role)

This is where neonatology owns the baby before surgery:

Airway & Positioning

  • Position upright prone - reduces aspiration of saliva pooling in the blind pouch
  • Avoid bag-mask ventilation and positive pressure - PPV preferentially inflates the stomach via the TEF rather than the lungs; can cause massive gastric distention and respiratory failure
  • Avoid intubation if possible - for the same reason. If intubation is unavoidable (respiratory failure), try to position the ETT tip distal to the TEF to reduce gas leak into the GI tract. In extreme ventilation failure, an occlusive balloon catheter in the fistula or emergent gastrostomy (placed to water seal, like a thoracostomy) can decompress the stomach.

Proximal Pouch Drainage

  • Insert a Replogle (double-lumen sump) tube into the proximal esophageal pouch
  • Apply continuous low-pressure suction - this prevents pooling of secretions and aspiration
  • This is the single most important nursing/medical measure pre-op

Antibiotics

  • Broad-spectrum IV antibiotics - aspiration pneumonitis is assumed

NPO + IV nutrition

  • Nothing by mouth; start parenteral nutrition

Monitoring

  • Pulse oximetry, respiratory rate, glucose, temperature stabilization

9. Surgical Management

Surgery is the definitive treatment. Your role is to optimize the baby preoperatively.

Standard Repair (Type C)

  1. Rigid bronchoscopy first - confirms TEF location and assesses tracheomalacia (some surgeons consider this optional for primary cases)
  2. Right thoracotomy (extrapleural approach) for left-sided aortic arch (the standard); left thoracotomy considered for right-sided arch
  3. Azygos vein division to expose the TEF
  4. Fistula ligation and division - 1-2mm segment divided, tracheal defect closed with absorbable interrupted sutures
  5. Primary esophageal anastomosis - upper pouch mobilized maximally. Lower pouch mobilization is deliberately limited (segmental/precarious blood supply - risk of ischemia)
  6. Thoracoscopic repair is increasingly preferred with equivalent outcomes - less morbidity

Long-Gap EA

  • When gap > 3 vertebral bodies, primary anastomosis is not possible at birth
  • Cervical esophagostomy if aspiration cannot be controlled
  • Gastrostomy for enteral feeding
  • Delayed primary anastomosis at ~4-6 months after esophageal lengthening (confirmed radiographically)
  • If still insufficient: esophageal replacement with stomach, colon, or small bowel conduit at 1-2 years

H-type TEF (Type E)

  • Cervical incision approach (fistula is near the thoracic inlet)
  • Rigid bronchoscopy with Fogarty catheter / guidewire cannulation aids dissection

10. Prognosis - Spitz Classification

The Spitz Classification is the standard neonatal risk stratification tool:
Spitz GroupCriteriaSurvival
Group IBirth weight >1500 g AND no major cardiac anomaly97%
Group IIBW <1500 g OR major cardiac anomaly59%
Group IIIBW <1500 g AND major cardiac anomaly22%
  • Sabiston Textbook of Surgery, p. 2680

11. Postoperative Complications (Long-Term Follow-Up)

These babies don't get discharged from your concern after surgery - they need long-term monitoring:
ComplicationIncidenceNotes
Gastroesophageal reflux (GER)25-50%Due to disrupted lower esophageal sphincter + esophageal dysmotility; can cause aspiration, failure to thrive, apnea
Anastomotic stricture15-30%Presents as dysphagia, food impaction; treated with balloon dilation
Anastomotic leak10-20%Early postoperative; mostly managed conservatively
Tracheomalacia8-15%Floppy tracheal cartilage; causes "dying spells" / barky cough; can be severe enough to require aortopexy
Esophageal dysmotilityVery commonNearly all patients have some degree; contributes to feeding difficulties
Recurrent TEFUncommonPresents with recurrent aspiration pneumonia
Barrett's esophagusLong-term riskFrom chronic GER; requires surveillance

12. Quick Summary Table - Clinical Pearls for the NICU

PearlTeaching Point
First action at birthReplogle tube on continuous suction into proximal pouch
Avoid PPVAir preferentially enters stomach via TEF; causes life-threatening gastric distention
CXR signOG tube coiled at T2-T4 + bowel gas = Type C
Gasless abdomenPure EA (Type A) - no fistula to pass air
Most common typeType C (Gross C) - proximal EA + distal TEF, 86%
Hidden diagnosisH-type (Type E) - recurrent pneumonia, no EA
Prenatal cluePolyhydramnios + absent gastric bubble
Worst prognostic factorBW <1500g + major cardiac anomaly (Spitz III, 22% survival)
Most common late complicationGER (25-50%); always counsel families
VACTERL cardiacEcho is mandatory in every case

Sources:
  • Sabiston Textbook of Surgery: The Biological Basis of Modern Surgical Practice, Chapter 117, pp. 2678-2680
  • The Developing Human: Clinically Oriented Embryology, p. 576
  • Sleisenger and Fordtran's Gastrointestinal and Liver Disease, pp. 708-711
  • Harriet Lane Handbook (23rd ed.), p. 876

Teach me and make notes in deoth as a paeditrician and neonataologist fir topic Spina bifidia

Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Searching PubMed

myelomeningocele fetal surgery outcomes

Reading File
Reading File
Loading Image
Loading Image
Loading Image
Loading Image
Finding Sources

SPINA BIFIDA - In-Depth Notes for Paediatricians & Neonatologists


PART 1: EMBRYOLOGY - THE FOUNDATION

Normal Neural Tube Closure

During weeks 3-4 of gestation, the neural plate folds to form the neural tube via a process called primary neurulation. This proceeds in a "zipper" fashion from the cervical region bidirectionally toward the cranial (anterior neuropore, closes day 24) and caudal (posterior neuropore, closes day 26) ends.
Spina bifida results from failure of posterior neuropore closure.
Two mechanisms contribute to MMC pathology - the "Two-Hit Hypothesis":
  • Hit 1 (Primary): Failure of spinal canal closure in the 4th gestational week - the primary anatomical malformation
  • Hit 2 (Secondary): Ongoing exposure of open neural elements to amniotic fluid - direct trauma and neurotoxic injury progressively worsens neurological function throughout gestation
This two-hit concept is the entire rationale for fetal surgery - closing the defect in utero stops hit 2.
  • Creasy & Resnik's Maternal-Fetal Medicine, p. 785

PART 2: CLASSIFICATION OF SPINA BIFIDA

The Full Spectrum

SPINA BIFIDA
├── OCCULTA (hidden) - skin-covered, usually asymptomatic
└── CYSTICA (open/cystic) - meningeal cyst present
    ├── Meningocele - meninges + CSF only, no neural tissue
    ├── Myelomeningocele (MMC) - meninges + spinal cord/roots ← MOST COMMON + SEVERE
    └── Myelocele - neural plate flush with skin, no cyst

2A. Spina Bifida Occulta

  • Failure of vertebral arch fusion only - no herniation
  • Most common at L5 or S1 - present in ~10% of otherwise normal people
  • Usually asymptomatic and found incidentally on X-ray
Lumbar spine radiograph showing spina bifida occulta - unfused posterior vertebral arches visible at the lumbar level
Lumbar spine X-ray: Spina Bifida Occulta - Bradley & Daroff's Neurology in Clinical Practice
Cutaneous markers - look at the back on every newborn exam:
BOX 104.4 Dorsal Midline Skin Findings Associated With Spina Bifida Occulta - listing asymmetrical gluteal fold, dermal sinus, hairy tuft, hemangioma, lipoma, nevus, pilonidal sinus, rudimentary tail, spinal aplasia cutis
Clinical pearl: Any dorsal midline skin finding (especially a hairy tuft, dermal sinus, or subcutaneous lipoma) in a neonate warrants spinal MRI to rule out occult spinal dysraphism and tethered cord.

2B. Meningocele

  • Meninges + CSF herniate through the bony defect, covered by skin
  • Spinal cord stays in normal position
  • Less severe neurological deficit (but may have underlying cord defects)
  • If good skin coverage: can be managed conservatively or electively repaired at 3-6 months

2C. Myelomeningocele (MMC) - Your Core Focus

The most important form. The roof of the defect is formed by exposed neural tissue (the neural placode).
MRI appearances - myelocele vs myelomeningocele:
Sagittal T1-weighted MRI: (A) Myelocele - neural tissue arrowhead flush with skin surface arrow; (B) Myelomeningocele - lesion extends beyond skin surface, contains nerve tissue and CSF arrow
Goldman-Cecil Medicine - Sagittal T1 MRI: Myelocele (A) vs Myelomeningocele (B)

PART 3: EPIDEMIOLOGY

ParameterData
Global incidence~1 per 1,000 births
US incidence (post-folate fortification)~0.6 per 1,000 births
SexFemales slightly more affected
Folate impact~50% reduction in MMC incidence
Pregnancy termination rate25-40% of MMC pregnancies terminated after prenatal diagnosis
Hydrocephalus requiring treatment81% of MMC patients
5-year mortality (neonatal repair)~79 per 1,000 (7.9%)
Mortality with brainstem dysfunction~35%
  • Miller's Anesthesia 10e, p. 9026; Creasy & Resnik's MFM, p. 785

PART 4: PRENATAL SCREENING & DIAGNOSIS

Maternal Serum Screening

  • Elevated alpha-fetoprotein (AFP) in maternal serum and amniotic fluid - AFP leaks from the open neural defect
  • Abnormal AFP triggers amniocentesis for amniotic AFP + acetylcholinesterase levels
  • Acetylcholinesterase is specific for open NTDs (not present in normal amniotic fluid)

Fetal Ultrasound - Second Trimester Findings

Second-trimester ultrasound: (A) Normal midsagittal lumbosacral - conus at L2-L3 ventral; (B) Meningolipoma, tethered cord, conus at L4 dorsal; (C) Cystic mass protruding from lumbosacral vertebrae; (D) Transverse section showing U-shaped splayed vertebra, meningeal sac; (E) 3D surface render showing nervous tissue strands emerging from spinal canal arrows; (F) Brain - ventriculomegaly and lemon sign
Creasy & Resnik's MFM - Fetal ultrasound findings in MMC
Sonographic signs to know:
SignWhat it means
Lemon signBifrontal skull indentation on axial head view - Chiari II traction
Banana signCurved cerebellum on axial view - Chiari II herniation
Splayed U-shaped posterior elementsOn axial spine view - unfused laminae
Dorsal cystic massMeningeal sac protruding
VentriculomegalySecondary hydrocephalus
Absent/small cerebellar cisterna magnaChiari II
Low-lying/absent corpus callosumAssociated brain anomalies
  • Creasy & Resnik's MFM, p. 786

Fetal MRI

  • Better delineation of lesion level, brain anatomy, Chiari II, associated anomalies
  • Helps counsel families and plan delivery/surgical approach

PART 5: ASSOCIATED CONDITIONS - THE BIG 3

5A. Arnold-Chiari Type II Malformation (Chiari II)

  • Almost invariably associated with MMC - present in virtually 100% of MMC cases (detectable 19-25 weeks)
  • Clinically significant in ~35% of patients
  • Mechanism: The open spinal defect causes CSF leakage → reduced pressure in the posterior fossa → the posterior fossa remains small → cerebellar vermis and caudal brainstem (medulla, sometimes pons) are forced downward through the foramen magnum
Consequences:
  • Hydrocephalus (impaired CSF flow through the 4th ventricle)
  • Brainstem dysfunction: central hypoventilation, vocal cord paralysis, swallowing difficulties, apnea
  • Cerebellar dysfunction: ataxia
  • Syringomyelia
  • Polymicrogyria
  • Kink in medulla
Neonatal red flags for symptomatic Chiari II:
  • Stridor (vocal cord dysfunction)
  • Apnea and bradycardia
  • Dysphagia / aspiration
  • Weak cry
  • Opisthotonos
Management: Posterior fossa decompression (enlarged foramen magnum + C1 arch removal) to restore CSF flow. Ventriculoperitoneal (VP) shunt for hydrocephalus.
  • Bailey & Love's Surgery 28th ed., p. 544; Bradley & Daroff's Neurology, p. 2553

5B. Hydrocephalus

  • 64-85% of lumbosacral MMC patients require a VP shunt
  • 80% require lifelong shunting
  • 50% have shunt complications in the first year of life
  • Consequences of untreated hydrocephalus: raised ICP, cognitive impairment, spasticity
  • Mean IQ with VP shunt: ~80 (low-normal); worse than those who do not require shunting
  • Hydrocephalus and the need for VP shunting is itself a predictor of cognitive outcome
Neonatologist's role: Monitor head circumference daily, perform serial cranial ultrasounds, consult neurosurgery promptly for progressive ventriculomegaly.

5C. Tethered Cord Syndrome

  • The spinal cord is abnormally attached at the repair site
  • Presents with progressive neurological deterioration, worsening gait, back pain, scoliosis, bladder dysfunction as the child grows
  • MRI shows low-lying conus medullaris (below L2) with thickened filum
  • Surgical release required (detethering)

PART 6: NEUROLOGICAL DEFICIT BY LESION LEVEL

The level of the MMC determines the functional neurological outcome. This is the most important prognostic variable.
Lesion LevelMotor FunctionAmbulation
ThoracicParalysis below lesion; no hip/knee/ankle controlWheelchair dependent
High Lumbar (L1-L2)Hip flexion only; no knee extension, ankleWheelchair; KAFO with crutches
Mid Lumbar (L3)Knee extension present; no ankle dorsiflexionShort-distance ambulation with AFOs
Low Lumbar (L4-L5)Ankle dorsiflexion present; weak plantarflexionCommunity ambulation with AFOs
Sacral (S1-S2)Near-normal lower limb; sphincter dysfunctionIndependent ambulation; CIC needed
Key rule: Higher lesion = more disability. Neurological deficits at birth are irreversible with postnatal repair - surgery prevents further deterioration, it does not restore lost function.

PART 7: NEONATAL ASSESSMENT AND IMMEDIATE MANAGEMENT

Delivery Planning

  • Planned caesarean section before onset of labour - reduces exposure of neural elements to birth canal trauma and improves neurological outcomes
  • Delivery at a centre with immediate neurosurgical capability

Neonatal Examination at Birth - Your Systematic Approach

1. Inspect the lesion:
  • Site, size, level (count vertebrae from sacrum)
  • Is it open (ruptured/no skin cover) or intact?
  • Is the sac leaking CSF? (infection risk skyrockets)
  • Is the neural placode visible?
2. Neurological assessment:
  • Lower limb tone and spontaneous movement
  • Response to pin-prick at successive dermatomal levels - defines the sensory level
  • Anal wink reflex (S3-S5)
  • Cremasteric reflex
  • Head circumference (baseline for hydrocephalus monitoring)
3. General examination for associated anomalies:
  • Orthopaedic: club foot (equinovarus), hip dislocation, kyphoscoliosis
  • Renal: palpate kidneys, arrange renal ultrasound
  • Other NTDs or chromosomal anomalies

Immediate Neonatal Steps (Hour 0)

PriorityAction
Protect the sacCover with warm saline-soaked sterile gauze, then covered loosely - keep it moist and clean
PositionProne or lateral - NEVER on the back (pressure on sac, rupture risk)
TemperatureWarm environment - the open lesion is a major source of heat loss
IV accessEstablish IV; start maintenance fluids
AntibioticsBroad-spectrum coverage (against Staph, gram-negatives) - meningitis prophylaxis if CSF leak
Head circumferenceMeasure and plot; arrange cranial ultrasound
NPOIf surgery planned imminently
Neurosurgical consultUrgent - aim for closure within 24-72 hours
Renal USBaseline upper tract imaging
Urological consultPlan early urodynamics; start CIC early
Orthopaedic consultFoot and hip examination, splinting
The open defect is a direct portal for meningitis. Delay to closure is associated with worse infection rates. Surgery within 24-72 hours is the standard of care.

PART 8: SURGICAL MANAGEMENT

Postnatal Repair

Goals:
  1. Close the skin over the neural placode
  2. Prevent CSF leak and meningitis
  3. Untether the cord from the wound
  4. Preserve remaining neurological function
Technique:
  • Neurosurgical dissection of the neural placode from surrounding skin
  • Reconstitution of the dura
  • Multi-layer closure (dura, fascia, skin)
  • Does NOT restore already-lost neurological function
VP shunt:
  • Placed concurrently or shortly after (at same admission)
  • 64-85% of lumbosacral MMC patients need one

Fetal Surgery (In Utero MMC Repair) - The MOMS Trial

The landmark MOMS Trial (Management Of Myelomeningocele Study) - randomized, prospective, 3 US centres, 2003-2010, n=183:
OutcomeFetal SurgeryPostnatal Surgeryp-value
VP shunt by 12 months40%82%<0.001
Hindbrain herniation reversalImprovedStandardSignificant
Independent walking at 30 months44.8%23.9%0.04
Function ≥2 levels better than expected26.4%11.4%Significant
Preterm birth (PPROM)HigherLowerSignificant
Maternal uterine dehiscenceHigher-Significant
10-year follow-up (pretrial cohort, n=54): Improved functional, behavioral, and motor outcomes especially in children who did not require VP shunting.
Recent evidence (2025 meta-analyses): Multiple systematic reviews confirm fetal surgery reduces VP shunt requirement, improves motor function and hindbrain herniation - at the cost of higher preterm birth rates. Kunpalin et al., Ultrasound Obstet Gynecol 2025 - PMID 40492626; Torres et al., Childs Nerv Syst 2025 - PMID 41398113
Eligibility criteria for fetal MMC repair:
  • Gestational age 19-26 weeks
  • Singleton pregnancy
  • MMC at T1-S1 level
  • Chiari II malformation on MRI
  • Normal karyotype
  • No other major anomalies
  • Must be performed at specialist centre only
Fetoscopic (minimally invasive) approach: Emerging technique - reduces maternal morbidity, allows vaginal delivery. Still associated with high PPROM rates. Phase I trials show promise. Not yet standard of care.
  • Miller's Anesthesia 10e, pp. 9026-9030

PART 9: NEUROGENIC BLADDER AND BOWEL - THE PAEDIATRICIAN'S DOMAIN

This is the area where your ongoing care matters most. Bladder dysfunction is the leading cause of morbidity and mortality in long-term MMC survivors (renal failure from high-pressure bladder).

Neurogenic Bladder

The problem:
  • Detrusor-sphincter dyssynergia: bladder contracts against a closed sphincter → elevated intravesical pressure → hydronephrosis → renal damage
  • Risk of VUR (vesicoureteral reflux) from high bladder pressures
  • Risk of recurrent UTIs
Assessment:
  • Urodynamic study (bladder pressure-volume study) - mandatory, defines storage and emptying pattern
  • Renal and bladder ultrasound - baseline upper tract evaluation
  • Voiding cystourethrogram (VCUG) if VUR suspected
Treatment:
  • Clean Intermittent Catheterization (CIC) - the cornerstone of neurogenic bladder management
    • Start in the neonatal/early infant period
    • Taught to parents initially, then to the child as they grow
    • 40-80% develop asymptomatic bacteriuria - this does NOT require antibiotics unless symptomatic
    • Stopping prophylactic antibiotics in spina bifida patients reduces bacterial resistance
  • Anticholinergics (oxybutynin) - reduce bladder overactivity and intravesical pressure; VUR resolved/improved in 44-79% when bladder overactivity is treated
  • Prophylactic antibiotics: Not routinely recommended (evidence does not support long-term benefit; increases resistance)
  • Surgical options (later): bladder augmentation, Mitrofanoff procedure for continent catheterizable channel
Key neonatal decision: Start CIC in all MMC neonates within the first week of life, regardless of residual bladder function. This is prophylactic renal protection.

Neurogenic Bowel

  • Loss of voluntary anal sphincter control (S2-S4 lesions)
  • Constipation + overflow incontinence
  • Management: regular bowel programs, diet, laxatives, rectal irrigation (Peristeen), antegrade continence enemas (ACE procedure / Malone procedure)

PART 10: ORTHOPAEDIC COMPLICATIONS

The motor deficit leads to progressive orthopaedic deformities:
ProblemDetailsManagement
Club foot (equinovarus)Most common; present at birthSerial casting (Ponseti), splinting, surgery
Hip dislocationFrom muscle imbalanceOrthopaedic management; less aggressive than idiopathic DDH
Neuromuscular scoliosisProgressive; worsened by tethered cordBracing, spinal fusion when severe
KyphosisCongenital (rigid) or paralyticSurgical correction
Pathological fracturesOsteoporosis from immobility + denervationSoft tissue swelling without pain in insensate limb - diagnose clinically + X-ray
Pressure soresFrom sensory lossFrequent repositioning, appropriate seating
  • Bailey & Love's Surgery 28th ed., pp. 1554-1581

PART 11: COGNITIVE AND NEURODEVELOPMENTAL OUTCOMES

  • >70% of survivors have IQ >80
  • Only 37% can live independently as adults
  • Mean IQ with VP shunt: ~80 (low-normal)
  • Children without VP shunting have better cognitive outcomes
  • Specific difficulties: executive function, processing speed, visual-motor integration, memory
  • Arithmetic and reading comprehension commonly affected despite adequate verbal IQ ("cocktail party speech" - fluent but shallow)
  • Early intervention (speech, OT, PT, educational support) significantly improves outcomes

PART 12: PREVENTION

Folic Acid

  • Primary prevention: 400 mcg/day periconceptionally for all women of childbearing age
  • High-risk women (prior NTD pregnancy, antiepileptic drugs, diabetes): 4-5 mg/day starting 3 months before conception and through first trimester
  • Reduces NTD incidence by ~50-70%
  • Folate fortification of bread/grain (USA since 1998) contributed to population-level reduction

Recurrence risk

  • One affected child: 2-3% recurrence risk in subsequent pregnancies
  • Two affected children: ~10% risk
  • Affected parent: ~4% risk

PART 13: MULTIDISCIPLINARY TEAM (MDT) APPROACH

MMC requires lifelong coordinated care across specialties:
SpecialtyRole
NeonatologyInitial stabilization, surgical preparation, early CIC, neurodevelopmental monitoring
NeurosurgeryMMC closure, VP shunt, tethered cord release
Urology/NephrologyNeurogenic bladder management, renal protection
OrthopaedicsFoot, hip, spine deformities
PhysiotherapyMobility, gait, splinting
Occupational therapyADLs, hand function, school
Developmental PaediatricsCognitive, learning, behaviour
DieteticsObesity prevention (huge problem - immobility + denervated limbs)
NeurologySeizures, Chiari management
PsychologyMental health (depression, anxiety high in adolescents)

PART 14: PROGNOSIS SUMMARY

DomainOutcome
Survival~85-90% survive to adulthood with modern care; 14% mortality by age 5
Brainstem dysfunction35% mortality in those with Chiari II brainstem symptoms
AmbulationDepends on level; ~50% of all MMC community ambulators
ContinenceRarely achieved without CIC and bowel program
Cognitive70%+ IQ >80; 37% live independently
Quality of lifeSelf-reported QoL surprisingly positive in surveys; greatest predictors: level of lesion, shunt complications, social support

QUICK REFERENCE CARD - NEONATAL PEARLS

ScenarioAction
Open MMC at birthProne position + moist sterile dressing + IV antibiotics + urgent neurosurgery
CSF leaking from sacEmergency - meningitis imminent; stat neurosurgical consultation
Hairy tuft / dimple on backSpinal MRI to exclude occult dysraphism + tethered cord
Stridor + apnea post-MMC repairThink symptomatic Chiari II - brainstem compression
Progressive ventriculomegalyVP shunt evaluation
All MMC neonatesStart CIC within first week regardless of apparent bladder function
Family counsellingDiscuss fetal surgery options if diagnosed prenatally at 19-26 weeks
Recurrence counselling5 mg folic acid for next pregnancy

Sources:

Above in pdf with minimum pages all content

Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null && echo "---" && pip show reportlab weas…

Running Command

mkdir -p /home/daytona/workspace/spina-bifida-notes

Writing File

~/spina-bifida-notes/generate_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, PageBreak, KeepTogether
)
from reportlab.platypus.flowables import BalancedColumns
from reportlab.lib.colors import HexColor
import urllib.request
import io

OUTPUT = "/home/daytona/workspace/spina-bifida-notes/Spina_Bifida_Notes.pdf"

# ── Colour palette ──────────────────────────────────────────────
C_DARK   = HexColor("#1A237E")   # deep navy
C_MID    = HexColor("#283593")   # mid navy
C_ACCENT = HexColor("#0288D1")   # teal-blue
C_LIGHT  = HexColor("#E3F2FD")   # very light blue tint
C_GREEN  = HexColor("#1B5E20")   # dark green for pearls
C_GLIGHT = HexColor("#E8F5E9")   # light green bg
C_WARN   = HexColor("#B71C1C")   # red for warnings
C_WLIGHT = HexColor("#FFEBEE")   # light red bg
C_TABLE_H= HexColor("#1565C0")   # table header
C_ALT    = HexColor("#EFF3FB")   # alternating row
C_GREY   = HexColor("#546E7A")   # muted grey text
C_HR     = HexColor("#90CAF9")   # divider line

# ── Document ─────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=14*mm, rightMargin=14*mm,
    topMargin=16*mm,  bottomMargin=14*mm,
    title="Spina Bifida – Paediatric & Neonatal Notes",
    author="Orris Medical AI"
)

W = A4[0] - 28*mm   # usable width

# ── Styles ───────────────────────────────────────────────────────
base = getSampleStyleSheet()

def S(name, **kw):
    return ParagraphStyle(name, **kw)

sTitle = S("sTitle", fontSize=20, textColor=colors.white, leading=26,
           alignment=TA_CENTER, fontName="Helvetica-Bold", spaceAfter=2)
sSubtitle = S("sSubtitle", fontSize=10, textColor=HexColor("#BBDEFB"),
              alignment=TA_CENTER, fontName="Helvetica", leading=14)
sH1 = S("sH1", fontSize=12, textColor=colors.white, leading=16,
        fontName="Helvetica-Bold", spaceBefore=6, spaceAfter=2)
sH2 = S("sH2", fontSize=10.5, textColor=C_MID, leading=14,
        fontName="Helvetica-Bold", spaceBefore=5, spaceAfter=2)
sH3 = S("sH3", fontSize=9.5, textColor=C_DARK, leading=13,
        fontName="Helvetica-Bold", spaceBefore=4, spaceAfter=1)
sBody = S("sBody", fontSize=8.5, textColor=HexColor("#212121"), leading=12,
          fontName="Helvetica", spaceAfter=3, alignment=TA_JUSTIFY)
sBullet = S("sBullet", fontSize=8.5, textColor=HexColor("#212121"), leading=11.5,
            fontName="Helvetica", leftIndent=10, spaceAfter=1.5,
            bulletIndent=2, alignment=TA_LEFT)
sPearl = S("sPearl", fontSize=8.5, textColor=C_GREEN, leading=12,
           fontName="Helvetica-BoldOblique", leftIndent=6, spaceAfter=2)
sWarn  = S("sWarn",  fontSize=8.5, textColor=C_WARN,  leading=12,
           fontName="Helvetica-Bold", leftIndent=6, spaceAfter=2)
sSmall = S("sSmall", fontSize=7.5, textColor=C_GREY, leading=11,
           fontName="Helvetica", spaceAfter=1)
sFooter= S("sFooter", fontSize=7, textColor=C_GREY, leading=10,
           fontName="Helvetica", alignment=TA_CENTER)
sTH = S("sTH", fontSize=8, textColor=colors.white, leading=10,
        fontName="Helvetica-Bold", alignment=TA_CENTER)
sTD = S("sTD", fontSize=8, textColor=HexColor("#1A237E"), leading=10,
        fontName="Helvetica", alignment=TA_LEFT)
sTD2= S("sTD2", fontSize=8, textColor=HexColor("#212121"), leading=10,
        fontName="Helvetica", alignment=TA_LEFT)
sCode = S("sCode", fontSize=7.5, textColor=HexColor("#263238"), leading=11,
          fontName="Courier", leftIndent=8, backColor=HexColor("#F5F5F5"),
          spaceAfter=2)

# ── Helpers ───────────────────────────────────────────────────────
def hr(): return HRFlowable(width="100%", thickness=0.6, color=C_HR, spaceAfter=3, spaceBefore=2)

def section_header(text):
    """Full-width dark banner with white heading."""
    t = Table([[Paragraph(text, sH1)]], colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), C_DARK),
        ("LEFTPADDING",  (0,0), (-1,-1), 7),
        ("RIGHTPADDING", (0,0), (-1,-1), 7),
        ("TOPPADDING",   (0,0), (-1,-1), 5),
        ("BOTTOMPADDING",(0,0), (-1,-1), 5),
        ("ROWBACKGROUNDS", (0,0), (-1,-1), [C_DARK]),
    ]))
    return t

def sub_header(text):
    t = Table([[Paragraph(text, sH2)]], colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), C_LIGHT),
        ("LEFTPADDING",  (0,0), (-1,-1), 6),
        ("TOPPADDING",   (0,0), (-1,-1), 3),
        ("BOTTOMPADDING",(0,0), (-1,-1), 3),
        ("LINEBELOW",    (0,0), (-1,-1), 1.2, C_ACCENT),
    ]))
    return t

def pearl_box(text):
    t = Table([[Paragraph("★  " + text, sPearl)]], colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), C_GLIGHT),
        ("LEFTPADDING",  (0,0), (-1,-1), 8),
        ("RIGHTPADDING", (0,0), (-1,-1), 8),
        ("TOPPADDING",   (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",(0,0), (-1,-1), 4),
        ("ROUNDEDCORNERS", [4]),
        ("BOX", (0,0), (-1,-1), 0.8, C_GREEN),
    ]))
    return t

def warn_box(text):
    t = Table([[Paragraph("⚠  " + text, sWarn)]], colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), C_WLIGHT),
        ("LEFTPADDING",  (0,0), (-1,-1), 8),
        ("RIGHTPADDING", (0,0), (-1,-1), 8),
        ("TOPPADDING",   (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",(0,0), (-1,-1), 4),
        ("BOX", (0,0), (-1,-1), 0.8, C_WARN),
    ]))
    return t

def make_table(headers, rows, col_widths=None):
    hrow = [Paragraph(h, sTH) for h in headers]
    data = [hrow]
    for i, row in enumerate(rows):
        style = sTD if i % 2 == 0 else sTD2
        data.append([Paragraph(str(c), style) for c in row])
    if col_widths is None:
        col_widths = [W / len(headers)] * len(headers)
    tbl = Table(data, colWidths=col_widths, repeatRows=1)
    row_styles = [
        ("BACKGROUND",   (0,0), (-1,0),  C_TABLE_H),
        ("TEXTCOLOR",    (0,0), (-1,0),  colors.white),
        ("GRID",         (0,0), (-1,-1), 0.4, HexColor("#B0BEC5")),
        ("LEFTPADDING",  (0,0), (-1,-1), 5),
        ("RIGHTPADDING", (0,0), (-1,-1), 5),
        ("TOPPADDING",   (0,0), (-1,-1), 3),
        ("BOTTOMPADDING",(0,0), (-1,-1), 3),
        ("VALIGN",       (0,0), (-1,-1), "TOP"),
    ]
    for i in range(1, len(data)):
        if i % 2 == 0:
            row_styles.append(("BACKGROUND", (0,i), (-1,i), C_ALT))
    tbl.setStyle(TableStyle(row_styles))
    return tbl

def B(text): return Paragraph("<bullet>&bull;</bullet> " + text, sBullet)
def P(text): return Paragraph(text, sBody)
def SP(n=3): return Spacer(1, n*mm)

# ═══════════════════════════════════════════════════════════════
# BUILD CONTENT
# ═══════════════════════════════════════════════════════════════
story = []

# ─── COVER BANNER ─────────────────────────────────────────────
cover = Table([
    [Paragraph("SPINA BIFIDA", sTitle)],
    [Paragraph("In-Depth Clinical Notes for Paediatricians &amp; Neonatologists", sSubtitle)],
    [Paragraph("Compiled from: Goldman-Cecil Medicine • Creasy &amp; Resnik MFM • Miller's Anesthesia • Bailey &amp; Love • Bradley &amp; Daroff's Neurology • Campbell-Walsh Urology | July 2026", sSmall)],
], colWidths=[W])
cover.setStyle(TableStyle([
    ("BACKGROUND",   (0,0), (0,1), C_DARK),
    ("BACKGROUND",   (0,2), (0,2), C_MID),
    ("LEFTPADDING",  (0,0), (-1,-1), 10),
    ("RIGHTPADDING", (0,0), (-1,-1), 10),
    ("TOPPADDING",   (0,0), (0,1), 8),
    ("BOTTOMPADDING",(0,1), (0,1), 8),
    ("TOPPADDING",   (0,2), (0,2), 4),
    ("BOTTOMPADDING",(0,2), (0,2), 4),
]))
story += [cover, SP(4)]

# ═══ PART 1: EMBRYOLOGY ═══════════════════════════════════════
story += [section_header("PART 1 — EMBRYOLOGY"), SP(2)]
story += [sub_header("Normal Neural Tube Closure"), SP(1)]
story += [
    P("During <b>weeks 3-4 of gestation</b>, the neural plate folds to form the neural tube via <b>primary neurulation</b>. This proceeds in a 'zipper' fashion from the cervical region bidirectionally. The anterior neuropore closes ~day 24; the <b>posterior neuropore closes ~day 26</b>. Spina bifida results from failure of posterior neuropore closure."),
    SP(2),
    sub_header("Two-Hit Hypothesis (Pathomechanism of MMC)"),
    SP(1),
    make_table(["Hit", "Description", "Timing"],
    [
        ["Hit 1 (Primary)", "Failure of spinal canal closure — the anatomical malformation", "4th gestational week"],
        ["Hit 2 (Secondary)", "Progressive neural damage from exposure to amniotic fluid (neurotoxic + direct trauma)", "Ongoing throughout gestation"],
    ], [35*mm, 100*mm, 45*mm]),
    SP(2),
    pearl_box("The Two-Hit Hypothesis is the entire scientific rationale for fetal surgery — closing the defect in utero stops Hit 2 and preserves neurological function."),
    SP(2),
    P("<b>Sonic hedgehog (SHH) signalling</b> is critical for separation of the respiratory/GI tracts from the neural tube. Doxorubicin in animal models disrupts this pathway and produces NTDs experimentally."),
    SP(3),
]

# ═══ PART 2: CLASSIFICATION ═══════════════════════════════════
story += [section_header("PART 2 — CLASSIFICATION"), SP(2)]
story += [
    make_table(["Type", "Description", "Skin cover?", "Neural tissue?", "Freq."],
    [
        ["Spina Bifida Occulta", "Failure of vertebral arch fusion only; no herniation", "Yes (intact)", "None", "~10% population"],
        ["Meningocele", "Meninges + CSF herniate through bony defect", "Yes (skin)", "Absent from sac", "Uncommon"],
        ["Myelocele", "Neural plate flush with skin surface; no cyst", "No (open)", "Exposed, flush", "Rare"],
        ["Myelomeningocele (MMC)", "Meninges + spinal cord/nerve roots in sac; sac protrudes", "No (open)", "In sac", "MOST COMMON severe form"],
    ], [42*mm, 70*mm, 22*mm, 28*mm, 30*mm]),
    SP(3),
]

story += [sub_header("Spina Bifida Occulta — Cutaneous Markers (Always Examine the Back!)"), SP(1)]
story += [
    P("Any dorsal midline skin finding warrants spinal MRI to exclude occult dysraphism and tethered cord:"),
]
cutaneous = [
    "Asymmetrical gluteal fold", "Dermal sinus or dimple (above gluteal cleft)",
    "Hairy tuft (hypertrichosis)", "Hemangioma", "Lipoma",
    "Nevus", "Pilonidal sinus", "Rudimentary tail", "Spinal aplasia cutis"
]
# 3-column layout for cutaneous markers
col_data = []
for i in range(0, len(cutaneous), 3):
    row = cutaneous[i:i+3]
    while len(row) < 3:
        row.append("")
    col_data.append([Paragraph("<bullet>&bull;</bullet> " + r, sBullet) if r else Paragraph("", sBullet) for r in row])
ct = Table(col_data, colWidths=[W/3]*3)
ct.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), C_LIGHT),
    ("LEFTPADDING", (0,0), (-1,-1), 5),
    ("TOPPADDING",  (0,0), (-1,-1), 2),
    ("BOTTOMPADDING",(0,0),(-1,-1), 2),
    ("GRID", (0,0), (-1,-1), 0.3, HexColor("#B0BEC5")),
]))
story += [ct, SP(2),
    warn_box("A sacral dimple ABOVE the gluteal cleft or > 5 mm deep requires MRI. A dimple AT the base of the gluteal cleft in an otherwise normal infant is usually benign."),
    SP(3),
]

# ═══ PART 3: EPIDEMIOLOGY ══════════════════════════════════════
story += [section_header("PART 3 — EPIDEMIOLOGY"), SP(2)]
story += [
    make_table(["Parameter", "Data"],
    [
        ["Global incidence", "~1 per 1,000 births"],
        ["US incidence (post-folate fortification)", "~0.6 per 1,000 births"],
        ["Sex", "Females slightly more affected"],
        ["Folate supplementation impact", "~50% reduction in MMC incidence"],
        ["Hydrocephalus requiring VP shunt", "64–85% of lumbosacral MMC (81% overall)"],
        ["5-year mortality (neonatal repair)", "~7.9% (79 per 1,000)"],
        ["Mortality with brainstem dysfunction", "~35%"],
        ["IQ >80 in long-term survivors", ">70%"],
        ["Live independently as adults", "Only ~37%"],
    ], [80*mm, 110*mm]),
    SP(3),
]

# ═══ PART 4: PRENATAL SCREENING ════════════════════════════════
story += [section_header("PART 4 — PRENATAL SCREENING & DIAGNOSIS"), SP(2)]
story += [sub_header("Maternal Serum / Amniotic Fluid"), SP(1)]
story += [
    B("Elevated <b>maternal serum alpha-fetoprotein (MSAFP)</b> — AFP leaks from the open neural defect into amniotic fluid and then maternal serum"),
    B("Abnormal AFP triggers <b>amniocentesis</b>: measure amniotic AFP + <b>acetylcholinesterase</b>"),
    B("Acetylcholinesterase is <i>specific</i> for open NTDs (absent in normal amniotic fluid)"),
    SP(2),
    sub_header("Fetal Ultrasound — Second Trimester Signs"),
    SP(1),
    make_table(["Ultrasound Sign", "Significance"],
    [
        ["Lemon sign", "Bifrontal skull indentation on axial view — Chiari II traction on frontal bones"],
        ["Banana sign", "Curved/obliterated cerebellum — Chiari II cerebellar herniation"],
        ["U-shaped splayed posterior elements", "On axial spine view — unfused laminae at the defect level"],
        ["Dorsal cystic mass (lumbosacral)", "The meningeal sac protruding through the defect"],
        ["Ventriculomegaly", "Secondary hydrocephalus from Chiari II CSF obstruction"],
        ["Absent/small cisterna magna", "Posterior fossa crowding from Chiari II"],
        ["Low-lying conus medullaris", "Tethered cord (below L2 on MRI/US)"],
        ["Polyhydramnios", "Less common than in EA; can occur with severe NTD"],
    ], [55*mm, 125*mm]),
    SP(2),
    pearl_box("Fetal vertebral column is detectable on US from 10–12 weeks. Chiari II is almost invariably present between 19–25 weeks — its ABSENCE should make you reconsider the diagnosis."),
    SP(2),
    sub_header("Fetal MRI"), SP(1),
    B("Better delineation of lesion level, brain anatomy, Chiari II severity, and associated anomalies"),
    B("Guides prenatal counselling and surgical planning (fetal vs. postnatal repair)"),
    SP(3),
]

# ═══ PART 5: ASSOCIATED CONDITIONS ════════════════════════════
story += [section_header("PART 5 — ASSOCIATED CONDITIONS"), SP(2)]

story += [sub_header("5A. Arnold-Chiari Type II Malformation"), SP(1)]
story += [
    P("<b>Mechanism:</b> Open spinal defect → chronic CSF leak → reduced posterior fossa pressure → small posterior fossa → cerebellar vermis and caudal brainstem (medulla ± pons) herniate caudally through the foramen magnum."),
    SP(1),
    make_table(["Feature", "Detail"],
    [
        ["Prevalence", "Present in virtually 100% of MMC; clinically significant in ~35%"],
        ["Detectable on imaging", "Almost invariably 19–25 weeks' gestation (fetal MRI/US)"],
        ["Structures herniated", "Cerebellar vermis, medulla, sometimes pons"],
        ["Associated brain findings", "Polymicrogyria, small posterior fossa, kink in medulla, absent corpus callosum"],
        ["Hydrocephalus", "CSF flow blocked at 4th ventricle → secondary hydrocephalus"],
        ["Syringomyelia", "CSF tracking into central canal"],
        ["VP shunt need", ">80% require lifelong shunting; 50% have shunt complications year 1"],
    ], [55*mm, 125*mm]),
    SP(2),
    warn_box("Neonatal red flags for SYMPTOMATIC Chiari II: stridor (vocal cord paralysis), apnea/bradycardia, dysphagia/aspiration, weak cry, opisthotonos, central hypoventilation. Mortality 35% if brainstem dysfunction present."),
    SP(2),
]

story += [sub_header("5B. Hydrocephalus"), SP(1)]
story += [
    B("64–85% of lumbosacral MMC patients require a <b>VP shunt</b>"),
    B("Mean IQ with VP shunt: <b>~80</b> (low-normal); worse than non-shunted patients"),
    B("50% of shunted children have shunt complications in the first year"),
    B("<b>Monitor:</b> daily head circumference, serial cranial ultrasounds, fontanelle tension"),
    B("Consult neurosurgery promptly for progressive ventriculomegaly"),
    SP(2),
]

story += [sub_header("5C. Tethered Cord Syndrome"), SP(1)]
story += [
    P("Spinal cord abnormally attached at repair site. Presents with <b>progressive</b> neurological deterioration (worsening gait, back pain, scoliosis, worsening bladder dysfunction) as child grows. MRI shows low-lying conus (below L2) with thickened filum terminale. Treatment: surgical detethering."),
    SP(3),
]

# ═══ PART 6: NEUROLOGICAL DEFICIT BY LEVEL ════════════════════
story += [section_header("PART 6 — NEUROLOGICAL DEFICIT BY LESION LEVEL"), SP(2)]
story += [
    make_table(["Level", "Motor Function", "Ambulation Expected"],
    [
        ["Thoracic", "Total paralysis below lesion; no hip/knee/ankle control", "Wheelchair dependent"],
        ["High Lumbar (L1–L2)", "Hip flexion only; no knee extension or ankle control", "Wheelchair; KAFO + crutches possible"],
        ["Mid Lumbar (L3)", "Knee extension present; no ankle dorsiflexion or plantarflexion", "Short-distance ambulation with AFOs"],
        ["Low Lumbar (L4–L5)", "Ankle dorsiflexion present; weak plantarflexion", "Community ambulation with AFOs"],
        ["Sacral (S1–S2)", "Near-normal lower limb strength; sphincter dysfunction", "Independent ambulation; CIC required"],
    ], [30*mm, 95*mm, 65*mm]),
    SP(2),
    pearl_box("Neurological deficits at birth are IRREVERSIBLE with postnatal repair. Surgery prevents further deterioration — it does NOT restore lost function. This is why fetal surgery (stopping Hit 2) is so valuable."),
    SP(2),
    warn_box("Higher lesion level = greater disability. Thoracic and high lumbar lesions carry the worst functional prognosis."),
    SP(3),
]

# ═══ PART 7: NEONATAL ASSESSMENT & IMMEDIATE MANAGEMENT ═══════
story += [section_header("PART 7 — NEONATAL ASSESSMENT & IMMEDIATE MANAGEMENT"), SP(2)]

story += [sub_header("Delivery Planning"), SP(1)]
story += [
    B("Planned <b>caesarean section BEFORE onset of labour</b> — reduces exposure of open neural elements to birth canal trauma"),
    B("Improved neurological outcomes vs. vaginal delivery or CS after labour onset"),
    B("Deliver at a centre with <b>immediate neurosurgical capability</b>"),
    SP(2),
]

story += [sub_header("Systematic Neonatal Examination"), SP(1)]
story += [
    P("<b>1. Inspect the lesion:</b> Site, size, vertebral level (count from sacrum), skin cover (intact vs. open), CSF leakage (infection risk), visibility of neural placode."),
    P("<b>2. Neurological assessment:</b> Lower limb tone, spontaneous movement, response to pin-prick at successive dermatomal levels (defines sensory level), anal wink reflex (S3–S5), cremasteric reflex."),
    P("<b>3. Head:</b> Measure occipitofrontal circumference (OFC) — baseline for hydrocephalus monitoring. Palpate fontanelle. Arrange cranial ultrasound."),
    P("<b>4. Associated anomalies:</b> Club foot (equinovarus), hip dislocation, kyphoscoliosis, renal — palpate kidneys, arrange renal ultrasound."),
    SP(2),
]

story += [sub_header("Immediate Actions — Hour 0 Protocol"), SP(1)]
story += [
    make_table(["Priority", "Action", "Why"],
    [
        ["1 — Sac protection", "Cover with warm saline-soaked sterile gauze + waterproof dressing", "Prevent desiccation and infection; maintain moisture"],
        ["2 — Position", "PRONE or lateral decubitus — NEVER supine", "Supine = pressure on sac = rupture + cord compression"],
        ["3 — Temperature", "Warm environment, radiant warmer, cover exposed area", "Open lesion = massive transepidermal heat + water loss"],
        ["4 — IV access + fluids", "Peripheral IV; maintenance fluid (account for extra insensible losses)", "Compensation for fluid loss through lesion"],
        ["5 — Antibiotics", "Broad-spectrum IV (cephalosporin + aminoglycoside or ampicillin + gentamicin)", "Meningitis prophylaxis; especially if CSF leaking"],
        ["6 — Neurosurgery", "Urgent consult; aim for closure within 24–72 hours", "Every hour of delay increases meningitis risk"],
        ["7 — Cranial US", "Same-day study", "Baseline ventricular size for hydrocephalus monitoring"],
        ["8 — Renal US", "Day 1", "Baseline upper tracts; part of VACTERL-like screen"],
        ["9 — Urology", "Consult Day 1; plan urodynamics + start CIC in first week", "Prophylactic renal protection — do not wait for symptoms"],
        ["10 — Orthopaedics", "Foot and hip examination; splinting for equinovarus", "Early intervention improves long-term ambulation"],
        ["11 — NPO", "If surgery planned imminently", "Preoperative preparation"],
    ], [35*mm, 85*mm, 70*mm]),
    SP(2),
    warn_box("An open MMC is a direct portal for meningitis. Time to closure must be minimised. Delay beyond 72 hours is associated with significantly higher infection rates and worse outcomes."),
    SP(3),
]

# ═══ PART 8: SURGICAL MANAGEMENT ══════════════════════════════
story += [section_header("PART 8 — SURGICAL MANAGEMENT"), SP(2)]

story += [sub_header("Postnatal Surgical Repair"), SP(1)]
story += [
    P("<b>Goals:</b> (1) Close skin over neural placode, (2) Prevent CSF leak and meningitis, (3) Untether the cord from the wound edges, (4) Preserve remaining neurological function."),
    P("<b>Technique:</b> Neurosurgical dissection of neural placode from surrounding skin → reconstitution of dura → multi-layer closure (dura, fascia, skin). VP shunt placed concurrently or at same admission in ~70–85%."),
    SP(2),
]

story += [sub_header("Fetal Surgery — The MOMS Trial"), SP(1)]
story += [
    P("Randomised, prospective, 3 US centres, 2003–2010, n=183. Compared <b>open in-utero repair (19–26 weeks)</b> vs standard postnatal repair."),
    SP(1),
    make_table(["Outcome", "Fetal Surgery", "Postnatal Surgery", "Result"],
    [
        ["VP shunt required by 12 months", "40%", "82%", "p < 0.001 — Fetal better"],
        ["Hindbrain herniation reversal", "Significant", "No change", "Fetal better"],
        ["Independent walking at 30 months", "44.8%", "23.9%", "p = 0.04 — Fetal better"],
        ["Function ≥2 levels better than expected", "26.4%", "11.4%", "Fetal better"],
        ["Preterm birth / PPROM", "Higher", "Lower", "Fetal worse — trade-off"],
        ["Maternal uterine dehiscence", "Higher", "Lower", "Fetal worse — trade-off"],
    ], [70*mm, 25*mm, 30*mm, 65*mm]),
    SP(2),
    pearl_box("10-year follow-up (pretrial cohort n=54): Improved functional, behavioural, and motor outcomes — especially in children who did NOT require VP shunting. 2025 meta-analyses confirm these benefits. (Kunpalin et al. Ultrasound Obstet Gynecol 2025, PMID 40492626; Torres et al. Childs Nerv Syst 2025, PMID 41398113)"),
    SP(2),
    sub_header("Eligibility Criteria for Fetal MMC Repair"), SP(1),
    make_table(["Criterion", "Detail"],
    [
        ["Gestational age", "19–26 weeks"],
        ["Lesion level", "T1 to S1"],
        ["Brain finding", "Chiari II malformation on MRI"],
        ["Karyotype", "Normal (46,XX or 46,XY)"],
        ["Other anomalies", "None (isolated MMC)"],
        ["Pregnancy", "Singleton"],
        ["Centre requirement", "Specialist high-volume centre only — NOT generalizable"],
    ], [50*mm, 140*mm]),
    SP(2),
    sub_header("Fetoscopic (Minimally Invasive) Repair"), SP(1),
    P("Emerging technique. Reduces maternal morbidity and may allow vaginal delivery. Phase I trials (n=10) showed improved hindbrain herniation and motor function but 100% PPROM rate and mean delivery at 32 weeks. Two-port fetoscopic technique with partial CO2 insufflation shows improving results. Not yet standard of care — offered at select centres."),
    SP(3),
]

# ═══ PART 9: NEUROGENIC BLADDER & BOWEL ═══════════════════════
story += [section_header("PART 9 — NEUROGENIC BLADDER & BOWEL"), SP(2)]
story += [sub_header("Why This Is the Most Important Long-Term Issue"), SP(1)]
story += [
    P("Bladder dysfunction is the <b>leading cause of long-term morbidity and mortality</b> in MMC survivors. High intravesical pressures → hydronephrosis → renal scarring → renal failure. <b>Most kidney damage is preventable with early CIC.</b>"),
    SP(1),
    sub_header("Neurogenic Bladder — Assessment"),
    SP(1),
    B("<b>Urodynamic study</b> (bladder pressure-volume study) — mandatory; characterises storage and emptying function"),
    B("<b>Renal + bladder ultrasound</b> — baseline upper tract evaluation; repeat every 6–12 months"),
    B("<b>VCUG</b> if VUR suspected (elevated bladder pressures predispose to reflux)"),
    SP(2),
    sub_header("Treatment"),
    SP(1),
    make_table(["Treatment", "Indication / Details"],
    [
        ["Clean Intermittent Catheterisation (CIC)", "Cornerstone. Start in neonatal period. Parents taught first; child self-catheterises from ~5–6 years. 40–80% develop asymptomatic bacteriuria — does NOT require antibiotics unless symptomatic."],
        ["Anticholinergics (oxybutynin)", "Bladder overactivity + detrusor hypertonia. Reduces intravesical pressure, protects upper tracts. VUR resolved/improved in 44–79% when overactivity treated."],
        ["Prophylactic antibiotics", "NOT routinely recommended. No long-term benefit; increases bacterial resistance. Stopping prophylaxis reduces resistance (Zegers et al. 2017)."],
        ["Bladder augmentation (cystoplasty)", "Surgical — for refractory high-pressure bladder unresponsive to medical therapy"],
        ["Mitrofanoff procedure", "Creates continent catheterisable channel (appendix) for patients who cannot catheterise urethrally"],
        ["Botulinum toxin (intravesical)", "Alternative to augmentation for overactive detrusor"],
    ], [55*mm, 135*mm]),
    SP(2),
    warn_box("ASB (asymptomatic bacteriuria) in CIC patients does NOT require treatment. Treat only symptomatic UTI (fever, systemic signs, new haematuria). Blanket antibiotic use drives resistance."),
    SP(2),
    sub_header("Neurogenic Bowel"), SP(1),
    B("Loss of voluntary anal sphincter control (S2–S4 lesions) → constipation + overflow incontinence"),
    B("Bowel program: scheduled toileting, high-fibre diet, osmotic laxatives"),
    B("Rectal irrigation (e.g. Peristeen) for refractory constipation"),
    B("Malone antegrade continence enema (ACE/MACE procedure) — surgical option for older children"),
    SP(3),
]

# ═══ PART 10: ORTHOPAEDIC COMPLICATIONS ═══════════════════════
story += [section_header("PART 10 — ORTHOPAEDIC COMPLICATIONS"), SP(2)]
story += [
    make_table(["Complication", "Notes", "Management"],
    [
        ["Club foot (equinovarus)", "Most common; present at birth from muscle imbalance (unopposed plantarflexion)", "Ponseti serial casting; AFOs; surgery if resistant"],
        ["Hip dislocation", "Muscle imbalance (flexors without extensors); unilateral or bilateral", "Orthopaedic assessment; less aggressive than idiopathic DDH"],
        ["Neuromuscular scoliosis", "Progressive; worsened by tethered cord; common at thoracic/high lumbar levels", "Bracing; posterior spinal fusion when curves > 40–50°"],
        ["Congenital kyphosis", "Rigid angular kyphosis at birth especially thoracolumbar; can cause skin breakdown over sac", "Surgical correction; resection of kyphus at time of MMC repair"],
        ["Pathological fractures", "Osteoporosis from immobility + denervation; painless swelling in insensate limb", "Soft tissue swelling without pain in anaesthetic limb — X-ray, splint"],
        ["Pressure sores", "Sensory loss means child cannot feel pressure ischaemia", "Regular repositioning; appropriate wheelchair seating; skin checks"],
    ], [42*mm, 78*mm, 70*mm]),
    SP(3),
]

# ═══ PART 11: COGNITIVE & NEURODEVELOPMENTAL OUTCOMES ══════════
story += [section_header("PART 11 — COGNITIVE & NEURODEVELOPMENTAL OUTCOMES"), SP(2)]
story += [
    make_table(["Domain", "Detail"],
    [
        ["IQ", ">70% of MMC survivors have IQ >80; mean IQ with VP shunt ~80 (low-normal)"],
        ["Independent living", "Only ~37% of adults with MMC live independently"],
        ["Cognitive profile", "Executive dysfunction, slow processing speed, poor visual-motor integration, arithmetic difficulty"],
        ["'Cocktail party speech'", "Fluent, verbose speech but poor comprehension and shallow content — can mask cognitive deficits"],
        ["Predictor of cognition", "VP shunt requirement is the strongest predictor — shunted children do worse"],
        ["Intervention", "Early speech therapy, OT, PT, and educational support significantly improve outcomes"],
    ], [55*mm, 135*mm]),
    SP(3),
]

# ═══ PART 12: PREVENTION ══════════════════════════════════════
story += [section_header("PART 12 — PREVENTION & RECURRENCE"), SP(2)]
story += [
    make_table(["Scenario", "Folic Acid Dose", "Timing"],
    [
        ["All women of reproductive age", "400 mcg (0.4 mg) daily", "Periconceptionally and through first trimester"],
        ["Previous NTD-affected pregnancy", "4–5 mg daily", "Start 3 months BEFORE conception; continue through T1"],
        ["Antiepileptic drugs / diabetes / obesity", "4–5 mg daily", "Start 3 months before conception"],
        ["Population-level", "Folate fortification of bread/grain (USA since 1998)", "Ongoing; ~50% reduction in NTD incidence"],
    ], [55*mm, 60*mm, 75*mm]),
    SP(2),
    sub_header("Recurrence Risk"),
    SP(1),
    make_table(["Situation", "Risk"],
    [
        ["General population (no family history)", "~1 in 1,000"],
        ["One previously affected child", "2–3%"],
        ["Two previously affected children", "~10%"],
        ["Affected parent", "~4%"],
        ["Affected sibling (not child)", "~2–3%"],
    ], [100*mm, 90*mm]),
    SP(3),
]

# ═══ PART 13: MDT TEAM ════════════════════════════════════════
story += [section_header("PART 13 — MULTIDISCIPLINARY TEAM (MDT) ROLES"), SP(2)]
story += [
    make_table(["Specialty", "Role"],
    [
        ["Neonatology", "Initial stabilisation, sac protection, early CIC, antibiotic prophylaxis, hydrocephalus monitoring, neurodevelopmental follow-up"],
        ["Neurosurgery", "MMC closure, VP shunt, tethered cord release, Chiari decompression"],
        ["Urology / Nephrology", "Urodynamics, CIC programme, renal surveillance, upper tract protection, surgical options (augmentation, Mitrofanoff)"],
        ["Orthopaedics", "Club foot, hip dislocation, scoliosis/kyphosis correction, fracture management"],
        ["Physiotherapy", "Mobility, gait training, splinting, orthotics (AFOs, KAFOs)"],
        ["Occupational Therapy", "ADLs, hand function, school adaptations, independent catheterisation"],
        ["Developmental Paediatrics", "IQ/cognitive assessment, learning support, behavioural issues"],
        ["Dietetics", "Obesity prevention (immobility + denervated limbs = high risk), bowel diet"],
        ["Neurology", "Seizure management, Chiari II symptoms"],
        ["Psychology / Psychiatry", "Mental health (depression and anxiety are elevated in adolescents with MMC)"],
        ["Social work", "Family support, disability services, transition planning to adult care"],
    ], [45*mm, 145*mm]),
    SP(3),
]

# ═══ PART 14: PROGNOSIS SUMMARY ═══════════════════════════════
story += [section_header("PART 14 — PROGNOSIS SUMMARY"), SP(2)]
story += [
    make_table(["Domain", "Outcome"],
    [
        ["Survival to adulthood", "~85–90% with modern care; 14% mortality by age 5"],
        ["With brainstem dysfunction (Chiari II)", "~35% mortality — highest-risk group"],
        ["Ambulation", "~50% of all MMC patients achieve community ambulation (level-dependent)"],
        ["Continence", "Rarely achieved without CIC + bowel program; most require lifelong management"],
        ["Cognition", "IQ >80 in >70%; only 37% independent as adults"],
        ["Quality of life", "Self-reported QoL surprisingly positive; greatest predictors: lesion level, shunt complications, social support"],
        ["Renal outcome", "Preventable with early CIC; renal failure historically major cause of adult death"],
    ], [55*mm, 135*mm]),
    SP(3),
]

# ═══ QUICK REFERENCE TABLE ════════════════════════════════════
story += [section_header("QUICK REFERENCE — NEONATAL CLINICAL PEARLS"), SP(2)]
story += [
    make_table(["Scenario", "Action / Key Point"],
    [
        ["Open MMC at birth", "PRONE + warm moist sterile dressing + IV antibiotics + urgent neurosurgery within 24–72 h"],
        ["CSF leaking from sac", "Emergency — meningitis imminent. Stat neurosurgical consultation. Intensify antibiotics."],
        ["Hairy tuft / sacral dimple above gluteal cleft", "Spinal MRI to exclude occult dysraphism and tethered cord"],
        ["Stridor + apnea post-MMC repair", "Think SYMPTOMATIC CHIARI II — brainstem compression. Posterior fossa decompression."],
        ["Progressive macrocephaly / full fontanelle", "Hydrocephalus — urgent cranial US + neurosurgical review for VP shunt"],
        ["All MMC neonates, bladder", "Start CIC within first week regardless of apparent bladder function — prophylactic renal protection"],
        ["Asymptomatic bacteriuria on CIC", "Do NOT treat — no antibiotics unless symptomatic UTI"],
        ["Prenatal diagnosis at 19–26 weeks", "Refer to fetal surgery centre; counsel about MOMS trial evidence"],
        ["Family counselling post-delivery", "5 mg folic acid starting 3 months before next conception"],
        ["Painless swollen limb in MMC child", "Pathological fracture — X-ray; diagnose clinically in insensate limb"],
    ], [70*mm, 120*mm]),
    SP(4),
]

# ─── SOURCES ──────────────────────────────────────────────────
story.append(hr())
sources = (
    "<b>Sources:</b> The Developing Human: Clinically Oriented Embryology (Moore et al.) | "
    "Bradley &amp; Daroff's Neurology in Clinical Practice (7e) | "
    "Miller's Anesthesia 10e | "
    "Creasy &amp; Resnik's Maternal-Fetal Medicine (8e) | "
    "Goldman-Cecil Medicine (International Ed.) | "
    "Bailey &amp; Love's Short Practice of Surgery (28e) | "
    "Campbell-Walsh Urology (4th ed.) | "
    "Kunpalin et al. Ultrasound Obstet Gynecol 2025 (PMID 40492626) | "
    "Torres et al. Childs Nerv Syst 2025 (PMID 41398113) | "
    "de Oliveira Manduca Palmiero et al. Childs Nerv Syst 2025 (PMID 41342964)"
)
story.append(Paragraph(sources, sSmall))
story.append(SP(1))
story.append(Paragraph("Generated by Orris Medical AI — For educational purposes only. Always verify against current clinical guidelines.", sFooter))

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

cd /home/daytona/workspace/spina-bifida-notes && python generate_pdf.py 2>&1

Running Command

python3 -c "from pypdf import PdfReader; r = PdfReader('/home/daytona/workspace/…

Your PDF is ready — all 14 parts of the notes compressed into 7 pages of A4.

Spina Bifida Notes

PDF Document · PDF


What's inside (7 pages):
PartTopic
1Embryology + Two-Hit Hypothesis
2Classification (Occulta → MMC) + Cutaneous markers table
3Epidemiology
4Prenatal screening (AFP, USS signs: Lemon/Banana/Ventriculomegaly)
5Associated conditions — Chiari II, Hydrocephalus, Tethered Cord
6Neurological deficit by lesion level (Thoracic → Sacral)
7Neonatal assessment + Hour-0 Protocol table
8Surgical management + MOMS Trial results table
9Neurogenic bladder & bowel (CIC, anticholinergics, bowel program)
10Orthopaedic complications
11Cognitive/neurodevelopmental outcomes
12Prevention + Recurrence risk tables
13MDT roles table
14Prognosis summary + Quick Reference Pearl Table
All tables, clinical pearl boxes (green), and warning boxes (red) are formatted for easy bedside reference.
This is a shared conversation. Sign in to Orris to start your own chat.