I'm pediatrics postgraduate. Uh, I want to study the first revision of pediatrics in first six months, starting from hematology. Help me to figure out a, uh... Time table? I'm free now, uh, so, uh, from... Seven o'clock to ten o'clock and morning, uh, 5:30 to 6:30. So, accordingly, give me a timetable to, uh, from hematology, which are the topic I to study, how much time to spend on that topic. Likewise, a detailed, uh, Uh, the detailed timetable for hematology, then general pediatrics, nutrition, uh, neonatology, everything to cover. Please give me a detailed, uh, in PDF format.

Reading File
Running Command

mkdir -p /tmp/workspace/pediatrics-timetable && ls /tmp/workspace/pediatrics-timetable/

Writing File

~/pediatrics-timetable/generate_timetable.py


from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    PageBreak, HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import BaseDocTemplate, Frame, PageTemplate
from reportlab.lib.colors import HexColor

OUTPUT = "/tmp/workspace/pediatrics-timetable/Pediatrics_PG_Revision_Timetable.pdf"

# ── Colour Palette ────────────────────────────────────────────────────────────
DARK_BLUE   = HexColor("#1A3A5C")
MED_BLUE    = HexColor("#2E6DA4")
LIGHT_BLUE  = HexColor("#D6E8F7")
ACCENT      = HexColor("#E8A838")
GREEN       = HexColor("#1A7A4A")
LIGHT_GREEN = HexColor("#D4EDDA")
RED         = HexColor("#C0392B")
LIGHT_RED   = HexColor("#FADBD8")
PURPLE      = HexColor("#6C3483")
LIGHT_PURPLE= HexColor("#E8DAEF")
ORANGE      = HexColor("#CA6F1E")
LIGHT_ORANGE= HexColor("#FDEBD0")
TEAL        = HexColor("#117A65")
LIGHT_TEAL  = HexColor("#D1F2EB")
GRAY        = HexColor("#5D6D7E")
LIGHT_GRAY  = HexColor("#F2F3F4")
WHITE       = colors.white
BLACK       = colors.black

# ── Document setup ────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    rightMargin=1.5*cm, leftMargin=1.5*cm,
    topMargin=2*cm, bottomMargin=2*cm,
)

styles = getSampleStyleSheet()

def S(name, parent="Normal", **kw):
    return ParagraphStyle(name, parent=styles[parent], **kw)

# Custom styles
TITLE_S  = S("TITLE_S",  fontSize=22, textColor=WHITE,   alignment=TA_CENTER, fontName="Helvetica-Bold", leading=28, spaceAfter=4)
SUB_S    = S("SUB_S",    fontSize=12, textColor=WHITE,   alignment=TA_CENTER, fontName="Helvetica",      leading=16)
H1       = S("H1",       fontSize=15, textColor=WHITE,   alignment=TA_LEFT,   fontName="Helvetica-Bold", leading=20, spaceBefore=6, spaceAfter=4)
H2       = S("H2",       fontSize=12, textColor=WHITE,   alignment=TA_LEFT,   fontName="Helvetica-Bold", leading=16, spaceBefore=4, spaceAfter=3)
BODY     = S("BODY",     fontSize=9,  textColor=BLACK,   alignment=TA_LEFT,   fontName="Helvetica",      leading=13, spaceAfter=3)
BODY_B   = S("BODY_B",   fontSize=9,  textColor=BLACK,   alignment=TA_LEFT,   fontName="Helvetica-Bold", leading=13, spaceAfter=2)
SMALL    = S("SMALL",    fontSize=8,  textColor=GRAY,    alignment=TA_LEFT,   fontName="Helvetica",      leading=11)
CENT     = S("CENT",     fontSize=9,  textColor=BLACK,   alignment=TA_CENTER, fontName="Helvetica",      leading=12)
CENT_B   = S("CENT_B",   fontSize=9,  textColor=BLACK,   alignment=TA_CENTER, fontName="Helvetica-Bold", leading=12)
CENT_W   = S("CENT_W",   fontSize=9,  textColor=WHITE,   alignment=TA_CENTER, fontName="Helvetica-Bold", leading=12)
NOTE     = S("NOTE",     fontSize=8.5,textColor=DARK_BLUE,alignment=TA_LEFT,  fontName="Helvetica",      leading=12, spaceAfter=2)
BULLET   = S("BULLET",   fontSize=9,  textColor=BLACK,   alignment=TA_LEFT,   fontName="Helvetica",      leading=13, leftIndent=12, spaceAfter=1)

def colored_table_header(texts, bg, fg=WHITE, fontName="Helvetica-Bold", fontSize=9):
    return [Paragraph(f"<font color='#{fg.hexval()[2:]}' name='{fontName}'><b>{t}</b></font>", 
                      ParagraphStyle("th", fontSize=fontSize, textColor=fg, fontName=fontName, 
                                     alignment=TA_CENTER, leading=13))
            for t in texts]

def title_box(text, bg=DARK_BLUE, fg=WHITE):
    data = [[Paragraph(text, ParagraphStyle("tb", fontSize=14, textColor=fg,
                                            fontName="Helvetica-Bold", alignment=TA_CENTER, leading=18))]]
    t = Table(data, colWidths=[17.5*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("ROUNDEDCORNERS", [6]),
        ("BOX",  (0,0), (-1,-1), 1, bg),
        ("TOPPADDING",  (0,0), (-1,-1), 8),
        ("BOTTOMPADDING",(0,0), (-1,-1), 8),
    ]))
    return t

def section_box(text, bg=MED_BLUE):
    data = [[Paragraph(text, H2)]]
    t = Table(data, colWidths=[17.5*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("BOX", (0,0), (-1,-1), 0.5, bg),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING", (0,0), (-1,-1), 8),
    ]))
    return t

# ─────────────────────────────────────────────────────────────────────────────
# DATA: 6 months, ~24 weeks
# Study time per day: Morning 5:30-6:30 (1h) + Evening 7:00-10:00 (3h) = 4h/day
# Assuming 6 study days/week => 24 h/week => ~96 h/month
# ─────────────────────────────────────────────────────────────────────────────

SCHEDULE_INFO = [
    ["Morning Session", "5:30 AM – 6:30 AM", "1 hour", "Quick revision / MCQs / mnemonics / short notes review"],
    ["Evening Session", "7:00 PM – 10:00 PM", "3 hours", "Main study: reading, note-making, long topics"],
    ["Total per day", "–", "4 hours", "6 days/week (Sunday = light review / rest)"],
    ["Total per week", "–", "~24 hours", "Sunday: 1-2 h light review / revision of the week"],
    ["Total per month", "–", "~96 hours", ""],
]

# 6-month plan (26 weeks total)
# Month 1: Hematology (4 weeks)
# Month 2: Neonatology (4 weeks)
# Month 3: Nutrition + Growth & Development (3+1 weeks)
# Month 4: Infectious Diseases + Immunology/Vaccines (3+1 weeks)
# Month 5: Respiratory + Cardiology (2+2 weeks)
# Month 6: Nephrology + Neurology + Endocrine + Revision (1+2+1 weeks)

MONTHS = [
    {
        "num": 1,
        "name": "Hematology",
        "color": RED,
        "light": LIGHT_RED,
        "weeks": 4,
        "overview": (
            "Hematology is one of the highest-yield topics for pediatric PG exams. "
            "Focus on anemia (especially IDA, hemolytic anemias), hemoglobinopathies, "
            "bleeding disorders, and bone marrow failures. Devote extra time to thalassemia "
            "and sickle cell disease as these are exam favorites."
        ),
        "weekly": [
            {
                "week": 1,
                "theme": "Normal Hematopoiesis & Iron Deficiency Anemia (IDA)",
                "morning_focus": "MCQs on hematopoiesis, CBC values by age, iron metabolism flashcards",
                "days": [
                    ("Mon", "Hematopoiesis: sites by age, lineages, growth factors", "2 h reading + 1 h notes"),
                    ("Tue", "Normal CBC values across pediatric age groups", "1.5 h reading + 1.5 h table-making"),
                    ("Wed", "Iron metabolism: absorption, transport, storage, regulation", "2 h reading + 1 h notes"),
                    ("Thu", "IDA: etiology, pathophysiology, clinical features, investigations", "2 h reading + 1 h notes"),
                    ("Fri", "IDA: treatment (oral/IV iron), response, prevention", "1.5 h + 1.5 h MCQ practice"),
                    ("Sat", "Nutritional anemias: Folate deficiency, B12 deficiency, comparison", "2 h reading + 1 h notes"),
                    ("Sun", "REVIEW: Revise week's notes, attempt 30 MCQs on IDA + nutritional anemias", "1.5 h"),
                ],
            },
            {
                "week": 2,
                "theme": "Hemolytic Anemias & Hemoglobinopathies",
                "morning_focus": "Peripheral smear findings flashcards, hemolysis markers mnemonics",
                "days": [
                    ("Mon", "Approach to hemolytic anemia: intravascular vs extravascular, lab markers", "2 h + 1 h"),
                    ("Tue", "G6PD deficiency: genetics, triggers, variants, neonatal jaundice link", "2 h + 1 h"),
                    ("Wed", "Hereditary spherocytosis & elliptocytosis: genetics, smear, treatment", "2 h + 1 h"),
                    ("Thu", "Thalassemia major & minor: genetics, pathophysiology, Hb electrophoresis", "2 h + 1 h"),
                    ("Fri", "Thalassemia: clinical features, chelation therapy, complications, HLA", "2 h + 1 h"),
                    ("Sat", "Sickle cell disease: genetics, vaso-occlusion, acute chest, management", "2 h + 1 h"),
                    ("Sun", "REVIEW: 40 MCQs on hemolytic anemias + thalassemia + SCD", "1.5 h"),
                ],
            },
            {
                "week": 3,
                "theme": "Bleeding Disorders & Platelet Disorders",
                "morning_focus": "Coagulation cascade diagram revision, PT/APTT interpretation",
                "days": [
                    ("Mon", "Hemostasis overview: primary vs secondary, coagulation cascade", "2 h + 1 h"),
                    ("Tue", "Hemophilia A & B: genetics, factor levels, clinical grading, treatment", "2 h + 1 h"),
                    ("Wed", "von Willebrand disease: types, lab findings, DDAVP, treatment", "2 h + 1 h"),
                    ("Thu", "ITP (Immune Thrombocytopenia): acute vs chronic, management, IVIG", "2 h + 1 h"),
                    ("Fri", "DIC, TTP, HUS: differentiating features, MAHA, treatment", "2 h + 1 h"),
                    ("Sat", "Vitamin K deficiency bleeding (VKDB): early/classic/late, prophylaxis", "1.5 h + 1.5 h MCQ"),
                    ("Sun", "REVIEW: Bleeding disorders MCQs x40 + coagulation factor table revision", "1.5 h"),
                ],
            },
            {
                "week": 4,
                "theme": "Bone Marrow Failure, Leukemias & Lymphomas",
                "morning_focus": "Leukemia classification, ALL vs AML differentials on flashcards",
                "days": [
                    ("Mon", "Aplastic anemia: etiology, pancytopenia, Fanconi anemia, treatment", "2 h + 1 h"),
                    ("Tue", "ALL: classification (FAB, immunophenotype), favorable vs poor prognosis", "2 h + 1 h"),
                    ("Wed", "ALL management: induction, consolidation, maintenance; CNS prophylaxis", "2 h + 1 h"),
                    ("Thu", "AML in children: FAB M3 (APL), Down syndrome & AML, treatment", "1.5 h + 1.5 h"),
                    ("Fri", "Lymphomas: Hodgkin (Reed-Sternberg) vs NHL, staging (Ann Arbor)", "2 h + 1 h"),
                    ("Sat", "Hematology integration: full revision of Months 1 topics, weak areas", "3 h integration"),
                    ("Sun", "MOCK TEST: 60 MCQs on entire Hematology section + self-assessment", "2 h"),
                ],
            },
        ],
    },
    {
        "num": 2,
        "name": "Neonatology",
        "color": TEAL,
        "light": LIGHT_TEAL,
        "weeks": 4,
        "overview": (
            "Neonatology is a vast and high-yield topic. Prioritize neonatal resuscitation, "
            "jaundice management, respiratory distress, sepsis, and prematurity complications. "
            "Know phototherapy criteria and exchange transfusion thresholds by heart."
        ),
        "weekly": [
            {
                "week": 1,
                "theme": "Normal Newborn, Resuscitation & Prematurity",
                "morning_focus": "NRP algorithm steps, Apgar scoring mnemonics",
                "days": [
                    ("Mon", "Normal newborn: reflexes, vital signs, gestational age assessment (Ballard)", "2 h + 1 h"),
                    ("Tue", "Neonatal resuscitation (NRP): algorithm, medications, airway management", "2 h + 1 h"),
                    ("Wed", "Preterm infant: definition, classification (VLBW, ELBW), general care", "2 h + 1 h"),
                    ("Thu", "RDS (HMD): pathophysiology, surfactant therapy, CPAP, ventilation", "2 h + 1 h"),
                    ("Fri", "BPD, air leak syndromes (pneumothorax), TTN, MAS: compare & contrast", "2 h + 1 h"),
                    ("Sat", "IVH: grading (Papile), prevention (antenatal steroids), sequelae", "2 h + 1 h"),
                    ("Sun", "REVIEW: 35 MCQs on normal newborn + resuscitation + prematurity", "1.5 h"),
                ],
            },
            {
                "week": 2,
                "theme": "Neonatal Jaundice & Neonatal Infections",
                "morning_focus": "Phototherapy/exchange transfusion criteria tables (AAP nomogram)",
                "days": [
                    ("Mon", "Bilirubin metabolism; physiological vs pathological jaundice criteria", "2 h + 1 h"),
                    ("Tue", "Phototherapy: mechanism, criteria (Bhutani nomogram), intensive PT", "2 h + 1 h"),
                    ("Wed", "Exchange transfusion: criteria, double vs single volume, complications", "2 h + 1 h"),
                    ("Thu", "Kernicterus: bilirubin neurotoxicity, ABR, sequelae, BIND score", "1.5 h + 1.5 h"),
                    ("Fri", "Neonatal sepsis: EOS vs LOS, risk factors, organisms, blood culture", "2 h + 1 h"),
                    ("Sat", "Neonatal sepsis: antibiotics (ampicillin + gentamicin), TORCH infections", "2 h + 1 h"),
                    ("Sun", "REVIEW: 40 MCQs on jaundice + neonatal infections", "1.5 h"),
                ],
            },
            {
                "week": 3,
                "theme": "Neonatal Hypoglycemia, Seizures, NEC & Birth Defects",
                "morning_focus": "NEC staging (Bell criteria), seizure type mnemonics",
                "days": [
                    ("Mon", "Neonatal hypoglycemia: definition, Whipple's triad, causes, management", "2 h + 1 h"),
                    ("Tue", "Neonatal seizures: subtle/clonic/tonic/myoclonic; EEG, phenobarbitone", "2 h + 1 h"),
                    ("Wed", "NEC: pathophysiology, Bell staging, medical vs surgical management", "2 h + 1 h"),
                    ("Thu", "Neonatal hypocalcemia, hyponatremia, hypernatremia: causes & Rx", "2 h + 1 h"),
                    ("Fri", "Common neonatal surgical problems: TEF, CDH, omphalocele, gastroschisis", "2 h + 1 h"),
                    ("Sat", "Birth injuries: cephalohematoma, caput, Erb's palsy, fractures", "1.5 h + 1.5 h"),
                    ("Sun", "REVIEW: 35 MCQs on metabolic disorders + seizures + NEC", "1.5 h"),
                ],
            },
            {
                "week": 4,
                "theme": "SGA/LGA, Congenital Abnormalities & Neonatal Integration",
                "morning_focus": "SGA vs IUGR definitions, IDM complications list",
                "days": [
                    ("Mon", "SGA/IUGR vs LGA: definitions, causes, neonatal polycythemia, IDM", "2 h + 1 h"),
                    ("Tue", "Post-term neonate: complications, oligohydramnios, meconium aspiration", "1.5 h + 1.5 h"),
                    ("Wed", "Inborn errors: PKU, galactosemia, congenital hypothyroidism (neonatal screen)", "2 h + 1 h"),
                    ("Thu", "Retinopathy of prematurity (ROP): staging, screening criteria, treatment", "2 h + 1 h"),
                    ("Fri", "Breastfeeding: composition of breast milk, contraindications, jaundice link", "1.5 h + 1.5 h"),
                    ("Sat", "Full neonatology integration: weak area revision + past questions", "3 h"),
                    ("Sun", "MOCK TEST: 60 MCQs on entire Neonatology section", "2 h"),
                ],
            },
        ],
    },
    {
        "num": 3,
        "name": "Nutrition & Growth and Development",
        "color": GREEN,
        "light": LIGHT_GREEN,
        "weeks": 4,
        "overview": (
            "Nutrition is extremely high-yield for PG exams. Cover protein-energy malnutrition "
            "thoroughly (Kwashiorkor vs Marasmus criteria, SAM management). Growth charts, "
            "developmental milestones, and micronutrient deficiencies are frequently tested."
        ),
        "weekly": [
            {
                "week": 1,
                "theme": "Infant Feeding, Breastfeeding & Complementary Feeding",
                "morning_focus": "Breast milk composition flashcards, WHO breastfeeding recommendations",
                "days": [
                    ("Mon", "Breastfeeding: initiation, exclusive breastfeeding, WHO Baby-Friendly", "2 h + 1 h"),
                    ("Wed", "Breast milk vs formula: composition (protein, fat, carbs, immunoglobulins)", "2 h + 1 h"),
                    ("Tue", "Complementary feeding: when to start, what to start, iron-rich foods", "2 h + 1 h"),
                    ("Thu", "Infant formulas: cow milk vs soy vs hydrolysate; indications", "1.5 h + 1.5 h"),
                    ("Fri", "Weaning foods: IYCF guidelines, ICDS program, mid-day meal scheme", "1.5 h + 1.5 h"),
                    ("Sat", "Energy & protein requirements by age group (IAP & WHO charts)", "2 h + 1 h"),
                    ("Sun", "REVIEW: 30 MCQs on infant nutrition + breastfeeding", "1.5 h"),
                ],
            },
            {
                "week": 2,
                "theme": "Protein Energy Malnutrition (PEM) & SAM",
                "morning_focus": "Kwashiorkor vs Marasmus table, MUAC cutoffs, SAM management steps",
                "days": [
                    ("Mon", "Classification of malnutrition: Gomez, Waterlow, WHO, MUAC, CIAF", "2 h + 1 h"),
                    ("Tue", "Kwashiorkor: clinical features, pitting edema, hypoalbuminemia, flaky paint", "2 h + 1 h"),
                    ("Wed", "Marasmus vs Marasmic-Kwashiorkor: clinical comparison, WHZ criteria", "2 h + 1 h"),
                    ("Thu", "SAM: admission criteria, 10-step WHO management, F-75 vs F-100 diet", "2 h + 1 h"),
                    ("Fri", "Refeeding syndrome: pathophysiology, phosphate, prevention protocol", "1.5 h + 1.5 h"),
                    ("Sat", "CMAM: RUTF, outpatient management, NRC protocols", "2 h + 1 h"),
                    ("Sun", "REVIEW: 35 MCQs on PEM + SAM management", "1.5 h"),
                ],
            },
            {
                "week": 3,
                "theme": "Micronutrient Deficiencies & Vitamins",
                "morning_focus": "Vitamin deficiency clinical features rapid fire (A,D,C,B1,B2,B12,K,E)",
                "days": [
                    ("Mon", "Vitamin A: deficiency (XN, Bitot's), toxicity, supplementation schedule", "2 h + 1 h"),
                    ("Tue", "Vitamin D: rickets (biochemistry, X-ray findings), treatment, prophylaxis", "2 h + 1 h"),
                    ("Wed", "Vitamin C (Scurvy): Trummerfeld zone, ground glass bone, treatment", "1.5 h + 1.5 h"),
                    ("Thu", "B-vitamins: B1 (Beriberi/Wernicke), B2, B3 (Pellagra), B6, B12", "2 h + 1 h"),
                    ("Fri", "Zinc, iodine (cretinism), fluoride, selenium deficiencies", "2 h + 1 h"),
                    ("Sat", "Obesity: definition (BMI for age), complications, management in children", "2 h + 1 h"),
                    ("Sun", "REVIEW: 35 MCQs on micronutrients + vitamins", "1.5 h"),
                ],
            },
            {
                "week": 4,
                "theme": "Growth, Development & Developmental Disorders",
                "morning_focus": "Developmental milestone chart rapid revision (motor, language, social)",
                "days": [
                    ("Mon", "Physical growth: weight/height velocity charts, Tanner staging, bone age", "2 h + 1 h"),
                    ("Tue", "Developmental milestones: gross motor, fine motor, language, social by age", "2 h + 1 h"),
                    ("Wed", "Developmental assessment tools: Denver II, Gesell, DDST, DASII", "1.5 h + 1.5 h"),
                    ("Thu", "Global developmental delay, intellectual disability: causes & workup", "2 h + 1 h"),
                    ("Fri", "Autism spectrum disorder: diagnostic criteria (DSM-5), red flags, management", "2 h + 1 h"),
                    ("Sat", "ADHD, learning disability, cerebral palsy: overview and classification", "2 h + 1 h"),
                    ("Sun", "MOCK TEST: 60 MCQs on Nutrition + Growth & Development", "2 h"),
                ],
            },
        ],
    },
    {
        "num": 4,
        "name": "Infectious Diseases & Immunization",
        "color": PURPLE,
        "light": LIGHT_PURPLE,
        "weeks": 4,
        "overview": (
            "Infectious diseases cover a wide range of examinable conditions. Focus on common "
            "viral exanthems, bacterial infections (meningitis, typhoid, TB), and parasitic diseases. "
            "Immunization schedule (IAP/UIP) is always asked and must be memorized perfectly."
        ),
        "weekly": [
            {
                "week": 1,
                "theme": "Immunization & Vaccines",
                "morning_focus": "UIP + IAP vaccine schedule table, cold chain, contraindications",
                "days": [
                    ("Mon", "Principles of immunization: active vs passive, types of vaccines", "2 h + 1 h"),
                    ("Tue", "UIP vaccine schedule (BCG, OPV, DPT, HepB, measles, MR, JE, etc.)", "2 h + 1 h"),
                    ("Wed", "IAP recommended vaccines 2024: PCV, rotavirus, varicella, hepatitis A, HPV", "2 h + 1 h"),
                    ("Thu", "Vaccine adverse effects, contraindications, AEFI management", "1.5 h + 1.5 h"),
                    ("Fri", "Cold chain: 2-8°C maintenance, VVM, freeze-sensitive vs heat-sensitive", "1.5 h + 1.5 h"),
                    ("Sat", "Special vaccines: meningococcal, typhoid (Vi), rabies PEP, COVID in kids", "2 h + 1 h"),
                    ("Sun", "REVIEW: 35 MCQs on immunization schedule + cold chain + AEFIs", "1.5 h"),
                ],
            },
            {
                "week": 2,
                "theme": "Bacterial Infections: TB, Meningitis, Typhoid, Diphtheria",
                "morning_focus": "Mantoux interpretation criteria, TB drug dosages mnemonic (RHEZ)",
                "days": [
                    ("Mon", "Childhood TB: primary complex, Ghon focus, progressive primary TB", "2 h + 1 h"),
                    ("Tue", "TB diagnosis: Mantoux, IGRA, gene Xpert, FNAC, ADA; RNTCP vs NTEP", "2 h + 1 h"),
                    ("Wed", "TB treatment: DOTS, 2HRZE + 4HR, drug side effects, MDR-TB in children", "2 h + 1 h"),
                    ("Thu", "Bacterial meningitis: organisms by age, LP findings, dexamethasone, Rx", "2 h + 1 h"),
                    ("Fri", "Typhoid: Rose spots, relative bradycardia, Widal, treatment, complications", "2 h + 1 h"),
                    ("Sat", "Diphtheria: Bull neck, membrane, antitoxin; Pertussis: whoop, Bordet-Gengou", "2 h + 1 h"),
                    ("Sun", "REVIEW: 35 MCQs on bacterial infections", "1.5 h"),
                ],
            },
            {
                "week": 3,
                "theme": "Viral Exanthems, Malaria, Dengue & Parasites",
                "morning_focus": "Exanthem order of appearance (3C's of measles, Koplik spots, rash day)",
                "days": [
                    ("Mon", "Measles: prodrome, Koplik spots, rash, complications (SSPE, encephalitis)", "2 h + 1 h"),
                    ("Tue", "Chickenpox, Roseola, Rubella, HFMD: clinical differentiation", "2 h + 1 h"),
                    ("Wed", "Dengue: WHO classification (2009), NS1, dengue shock, platelet transfusion", "2 h + 1 h"),
                    ("Thu", "Malaria: P. falciparum severe malaria in children, WHO criteria, IV artesunate", "2 h + 1 h"),
                    ("Fri", "Enteric parasites: ascariasis, hookworm, giardia, E. histolytica, treatment", "2 h + 1 h"),
                    ("Sat", "Kala-azar (VL), filariasis, toxoplasmosis: clinical features and treatment", "2 h + 1 h"),
                    ("Sun", "REVIEW: 40 MCQs on viral diseases + parasitic infections + malaria", "1.5 h"),
                ],
            },
            {
                "week": 4,
                "theme": "Meningitis, Encephalitis, HIV in Children & SARI",
                "morning_focus": "CSF analysis comparison table (viral/bacterial/TB/fungal)",
                "days": [
                    ("Mon", "Viral encephalitis: herpes encephalitis (HSV), JE, enteroviral: treatment", "2 h + 1 h"),
                    ("Tue", "TB meningitis: hydrocephalus, CSF ADA, stages, anti-TB + steroids", "2 h + 1 h"),
                    ("Wed", "Pediatric HIV: WHO clinical staging, ARV initiation, opportunistic infections", "2 h + 1 h"),
                    ("Thu", "Pediatric HIV: PMTCT, cotrimoxazole prophylaxis, national PPTCT program", "1.5 h + 1.5 h"),
                    ("Fri", "SARI, COVID-19 in children, MIS-C: WHO criteria, treatment", "1.5 h + 1.5 h"),
                    ("Sat", "Infectious diseases integration: full revision + past questions review", "3 h"),
                    ("Sun", "MOCK TEST: 60 MCQs on entire Infectious Diseases + Immunization", "2 h"),
                ],
            },
        ],
    },
    {
        "num": 5,
        "name": "Respiratory & Cardiovascular Diseases",
        "color": MED_BLUE,
        "light": LIGHT_BLUE,
        "weeks": 4,
        "overview": (
            "Respiratory diseases (pneumonia, asthma, croup, bronchiolitis) and congenital heart "
            "diseases (CHD) are both high-yield. Know the IMCI classification for pneumonia, WHO "
            "criteria, asthma stepwise management (GINA), and acyanotic vs cyanotic CHD features."
        ),
        "weekly": [
            {
                "week": 1,
                "theme": "Respiratory: Pneumonia, Bronchiolitis, Croup",
                "morning_focus": "IMCI pneumonia classification, fast breathing cut-offs by age, WHO ARI",
                "days": [
                    ("Mon", "Approach to respiratory distress: tachypnea, retractions, SpO2 grading", "2 h + 1 h"),
                    ("Tue", "Pneumonia: WHO classification, IMCI, organisms by age, antibiotics", "2 h + 1 h"),
                    ("Wed", "Severe pneumonia, empyema, lung abscess: management, pleural tap", "2 h + 1 h"),
                    ("Thu", "Acute bronchiolitis: RSV, scoring (Wang score), nebulized hypertonic saline", "2 h + 1 h"),
                    ("Fri", "Croup (LTB): Westley score, racemic epi, dexamethasone; vs epiglottitis", "2 h + 1 h"),
                    ("Sat", "Foreign body aspiration: clinical features, CXR findings, bronchoscopy", "1.5 h + 1.5 h"),
                    ("Sun", "REVIEW: 35 MCQs on pneumonia + bronchiolitis + croup", "1.5 h"),
                ],
            },
            {
                "week": 2,
                "theme": "Asthma, CF & Chronic Lung Diseases",
                "morning_focus": "GINA stepwise asthma treatment table, peak flow interpretation",
                "days": [
                    ("Mon", "Asthma: pathophysiology, phenotypes (allergic vs non-allergic), triggers", "2 h + 1 h"),
                    ("Tue", "Asthma: GINA classification, stepwise treatment, ICS dose equivalents", "2 h + 1 h"),
                    ("Wed", "Acute severe asthma: PICU management, IV magnesium, IV salbutamol", "2 h + 1 h"),
                    ("Thu", "Cystic fibrosis: CFTR gene, sweat test, pancreatic insufficiency, DIOS", "2 h + 1 h"),
                    ("Fri", "CF: pulmonary management, Pseudomonas, TOBI, lung transplant", "2 h + 1 h"),
                    ("Sat", "Primary ciliary dyskinesia, pulmonary hypertension in children: overview", "1.5 h + 1.5 h"),
                    ("Sun", "REVIEW: 35 MCQs on asthma + CF + chronic lung diseases", "1.5 h"),
                ],
            },
            {
                "week": 3,
                "theme": "Congenital Heart Disease: Acyanotic",
                "morning_focus": "Acyanotic CHD mnemonic: left-to-right shunts, murmur characteristics",
                "days": [
                    ("Mon", "Classification of CHD: acyanotic vs cyanotic, with/without shunts", "2 h + 1 h"),
                    ("Tue", "VSD: types, natural history, Eisenmenger, surgical closure indications", "2 h + 1 h"),
                    ("Wed", "ASD (secundum/primum), PDA: clinical features, closure (device/indomethacin)", "2 h + 1 h"),
                    ("Thu", "PS, AS, coarctation of aorta: murmur, gradient, treatment", "2 h + 1 h"),
                    ("Fri", "AVSD (AV canal defect): Down syndrome link, complete vs partial", "1.5 h + 1.5 h"),
                    ("Sat", "Cardiac failure in children: BNP, diuretics, ACE inhibitors, digoxin", "2 h + 1 h"),
                    ("Sun", "REVIEW: 35 MCQs on acyanotic CHD", "1.5 h"),
                ],
            },
            {
                "week": 4,
                "theme": "Cyanotic CHD, Arrhythmias & Rheumatic Fever",
                "morning_focus": "5 T's of cyanotic CHD, hyperoxia test interpretation, tet spell management",
                "days": [
                    ("Mon", "TOF: anatomy (4 components), CXR (boot-shaped heart), Blalock-Taussig shunt", "2 h + 1 h"),
                    ("Tue", "TGA, Tricuspid atresia, Ebstein anomaly, TAPVC: clinical features & Rx", "2 h + 1 h"),
                    ("Wed", "Hypoplastic left heart syndrome (HLHS): Norwood procedure, single ventricle", "1.5 h + 1.5 h"),
                    ("Thu", "Arrhythmias: SVT (adenosine), WPW, long QT, complete heart block in children", "2 h + 1 h"),
                    ("Fri", "Acute Rheumatic Fever: Jones criteria (revised 2015), Sydenham chorea", "2 h + 1 h"),
                    ("Sat", "Rheumatic heart disease: mitral stenosis, prophylaxis with penicillin", "2 h + 1 h"),
                    ("Sun", "MOCK TEST: 60 MCQs on Respiratory + Cardiovascular", "2 h"),
                ],
            },
        ],
    },
    {
        "num": 6,
        "name": "Nephrology, Neurology, Endocrinology & Integration",
        "color": ORANGE,
        "light": LIGHT_ORANGE,
        "weeks": 4,
        "overview": (
            "The final month covers high-yield remaining topics and dedicated grand revision. "
            "Nephrotic syndrome, nephritic syndrome, UTI, seizures (ILAE classification), "
            "cerebral palsy, thyroid disorders, diabetes, and adrenal diseases are top priorities."
        ),
        "weekly": [
            {
                "week": 1,
                "theme": "Nephrology: NS, UTI, AGN & Renal Failure",
                "morning_focus": "Nephrotic vs nephritic differences table, UTI organisms & antibiotic choice",
                "days": [
                    ("Mon", "Nephrotic syndrome: minimal change, steroid-sensitive vs resistant, cyclophosphamide", "2 h + 1 h"),
                    ("Tue", "Nephritic syndrome: APSGN, IgA nephropathy, MPGN: ASO, C3, CXR", "2 h + 1 h"),
                    ("Wed", "UTI: clean catch, DMSA scan, MCUG, VUR grading, antibiotic prophylaxis", "2 h + 1 h"),
                    ("Thu", "AKI: KDIGO staging, RIFLE criteria, dialysis indications, peritoneal dialysis", "2 h + 1 h"),
                    ("Fri", "CKD in children: Schwartz formula (eGFR), hypertension, anaemia of CKD", "2 h + 1 h"),
                    ("Sat", "Hypertension in children: normative tables, workup, antihypertensives", "1.5 h + 1.5 h"),
                    ("Sun", "REVIEW: 35 MCQs on nephrology", "1.5 h"),
                ],
            },
            {
                "week": 2,
                "theme": "Neurology: Seizures, CP, Meningitis & Neuromuscular",
                "morning_focus": "ILAE seizure classification 2017, febrile seizure criteria, Dravet vs GEFS+",
                "days": [
                    ("Mon", "Seizures: focal vs generalized (ILAE 2017), EEG, first unprovoked seizure Rx", "2 h + 1 h"),
                    ("Tue", "Febrile seizures: simple vs complex, risk of epilepsy, management", "2 h + 1 h"),
                    ("Wed", "Epilepsy syndromes: West, Lennox-Gastaut, absence, juvenile myoclonic", "2 h + 1 h"),
                    ("Thu", "Cerebral palsy: GMFCS classification, types (spastic/dyskinetic/ataxic), Rx", "2 h + 1 h"),
                    ("Fri", "Muscular dystrophies: Duchenne (dystrophin, Gowers sign), Becker, steroid Rx", "2 h + 1 h"),
                    ("Sat", "Acute flaccid paralysis (AFP): polio vs GBS; neurofibromatosis, tuberous sclerosis", "2 h + 1 h"),
                    ("Sun", "REVIEW: 35 MCQs on neurology", "1.5 h"),
                ],
            },
            {
                "week": 3,
                "theme": "Endocrinology, Genetics & Metabolic Disorders",
                "morning_focus": "Diabetes type 1 criteria, DKA management steps, insulin dosing in children",
                "days": [
                    ("Mon", "Hypothyroidism: congenital (neonatal screen, treatment), acquired (Hashimoto)", "2 h + 1 h"),
                    ("Tue", "Hyperthyroidism (Graves): TRAb, propylthiouracil, neonatal thyrotoxicosis", "1.5 h + 1.5 h"),
                    ("Wed", "Type 1 DM: diagnosis (ISPAD criteria), DKA management, insulin regimens", "2 h + 1 h"),
                    ("Thu", "Adrenal disorders: CAH (21-hydroxylase), Addison, Cushing in children", "2 h + 1 h"),
                    ("Fri", "Short stature: GHD workup, bone age, GH stimulation test, IGF-1", "2 h + 1 h"),
                    ("Sat", "Down syndrome, Turner, Klinefelter, chromosomal disorders: clinical features", "2 h + 1 h"),
                    ("Sun", "REVIEW: 35 MCQs on endocrinology + genetics", "1.5 h"),
                ],
            },
            {
                "week": 4,
                "theme": "Grand Revision & Mock Tests",
                "morning_focus": "Rapid revision: top 10 formulas, drug doses, diagnostic criteria across all subjects",
                "days": [
                    ("Mon", "Grand revision: Hematology + Neonatology (key tables, flowcharts, mnemonics)", "3 h focused"),
                    ("Tue", "Grand revision: Nutrition + Growth + Infectious Diseases", "3 h focused"),
                    ("Wed", "Grand revision: Respiratory + Cardiovascular (CHD, asthma, rheumatic fever)", "3 h focused"),
                    ("Thu", "Grand revision: Nephrology + Neurology + Endocrinology", "3 h focused"),
                    ("Fri", "GRAND MOCK TEST 1: 100 MCQs (all topics) - timed exam practice", "3 h exam"),
                    ("Sat", "GRAND MOCK TEST 2: 100 MCQs - analysis, error log, weak area re-revision", "3 h exam + review"),
                    ("Sun", "Personal weak area revision + reading question bank explanations", "2 h"),
                ],
            },
        ],
    },
]

# ─────────────────────────────────────────────────────────────────────────────
# BUILD PDF
# ─────────────────────────────────────────────────────────────────────────────
story = []
W = 17.5 * cm

# ─── COVER PAGE ──────────────────────────────────────────────────────────────
story.append(Spacer(1, 1.5*cm))

cover_bg = Table(
    [[Paragraph("PEDIATRICS POSTGRADUATE", ParagraphStyle("cv1", fontSize=22, textColor=WHITE,
                                                           fontName="Helvetica-Bold", alignment=TA_CENTER, leading=28)),
      ],
     [Paragraph("6-Month First Revision Timetable", ParagraphStyle("cv2", fontSize=16, textColor=ACCENT,
                                                                     fontName="Helvetica-Bold", alignment=TA_CENTER, leading=22)),
      ],
     [Paragraph("Hematology  ·  Neonatology  ·  Nutrition  ·  Infectious Diseases  ·  Respiratory  ·  Cardiology  ·  Nephrology  ·  Neurology  ·  Endocrinology",
                ParagraphStyle("cv3", fontSize=9, textColor=LIGHT_BLUE, fontName="Helvetica",
                               alignment=TA_CENTER, leading=14, spaceBefore=4)),
      ],
    ],
    colWidths=[W],
)
cover_bg.setStyle(TableStyle([
    ("BACKGROUND", (0, 0), (-1, -1), DARK_BLUE),
    ("ROWBACKGROUNDS", (0, 0), (-1, -1), [DARK_BLUE, DARK_BLUE, DARK_BLUE]),
    ("TOPPADDING",  (0, 0), (-1, -1), 18),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 18),
    ("LEFTPADDING", (0, 0), (-1, -1), 20),
    ("RIGHTPADDING", (0, 0), (-1, -1), 20),
    ("BOX", (0, 0), (-1, -1), 2, ACCENT),
]))
story.append(cover_bg)
story.append(Spacer(1, 0.6*cm))

# Study windows
story.append(title_box("DAILY STUDY SCHEDULE", bg=MED_BLUE))
story.append(Spacer(1, 0.3*cm))

sw_data = [
    [Paragraph("Session", CENT_W), Paragraph("Time", CENT_W),
     Paragraph("Duration", CENT_W), Paragraph("Focus", CENT_W)],
]
for row in SCHEDULE_INFO:
    sw_data.append([Paragraph(row[0], CENT_B), Paragraph(row[1], CENT),
                    Paragraph(row[2], CENT), Paragraph(row[3], BODY)])

sw_t = Table(sw_data, colWidths=[3.5*cm, 3.5*cm, 2.5*cm, 8*cm], repeatRows=1)
sw_t.setStyle(TableStyle([
    ("BACKGROUND", (0, 0), (-1, 0), DARK_BLUE),
    ("TEXTCOLOR",  (0, 0), (-1, 0), WHITE),
    ("ROWBACKGROUNDS", (0, 1), (-1, -1), [LIGHT_GRAY, WHITE]),
    ("GRID", (0, 0), (-1, -1), 0.5, colors.grey),
    ("TOPPADDING",    (0, 0), (-1, -1), 5),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
    ("LEFTPADDING",   (0, 0), (-1, -1), 6),
    ("RIGHTPADDING",  (0, 0), (-1, -1), 6),
    ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
    ("FONTNAME", (0, 1), (2, -1), "Helvetica-Bold"),
]))
story.append(sw_t)
story.append(Spacer(1, 0.4*cm))

# Key principles box
princ_data = [
    [Paragraph("KEY STUDY PRINCIPLES", ParagraphStyle("kp", fontSize=11, textColor=DARK_BLUE,
                                                        fontName="Helvetica-Bold", alignment=TA_LEFT, leading=14))],
    [Paragraph(
        "1. Morning (5:30–6:30): Use for active recall — MCQs, flashcards, mnemonics, quick tables. Do NOT read new material.\n"
        "2. Evening (7:00–10:00): Main study block — read textbook, make notes, solve image-based questions.\n"
        "3. Sunday is a review day — revisit the whole week's topics, attempt a set of MCQs, update your error log.\n"
        "4. At the end of each month, do a mock test of 60–100 MCQs before moving to the next subject.\n"
        "5. Keep a personal ERROR LOG notebook — write wrong answers and revisit them every Sunday.\n"
        "6. References: Nelson's Textbook of Pediatrics, IAP Textbook, OP Ghai, Park's Preventive Pediatrics.",
        BODY
    )],
]
princ_t = Table(princ_data, colWidths=[W])
princ_t.setStyle(TableStyle([
    ("BACKGROUND", (0, 0), (-1, 0), LIGHT_BLUE),
    ("BACKGROUND", (0, 1), (-1, 1), LIGHT_GRAY),
    ("BOX",  (0, 0), (-1, -1), 1, MED_BLUE),
    ("LINEBELOW", (0, 0), (-1, 0), 1, MED_BLUE),
    ("TOPPADDING",    (0, 0), (-1, -1), 7),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 7),
    ("LEFTPADDING",   (0, 0), (-1, -1), 10),
    ("RIGHTPADDING",  (0, 0), (-1, -1), 10),
]))
story.append(princ_t)
story.append(Spacer(1, 0.4*cm))

# 6 month overview table
story.append(title_box("6-MONTH OVERVIEW AT A GLANCE", bg=DARK_BLUE))
story.append(Spacer(1, 0.3*cm))

ov_data = [
    [Paragraph("Month", CENT_W), Paragraph("Subject", CENT_W), Paragraph("Weeks", CENT_W),
     Paragraph("Key Subtopics", CENT_W), Paragraph("Approx. Hours", CENT_W)],
    ["1", "Hematology", "4", "IDA, Hemolytic anemias, Thalassemia, SCD, Bleeding disorders, Leukemias", "~96 h"],
    ["2", "Neonatology", "4", "Resuscitation, Jaundice, Prematurity, Sepsis, Metabolic, NEC, ROP", "~96 h"],
    ["3", "Nutrition & Growth/Development", "4", "PEM/SAM, Vitamins, Micronutrients, Milestones, ASD, ADHD", "~96 h"],
    ["4", "Infectious Diseases & Immunization", "4", "Vaccines (UIP/IAP), TB, Meningitis, Malaria, Dengue, HIV, Parasites", "~96 h"],
    ["5", "Respiratory & Cardiovascular", "4", "Pneumonia, Asthma, CF, Acyanotic/Cyanotic CHD, ARF, Arrhythmias", "~96 h"],
    ["6", "Nephrology + Neurology + Endocrine + Revision", "4", "NS, UTI, Seizures, CP, T1DM, CAH, Down Syndrome, Grand Mock Tests", "~96 h"],
]

for i in range(1, len(ov_data)):
    ov_data[i] = [Paragraph(str(ov_data[i][j]), CENT if j in [0,2,4] else BODY) for j in range(5)]

ov_t = Table(ov_data, colWidths=[1.5*cm, 4*cm, 1.8*cm, 7.7*cm, 2.5*cm], repeatRows=1)
month_colors = [RED, TEAL, GREEN, PURPLE, MED_BLUE, ORANGE]
ov_style = [
    ("BACKGROUND", (0, 0), (-1, 0), DARK_BLUE),
    ("TEXTCOLOR",  (0, 0), (-1, 0), WHITE),
    ("GRID", (0, 0), (-1, -1), 0.5, colors.grey),
    ("TOPPADDING",    (0, 0), (-1, -1), 4),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 4),
    ("LEFTPADDING",   (0, 0), (-1, -1), 5),
    ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
]
for i, col in enumerate(month_colors, 1):
    light = [LIGHT_RED, LIGHT_TEAL, LIGHT_GREEN, LIGHT_PURPLE, LIGHT_BLUE, LIGHT_ORANGE][i-1]
    ov_style.append(("BACKGROUND", (0, i), (0, i), col))
    ov_style.append(("TEXTCOLOR",  (0, i), (0, i), WHITE))
    ov_style.append(("BACKGROUND", (1, i), (-1, i), light))

ov_t.setStyle(TableStyle(ov_style))
story.append(ov_t)

# ─── MONTHLY DETAIL PAGES ────────────────────────────────────────────────────
for month in MONTHS:
    story.append(PageBreak())
    
    # Month header
    m_header = Table(
        [[Paragraph(f"MONTH {month['num']}", ParagraphStyle("mh1", fontSize=13, textColor=WHITE,
                                                              fontName="Helvetica-Bold", alignment=TA_CENTER, leading=16)),
          Paragraph(month['name'].upper(), ParagraphStyle("mh2", fontSize=18, textColor=WHITE,
                                                           fontName="Helvetica-Bold", alignment=TA_LEFT, leading=22)),
          Paragraph(f"{month['weeks']} WEEKS  |  ~{month['weeks']*24} HOURS", 
                    ParagraphStyle("mh3", fontSize=10, textColor=ACCENT,
                                   fontName="Helvetica", alignment=TA_RIGHT, leading=14))]],
        colWidths=[3*cm, 10*cm, 4.5*cm]
    )
    m_header.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), month['color']),
        ("TOPPADDING",    (0, 0), (-1, -1), 12),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 12),
        ("LEFTPADDING",   (0, 0), (-1, -1), 10),
        ("RIGHTPADDING",  (0, 0), (-1, -1), 10),
        ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
    ]))
    story.append(m_header)
    story.append(Spacer(1, 0.3*cm))
    
    # Overview
    ov_box = Table(
        [[Paragraph("Overview", ParagraphStyle("ovh", fontSize=10, textColor=month['color'],
                                                fontName="Helvetica-Bold", leading=14)),
          Paragraph(month['overview'], BODY)]],
        colWidths=[2.2*cm, 15.3*cm]
    )
    ov_box.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), month['light']),
        ("BOX",  (0, 0), (-1, -1), 1, month['color']),
        ("TOPPADDING",    (0, 0), (-1, -1), 7),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 7),
        ("LEFTPADDING",   (0, 0), (-1, -1), 8),
        ("VALIGN",        (0, 0), (-1, -1), "TOP"),
    ]))
    story.append(ov_box)
    story.append(Spacer(1, 0.4*cm))
    
    # Weekly detail
    for wk in month['weekly']:
        wk_elements = []
        
        # Week header
        wk_hdr = Table(
            [[Paragraph(f"WEEK {(month['num']-1)*4 + wk['week']}", 
                        ParagraphStyle("wknum", fontSize=10, textColor=WHITE, fontName="Helvetica-Bold",
                                       alignment=TA_CENTER, leading=14)),
              Paragraph(wk['theme'],
                        ParagraphStyle("wkth", fontSize=10, textColor=WHITE, fontName="Helvetica-Bold",
                                       alignment=TA_LEFT, leading=14))]],
            colWidths=[2.5*cm, 15*cm]
        )
        wk_hdr.setStyle(TableStyle([
            ("BACKGROUND", (0, 0), (-1, -1), month['color']),
            ("TOPPADDING",    (0, 0), (-1, -1), 5),
            ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
            ("LEFTPADDING",   (0, 0), (-1, -1), 8),
            ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
        ]))
        wk_elements.append(wk_hdr)
        
        # Morning focus
        mf_box = Table(
            [[Paragraph("☀ Morning Focus (5:30–6:30 AM):", 
                        ParagraphStyle("mfh", fontSize=8.5, textColor=ORANGE, fontName="Helvetica-Bold", leading=12)),
              Paragraph(wk['morning_focus'], SMALL)]],
            colWidths=[4.5*cm, 13*cm]
        )
        mf_box.setStyle(TableStyle([
            ("BACKGROUND", (0, 0), (-1, -1), LIGHT_ORANGE),
            ("BOX", (0, 0), (-1, -1), 0.5, ORANGE),
            ("TOPPADDING",    (0, 0), (-1, -1), 4),
            ("BOTTOMPADDING", (0, 0), (-1, -1), 4),
            ("LEFTPADDING",   (0, 0), (-1, -1), 6),
            ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
        ]))
        wk_elements.append(mf_box)
        
        # Day-wise table
        day_header = [
            Paragraph("Day", CENT_W),
            Paragraph("Topic / Activity (Evening 7–10 PM)", CENT_W),
            Paragraph("Time Split", CENT_W),
        ]
        day_data = [day_header]
        for idx, (day, topic, time) in enumerate(wk['days']):
            bg = month['light'] if idx % 2 == 0 else WHITE
            day_data.append([
                Paragraph(day, CENT_B),
                Paragraph(topic, BODY),
                Paragraph(time, CENT),
            ])
        
        day_t = Table(day_data, colWidths=[1.5*cm, 12*cm, 4*cm], repeatRows=1)
        day_style = [
            ("BACKGROUND", (0, 0), (-1, 0), month['color']),
            ("TEXTCOLOR",  (0, 0), (-1, 0), WHITE),
            ("GRID", (0, 0), (-1, -1), 0.4, colors.lightgrey),
            ("TOPPADDING",    (0, 0), (-1, -1), 4),
            ("BOTTOMPADDING", (0, 0), (-1, -1), 4),
            ("LEFTPADDING",   (0, 0), (-1, -1), 5),
            ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
        ]
        for i in range(1, len(day_data)):
            if i % 2 == 1:
                day_style.append(("BACKGROUND", (0, i), (-1, i), month['light']))
            # Sunday
            if wk['days'][i-1][0] == "Sun":
                day_style.append(("BACKGROUND", (0, i), (-1, i), HexColor("#FFF3CD")))
                day_style.append(("FONTNAME", (0, i), (-1, i), "Helvetica-BoldOblique"))
        day_t.setStyle(TableStyle(day_style))
        wk_elements.append(day_t)
        wk_elements.append(Spacer(1, 0.35*cm))
        
        story.append(KeepTogether(wk_elements[:3]))  # header + morning focus + start of table
        story.append(day_t)
        story.append(Spacer(1, 0.35*cm))

# ─── APPENDIX: QUICK REFERENCE ───────────────────────────────────────────────
story.append(PageBreak())
story.append(title_box("APPENDIX: QUICK REFERENCE — HIGH-YIELD FACTS FOR DAILY MORNING SESSIONS", bg=DARK_BLUE))
story.append(Spacer(1, 0.3*cm))

appendix_sections = [
    ("Hematology", RED, LIGHT_RED, [
        "IDA: MCV <70 fL in children, serum ferritin <12 ng/mL is diagnostic",
        "Thalassemia major: Hb electrophoresis shows HbF >90%, HbA absent",
        "Sickle cell: HbS >50% on electrophoresis; target cells, sickle cells on smear",
        "G6PD deficiency: Heinz bodies, bite cells; X-linked recessive",
        "ITP: platelet <100,000/μL, normal PT/APTT, no anemia; first-line: IVIG or steroids",
        "Hemophilia A: factor VIII deficiency; B: factor IX; both X-linked recessive",
        "DIC: ↑PT, ↑APTT, ↓fibrinogen, ↑D-dimer, thrombocytopenia",
        "ALL: most common childhood cancer; L1 most common (FAB); pre-B most common phenotype",
    ]),
    ("Neonatology", TEAL, LIGHT_TEAL, [
        "Phototherapy threshold (term): TSB >12 mg/dL (day 3–5) in healthy term neonate",
        "Exchange transfusion: TSB 20–25 mg/dL range (depends on gestation & risk factors)",
        "Neonatal sepsis EOS (<72 h): GBS, E. coli; LOS (>72 h): Staph epidermidis, Klebsiella",
        "RDS: lecithin:sphingomyelin (L:S ratio) <2:1 predicts immaturity; treat with surfactant",
        "NEC: Bell Stage II = radiological pneumatosis intestinalis; Stage III = perforation",
        "Normal newborn weight loss: up to 10% in first week; regains by day 10",
        "IVH: most common in <32 weeks; grade III–IV associated with poor neurodevelopment",
        "Hypoglycaemia: blood glucose <45 mg/dL in symptomatic neonate (treat immediately)",
    ]),
    ("Nutrition & Growth", GREEN, LIGHT_GREEN, [
        "SAM criteria (WHO): WHZ <-3 SD, or MUAC <11.5 cm (6–59 months), or bilateral pitting edema",
        "Kwashiorkor: hypoalbuminemia (<3 g/dL), pitting edema, flaky paint dermatosis, flag sign",
        "Vitamin D deficiency: ALP raised, Ca normal or low, phosphate low, PTH raised",
        "Rickets X-ray: widened metaphysis, cupping, fraying, Looser zones",
        "Vitamin A deficiency: night blindness (XN) → Bitot's spots (X1B) → keratomalacia (X3)",
        "Vitamin C (Scurvy): subperiosteal hemorrhage, Trummerfeld zone, ground glass bone density",
        "Normal milestones: social smile 6 wk, holds head 3 mo, sits 6 mo, walks 12–15 mo",
        "Weight formula: 1–6 yr = Age (yr) × 2 + 8; Length: 2–12 yr = Age × 6 + 77 cm",
    ]),
    ("Infections & Immunization", PURPLE, LIGHT_PURPLE, [
        "Mantoux positive: >10 mm in vaccinated child; >5 mm in immunocompromised / contact",
        "TB treatment 2HRZE + 4HR: H=INH, R=Rifampicin, Z=Pyrazinamide, E=Ethambutol",
        "UIP schedule key ages: BCG at birth; OPV 0,6,10,14 wk; DPT 6,10,14 wk; Measles 9&16 mo",
        "Dengue shock (Grade III/IV): narrow pulse pressure, cool extremities; use crystalloid 20 mL/kg",
        "Bacterial meningitis CSF: turbid, protein >100 mg/dL, glucose <40 mg/dL, PMN pleocytosis",
        "Childhood HIV: start ARV if <5 yr regardless of CD4; ART: 2NRTI + 1 NNRTI",
        "Measles complications: pneumonia most common; SSPE (subacute sclerosing panencephalitis): late",
        "Mumps: orchitis post-puberty; parotitis, meningitis, pancreatitis",
    ]),
    ("Respiratory & Cardiology", MED_BLUE, LIGHT_BLUE, [
        "Pneumonia fast breathing: <2 mo ≥60/min; 2–12 mo ≥50/min; 1–5 yr ≥40/min",
        "Croup: barking cough, stridor; Westley score ≥8 = severe; give dexamethasone 0.6 mg/kg",
        "Bronchiolitis: peak age 2–6 months; RSV most common; treat with O2 + hypertonic saline",
        "Asthma GINA step 1: SABA PRN; Step 2: low-dose ICS; Step 5: biologic (omalizumab)",
        "Cystic fibrosis: sweat chloride >60 mEq/L diagnostic; CFTR mutation on chromosome 7",
        "TOF: boot-shaped heart on CXR; right ventricular hypertrophy; cyanosis worsens with crying",
        "Hyperoxia test: if PaO2 >150 mmHg on 100% O2 → cardiac lesion unlikely",
        "ARF (Jones criteria 2015): 2 major OR 1 major + 2 minor criteria; streptococcal evidence required",
    ]),
    ("Nephrology, Neurology & Endocrine", ORANGE, LIGHT_ORANGE, [
        "Nephrotic syndrome: protein >3.5 g/day, albumin <2.5 g/dL, edema, hyperlipidemia",
        "MCNS (minimal change): steroid-sensitive; 80–90% remission with prednisolone 2 mg/kg/day",
        "UTI diagnosis: clean catch >10^5 CFU/mL; catheter sample >10^4 CFU/mL",
        "Schwartz formula (eGFR): 0.413 × Height (cm) / serum creatinine (mg/dL)",
        "Febrile seizure: simple (single, <15 min, generalized); complex (>15 min / focal / recurrent)",
        "Duchenne MD: Gowers sign, calf pseudohypertrophy, CK >10,000 IU/L; X-linked recessive",
        "Congenital hypothyroidism: T4 low + TSH high on neonatal screen → start levothyroxine immediately",
        "CAH (21-hydroxylase): salt-losing (↓cortisol, ↓aldosterone, ↑17-OHP, virilization in girls)",
    ]),
]

for sec_name, col, light, facts in appendix_sections:
    sec_hdr = Table(
        [[Paragraph(sec_name.upper(), ParagraphStyle("apph", fontSize=10, textColor=WHITE,
                                                      fontName="Helvetica-Bold", alignment=TA_LEFT, leading=13))]],
        colWidths=[W]
    )
    sec_hdr.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), col),
        ("TOPPADDING",    (0, 0), (-1, -1), 5),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
        ("LEFTPADDING",   (0, 0), (-1, -1), 8),
    ]))
    
    fact_rows = [[Paragraph(f"• {f}", BODY)] for f in facts]
    fact_t = Table(fact_rows, colWidths=[W])
    fact_t.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), light),
        ("ROWBACKGROUNDS", (0, 0), (-1, -1), [light, WHITE]),
        ("TOPPADDING",    (0, 0), (-1, -1), 3),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 3),
        ("LEFTPADDING",   (0, 0), (-1, -1), 10),
        ("BOX", (0, 0), (-1, -1), 0.5, col),
        ("LINEAFTER",  (0, 0), (-1, -1), 0.5, col),
    ]))
    
    story.append(KeepTogether([sec_hdr, fact_t, Spacer(1, 0.3*cm)]))

# ─── Final note ──────────────────────────────────────────────────────────────
story.append(Spacer(1, 0.4*cm))
final_note = Table(
    [[Paragraph(
        "Best of luck with your Pediatrics PG Revision! Stay consistent — 4 hours every day is more powerful than 12 hours on weekends. "
        "Use the morning slot religiously for active recall and keep your error log updated. You have got this.",
        ParagraphStyle("fn", fontSize=9.5, textColor=DARK_BLUE, fontName="Helvetica-BoldOblique",
                       alignment=TA_CENTER, leading=14)
    )]],
    colWidths=[W]
)
final_note.setStyle(TableStyle([
    ("BACKGROUND", (0, 0), (-1, -1), LIGHT_BLUE),
    ("BOX", (0, 0), (-1, -1), 1.5, MED_BLUE),
    ("TOPPADDING",    (0, 0), (-1, -1), 10),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 10),
    ("LEFTPADDING",   (0, 0), (-1, -1), 12),
    ("RIGHTPADDING",  (0, 0), (-1, -1), 12),
]))
story.append(final_note)

# ─── BUILD ───────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF generated: {OUTPUT}")
Running Command

cd /tmp/workspace/pediatrics-timetable && python generate_timetable.py 2>&1

Editing File

~/pediatrics-timetable/generate_timetable.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/pediatrics-timetable/generate_timetable.py'
Running Command

cd /tmp/workspace/pediatrics-timetable && python generate_timetable.py 2>&1

Running Command

ls -lh /tmp/workspace/pediatrics-timetable/Pediatrics_PG_Revision_Timetable.pdf

Your PDF is ready! Download it here:

Pediatrics PG Revision Timetable

PDF Document · PDF


Here is a summary of everything included in the PDF:

What's Inside

Daily Study Windows Used:
SessionTimeDurationUse
Morning5:30 – 6:30 AM1 hourActive recall: MCQs, flashcards, mnemonics
Evening7:00 – 10:00 PM3 hoursMain reading + note-making
Total4 h/day, 6 days/weekSunday = weekly review + MCQs

6-Month Subject Plan (~96 hours per month)

MonthSubjectWeeks
1Hematology4
2Neonatology4
3Nutrition + Growth & Development4
4Infectious Diseases + Immunization4
5Respiratory + Cardiovascular (CHD)4
6Nephrology + Neurology + Endocrine + Grand Revision4

Month 1 - Hematology (detailed breakdown as sample):

  • Week 1 - Normal hematopoiesis, IDA, nutritional anemias
  • Week 2 - Hemolytic anemias, G6PD, HS, Thalassemia, Sickle cell disease
  • Week 3 - Bleeding disorders: Hemophilia, ITP, DIC, vWD, VKDB
  • Week 4 - Aplastic anemia, ALL, AML, Lymphomas + Mock test (60 MCQs)
Each week has:
  • Day-by-day evening topics with time split
  • A morning session focus (MCQs / flashcards specific to that week's theme)
  • Sunday MCQ review session
The PDF also includes an Appendix with 8 rapid-fire high-yield fact sheets (one per subject) to use during your morning 5:30 AM sessions - things like diagnostic cutoffs, drug doses, and diagnostic criteria from Nelson's, IAP guidelines, and WHO protocols.
This is a shared conversation. Sign in to Orris to start your own chat.