differentiate febrile seizure Vs epilepsy in peads . Use a standard latest edition peadiatric book. Only include the exam specific points. Remove uncommon one not asked in the MBBS final year exam. filter out the most important ones. Make it pdf
mkdir -p /tmp/workspace/febrile-seizure-pdf && ls /tmp/workspace/febrile-seizure-pdf/
~/febrile-seizure-pdf/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import (
SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer,
HRFlowable
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import KeepTogether
OUTPUT = "/tmp/workspace/febrile-seizure-pdf/Febrile_Seizure_vs_Epilepsy_Paeds.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
rightMargin=1.8*cm, leftMargin=1.8*cm,
topMargin=1.8*cm, bottomMargin=1.8*cm
)
# ── Colour palette ──────────────────────────────────────────────
BLUE_DARK = colors.HexColor("#1a3a5c")
BLUE_MID = colors.HexColor("#2e6da4")
BLUE_LIGHT = colors.HexColor("#d6e8f7")
ORANGE = colors.HexColor("#e05c2a")
GREEN_LIGHT = colors.HexColor("#e8f5e9")
AMBER_LIGHT = colors.HexColor("#fff3e0")
WHITE = colors.white
GREY_LIGHT = colors.HexColor("#f5f5f5")
GREY_ROW = colors.HexColor("#eeeeee")
TEXT_DARK = colors.HexColor("#1a1a1a")
RED_SOFT = colors.HexColor("#fdecea")
# ── Styles ───────────────────────────────────────────────────────
styles = getSampleStyleSheet()
title_style = ParagraphStyle("title", fontName="Helvetica-Bold",
fontSize=17, textColor=WHITE, alignment=TA_CENTER,
leading=22, spaceAfter=4)
subtitle_style = ParagraphStyle("subtitle", fontName="Helvetica",
fontSize=9, textColor=colors.HexColor("#cce0f5"), alignment=TA_CENTER,
leading=12, spaceAfter=2)
section_head = ParagraphStyle("sechead", fontName="Helvetica-Bold",
fontSize=11, textColor=WHITE, alignment=TA_CENTER, leading=14)
col_head = ParagraphStyle("colhead", fontName="Helvetica-Bold",
fontSize=9.5, textColor=WHITE, alignment=TA_CENTER, leading=12)
row_label = ParagraphStyle("rowlabel", fontName="Helvetica-Bold",
fontSize=8.5, textColor=BLUE_DARK, alignment=TA_LEFT, leading=11)
cell_style = ParagraphStyle("cell", fontName="Helvetica",
fontSize=8.5, textColor=TEXT_DARK, alignment=TA_LEFT, leading=11)
cell_bold = ParagraphStyle("cellbold", fontName="Helvetica-Bold",
fontSize=8.5, textColor=TEXT_DARK, alignment=TA_LEFT, leading=11)
note_style = ParagraphStyle("note", fontName="Helvetica-Oblique",
fontSize=7.5, textColor=colors.HexColor("#555555"),
alignment=TA_LEFT, leading=10, leftIndent=5)
box_head = ParagraphStyle("boxhead", fontName="Helvetica-Bold",
fontSize=9, textColor=BLUE_DARK, alignment=TA_LEFT, leading=12)
box_body = ParagraphStyle("boxbody", fontName="Helvetica",
fontSize=8.5, textColor=TEXT_DARK, alignment=TA_LEFT, leading=12)
footer_style = ParagraphStyle("footer", fontName="Helvetica-Oblique",
fontSize=7, textColor=colors.HexColor("#888888"), alignment=TA_CENTER)
# ── Helper: build a table row ─────────────────────────────────────
def row(feature, febrile, epilepsy, shade=False):
bg = GREY_ROW if shade else WHITE
return ([
Paragraph(feature, row_label),
Paragraph(febrile, cell_style),
Paragraph(epilepsy, cell_style),
], bg)
# ── Title block ───────────────────────────────────────────────────
def title_block():
title_data = [[Paragraph("Febrile Seizure vs Epilepsy", title_style)],
[Paragraph("Paediatrics | MBBS Final Year Exam Reference • Based on Harrison's 22e, Adams & Victor 12e, Bradley & Daroff's Neurology, Rosen's Emergency Medicine", subtitle_style)]]
t = Table(title_data, colWidths=[17.4*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), BLUE_DARK),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING",(0,0),(-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING",(0,0), (-1,-1), 10),
("ROWBACKGROUNDS",(0,0),(-1,-1),[BLUE_DARK]),
]))
return t
# ── Section header bar ────────────────────────────────────────────
def sec_bar(text, color=BLUE_MID):
t = Table([[Paragraph(text, section_head)]], colWidths=[17.4*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), color),
("TOPPADDING", (0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("LEFTPADDING",(0,0),(-1,-1), 8),
]))
return t
# ── Main comparison table builder ────────────────────────────────
def comparison_table(rows_data):
"""rows_data: list of (feature, febrile_text, epilepsy_text)"""
col_w = [4.2*cm, 6.6*cm, 6.6*cm]
header = [
Paragraph("Feature", col_head),
Paragraph("Febrile Seizure", col_head),
Paragraph("Epilepsy (Childhood)", col_head),
]
table_data = [header]
row_styles = []
for i, (feat, feb, epi) in enumerate(rows_data):
shade = (i % 2 == 0)
bg = GREY_LIGHT if shade else WHITE
table_data.append([
Paragraph(feat, row_label),
Paragraph(feb, cell_style),
Paragraph(epi, cell_style),
])
if shade:
row_styles.append(("BACKGROUND", (0, i+1), (-1, i+1), bg))
t = Table(table_data, colWidths=col_w, repeatRows=1)
style = TableStyle([
# Header
("BACKGROUND", (0,0), (-1,0), BLUE_MID),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,0), 9.5),
("ALIGN", (0,0), (-1,0), "CENTER"),
("VALIGN", (0,0), (-1,-1), "TOP"),
# Grid
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#b0b0b0")),
("LINEBELOW", (0,0), (-1,0), 1.2, BLUE_DARK),
# Padding
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
])
for s in row_styles:
style.add(*s)
t.setStyle(style)
return t
# ── Risk box / info boxes ─────────────────────────────────────────
def two_col_box(left_title, left_items, right_title, right_items,
left_bg=GREEN_LIGHT, right_bg=AMBER_LIGHT):
"""Two side-by-side info boxes"""
def make_cell(title, items, bg):
content = [Paragraph(title, box_head)]
for item in items:
content.append(Paragraph(f"• {item}", box_body))
cell_tbl = Table([[c] for c in content], colWidths=[7.9*cm])
cell_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 4),
("LEFTPADDING",(0,0),(-1,-1), 8),
("RIGHTPADDING",(0,0),(-1,-1), 6),
("BOX", (0,0),(-1,-1), 0.8, BLUE_MID),
]))
return cell_tbl
lc = make_cell(left_title, left_items, left_bg)
rc = make_cell(right_title, right_items, right_bg)
outer = Table([[lc, rc]], colWidths=[8.4*cm, 8.4*cm],
hAlign="CENTER")
outer.setStyle(TableStyle([
("VALIGN", (0,0),(-1,-1), "TOP"),
("LEFTPADDING",(0,0),(-1,-1), 3),
("RIGHTPADDING",(0,0),(-1,-1), 3),
]))
return outer
def single_box(title, items, bg=BLUE_LIGHT, border=BLUE_MID):
content = [Paragraph(title, box_head)]
for item in items:
content.append(Paragraph(f"• {item}", box_body))
t = Table([[c] for c in content], colWidths=[17.0*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), bg),
("TOPPADDING", (0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 4),
("LEFTPADDING",(0,0),(-1,-1), 10),
("RIGHTPADDING",(0,0),(-1,-1), 10),
("BOX",(0,0),(-1,-1), 0.8, border),
]))
return t
def red_box(title, items):
return single_box(title, items, bg=RED_SOFT, border=ORANGE)
# ═══════════════════════════════════════════════════════════════════
# DATA
# ═══════════════════════════════════════════════════════════════════
comparison_rows = [
# ── DEFINITION & BASIC
("Definition",
"Seizure with fever, NO CNS infection, in a neurologically normal child",
"Recurrent, unprovoked seizures (≥2 seizures, NOT provoked by fever or acute illness)"),
("Age of onset",
"6 months – 5 years (peak: 9–20 months)",
"Any age; most childhood epilepsies start in first decade"),
("Relation to fever",
"ALWAYS associated with fever (>38°C / 100.4°F); occurs on RISING phase of fever",
"NOT related to fever; seizures occur without fever"),
("Seizure type",
"Usually generalised tonic-clonic (symmetric)",
"Variable: generalised, focal, myoclonic, absence — depends on syndrome"),
("Duration",
"Simple: <15 min • Complex: >15 min (febrile status)",
"Usually <2–3 min; status epilepticus possible but uncommon"),
("Recurrence in same illness",
"Simple: does NOT recur within 24 h • Complex: recurs within 24 h",
"Seizures recur WITHOUT fever; triggered by stress, sleep deprivation, lights"),
("Focal features",
"Simple: ABSENT • Complex: focal features present (Todd's paresis possible)",
"Common in focal epilepsy syndromes (temporal, frontal lobe)"),
("Post-ictal state",
"Brief, returns to baseline quickly",
"Prolonged post-ictal confusion, drowsiness or focal deficit may occur"),
("Neurological baseline",
"Neurologically NORMAL between episodes",
"May have underlying neurological abnormality or developmental delay"),
("EEG",
"NORMAL inter-ictally; NOT routinely indicated after simple febrile seizure",
"Abnormal inter-ictal EEG often present; essential for diagnosis and classification"),
("Neuroimaging (CT/MRI)",
"NOT routinely indicated after first simple febrile seizure",
"Indicated if focal deficit, partial seizure, or atypical features"),
("CSF / Lumbar puncture",
"Indicated if signs of meningism; routine LP NOT needed for simple FS",
"Not a routine investigation; done only to rule out meningitis in first febrile episode"),
("Recurrence risk",
"30–50% chance of ≥1 further febrile seizure; resolves by age 5",
"High recurrence risk without AEDs; persists beyond childhood in many syndromes"),
("Risk of developing epilepsy",
"Simple FS: ~2% (same as general population) • Complex FS: 6–49% (one, two, or three complex features respectively)",
"By definition, the child already has epilepsy; risk of ongoing seizures depends on syndrome"),
("Family history",
"Family history of febrile seizures common (polygenic inheritance); positive in 25%",
"Family history of epilepsy; specific genetics in Dravet, JME, etc."),
("Treatment – acute",
"Diazepam (IV/rectal) if seizure >5 min; simple FS needs no AED",
"Benzodiazepine for acute seizure; AEDs for long-term control"),
("Long-term AED prophylaxis",
"NOT indicated; does NOT prevent later epilepsy; rectal/oral diazepam at fever onset if high-risk",
"Indicated (valproate, carbamazepine, lamotrigine, ethosuximide etc. per syndrome)"),
("Prognosis / outcome",
"Excellent; 98% seizure-free by age 5; normal school progress; no cognitive impact",
"Variable; depends on syndrome — benign (BECTS) to refractory (Lennox-Gastaut)"),
("EEG post-ictal",
"Normal inter-ictal EEG",
"Abnormal: spike-wave, hypsarrhythmia, focal spikes etc."),
]
risk_complex_items = [
"Prolonged duration (>15 min)",
"Focal features (asymmetric seizure, Todd's paresis)",
"Recurrence within 24 h in same febrile illness",
"Note: These three complex features = risk 6%, 17%, 49% for later epilepsy respectively",
]
risk_epilepsy_items = [
"Pre-existing neurodevelopmental abnormality / cerebral palsy",
"Complex febrile seizure features (all 3 features = 49% risk)",
"Family history of epilepsy (NOT just febrile seizures)",
"Multiple recurrent febrile seizures",
"Dravet syndrome presentation (prolonged, asymmetric FS in first year)",
]
simple_vs_complex = [
("Feature", "Simple Febrile Seizure", "Complex Febrile Seizure"),
("Duration", "<15 minutes", ">15 minutes"),
("Type", "Generalised (tonic-clonic)", "May be FOCAL"),
("Recurrence (24 h)", "Single event in 24 h", "Recurs within 24 h"),
("Post-ictal", "Rapidly returns to normal", "May have Todd's paresis"),
("EEG", "Not indicated", "May be indicated"),
("Risk of epilepsy", "~2% (= general population)", "6–49% depending on features"),
("LP", "Only if meningism signs", "Strongly consider LP"),
("Management", "Reassurance + fever control", "Investigate; consider AED if high-risk"),
]
def simple_vs_complex_table():
col_w = [4.2*cm, 6.2*cm, 6.2*cm] # narrowed slightly
header = [
Paragraph("Feature", col_head),
Paragraph("Simple Febrile Seizure", col_head),
Paragraph("Complex Febrile Seizure", col_head),
]
table_data = [header]
for i, (feat, simple, cplx) in enumerate(simple_vs_complex[1:]):
shade = (i % 2 == 0)
bg = GREY_LIGHT if shade else WHITE
table_data.append([
Paragraph(feat, row_label),
Paragraph(simple, cell_style),
Paragraph(cplx, cell_style),
])
t = Table(table_data, colWidths=col_w, repeatRows=1)
t.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,0), colors.HexColor("#2e6da4")),
("TEXTCOLOR", (0,0),(-1,0), WHITE),
("FONTNAME", (0,0),(-1,0), "Helvetica-Bold"),
("ALIGN", (0,0),(-1,0), "CENTER"),
("VALIGN", (0,0),(-1,-1), "TOP"),
("GRID", (0,0),(-1,-1), 0.4, colors.HexColor("#b0b0b0")),
("LINEBELOW", (0,0),(-1,0), 1.2, BLUE_DARK),
("TOPPADDING", (0,0),(-1,-1), 5),
("BOTTOMPADDING", (0,0),(-1,-1), 5),
("LEFTPADDING", (0,0),(-1,-1), 5),
("RIGHTPADDING", (0,0),(-1,-1), 5),
("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_LIGHT]),
]))
return t
high_yield_mnemonics = [
('SIMPLE febrile seizure: "GANG"',
"G – Generalised • A – Age 6 months–5 yrs • N – No recurrence in 24 h • G – Gone in <15 min"),
('COMPLEX febrile seizure: "FAR"',
"F – Focal • A – Again within 24 h • R – Range extended (>15 min)"),
("Risk of epilepsy after FS",
"1 complex feature = 6% | 2 features = 17% | 3 features = 49%"),
("Epilepsy vs Febrile Seizure",
"Epilepsy = seizures WITHOUT fever, UNPROVOKED, RECURRENT"),
("LP rule",
"LP NOT routine in simple FS. Perform if: meningism present / age <6 months / incomplete immunisation / pre-treated with antibiotics"),
("AED prophylaxis",
"NOT given for febrile seizures. Given only in epilepsy."),
]
def mnemonic_table():
data = [[Paragraph(title, cell_bold), Paragraph(body, cell_style)]
for title, body in high_yield_mnemonics]
t = Table(data, colWidths=[5.0*cm, 12.0*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), AMBER_LIGHT),
("GRID", (0,0),(-1,-1), 0.4, colors.HexColor("#d0c080")),
("VALIGN", (0,0),(-1,-1), "TOP"),
("TOPPADDING", (0,0),(-1,-1), 5),
("BOTTOMPADDING", (0,0),(-1,-1), 5),
("LEFTPADDING", (0,0),(-1,-1), 6),
("RIGHTPADDING", (0,0),(-1,-1), 6),
("ROWBACKGROUNDS",(0,0),(-1,-1),[AMBER_LIGHT, colors.HexColor("#fffde7")]),
]))
return t
# ═══════════════════════════════════════════════════════════════════
# BUILD DOCUMENT
# ═══════════════════════════════════════════════════════════════════
story = []
# Title
story.append(title_block())
story.append(Spacer(1, 0.4*cm))
# ── SECTION 1: Main Comparison ────────────────────────────────────
story.append(KeepTogether([
sec_bar("1. MAIN COMPARISON TABLE"),
Spacer(1, 0.15*cm),
comparison_table(comparison_rows),
Spacer(1, 0.1*cm),
]))
story.append(Spacer(1, 0.4*cm))
# ── SECTION 2: Simple vs Complex Febrile Seizure ─────────────────
story.append(sec_bar("2. SIMPLE vs COMPLEX FEBRILE SEIZURE", color=colors.HexColor("#1a5276")))
story.append(Spacer(1, 0.15*cm))
story.append(simple_vs_complex_table())
story.append(Spacer(1, 0.4*cm))
# ── SECTION 3: Risk Boxes ─────────────────────────────────────────
story.append(sec_bar("3. KEY RISK FACTORS", color=colors.HexColor("#1a5276")))
story.append(Spacer(1, 0.2*cm))
story.append(two_col_box(
"Features Defining COMPLEX Febrile Seizure",
risk_complex_items,
"Factors Predicting LATER EPILEPSY after FS",
risk_epilepsy_items,
left_bg=BLUE_LIGHT,
right_bg=AMBER_LIGHT,
))
story.append(Spacer(1, 0.4*cm))
# ── SECTION 4: High-Yield Points / Mnemonics ─────────────────────
story.append(sec_bar("4. HIGH-YIELD EXAM POINTS & MNEMONICS", color=colors.HexColor("#6e2fa8")))
story.append(Spacer(1, 0.15*cm))
story.append(mnemonic_table())
story.append(Spacer(1, 0.3*cm))
# ── SECTION 5: Must-Know One-Liners ──────────────────────────────
story.append(sec_bar("5. MUST-KNOW ONE-LINERS FOR MCQs", color=ORANGE))
story.append(Spacer(1, 0.15*cm))
oneliners = [
"Most common age for febrile seizure: 9–20 months (peak); range 6 months–5 years.",
"Most common type of febrile seizure: Simple generalised tonic-clonic.",
"EEG after a SIMPLE febrile seizure: NOT routinely indicated.",
"LP after febrile seizure: Only if signs of meningism; NOT routine.",
"Antipyretics (paracetamol) do NOT prevent recurrence of febrile seizures.",
"Drug of choice for ACUTE prolonged febrile seizure / status: IV/rectal Diazepam.",
"Prophylactic AED for febrile seizures: NOT recommended routinely.",
"Risk of epilepsy after simple FS: ~2% (barely above 0.5–1% in general population).",
"Risk of epilepsy with all 3 complex features: ~49% — IMPORTANT MCQ number.",
"98% of children with febrile seizures are seizure-free by age 5 years.",
"Dravet syndrome (SCNIA mutation): starts as prolonged febrile seizures in first year of life; progresses to refractory epilepsy.",
"GEFS+ (Generalised Epilepsy with Febrile Seizures Plus): febrile seizures + afebrile generalised seizures; autosomal dominant.",
"Febrile status epilepticus: associated with hippocampal injury and later temporal lobe epilepsy (mesial temporal sclerosis).",
"First-line AED for childhood absence epilepsy: Ethosuximide.",
"Most common childhood epilepsy with good prognosis: BECTS (Benign Childhood Epilepsy with Centro-Temporal Spikes); remits by puberty.",
]
story.append(single_box("", oneliners, bg=RED_SOFT, border=ORANGE))
story.append(Spacer(1, 0.4*cm))
# ── SECTION 6: Investigations Summary ────────────────────────────
story.append(sec_bar("6. INVESTIGATIONS SUMMARY", color=colors.HexColor("#145a32")))
story.append(Spacer(1, 0.15*cm))
inv_data = [
[Paragraph("Investigation", col_head),
Paragraph("Febrile Seizure (Simple)", col_head),
Paragraph("Febrile Seizure (Complex)", col_head),
Paragraph("Epilepsy", col_head)],
[Paragraph("EEG", row_label),
Paragraph("NOT routinely indicated", cell_style),
Paragraph("May be indicated", cell_style),
Paragraph("Essential; often diagnostic", cell_style)],
[Paragraph("MRI Brain", row_label),
Paragraph("NOT indicated", cell_style),
Paragraph("Consider if focal", cell_style),
Paragraph("Indicated (focal, structural epilepsy)", cell_style)],
[Paragraph("Lumbar Puncture", row_label),
Paragraph("Only if meningism; age <6 m; incomplete immunisation", cell_style),
Paragraph("Strongly consider", cell_style),
Paragraph("If first episode with fever to exclude meningitis", cell_style)],
[Paragraph("Blood tests", row_label),
Paragraph("Only for fever source; not the seizure", cell_style),
Paragraph("Glucose, electrolytes, cultures", cell_style),
Paragraph("Targeted (metabolic screen in new-onset)", cell_style)],
[Paragraph("Genetic testing", row_label),
Paragraph("Not routine", cell_style),
Paragraph("If Dravet suspected (SCN1A)", cell_style),
Paragraph("When syndrome suggests (SCNIA, KCNQ2, etc.)", cell_style)],
]
inv_t = Table(inv_data, colWidths=[3.5*cm, 4.3*cm, 4.3*cm, 4.3*cm], repeatRows=1)
inv_t.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,0), colors.HexColor("#145a32")),
("TEXTCOLOR", (0,0),(-1,0), WHITE),
("FONTNAME", (0,0),(-1,0), "Helvetica-Bold"),
("ALIGN", (0,0),(-1,0), "CENTER"),
("VALIGN", (0,0),(-1,-1), "TOP"),
("GRID", (0,0),(-1,-1), 0.4, colors.HexColor("#b0c0b0")),
("LINEBELOW", (0,0),(-1,0), 1.2, colors.HexColor("#0b3d22")),
("TOPPADDING", (0,0),(-1,-1), 5),
("BOTTOMPADDING", (0,0),(-1,-1), 5),
("LEFTPADDING", (0,0),(-1,-1), 5),
("RIGHTPADDING", (0,0),(-1,-1), 5),
("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, colors.HexColor("#e8f5e9")]),
]))
story.append(inv_t)
story.append(Spacer(1, 0.5*cm))
# ── Footer ────────────────────────────────────────────────────────
story.append(HRFlowable(width="100%", thickness=0.5, color=BLUE_MID))
story.append(Spacer(1, 0.1*cm))
story.append(Paragraph(
"Sources: Harrison's Principles of Internal Medicine 22e (2025) • Adams & Victor's Principles of Neurology 12e • "
"Bradley & Daroff's Neurology in Clinical Practice • Rosen's Emergency Medicine • Tintinalli's Emergency Medicine • "
"Swanson's Family Medicine Review | For MBBS Final Year Examinations",
footer_style))
# ── Build ─────────────────────────────────────────────────────────
doc.build(story)
print("PDF created:", OUTPUT)
cd /tmp/workspace/febrile-seizure-pdf && python generate_pdf.py 2>&1
ls -lh /tmp/workspace/febrile-seizure-pdf/
Febrile Seizure vs Epilepsy Paeds
PDF Document · PDF
Can you make it a PDF? i dont want notes yeah , a comparison table covering all the filtered out important points only for the exam specific one
~/febrile-seizure-pdf/generate_clean.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.lib.styles import ParagraphStyle
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer, HRFlowable
from reportlab.lib.enums import TA_CENTER, TA_LEFT
OUTPUT = "/tmp/workspace/febrile-seizure-pdf/Febrile_Seizure_vs_Epilepsy_EXAM.pdf"
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
rightMargin=1.5*cm, leftMargin=1.5*cm,
topMargin=1.5*cm, bottomMargin=1.5*cm
)
# ── Colours ──────────────────────────────────────────────────────
NAVY = colors.HexColor("#0d2b4e")
BLUE_HDR = colors.HexColor("#1a5276")
BLUE_SUB = colors.HexColor("#2980b9")
ROW_SHADE = colors.HexColor("#eaf2fb")
WHITE = colors.white
TEXT = colors.HexColor("#111111")
GOLD = colors.HexColor("#d4ac0d")
LIGHT_GOLD = colors.HexColor("#fef9e7")
# ── Styles ────────────────────────────────────────────────────────
title_s = ParagraphStyle("T", fontName="Helvetica-Bold",
fontSize=16, textColor=WHITE, alignment=TA_CENTER, leading=20)
sub_s = ParagraphStyle("S", fontName="Helvetica",
fontSize=8.5, textColor=colors.HexColor("#aed6f1"),
alignment=TA_CENTER, leading=11)
hdr_s = ParagraphStyle("H", fontName="Helvetica-Bold",
fontSize=9.5, textColor=WHITE, alignment=TA_CENTER, leading=12)
feat_s = ParagraphStyle("F", fontName="Helvetica-Bold",
fontSize=8.5, textColor=NAVY, alignment=TA_LEFT, leading=11)
cell_s = ParagraphStyle("C", fontName="Helvetica",
fontSize=8.5, textColor=TEXT, alignment=TA_LEFT, leading=11)
foot_s = ParagraphStyle("FT", fontName="Helvetica-Oblique",
fontSize=7, textColor=colors.HexColor("#777777"), alignment=TA_CENTER)
# ── Data: (Feature, Febrile Seizure, Epilepsy) ───────────────────
ROWS = [
("Definition",
"Seizure WITH fever, NO CNS infection, in a neurologically NORMAL child",
"≥2 unprovoked (afebrile) recurrent seizures NOT triggered by fever"),
("Age of onset",
"6 months – 5 years (peak 9–20 months)",
"Any age; most childhood syndromes in first decade"),
("Relation to fever",
"ALWAYS with fever >38°C; occurs on RISING phase of temperature",
"NO fever relationship; occurs spontaneously"),
("Seizure type",
"Generalised tonic-clonic (symmetric) — SIMPLE type\nFocal features only in COMPLEX type",
"Variable: generalised, focal, absence, myoclonic — depends on syndrome"),
("Duration",
"Simple: <15 min\nComplex (febrile status): >15 min",
"Usually <2–3 min per episode; status epilepticus possible"),
("Recurrence in\nsame illness",
"Simple: does NOT recur within 24 h\nComplex: recurs within 24 h / same febrile illness",
"Recurs WITHOUT fever; triggered by sleep deprivation, stress, lights"),
("Focal features",
"Simple: ABSENT\nComplex: focal (Todd's paresis may follow)",
"Common in focal epilepsy (temporal / frontal lobe syndromes)"),
("Post-ictal phase",
"Brief; child returns to baseline QUICKLY",
"Prolonged confusion, drowsiness, or focal deficit may persist"),
("Neuro status\nbetween episodes",
"NORMAL — no neurological deficit",
"May have underlying neurological abnormality / developmental delay"),
("EEG",
"NORMAL inter-ictally\nNOT routinely indicated after simple FS",
"Abnormal inter-ictal EEG — ESSENTIAL for diagnosis & classification"),
("MRI / CT Brain",
"NOT routinely indicated after first simple FS",
"Indicated when focal seizure, structural cause, or atypical features"),
("Lumbar puncture",
"Only if signs of MENINGISM\nConsider: age <6 m / incomplete immunisation / pre-treated antibiotics",
"Not a routine test; only to exclude meningitis in first febrile episode"),
("Risk of future\nepilepsy",
"Simple FS: ~2% (≈ general population risk)\nComplex FS: 6% (1 feature) / 17% (2 features) / 49% (3 features)",
"Already diagnosed as epilepsy; ongoing risk depends on syndrome"),
("Recurrence risk",
"30–50% chance of ≥1 further febrile seizure; resolves by age 5",
"High without AED; seizures persist in most syndromes"),
("Family history",
"Family history of FEBRILE seizures (polygenic); positive ~25%",
"Family history of EPILEPSY; specific gene mutations in some syndromes"),
("Acute treatment",
"Diazepam IV/rectal if seizure >5 min\nSimple FS: NO antiepileptic needed",
"Benzodiazepine acutely; AED started for long-term control"),
("Long-term AED\nprophylaxis",
"NOT indicated — does NOT prevent later epilepsy\nRectal/oral diazepam at fever onset only in selected high-risk cases",
"INDICATED — valproate, carbamazepine, lamotrigine, ethosuximide etc."),
("Antipyretics",
"Do NOT prevent recurrence of febrile seizures",
"Not relevant"),
("Prognosis",
"EXCELLENT — 98% seizure-free by age 5; normal development & schooling",
"Variable: benign (BECTS remits by puberty) → refractory (Lennox-Gastaut)"),
("Key associated\nsyndromes",
"Dravet syndrome starts as prolonged FS in infancy (SCN1A mutation)\nGEFS+ — febrile + afebrile seizures; autosomal dominant",
"Absence epilepsy, JME, BECTS, West syndrome, Lennox-Gastaut etc."),
]
# ── Title block ───────────────────────────────────────────────────
title_tbl = Table([
[Paragraph("Febrile Seizure vs Epilepsy in Paediatrics", title_s)],
[Paragraph("MBBS Final Year | Exam-Focused Comparison | Harrison's 22e · Adams & Victor 12e · Bradley & Daroff's Neurology", sub_s)],
], colWidths=[18.0*cm])
title_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), NAVY),
("TOPPADDING", (0,0),(-1,-1), 8),
("BOTTOMPADDING", (0,0),(-1,-1), 7),
("LEFTPADDING", (0,0),(-1,-1), 10),
("RIGHTPADDING", (0,0),(-1,-1), 10),
]))
# ── Main table ────────────────────────────────────────────────────
COL_W = [3.8*cm, 7.1*cm, 7.1*cm]
header_row = [
Paragraph("Feature", hdr_s),
Paragraph("Febrile Seizure", hdr_s),
Paragraph("Epilepsy (Childhood)", hdr_s),
]
table_data = [header_row]
for i, (feat, feb, epi) in enumerate(ROWS):
table_data.append([
Paragraph(feat, feat_s),
Paragraph(feb, cell_s),
Paragraph(epi, cell_s),
])
main_tbl = Table(table_data, colWidths=COL_W, repeatRows=1)
main_tbl.setStyle(TableStyle([
# Header row
("BACKGROUND", (0,0), (-1,0), BLUE_HDR),
("LINEBELOW", (0,0), (-1,0), 1.5, NAVY),
# Alternating rows
("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, ROW_SHADE]),
# Grid
("GRID", (0,0), (-1,-1), 0.35, colors.HexColor("#aab7c4")),
("LINEAFTER", (0,0), (0,-1), 0.8, BLUE_SUB),
# Alignment & padding
("VALIGN", (0,0), (-1,-1), "TOP"),
("ALIGN", (0,0), (-1,0), "CENTER"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
# Feature column slightly bolder bg
("BACKGROUND", (0,1), (0,-1), colors.HexColor("#d6eaf8")),
]))
# ── Footer ────────────────────────────────────────────────────────
footer = Paragraph(
"Sources: Harrison's Principles of Internal Medicine 22e (2025) • Adams & Victor's Principles of Neurology 12e • "
"Bradley & Daroff's Neurology in Clinical Practice • Rosen's Emergency Medicine | MBBS Final Year Paediatrics",
foot_s)
# ── Build ─────────────────────────────────────────────────────────
story = [
title_tbl,
Spacer(1, 0.35*cm),
main_tbl,
Spacer(1, 0.25*cm),
HRFlowable(width="100%", thickness=0.5, color=BLUE_SUB),
Spacer(1, 0.08*cm),
footer,
]
doc.build(story)
print("Done:", OUTPUT)
cd /tmp/workspace/febrile-seizure-pdf && python generate_clean.py 2>&1
Febrile Seizure vs Epilepsy EXAM
PDF Document · PDF