attachment
attachment

What is the answer

B - Pyloric Stenosis
The classic presentation here is a 4-week-old infant with projectile vomiting after every feeding - this is the textbook description of hypertrophic pyloric stenosis.
Why B is correct:
  • Pyloric stenosis typically presents at 2-8 weeks of age (peak ~4 weeks)
  • The hallmark is forceful, projectile, non-bilious vomiting immediately after feeding
  • Caused by hypertrophy of the pyloric muscle, obstructing gastric outflow
  • Infants remain hungry after vomiting ("hungry vomiter")
  • Can lead to hypochloremic, hypokalemic metabolic alkalosis
  • Diagnosed with ultrasound; treated with pyloromyotomy (Ramstedt procedure)
Why the others are wrong:
  • A - Gastroenteritis: Causes vomiting + diarrhea, not isolated projectile vomiting; typically affects older children
  • C - Gastroesophageal reflux (GER): Causes regurgitation/spitting up, but NOT forceful projectile vomiting
  • D - Hirschsprung disease: Presents with failure to pass meconium and abdominal distension, not projectile vomiting
The key discriminator is "projectile" + post-feeding + 4-week-old - that triad points directly to pyloric stenosis.

Generate a quick reference guide for pediatric vomiting disorders

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Finding Sources
Reading File
I now have comprehensive textbook data from Rosen's Emergency Medicine, Robbins Pathology, Tintinalli's Emergency Medicine, and Bailey & Love's Surgery to compile a thorough reference guide.

Pediatric Vomiting Disorders - Quick Reference Guide

Sources: Rosen's Emergency Medicine, Tintinalli's Emergency Medicine, Robbins & Kumar Pathologic Basis of Disease, Bailey & Love's Surgery

Age-Based Differential at a Glance

Age GroupTop Causes to Consider
Newborn (0-2 wk)Esophageal atresia, malrotation/volvulus, intestinal atresia, meconium ileus, Hirschsprung disease, congenital adrenal hyperplasia, GER, sepsis
Infant (2-12 wk)Pyloric stenosis, malrotation, intussusception, GER, UTI, gastroenteritis
Infant (3-24 mo)Intussusception, Hirschsprung, GER, gastroenteritis, UTI, Meckel diverticulum
Child (>12 mo)Gastroenteritis, appendicitis, intussusception, cyclic vomiting, migraine, peptic ulcer, foreign body
Red flag: Bilious (green) vomiting = surgical emergency until proven otherwise. 1/3 to 1/2 of newborns with bilious vomiting have a surgical lesion (malrotation/volvulus or Hirschsprung disease).

Disorder-by-Disorder Reference


1. Hypertrophic Pyloric Stenosis (HPS)

FeatureDetails
Age2-8 weeks (peak ~4 weeks); rare after 12 weeks
SexMales 4-5x more common; first-born predisposition
Incidence1:250-900 live births
Vomiting typeForceful projectile, non-bilious vomiting shortly after every feeding
HungerInfant remains hungry immediately after vomiting ("hungry vomiter")
Classic signPalpable "olive" mass in right epigastrium; visible left-to-right peristaltic waves
LabsHypochloremic, hypokalemic metabolic alkalosis (HCO3 ≥29, Cl ≤98 mmol/L)
DiagnosisUltrasound: pyloric muscle thickness >4 mm, diameter >14 mm, length >19 mm; "string sign" on UGI
TreatmentPyloromyotomy (Ramstedt procedure) - surgical splitting of pyloric muscle
Risk factorsErythromycin/azithromycin in first 2 weeks of life; prematurity; Down syndrome; family history

2. Gastroesophageal Reflux (GER)

FeatureDetails
AgeBegins shortly after birth; peaks 4 months; usually resolves by 12-18 months
Vomiting typePassive regurgitation/spitting up; NOT projectile
Key distinctionStarts at birth, relatively constant (vs. pyloric stenosis which is progressive from 2-3 weeks)
Alarm featuresPoor weight gain, irritability, arching, apnea (GERD)
DiagnosisClinical; pH probe or endoscopy if complicated
TreatmentPositioning, thickened feeds, PPI/H2 blockers if symptomatic GERD

3. Intussusception

FeatureDetails
AgeMost common GI obstruction in children <2 years; peak 5-12 months
SexMales more common
Vomiting typePresent but secondary; colicky pain is dominant symptom
Classic triadColicky abdominal pain + palpable sausage-shaped mass + "currant jelly" stool (bloody mucus) - triad present in minority
Pain patternSevere episodic pain lasting 10-15 min, recurring every 15-30 min; child draws legs up
Lead pointUsually idiopathic (enlarged Peyer patches post-viral); >5 years: Meckel diverticulum, lymphoma, polyps
DiagnosisUltrasound ("target sign"); plain film "meniscus sign"; air enema is both diagnostic and therapeutic
TreatmentAir/hydrostatic enema reduction (first-line); surgery if failed or peritonitis

4. Hirschsprung Disease (Congenital Aganglionic Megacolon)

FeatureDetails
Incidence1:5,000 live births; boys 4-5x more common
Association10% with Down syndrome
PathophysiologyFailure of neural crest cell migration → absence of ganglion cells (Meissner + Auerbach plexuses) → functional obstruction → megacolon
HallmarkFailure to pass meconium within 48h of birth
PresentationChronic constipation, abdominal distension, bilious vomiting, failure to thrive
Classic sign"Squirt sign" - explosive stool release on rectal exam
DiagnosisBarium enema (narrowed aganglionic segment + proximal dilation); confirmed by rectal biopsy (absence of ganglion cells)
TreatmentSurgical resection of aganglionic segment

5. Malrotation with Midgut Volvulus

FeatureDetails
Age80% present in first month of life
Vomiting typeSudden onset bilious (green) vomiting = SURGICAL EMERGENCY
SignsAbdominal distension, bloody stools (late sign = ischemia), shock
DiagnosisUGI series: duodenojejunal junction not in left upper quadrant; "corkscrew" sign
TreatmentEmergency Ladd's procedure; every minute counts to prevent bowel necrosis

6. Gastroenteritis

FeatureDetails
AgeAny age
Vomiting typeAcute onset, accompanied by diarrhea, fever, exposure history
CauseViral (Rotavirus, Norovirus most common); bacterial
Key distinctionDiarrhea + systemic illness differentiates from structural causes
TreatmentOral rehydration therapy (ORT); IV fluids if severe dehydration

Danger Signs Requiring Urgent Evaluation

  • Bilious (green) vomiting at any age
  • Vomiting + bloody stools
  • Vomiting + severe abdominal distension
  • Vomiting + altered consciousness or fontanelle bulging (consider raised ICP, meningitis)
  • Signs of dehydration: sunken fontanelle, dry mucous membranes, decreased urine output, poor capillary refill
  • Failure to pass meconium within 48 hours

Quick Comparison: The Most Tested Distinctions

ClueDiagnosis
4-week-old, projectile non-bilious vomiting, hungry afterPyloric stenosis
Bilious vomiting, newbornMalrotation/volvulus (emergency)
Failure to pass meconium, constipation, Down syndromeHirschsprung disease
6-12 month old, intermittent colicky pain + currant jelly stoolIntussusception
Vomiting + diarrhea, fever, viral exposureGastroenteritis
Spitting up from birth, non-projectile, otherwise wellGastroesophageal reflux

According to amc guidelines

Asking for Preferences
Searching the Web

AMC Australian Medical Council exam pediatric GI vomiting topics syllabus 2024

Searching the Web

AMC MCQ exam pediatric surgery pyloric stenosis intussusception high yield topics

Reading Web Page

https://www.fellowacademy.com.au/articles/amc-mcq-exam-forma…

Here is your AMC-focused guide for pediatric GI vomiting disorders.

AMC Exam Tips: Pediatric GI Vomiting Disorders

Aligned with AMC MCQ Examination Specifications and Royal Children's Hospital (RCH) Melbourne Clinical Practice Guidelines (updated Sept 2025)

AMC Exam Context

  • Paediatrics = ~12.5% of the AMC MCQ blueprint
  • AMC questions test your ability to select the single best answer from 5 options - they reward knowing the classic presentation AND key investigations/management
  • The AMC tests Australian guidelines - the primary reference for pediatric vomiting is the RCH Melbourne Clinical Practice Guidelines

AMC High-Yield Framework: Vomiting by Type

The RCH guideline maps vomiting characteristics directly to diagnoses - this is exactly what AMC questions test:
Vomiting TypeSuspect
ProjectilePyloric stenosis
Bilious (dark green)GIT obstruction (surgical emergency)
BloodUpper GI haemorrhage / swallowed maternal blood
Early morningRaised intracranial pressure
With diarrhoeaGastroenteritis
With rectal bleedingIntussusception / Meckel's diverticulum / colitis
Cyclic patternCyclical vomiting syndrome
In neonate/infantConsider inborn errors of metabolism

Condition-by-Condition: AMC High-Yield Points


Pyloric Stenosis - AMC Must-Knows

Classic AMC stem: 4-6 week old male infant, progressive projectile non-bilious vomiting after feeds, hungry immediately after
What AMC testsAnswer
Vomiting characterForceful, projectile, non-bilious, post-prandial
Age at presentation2-8 weeks (peak ~4 weeks)
SexMales 4x more common
Classic exam signPalpable "olive" mass in right epigastrium
Visible on abdomenLeft-to-right peristaltic waves
Metabolic derangementHypochloraemic, hypokalaemic metabolic alkalosis
Best investigationUltrasound (pyloric thickness >4 mm, length >19 mm)
TreatmentPyloromyotomy (Ramstedt procedure) - after fluid/electrolyte correction
Pre-op priorityCorrect the metabolic alkalosis first before surgery
AMC trap: Do NOT take to theatre immediately - stabilise electrolytes first. Pyloric stenosis is an urgent, not emergency operation.

Intussusception - AMC Must-Knows

Classic AMC stem: 6-12 month old infant, sudden colicky abdominal pain, drawing legs up, vomiting, bloody mucous stool
What AMC testsAnswer
Age peak5-12 months
Classic triadColicky pain + sausage-shaped mass + "currant jelly" stool
First-line investigationAbdominal ultrasound ("target sign" or "doughnut sign")
Treatment (first-line)Air enema reduction (diagnostic + therapeutic)
Contraindication to enemaSigns of perforation (free air)
Fallback treatmentSurgical reduction
Common triggerEnlarged Peyer patches post-viral illness
RCH Guideline tip: Rectal bleeding + vomiting in an infant = intussusception until proven otherwise.

Hirschsprung Disease - AMC Must-Knows

Classic AMC stem: Neonate fails to pass meconium within 48 hours, abdominal distension, bilious vomiting
What AMC testsAnswer
Key hallmarkFailure to pass meconium within 48 hours of birth
AssociationDown syndrome (trisomy 21) in ~10% of cases
Rectal exam findingExplosive stool release = "squirt sign"
PathologyAbsent ganglion cells (aganglionosis) in distal colon
Confirmatory testRectal biopsy (absence of ganglion cells)
Diagnostic imagingBarium enema: narrowed distal segment + proximal dilation
TreatmentSurgical resection of aganglionic segment

Gastroenteritis - AMC Must-Knows

Classic AMC stem: Child with vomiting AND diarrhoea, fever, daycare or viral exposure
What AMC testsAnswer
Key distinctionDiarrhoea + fever differentiates from structural causes
Most common causeRotavirus (infants), Norovirus (older children)
Dehydration assessmentSunken fontanelle, dry mucous membranes, reduced urine, skin turgor
First-line treatmentOral rehydration therapy (ORT) - small frequent sips
Antiemetic (RCH guideline)Ondansetron: 2mg (8-15kg), 4mg (15-30kg), 8mg (>30kg)
When to admitSevere dehydration, unable to tolerate ORT, altered consciousness
AMC focus: Always assess dehydration severity. The AMC may ask about ORT vs IV fluids decision-making.

Gastroesophageal Reflux (GER/GORD) - AMC Must-Knows

What AMC testsAnswer
Key distinction from pyloric stenosisBegins from birth, constant (not progressive); non-projectile regurgitation
Alarm features (GORD)Poor weight gain, irritability, arching (Sandifer syndrome), apnoea
Investigation (if complicated)pH impedance study or endoscopy
First-line managementParental reassurance, positioning, thickened feeds
Drug therapyAlginate (Gaviscon) first; PPI (omeprazole) for confirmed GORD

RCH Guideline: Red Flags (AMC Often Tests These)

The RCH guideline lists these as red flags requiring urgent action:
  • Bilious vomiting = GIT obstruction, treat as surgical emergency
  • Projectile vomiting in a young infant = pyloric stenosis
  • Early morning vomiting = raised ICP (intracranial tumour, hydrocephalus)
  • Vomiting + headache = migraine or intracranial pathology
  • Vomiting + fever + stiff neck = meningitis
  • Vomiting + rectal bleeding = intussusception / Meckel's
  • Failure to pass meconium = Hirschsprung disease

AMC Exam Strategy Summary

Clue in stemGo-to diagnosis
4-week-old, projectile non-bilious, hungry afterPyloric stenosis
Neonate, bilious vomitingMalrotation/volvulus (emergency)
Neonate, no meconium, Down syndromeHirschsprung disease
6-12 months, currant jelly stool, colicky painIntussusception
Vomiting + diarrhoea + feverGastroenteritis
Spitting from birth, not projectile, thrivingGastroesophageal reflux
Vomiting + headache + papilloedemaRaised ICP
Cyclic vomiting, well between episodesCyclical vomiting syndrome
Key AMC principle: Bilious vomiting at any age = surgical emergency. This is the single most important rule in AMC paediatric GI questions.

RCH Clinical Practice Guidelines: Vomiting | AMC MCQ Specifications: amc.org.au

Create a pdf for amc guidelines for each and every topic

Reading File
Searching the Web

AMC MCQ exam high yield topics all specialties medicine surgery psychiatry paediatrics 2024 2025

Reading Web Page

https://www.fellowacademy.com.au/articles/amc-mcq-exam-forma…

Running Command

mkdir -p /home/daytona/workspace/amc-guidelines && ls /home/daytona/workspace/

Writing File

~/amc-guidelines/generate_amc_pdf.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,
    HRFlowable, PageBreak, 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

# ── Colour palette ──────────────────────────────────────────────
NAVY       = HexColor('#1A3A5C')
TEAL       = HexColor('#006B6B')
GOLD       = HexColor('#C8860A')
LIGHT_BLUE = HexColor('#D6EAF8')
LIGHT_TEAL = HexColor('#D0EFEF')
LIGHT_GOLD = HexColor('#FEF9E7')
WHITE      = colors.white
GREY_BG    = HexColor('#F4F6F7')
RED_ALERT  = HexColor('#C0392B')
GREEN_OK   = HexColor('#1E8449')
ORANGE     = HexColor('#D35400')
LIGHT_RED  = HexColor('#FADBD8')
DARK_GREY  = HexColor('#2C3E50')

# ── Styles ───────────────────────────────────────────────────────
styles = getSampleStyleSheet()

def make_style(name, parent='Normal', **kwargs):
    return ParagraphStyle(name, parent=styles[parent], **kwargs)

cover_title   = make_style('CoverTitle',   fontSize=32, textColor=WHITE,
                            alignment=TA_CENTER, fontName='Helvetica-Bold', leading=40)
cover_sub     = make_style('CoverSub',     fontSize=16, textColor=HexColor('#BDC3C7'),
                            alignment=TA_CENTER, fontName='Helvetica', leading=22)
cover_tag     = make_style('CoverTag',     fontSize=11, textColor=GOLD,
                            alignment=TA_CENTER, fontName='Helvetica-Bold')

chapter_title = make_style('ChapterTitle', fontSize=22, textColor=WHITE,
                            fontName='Helvetica-Bold', leading=28)
section_head  = make_style('SectionHead',  fontSize=14, textColor=NAVY,
                            fontName='Helvetica-Bold', leading=18, spaceAfter=4)
sub_head      = make_style('SubHead',      fontSize=11, textColor=TEAL,
                            fontName='Helvetica-Bold', leading=14, spaceAfter=3)
body_text     = make_style('BodyText2',    fontSize=9.5, textColor=DARK_GREY,
                            fontName='Helvetica', leading=13, spaceAfter=3)
bullet_style  = make_style('Bullet2',      fontSize=9.5, textColor=DARK_GREY,
                            fontName='Helvetica', leading=13, leftIndent=14,
                            bulletIndent=4, spaceAfter=2)
alert_style   = make_style('Alert',        fontSize=9.5, textColor=RED_ALERT,
                            fontName='Helvetica-Bold', leading=13,
                            leftIndent=10, spaceAfter=2)
tip_style     = make_style('Tip',          fontSize=9.5, textColor=GREEN_OK,
                            fontName='Helvetica-Bold', leading=13,
                            leftIndent=10, spaceAfter=2)
table_hdr     = make_style('TableHdr',     fontSize=9, textColor=WHITE,
                            fontName='Helvetica-Bold', alignment=TA_CENTER)
table_cell    = make_style('TableCell',    fontSize=8.5, textColor=DARK_GREY,
                            fontName='Helvetica', leading=12)
footer_style  = make_style('Footer',       fontSize=8, textColor=HexColor('#7F8C8D'),
                            alignment=TA_CENTER)

PAGE_W, PAGE_H = A4

# ── Helper builders ──────────────────────────────────────────────
def hline(color=TEAL, thickness=1):
    return HRFlowable(width='100%', thickness=thickness, color=color, spaceAfter=6, spaceBefore=4)

def chapter_banner(title, subtitle='', color=NAVY):
    data = [[Paragraph(title, chapter_title)],
            [Paragraph(subtitle, make_style('CSubtitle', fontSize=10, textColor=HexColor('#BDC3C7'),
                                             fontName='Helvetica'))]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), color),
        ('ROUNDEDCORNERS', [6]),
        ('TOPPADDING',    (0,0), (-1,-1), 12),
        ('BOTTOMPADDING', (0,0), (-1,-1), 12),
        ('LEFTPADDING',   (0,0), (-1,-1), 16),
    ]))
    return t

def info_table(headers, rows, col_widths=None, header_color=NAVY):
    if col_widths is None:
        n = len(headers)
        col_widths = [17*cm/n]*n
    header_row = [Paragraph(h, table_hdr) for h in headers]
    table_data = [header_row]
    for row in rows:
        table_data.append([Paragraph(str(c), table_cell) for c in row])
    t = Table(table_data, colWidths=col_widths)
    ts = TableStyle([
        ('BACKGROUND',    (0,0), (-1,0),  header_color),
        ('ROWBACKGROUNDS',(0,1), (-1,-1), [WHITE, GREY_BG]),
        ('GRID',          (0,0), (-1,-1), 0.4, HexColor('#BDC3C7')),
        ('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),
        ('ROUNDEDCORNERS',[4]),
    ])
    t.setStyle(ts)
    return t

def alert_box(text, bg=LIGHT_RED, border=RED_ALERT, label='RED FLAG'):
    data = [[Paragraph(f'<b>{label}:</b> {text}',
                        make_style('AlertBox', fontSize=9, textColor=RED_ALERT,
                                   fontName='Helvetica-Bold', leading=12))]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ('BACKGROUND',    (0,0),(-1,-1), bg),
        ('LEFTBORDERPADDING', (0,0), (-1,-1), 4),
        ('BOX',           (0,0),(-1,-1), 1.5, border),
        ('TOPPADDING',    (0,0),(-1,-1), 7),
        ('BOTTOMPADDING', (0,0),(-1,-1), 7),
        ('LEFTPADDING',   (0,0),(-1,-1), 10),
        ('ROUNDEDCORNERS',[4]),
    ]))
    return t

def tip_box(text, bg=LIGHT_TEAL, border=TEAL, label='AMC TIP'):
    data = [[Paragraph(f'<b>{label}:</b> {text}',
                        make_style('TipBox', fontSize=9, textColor=TEAL,
                                   fontName='Helvetica-Bold', leading=12))]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ('BACKGROUND',    (0,0),(-1,-1), bg),
        ('BOX',           (0,0),(-1,-1), 1.5, border),
        ('TOPPADDING',    (0,0),(-1,-1), 7),
        ('BOTTOMPADDING', (0,0),(-1,-1), 7),
        ('LEFTPADDING',   (0,0),(-1,-1), 10),
        ('ROUNDEDCORNERS',[4]),
    ]))
    return t

def bullet(text):
    return Paragraph(f'• {text}', bullet_style)

def sp(n=6):
    return Spacer(1, n)

# ── Page header/footer ───────────────────────────────────────────
def on_page(canvas, doc):
    canvas.saveState()
    # Header bar
    canvas.setFillColor(NAVY)
    canvas.rect(0, PAGE_H-1.2*cm, PAGE_W, 1.2*cm, fill=1, stroke=0)
    canvas.setFillColor(WHITE)
    canvas.setFont('Helvetica-Bold', 9)
    canvas.drawString(1.5*cm, PAGE_H-0.8*cm, 'AMC MCQ Quick Reference Guide')
    canvas.setFont('Helvetica', 9)
    canvas.drawRightString(PAGE_W-1.5*cm, PAGE_H-0.8*cm, f'Page {doc.page}')
    # Footer
    canvas.setFillColor(HexColor('#7F8C8D'))
    canvas.setFont('Helvetica', 7.5)
    canvas.drawCentredString(PAGE_W/2, 0.7*cm,
        'For AMC MCQ Exam Preparation | Based on Australian Clinical Guidelines | Updated 2025-26')
    canvas.restoreState()

# ── Document setup ───────────────────────────────────────────────
OUTPUT = '/home/daytona/workspace/amc-guidelines/AMC_Guidelines_Quick_Reference.pdf'
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    topMargin=1.8*cm, bottomMargin=1.5*cm,
    leftMargin=1.8*cm, rightMargin=1.8*cm,
    title='AMC MCQ Quick Reference Guide',
    author='Orris Medical AI',
)

story = []

# ════════════════════════════════════════════════════════════════
# COVER PAGE
# ════════════════════════════════════════════════════════════════
cover_bg = Table([['']], colWidths=[17*cm], rowHeights=[24*cm])
cover_bg.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),NAVY)]))
story.append(cover_bg)

# Overlay content on cover via nested table
cover_content = [
    [Paragraph('AMC MCQ', make_style('CT1', fontSize=48, textColor=GOLD,
                                      fontName='Helvetica-Bold', alignment=TA_CENTER))],
    [Paragraph('Quick Reference Guide', make_style('CT2', fontSize=26, textColor=WHITE,
                                                    fontName='Helvetica-Bold', alignment=TA_CENTER))],
    [Spacer(1, 0.5*cm)],
    [Paragraph('Australian Medical Council', make_style('CT3', fontSize=14, textColor=HexColor('#BDC3C7'),
                                                          fontName='Helvetica', alignment=TA_CENTER))],
    [Paragraph('All Clinical Disciplines | Exam-Ready Format', make_style('CT4', fontSize=11,
               textColor=GOLD, fontName='Helvetica-Bold', alignment=TA_CENTER))],
    [Spacer(1, 1*cm)],
    [Table([[
        Paragraph('150 MCQs', make_style('stat', fontSize=11, textColor=WHITE, fontName='Helvetica-Bold', alignment=TA_CENTER)),
        Paragraph('3.5 Hours', make_style('stat', fontSize=11, textColor=WHITE, fontName='Helvetica-Bold', alignment=TA_CENTER)),
        Paragraph('Pass: 250/500', make_style('stat', fontSize=11, textColor=WHITE, fontName='Helvetica-Bold', alignment=TA_CENTER)),
        Paragraph('6 Specialties', make_style('stat', fontSize=11, textColor=WHITE, fontName='Helvetica-Bold', alignment=TA_CENTER)),
    ]], colWidths=[4.25*cm]*4,
    style=TableStyle([
        ('BACKGROUND',(0,0),(-1,-1),TEAL),
        ('BOX',(0,0),(-1,-1),1,WHITE),
        ('LINEAFTER',(0,0),(2,0),0.5,WHITE),
        ('TOPPADDING',(0,0),(-1,-1),8),
        ('BOTTOMPADDING',(0,0),(-1,-1),8),
        ('ROUNDEDCORNERS',[6]),
    ]))],
    [Spacer(1, 1*cm)],
    [Paragraph('Medicine 30%  |  Surgery 20%  |  Paediatrics 12.5%',
               make_style('dist', fontSize=9, textColor=HexColor('#BDC3C7'),
                           fontName='Helvetica', alignment=TA_CENTER))],
    [Paragraph('O&G 12.5%  |  Mental Health 12.5%  |  Population Health 12.5%',
               make_style('dist2', fontSize=9, textColor=HexColor('#BDC3C7'),
                           fontName='Helvetica', alignment=TA_CENTER))],
]

# Replace cover_bg with a proper positioned cover
story = []  # reset
cover_tbl = Table(cover_content, colWidths=[17*cm])
cover_tbl.setStyle(TableStyle([
    ('BACKGROUND', (0,0),(-1,-1), NAVY),
    ('TOPPADDING', (0,0),(-1,-1), 8),
    ('BOTTOMPADDING',(0,0),(-1,-1), 8),
    ('LEFTPADDING',(0,0),(-1,-1), 10),
    ('RIGHTPADDING',(0,0),(-1,-1), 10),
    ('ALIGN',(0,0),(-1,-1),'CENTER'),
    ('VALIGN',(0,0),(-1,-1),'MIDDLE'),
]))
story.append(cover_tbl)
story.append(PageBreak())

# ════════════════════════════════════════════════════════════════
# TABLE OF CONTENTS (simple)
# ════════════════════════════════════════════════════════════════
story.append(chapter_banner('Table of Contents', 'AMC MCQ All Disciplines', TEAL))
story.append(sp(12))
toc_items = [
    ('1', 'INTERNAL MEDICINE', 'Cardiology, Endocrinology, Respiratory, Gastroenterology, Neurology, Renal, Haematology, Rheumatology', '4'),
    ('2', 'SURGERY', 'General Surgery, Orthopaedics, Urology, Vascular, Neurosurgery', '9'),
    ('3', 'PAEDIATRICS', 'Neonatal, GI Disorders, Respiratory, Growth & Development, Immunisation', '13'),
    ('4', 'OBSTETRICS & GYNAECOLOGY', 'Antenatal Care, Labour, Postpartum, Gynaecology, Contraception', '17'),
    ('5', 'MENTAL HEALTH & PSYCHIATRY', 'Mood Disorders, Psychosis, Anxiety, Substance Abuse, Child Psych', '21'),
    ('6', 'POPULATION HEALTH & EMERGENCY', 'Screening, Ethics, Emergency Algorithms, Public Health, Indigenous Health', '25'),
]
for num, title, subtitle, page in toc_items:
    row_data = [[
        Paragraph(f'<b>{num}</b>', make_style('tocnum', fontSize=14, textColor=NAVY,
                                               fontName='Helvetica-Bold', alignment=TA_CENTER)),
        Paragraph(f'<b>{title}</b><br/><font size="8" color="#5D6D7E">{subtitle}</font>',
                  make_style('toctitle', fontSize=11, textColor=DARK_GREY, fontName='Helvetica-Bold')),
        Paragraph(f'<b>p.{page}</b>', make_style('tocpg', fontSize=11, textColor=TEAL,
                                                   fontName='Helvetica-Bold', alignment=TA_CENTER)),
    ]]
    t = Table(row_data, colWidths=[1.5*cm, 13.5*cm, 2*cm])
    t.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,-1), LIGHT_BLUE),
        ('BOX',(0,0),(-1,-1),0.5,HexColor('#AED6F1')),
        ('LEFTPADDING',(0,0),(-1,-1),8),
        ('RIGHTPADDING',(0,0),(-1,-1),8),
        ('TOPPADDING',(0,0),(-1,-1),8),
        ('BOTTOMPADDING',(0,0),(-1,-1),8),
        ('VALIGN',(0,0),(-1,-1),'MIDDLE'),
        ('ROUNDEDCORNERS',[4]),
    ]))
    story.append(t)
    story.append(sp(5))

story.append(PageBreak())

# ════════════════════════════════════════════════════════════════
# CHAPTER 1: INTERNAL MEDICINE
# ════════════════════════════════════════════════════════════════
story.append(chapter_banner('Chapter 1: Internal Medicine',
    'Medicine constitutes 30% of the AMC MCQ blueprint', NAVY))
story.append(sp(10))

# ── Cardiology ──────────────────────────────────────────────────
story.append(KeepTogether([
    Paragraph('CARDIOLOGY', section_head),
    hline(),
]))

story.append(Paragraph('Acute Coronary Syndrome (ACS)', sub_head))
story.append(info_table(
    ['Feature', 'STEMI', 'NSTEMI / UA'],
    [
        ['ECG', 'ST elevation, new LBBB', 'ST depression, T-wave inversion or normal'],
        ['Troponin', 'Elevated', 'Elevated (NSTEMI) / Normal (UA)'],
        ['Immediate Rx', 'Primary PCI within 90 min', 'Anticoagulation + risk stratification'],
        ['Antiplatelet', 'Aspirin 300mg + P2Y12 inhibitor', 'Same'],
        ['Key drug', 'Morphine, O2, Nitrates, Aspirin (MONA)', 'MONA + heparin'],
    ],
    col_widths=[4*cm, 6.5*cm, 6.5*cm]
))
story.append(sp(4))
story.append(tip_box('AMC often tests: Do NOT give nitrates if systolic BP <90 mmHg or right ventricular infarct (inferior STEMI). Avoid in phosphodiesterase inhibitor users.'))
story.append(sp(6))

story.append(Paragraph('Heart Failure', sub_head))
story.append(info_table(
    ['Type', 'EF', 'Key Features', 'Treatment'],
    [
        ['HFrEF', '<40%', 'Dilated, systolic dysfunction', 'ACEi/ARB + Beta-blocker + MRA + SGLT2i'],
        ['HFpEF', '>50%', 'Preserved systolic, diastolic dysfunction', 'Diuretics, control comorbidities, SGLT2i'],
        ['Acute HF', 'Either', 'Pulmonary oedema, orthopnoea', 'O2, IV furosemide, GTN infusion, sit upright'],
    ],
    col_widths=[2.5*cm, 2*cm, 6*cm, 6.5*cm]
))
story.append(sp(4))
story.append(alert_box('Bilateral crackles + S3 gallop + raised JVP + pitting oedema = cardiac failure. Order CXR, BNP, echo.'))
story.append(sp(6))

story.append(Paragraph('Atrial Fibrillation (AF)', sub_head))
story.append(info_table(
    ['Scenario', 'Management'],
    [
        ['Haemodynamically unstable AF', 'Immediate DC cardioversion'],
        ['AF <48 hours, stable', 'Rate OR rhythm control; anticoagulate if CHADS2-VASc ≥1 (♂) / ≥2 (♀)'],
        ['AF >48 hours or unknown duration', 'Rate control + anticoagulate ≥3 weeks before cardioversion; TOE-guided if urgent'],
        ['Rate control drugs', 'Beta-blockers (first line), diltiazem, digoxin (if HF)'],
        ['Anticoagulation', 'DOAC (rivaroxaban, apixaban) preferred over warfarin in non-valvular AF'],
    ],
    col_widths=[5.5*cm, 11.5*cm]
))
story.append(sp(8))

# ── Endocrinology ───────────────────────────────────────────────
story.append(KeepTogether([
    Paragraph('ENDOCRINOLOGY', section_head),
    hline(),
]))

story.append(Paragraph('Diabetes Mellitus', sub_head))
story.append(info_table(
    ['Parameter', 'Normal', 'Pre-diabetes', 'Diabetes'],
    [
        ['Fasting glucose', '<5.6 mmol/L', '5.6-6.9 mmol/L', '≥7.0 mmol/L'],
        ['2hr OGTT', '<7.8 mmol/L', '7.8-11.0 mmol/L', '≥11.1 mmol/L'],
        ['HbA1c', '<5.7%', '5.7-6.4%', '≥6.5%'],
        ['Random glucose', '-', '-', '≥11.1 + symptoms'],
    ],
    col_widths=[4.5*cm, 3.5*cm, 4*cm, 5*cm]
))
story.append(sp(5))
story.append(info_table(
    ['Type', 'First-Line Rx', 'Key Drug Notes'],
    [
        ['T2DM', 'Metformin (unless GFR <30)', 'Add SGLT2i if CVD/HF; GLP1-RA if obesity; insulin if HbA1c uncontrolled'],
        ['T1DM', 'Insulin (basal-bolus)', 'CSII (pump) for selected patients; check for coeliac, thyroid disease'],
        ['DKA', 'IV fluids + insulin infusion + K+ replacement', 'K+ must be ≥3.5 before starting insulin; switch to SC when eating'],
        ['HHS', 'Slow IV fluid replacement, heparin prophylaxis', 'Avoid rapid correction; BG target 10-15 mmol/L initially'],
    ],
    col_widths=[2.5*cm, 6*cm, 8.5*cm]
))
story.append(sp(4))
story.append(tip_box('Antenatal OGTT at 24-28 weeks is Australian guideline standard. GDM target: fasting <5.0, 2hr <6.7 mmol/L. First-line is diet; metformin/insulin if not controlled.'))
story.append(sp(6))

story.append(Paragraph('Thyroid Disorders', sub_head))
story.append(info_table(
    ['Disorder', 'TSH', 'T4/T3', 'Symptoms', 'Treatment'],
    [
        ['Hypothyroidism', 'High', 'Low', 'Fatigue, weight gain, cold intolerance, constipation, bradycardia', 'Levothyroxine (thyroxine)'],
        ['Hyperthyroidism (Graves)', 'Low', 'High', 'Weight loss, heat intolerance, tremor, tachycardia, exophthalmos', 'Carbimazole/PTU; beta-blocker for symptoms; radioiodine/surgery'],
        ['Thyroid storm', 'Very low', 'Very high', 'Fever, AF, altered consciousness, severe tachycardia', 'ICU; PTU, iodine (Lugol\'s), hydrocortisone, propranolol'],
        ['Subclinical hypothyroid', 'High', 'Normal', 'Minimal or none', 'Treat if TSH >10, symptomatic, or pregnant'],
    ],
    col_widths=[3*cm, 1.5*cm, 1.5*cm, 6*cm, 5*cm]
))
story.append(sp(8))

# ── Respiratory ─────────────────────────────────────────────────
story.append(KeepTogether([
    Paragraph('RESPIRATORY', section_head),
    hline(),
]))

story.append(info_table(
    ['Condition', 'Key Presentation', 'Investigation', 'Management'],
    [
        ['Asthma', 'Wheeze, SOB, chest tightness; reversible airflow obstruction', 'Spirometry: FEV1/FVC <0.7, reversible with bronchodilator', 'SABA PRN; add ICS; LABA + ICS; biologics for severe. Avoid NSAIDs/aspirin if sensitive.'],
        ['COPD', 'Smoker, chronic productive cough, progressive dyspnoea; FEV1/FVC <0.7 post-BD NOT reversible', 'Spirometry (post-bronchodilator), CXR, ABG', 'SABA + SAMA; LABA+LAMA; add ICS if frequent exacerbations; pulm rehab; O2 if pO2 <55 mmHg'],
        ['Pneumonia (CAP)', 'Fever, productive cough, consolidation on CXR', 'CXR, sputum, FBC, CRP; CURB-65 score', 'CURB-65 0-1: oral amoxicillin; ≥2: admit; ≥3: IV amox-clav + azithromycin'],
        ['PE', 'Pleuritic chest pain, SOB, tachycardia, DVT risk', 'D-dimer (if low probability), CTPA', 'Anticoagulate: DOAC (rivaroxaban) first line; thrombolyse if massive PE with haemodynamic compromise'],
        ['Pneumothorax (tension)', 'Tracheal deviation, absent breath sounds, hypotension', 'Clinical diagnosis - do NOT wait for CXR', 'Immediate needle decompression (2nd ICS MCL), then chest drain'],
    ],
    col_widths=[2.8*cm, 4.2*cm, 4*cm, 6*cm]
))
story.append(sp(4))
story.append(alert_box('Asthma prevalence is 11% in Australia - high-yield for AMC. Know the stepwise management and criteria for hospital admission (PEFR <50%, SpO2 <92%, inability to speak in sentences).'))
story.append(sp(8))

# ── Gastroenterology ────────────────────────────────────────────
story.append(KeepTogether([
    Paragraph('GASTROENTEROLOGY', section_head),
    hline(),
]))
story.append(info_table(
    ['Condition', 'Key Features', 'Investigation', 'Treatment'],
    [
        ['GORD', 'Heartburn, regurgitation, worse lying flat', 'Clinical; endoscopy if alarm features', 'PPI first line; lifestyle modification; surgery (fundoplication) for refractory'],
        ['Peptic Ulcer Disease', 'Epigastric pain; DU relieved by food; GU worse with food', 'Gastroscopy; H. pylori testing (UBT, faecal antigen)', 'PPI + triple therapy (amoxicillin + clarithromycin + PPI) for H. pylori'],
        ['IBD - Crohn\'s', 'Skip lesions, transmural, any GI; perianal disease', 'Colonoscopy + biopsy; CRP, FBC', 'Steroids (acute); azathioprine, biologics (infliximab) for maintenance'],
        ['IBD - Ulcerative Colitis', 'Continuous from rectum; blood + mucus PR', 'Colonoscopy; CRP; AXR for toxic megacolon', '5-ASA (mild-mod); steroids (acute flare); colectomy if medical failure'],
        ['Acute Pancreatitis', 'Epigastric pain radiating to back; N&V; raised lipase/amylase', 'Lipase (preferred), CT abdomen, USS', 'IV fluids, analgesia, NBM; ERCP if gallstone-induced'],
        ['Colorectal Cancer', 'Change in bowel habit, PR bleeding, weight loss, anaemia', 'Colonoscopy + biopsy; CEA; CT staging', 'Surgical resection; adjuvant chemotherapy if nodal involvement'],
    ],
    col_widths=[3*cm, 4.5*cm, 4*cm, 5.5*cm]
))
story.append(sp(8))

# ── Neurology ───────────────────────────────────────────────────
story.append(KeepTogether([
    Paragraph('NEUROLOGY', section_head),
    hline(),
]))
story.append(info_table(
    ['Condition', 'Key Differentiator', 'Investigation', 'Management'],
    [
        ['Ischaemic Stroke', 'Sudden focal deficit; FAST positive; within hours', 'Non-contrast CT head first (exclude bleed); MRI-DWI gold standard', 'tPA within 4.5hr if no contraindications; endovascular thrombectomy within 24hr in selected'],
        ['TIA', 'Deficit fully resolves <24hr (usually <1hr)', 'MRI brain + vessel imaging; ECG (AF); carotid USS', 'ABCD2 score; dual antiplatelet 21 days then single; urgent specialist review'],
        ['Haemorrhagic stroke', 'Sudden severe headache (SAH) or focal deficit; blood on CT', 'Non-contrast CT; LP if CT negative for SAH (xanthochromia)', 'Reverse anticoagulation; BP control; neurosurgical consult; nimodipine for SAH'],
        ['Meningitis', 'Fever + headache + neck stiffness + photophobia; Kernig/Brudzinski', 'LP (after CT to exclude raised ICP); blood cultures', 'Dexamethasone + ceftriaxone IV immediately; do NOT delay for CT if no focal signs'],
        ['Epilepsy (status)', 'Seizure >5 min or repeated without recovery', 'EEG; glucose; electrolytes; toxicology', '1st: IV/IM lorazepam/diazepam; 2nd: IV levetiracetam/phenytoin; 3rd: general anaesthesia'],
        ['Parkinson\'s Disease', 'TRAP: Tremor (rest), Rigidity, Akinesia, Postural instability', 'Clinical diagnosis; DaT scan if uncertain', 'Levodopa (most effective); dopamine agonists; MAO-B inhibitors'],
    ],
    col_widths=[3*cm, 4.5*cm, 4*cm, 5.5*cm]
))
story.append(sp(4))
story.append(tip_box('Cardioembolic stroke is most commonly from AF. AMC will test: start anticoagulation for AF stroke, timing 2-14 days depending on infarct size.'))
story.append(sp(6))

# ── Renal ───────────────────────────────────────────────────────
story.append(KeepTogether([
    Paragraph('RENAL / NEPHROLOGY', section_head),
    hline(),
]))
story.append(info_table(
    ['Condition', 'Na', 'Urine Na', 'Urine Osm', 'Treatment'],
    [
        ['Pre-renal AKI', 'Normal/high', '<20 mmol/L', '>500 mOsm/kg', 'IV fluid resuscitation'],
        ['Intrinsic renal AKI', 'Normal', '>40 mmol/L', '<350 mOsm/kg', 'Stop nephrotoxins; treat cause (e.g. steroids for GN)'],
        ['Post-renal AKI', 'Normal', '>40 mmol/L', 'Variable', 'Relieve obstruction (catheter, nephrostomy)'],
        ['CKD Stage 3-5', 'Normal to low', 'Variable', 'Variable', 'ACEi/ARB; BP control <130/80; SGLT2i; low-protein diet; dialysis if stage 5'],
        ['Hyperkalaemia >6.5', 'Variable', '-', '-', 'ECG changes: calcium gluconate IV → salbutamol/insulin-dextrose → resonium/dialysis'],
    ],
    col_widths=[3.5*cm, 1.5*cm, 2*cm, 2*cm, 8*cm]
))
story.append(sp(8))

story.append(PageBreak())

# ════════════════════════════════════════════════════════════════
# CHAPTER 2: SURGERY
# ════════════════════════════════════════════════════════════════
story.append(chapter_banner('Chapter 2: Surgery',
    'Surgery constitutes 20% of the AMC MCQ blueprint', TEAL))
story.append(sp(10))

story.append(Paragraph('ACUTE ABDOMEN', section_head))
story.append(hline())
story.append(info_table(
    ['Condition', 'Classic Features', 'Investigation', 'Management'],
    [
        ['Appendicitis', 'Periumbilical pain migrating to RIF; Rovsing, McBurney, Psoas signs; fever, raised WCC', 'CT abdomen (gold standard); USS (paeds/pregnancy); Alvarado score', 'Appendicectomy (laparoscopic); IV ceftriaxone + metronidazole'],
        ['Cholecystitis', 'RUQ pain after fatty meal; Murphy\'s sign; fever; raised WCC', 'USS (gallstones, thick GB wall); LFTs; ALP', 'IV fluids, antibiotics; laparoscopic cholecystectomy (early preferred)'],
        ['Bowel Obstruction (SBO)', 'Colicky pain, distension, vomiting, obstipation; ladder pattern on AXR', 'AXR (dilated loops >3cm, air-fluid levels); CT abdomen', 'NBM, NGT, IV fluids; surgery if no resolution in 48hr or strangulation signs'],
        ['Perforated Peptic Ulcer', 'Sudden severe epigastric pain; peritonism; free air under diaphragm', 'Erect CXR (free air); CT if uncertain', 'Resuscitate; IV antibiotics; emergency laparotomy or laparoscopic repair'],
        ['Mesenteric Ischaemia', 'Severe pain out of proportion to exam; AF or atherosclerosis history', 'CT angiography; raised lactate', 'Emergency surgery; embolectomy or bowel resection; anticoagulation'],
        ['Acute Pancreatitis', 'Epigastric pain to back, N+V, raised lipase; gallstones or alcohol', 'Lipase, LFTs, USS; CT (Balthazar) for severity', 'IV fluids (aggressive), analgesia, NBM; ERCP if CBD stone; HDU/ICU if severe'],
    ],
    col_widths=[3*cm, 5*cm, 3.5*cm, 5.5*cm]
))
story.append(sp(6))

story.append(Paragraph('HERNIA', section_head))
story.append(hline())
story.append(info_table(
    ['Type', 'Location', 'Key Feature', 'Management'],
    [
        ['Inguinal (indirect)', 'Lateral to inf. epigastric, through deep ring, into scrotum', 'Most common; young males; controlled by deep ring pressure', 'Laparoscopic or open repair (Lichtenstein)'],
        ['Inguinal (direct)', 'Medial to inf. epigastric, through Hesselbach triangle', 'Older males; weakness of posterior wall', 'Mesh repair'],
        ['Femoral', 'Below inguinal ligament, medial to femoral vein', 'More common in females; HIGH risk of strangulation', 'Urgent surgical repair'],
        ['Incisional', 'Through prior surgical scar', 'Obesity, infection risk factors', 'Mesh repair; optimise weight first'],
        ['Strangulated hernia', 'Any type, non-reducible + ischaemia signs', 'Pain, tenderness, peritonism, bowel obstruction', 'Emergency surgery'],
    ],
    col_widths=[3.5*cm, 4.5*cm, 4.5*cm, 4.5*cm]
))
story.append(sp(6))

story.append(Paragraph('ORTHOPAEDICS', section_head))
story.append(hline())
story.append(info_table(
    ['Condition', 'Mechanism/Age', 'Diagnosis', 'Management'],
    [
        ['NOF Fracture', 'Elderly female, osteoporosis, fall on hip; shortened/externally rotated leg', 'X-ray hip; MRI if X-ray negative', 'Total hip replacement (displaced); dynamic hip screw (undisplaced/subcapital)'],
        ['Colles Fracture', 'Elderly, FOOSH; dorsal angulation (dinner fork deformity)', 'X-ray wrist', 'Cast if undisplaced; ORIF if displaced/unstable'],
        ['Compartment Syndrome', 'Post-fracture, cast; pain on passive stretch; pulseless, paraesthesia, paralysis', 'Clinical - do NOT wait for imaging', 'Emergency fasciotomy - the 6 Ps: Pain, Pallor, Paraesthesia, Paralysis, Pulselessness, Perishingly cold'],
        ['Septic Arthritis', 'Hot, swollen joint; fever; child or immunocompromised', 'Joint aspiration (WCC >50,000); blood cultures', 'IV antibiotics + urgent surgical washout (emergency)'],
    ],
    col_widths=[3*cm, 4.5*cm, 3.5*cm, 6*cm]
))
story.append(sp(4))
story.append(alert_box('Compartment syndrome: 6 Ps. Do NOT delay fasciotomy waiting for pulses to disappear. Paraesthesia is the earliest symptom. Remove all casts immediately.'))
story.append(sp(6))

story.append(Paragraph('UROLOGY', section_head))
story.append(hline())
story.append(info_table(
    ['Condition', 'Key Feature', 'Investigation', 'Management'],
    [
        ['Testicular Torsion', 'Sudden scrotal pain; high-riding testis; absent cremasteric reflex; teenager', 'Clinical! Doppler USS (but do NOT delay surgery for it)', 'Emergency surgical exploration within 6 hours - manual detorsion while waiting'],
        ['Renal Colic', 'Loin to groin pain; haematuria; writhing in pain', 'CT KUB (non-contrast); urine dipstick', 'Analgesia (NSAIDs first line); alpha-blocker for stones <10mm; urological referral if >10mm'],
        ['BPH', 'Elderly male; hesitancy, poor flow, nocturia, incomplete emptying', 'PSA, USS, flow studies', 'Alpha-blockers (tamsulosin); 5-alpha reductase inhibitors; TURP if medical failure'],
        ['Bladder Cancer', 'Painless haematuria; smoker/aniline dye exposure', 'Cystoscopy + biopsy; CT urogram', 'TURBT for superficial; radical cystectomy for muscle-invasive; intravesical BCG for high-risk'],
    ],
    col_widths=[3*cm, 4.5*cm, 3.5*cm, 6*cm]
))
story.append(sp(4))
story.append(alert_box('Testicular torsion is a surgical emergency. Salvage rate is >90% within 6 hours, drops to <10% after 24 hours. Any acute scrotal pain in a young male = torsion until proven otherwise.'))
story.append(sp(8))

story.append(PageBreak())

# ════════════════════════════════════════════════════════════════
# CHAPTER 3: PAEDIATRICS
# ════════════════════════════════════════════════════════════════
story.append(chapter_banner('Chapter 3: Paediatrics',
    'Paediatrics = 12.5% of blueprint | Focus: neonatal, GI, respiratory, development, immunisation', GOLD))
story.append(sp(10))

story.append(Paragraph('NEONATAL EMERGENCIES', section_head))
story.append(hline())
story.append(info_table(
    ['Condition', 'Key Feature', 'Investigation', 'Management'],
    [
        ['Pyloric Stenosis', '4-week-old; forceful PROJECTILE non-bilious vomiting post-feed; hungry after; "olive" mass', 'Ultrasound (pyloric muscle >4mm, length >19mm); hypochloraemic hypokalaemic metabolic alkalosis', 'Correct electrolytes FIRST; then Ramstedt pyloromyotomy'],
        ['Malrotation + Volvulus', 'Neonate; BILIOUS (green) vomiting = SURGICAL EMERGENCY', 'UGI series: duodenojejunal junction not in left upper quadrant; "corkscrew" sign', 'Emergency Ladd\'s procedure; every minute counts'],
        ['Hirschsprung Disease', 'Failure to pass meconium in 48hr; abdominal distension; "squirt sign" on rectal exam', 'Barium enema (transition zone); confirmed by RECTAL BIOPSY', 'Surgical resection of aganglionic segment'],
        ['Necrotising Enterocolitis', 'Premature neonate; abdominal distension; bloody stools; pneumatosis intestinalis on AXR', 'AXR (bowel wall gas = pathognomonic); blood cultures', 'NBM, NGT, IV antibiotics (gentamicin + metronidazole + ampicillin); surgery if perforation'],
        ['Oesophageal Atresia', 'Neonate with excessive secretions; fails to tolerate feeds; CXR shows coiled NGT in oesophagus', 'CXR with NGT; check for VACTERL associations', 'Surgical repair; suction of secretions; O2 as needed'],
    ],
    col_widths=[3*cm, 4.5*cm, 4.5*cm, 5*cm]
))
story.append(sp(6))

story.append(Paragraph('PAEDIATRIC GI VOMITING - QUICK REFERENCE (RCH Guidelines)', section_head))
story.append(hline())
story.append(info_table(
    ['Vomiting Type', 'Suspect', 'Age', 'Key Management'],
    [
        ['Projectile, non-bilious, post-feed', 'Pyloric Stenosis', '2-8 weeks', 'USS → correct electrolytes → pyloromyotomy'],
        ['Bilious (dark green)', 'GIT obstruction / Volvulus', 'Any age', 'SURGICAL EMERGENCY - urgent imaging + surgery'],
        ['With diarrhoea + fever', 'Gastroenteritis', 'Any age', 'ORT; Ondansetron if needed; assess dehydration'],
        ['Colicky pain + currant jelly stool', 'Intussusception', '5-12 months', 'USS → air enema reduction; surgery if failed/perforated'],
        ['No meconium + distension', 'Hirschsprung Disease', 'Newborn', 'Rectal biopsy → surgical resection'],
        ['From birth, non-projectile, thriving', 'GER / GORD', '0-12 months', 'Reassurance; positioning; thickened feeds; PPI if GORD'],
        ['Early morning, with headache', 'Raised ICP', 'Any age', 'CT head urgently; neurosurgical review'],
        ['Cyclic, well between episodes', 'Cyclic Vomiting Syndrome', '5-15 years', 'Ondansetron; prophylaxis with amitriptyline/propranolol'],
    ],
    col_widths=[4*cm, 3.5*cm, 2.5*cm, 7*cm]
))
story.append(sp(4))
story.append(tip_box('RCH Ondansetron dosing for gastroenteritis: 8-15kg = 2mg; 15-30kg = 4mg; >30kg = 8mg. Do NOT use routinely - reserve for significant vomiting with dehydration risk.'))
story.append(sp(6))

story.append(Paragraph('PAEDIATRIC RESPIRATORY', section_head))
story.append(hline())
story.append(info_table(
    ['Condition', 'Age', 'Key Features', 'Management'],
    [
        ['Croup (Laryngotracheobronchitis)', '6 months-3 years', 'Barking cough, inspiratory stridor, seal-like, worse at night; parainfluenza virus', 'Mild: oral dexamethasone 0.15-0.6mg/kg; Moderate-Severe: add nebulised adrenaline; O2 if SpO2 <92%'],
        ['Bronchiolitis', '<2 years', 'RSV; wheeze + crackles; low-grade fever; tachypnoea; first episode', 'Supportive: O2 to keep SpO2 ≥92%; NG/IV feeds if respiratory distress; NO steroids/bronchodilators'],
        ['Asthma (Paeds)', '>2 years', 'Wheeze + cough + SOB; reversible; atopy history; positive FHx', 'Mild: salbutamol MDI; Moderate: repeat salbutamol + ipratropium + oral pred; Severe: IV magnesium + ICU'],
        ['Epiglottitis', '2-7 years', 'Tripod position, drooling, muffled voice, stridor, HIGH fever; Hib', 'DO NOT examine throat! Urgent anaesthesia + ENT; IV ceftriaxone; secure airway first'],
        ['Pertussis', 'Any (often infants)', 'Paroxysmal cough + inspiratory whoop + post-tussive vomiting + cyanosis', 'Azithromycin; isolate; notify public health; vaccination (DTPa schedule)'],
    ],
    col_widths=[3.5*cm, 2.5*cm, 5*cm, 6*cm]
))
story.append(sp(4))
story.append(alert_box('Epiglottitis: Do NOT attempt to examine the throat or lay the child down. Secure airway in theatre with ENT+anaesthesia present. Thumb sign on lateral neck X-ray.'))
story.append(sp(6))

story.append(Paragraph('AUSTRALIAN IMMUNISATION SCHEDULE (AMC High-Yield)', section_head))
story.append(hline())
story.append(info_table(
    ['Age', 'Vaccines Given'],
    [
        ['Birth', 'Hepatitis B (hepB)'],
        ['6 weeks', 'DTPa-IPV-HepB-Hib (Infanrix-hexa), Rotavirus (oral), Pneumococcal 13v (PCV13), Meningococcal B'],
        ['4 months', 'DTPa-IPV-HepB-Hib, Rotavirus (oral), PCV13, Meningococcal B'],
        ['6 months', 'DTPa-IPV-HepB-Hib, Rotavirus (oral if 3-dose), PCV13, Influenza (annual from 6mo)'],
        ['12 months', 'MMR (measles-mumps-rubella), Pneumococcal 23v, Meningococcal ACWY, Hib booster'],
        ['18 months', 'MMR + Varicella (MMRV), DTPa booster, Hib'],
        ['4 years', 'DTPa-IPV (Infanrix-IPV), MMR (or MMRV)'],
        ['Year 7', 'HPV (2 doses, 6-12 months apart), dTpa (adolescent booster), Meningococcal ACWY booster'],
    ],
    col_widths=[2.5*cm, 14.5*cm]
))
story.append(sp(4))
story.append(tip_box('Key AMC immunisation facts: 12 months = MenACWY + PCV23; 18 months = MMRV + DTPa. HPV given in Year 7. Influenza vaccine is annual from 6 months. Catch-up schedules exist for late presentations.'))
story.append(sp(8))

story.append(Paragraph('CHILD DEVELOPMENT MILESTONES', section_head))
story.append(hline())
story.append(info_table(
    ['Age', 'Gross Motor', 'Fine Motor', 'Language', 'Social'],
    [
        ['2 months', 'Head control briefly', 'Follows to midline', 'Coos, social smile', 'Recognises faces'],
        ['4 months', 'Head steady, pushes on arms', 'Reaches for objects', 'Laughs', 'Enjoys interaction'],
        ['6 months', 'Sits with support', 'Transfers objects', 'Babbles', 'Stranger anxiety emerging'],
        ['9 months', 'Pulls to stand', 'Pincer grip emerging', 'Mama/dada (non-specific)', 'Waves bye-bye'],
        ['12 months', 'Stands alone, first steps', 'Neat pincer grip', '1 word with meaning', 'Points, symbolic play'],
        ['18 months', 'Walks well', 'Tower of 2-3 blocks', '10-20 words', 'Parallel play'],
        ['2 years', 'Runs, kicks ball', 'Tower of 6 blocks', '50+ words, 2-word phrases', 'Tantrums, parallel play'],
        ['3 years', 'Climbs stairs alternating', 'Copies circle', '3-word sentences, name', 'Cooperative play'],
        ['4 years', 'Hops on one foot', 'Copies cross', 'Full sentences, tells stories', 'Imaginative play'],
    ],
    col_widths=[2*cm, 3.5*cm, 3.5*cm, 4*cm, 4*cm]
))
story.append(sp(4))
story.append(alert_box('Developmental RED FLAGS: No social smile by 3 months; no sitting by 9 months; no walking by 18 months; no words by 18 months; loss of previously acquired skills (regression) at ANY age.'))
story.append(sp(8))

story.append(PageBreak())

# ════════════════════════════════════════════════════════════════
# CHAPTER 4: OBSTETRICS & GYNAECOLOGY
# ════════════════════════════════════════════════════════════════
story.append(chapter_banner('Chapter 4: Obstetrics & Gynaecology',
    'O&G = 12.5% of AMC MCQ blueprint | Key: Australian antenatal guidelines', TEAL))
story.append(sp(10))

story.append(Paragraph('ANTENATAL CARE (Australian Guidelines)', section_head))
story.append(hline())
story.append(info_table(
    ['Timing', 'Screening / Action'],
    [
        ['First visit (<10 weeks)', 'Blood group + Rh, FBC, rubella immunity, hepatitis B+C, HIV, syphilis, urine MCS, STI screen, booking USS'],
        ['11-13+6 weeks', 'Combined first trimester screening: PAPP-A + beta-hCG + NT USS (Down syndrome, trisomy 18/13)'],
        ['18-20 weeks', 'Morphology USS (structural anomalies)'],
        ['24-28 weeks', 'OGTT (75g, 2hr) for GDM; repeat FBC; anti-D if Rh-ve'],
        ['28 weeks', 'Anti-D immunoglobulin 625 IU if Rh-ve (if no prior sensitisation)'],
        ['36 weeks', 'Group B Streptococcus (GBS) swab (vaginal + rectal); discuss birth plan'],
        ['GBS positive', 'IV penicillin in labour (benzyl penicillin); clindamycin if penicillin allergic'],
    ],
    col_widths=[3.5*cm, 13.5*cm]
))
story.append(sp(4))
story.append(tip_box('GDM diagnosis criteria (IADPSG/WHO): Fasting ≥5.1 mmol/L OR 1hr ≥10.0 OR 2hr ≥8.5 mmol/L. Treatment: dietary first; if not controlled → metformin or insulin.'))
story.append(sp(6))

story.append(Paragraph('HYPERTENSIVE DISORDERS OF PREGNANCY', section_head))
story.append(hline())
story.append(info_table(
    ['Condition', 'Definition', 'Features', 'Management'],
    [
        ['Gestational Hypertension', 'BP ≥140/90 after 20 weeks; NO proteinuria or features', 'Asymptomatic; monitor closely', 'Labetalol or nifedipine; deliver at 37-38 weeks if controlled'],
        ['Pre-eclampsia', 'BP ≥140/90 after 20 weeks + proteinuria ≥300mg/24hr OR organ damage', 'Headache, visual changes, RUQ pain, oedema, proteinuria', 'Antihypertensives; MgSO4 for seizure prevention; deliver at ≥37 weeks (mild) or urgently if severe'],
        ['Eclampsia', 'Pre-eclampsia + seizures', 'Tonic-clonic seizure', 'MgSO4 4g IV loading dose; then 1g/hr maintenance; deliver after stabilisation'],
        ['HELLP Syndrome', 'Haemolysis + Elevated LFTs + Low Platelets', 'RUQ/epigastric pain, N+V, jaundice, bleeding', 'Delivery is definitive; steroids if <34 weeks; platelet transfusion if <20'],
        ['Chronic Hypertension', 'Pre-existing or BP ≥140/90 before 20 weeks', 'Often asymptomatic', 'Safe drugs in pregnancy: methyldopa, labetalol, nifedipine. AVOID ACEi/ARB.'],
    ],
    col_widths=[3*cm, 4*cm, 4*cm, 6*cm]
))
story.append(sp(4))
story.append(alert_box('MgSO4 toxicity: Loss of patellar reflex (first sign), respiratory arrest (serum Mg >7 mmol/L). Antidote: IV calcium gluconate 1g. Monitor urine output and reflexes.'))
story.append(sp(6))

story.append(Paragraph('LABOUR & DELIVERY', section_head))
story.append(hline())
story.append(info_table(
    ['Complication', 'Key Feature', 'Management'],
    [
        ['PPH (Primary)', 'Blood loss >500mL vaginal or >1000mL LSCS; within 24hr', '4 Ts: Tone (most common 80%) → Trauma → Tissue → Thrombin. Oxytocin 10u IM + IV oxytocin; bimanual compression; uterotonic escalation; surgical if needed'],
        ['Shoulder Dystocia', 'Head delivers, turtle sign, shoulders impacted', 'McRoberts + suprapubic pressure (first line); Rubin II / Woods screw; last resort: Zavanelli'],
        ['Cord Prolapse', 'Umbilical cord before presenting part after membrane rupture', 'Manual elevation of presenting part; urgent LSCS; knee-chest position; O2'],
        ['Placenta Praevia', 'Painless bright red PV bleeding after 20 weeks; placenta covering os', 'NO digital vaginal exam; USS; elective LSCS if grade 3-4'],
        ['Placental Abruption', 'Painful dark red bleeding; hard uterus; fetal distress; trauma history', 'Resuscitate; CTG; emergency LSCS if fetal compromise; DIC risk'],
        ['Uterine Rupture', 'Previous scar; sudden scar pain; fetal bradycardia; presenting part recedes', 'Emergency LSCS + repair or hysterectomy; maternal and fetal emergency'],
    ],
    col_widths=[3.5*cm, 5*cm, 8.5*cm]
))
story.append(sp(6))

story.append(Paragraph('GYNAECOLOGY', section_head))
story.append(hline())
story.append(info_table(
    ['Condition', 'Key Features', 'Investigation', 'Management'],
    [
        ['Ectopic Pregnancy', 'Amenorrhoea + PV bleeding + lower abdominal pain; positive bHCG; empty uterus on USS', 'Transvaginal USS; serial bHCG', 'Haemodynamically unstable: emergency laparoscopy. Stable + small: methotrexate (if no contraindications)'],
        ['Ovarian Torsion', 'Sudden severe unilateral pain; nausea; Doppler may show absent flow', 'Pelvic USS + Doppler; laparoscopy', 'Emergency laparoscopic detorsion (preserve ovary if possible)'],
        ['Endometriosis', 'Dysmenorrhoea, dyspareunia, infertility; cyclical pain', 'Laparoscopy (gold standard); CA-125 elevated', 'Hormonal (OCP, Mirena, GnRH agonists); surgical excision if severe'],
        ['Cervical Cancer Screening (Australia)', 'Cervical Screening Test (HPV-based)', 'Every 5 years (ages 25-74); HPV test + reflex LBC', 'Colposcopy if HPV 16/18 positive or abnormal LBC'],
        ['PCOS', 'Oligomenorrhoea, hirsutism, acne, obesity; LH:FSH >2:1; polycystic ovaries', 'USS; LH, FSH, testosterone, SHBG; OGTT (insulin resistance)', 'Weight loss; OCP for cycles/hirsutism; metformin; clomiphene for fertility'],
    ],
    col_widths=[3*cm, 5*cm, 3.5*cm, 5.5*cm]
))
story.append(sp(4))
story.append(tip_box('Australian cervical screening: HPV-based test every 5 years for women aged 25-74. This replaced the 2-yearly Pap smear in 2017. Know this difference - it is a frequent AMC question.'))
story.append(sp(8))

story.append(PageBreak())

# ════════════════════════════════════════════════════════════════
# CHAPTER 5: MENTAL HEALTH & PSYCHIATRY
# ════════════════════════════════════════════════════════════════
story.append(chapter_banner('Chapter 5: Mental Health & Psychiatry',
    'Psychiatry = 12.5% of blueprint | Focus: first-line drugs, risk assessment, legal frameworks', NAVY))
story.append(sp(10))

story.append(Paragraph('MOOD DISORDERS', section_head))
story.append(hline())
story.append(info_table(
    ['Disorder', 'Diagnosis', 'First-Line Treatment', 'AMC Key Points'],
    [
        ['Major Depressive Disorder', '≥2 weeks: depressed mood OR anhedonia + ≥5 symptoms total (SIG E CAPS)', 'SSRI (sertraline, escitalopram); CBT for mild-mod; combination for moderate-severe', 'Minimum 6-12 months treatment after remission. Screen for bipolar before prescribing antidepressants.'],
        ['Bipolar I', 'At least one manic episode (≥7 days: DIGFAST); may have depressive episodes', 'Mood stabiliser: lithium (gold standard) or valproate; antipsychotic for acute mania', 'Lithium monitoring: thyroid, renal function, serum levels. Toxic level >1.5 mmol/L.'],
        ['Bipolar II', 'At least one hypomanic episode + at least one major depressive episode', 'Lithium or lamotrigine; quetiapine for depression phase', 'AVOID antidepressant monotherapy (can trigger mania)'],
        ['Persistent Depressive Disorder (Dysthymia)', '≥2 years of depressed mood (not meeting MDD criteria)', 'SSRI + psychotherapy', 'Chronic, lower severity; high comorbidity with anxiety and substance use'],
        ['Postpartum Depression', 'Within 4 weeks to 12 months post-delivery; affects 10-15%', 'Psychotherapy first line if mild; SSRI if moderate-severe (sertraline is safest in breastfeeding)', 'Distinct from baby blues (<2 weeks, self-limiting). Screen at 6-week check.'],
    ],
    col_widths=[3*cm, 4*cm, 4.5*cm, 5.5*cm]
))
story.append(sp(4))
story.append(tip_box('SIG E CAPS mnemonic for depression: Sleep changes, Interest loss, Guilt/worthlessness, Energy low, Concentration poor, Appetite change, Psychomotor change, Suicidal ideation.'))
story.append(sp(6))

story.append(Paragraph('PSYCHOTIC DISORDERS', section_head))
story.append(hline())
story.append(info_table(
    ['Disorder', 'Duration', 'Features', 'Treatment'],
    [
        ['Schizophrenia', '≥6 months (≥1 month active)', 'Positive: hallucinations (auditory command), delusions, disorganised speech. Negative: flat affect, alogia, avolition, anhedonia', 'Atypical antipsychotic (risperidone, olanzapine, quetiapine); clozapine for treatment-resistant'],
        ['Brief Psychotic Disorder', '<1 month', 'Sudden onset psychosis, full recovery', 'Antipsychotic short course; identify precipitant'],
        ['Schizoaffective', '>1 month', 'Psychosis PLUS prominent mood episodes (concurrent)', 'Mood stabiliser + antipsychotic; lithium or valproate'],
        ['Delusional Disorder', '>1 month', 'Non-bizarre fixed delusions; otherwise functioning normally', 'Antipsychotic; often poorly compliant'],
    ],
    col_widths=[3.5*cm, 2.5*cm, 6*cm, 5*cm]
))
story.append(sp(4))
story.append(alert_box('Clozapine: requires mandatory weekly FBC for first 18 weeks (agranulocytosis risk). Only indicated in treatment-resistant schizophrenia (failed 2 adequate antipsychotic trials).'))
story.append(sp(6))

story.append(Paragraph('ANXIETY & RELATED DISORDERS', section_head))
story.append(hline())
story.append(info_table(
    ['Disorder', 'Key Features', 'First-Line Treatment'],
    [
        ['GAD', '≥6 months excessive worry; muscle tension, fatigue, irritability, poor concentration', 'SSRI or SNRI + CBT; buspirone as adjunct'],
        ['Panic Disorder', 'Recurrent unexpected panic attacks + anticipatory anxiety; agoraphobia possible', 'SSRI + CBT; benzodiazepines short-term only for acute attacks'],
        ['Social Anxiety Disorder', 'Fear of social situations; blushing, sweating, avoidance', 'SSRI + CBT; beta-blocker for performance anxiety (propranolol)'],
        ['OCD', 'Obsessions + compulsions, ego-dystonic, time-consuming (>1hr/day)', 'High-dose SSRI (e.g. fluoxetine 60-80mg) + ERP (CBT); clomipramine if resistant'],
        ['PTSD', 'Trauma + re-experiencing + avoidance + hyperarousal + negative cognitions; >1 month', 'Trauma-focused CBT (first line); SSRI (sertraline, paroxetine); avoid benzodiazepines'],
    ],
    col_widths=[3*cm, 7*cm, 7*cm]
))
story.append(sp(6))

story.append(Paragraph('SUBSTANCE USE DISORDERS', section_head))
story.append(hline())
story.append(info_table(
    ['Substance', 'Withdrawal Features', 'Management'],
    [
        ['Alcohol', 'Tremor, sweating, tachycardia (6-24hr); seizures (12-48hr); delirium tremens 48-72hr (fever, confusion, autonomic instability)', 'Diazepam or chlordiazepoxide (CIWA protocol); thiamine 100mg TDS or IV Pabrinex BEFORE glucose; seizure prophylaxis'],
        ['Opioids', 'Yawning, lacrimation, piloerection, diarrhoea, cramps, tachycardia, anxiety (not life-threatening)', 'Opioid replacement: methadone or buprenorphine/naloxone. Overdose: IV/IM naloxone'],
        ['Benzodiazepines', 'Similar to alcohol; potentially life-threatening; seizures, agitation', 'Long-acting diazepam taper; never abrupt cessation'],
        ['Amphetamines/stimulants', 'Crash: fatigue, depression, hypersomnia, craving', 'Supportive; no specific pharmacotherapy; CBT'],
        ['Nicotine', 'Irritability, cravings, weight gain, poor concentration', 'Combination NRT; varenicline (most effective); bupropion'],
    ],
    col_widths=[3*cm, 7*cm, 7*cm]
))
story.append(sp(4))
story.append(alert_box('Wernicke\'s Encephalopathy (alcohol): CLASSIC TRIAD - confusion + ophthalmoplegia + ataxia. Give IV thiamine (Pabrinex) BEFORE any glucose administration. If missed, progresses to Korsakoff psychosis (anterograde amnesia - irreversible).'))
story.append(sp(8))

story.append(PageBreak())

# ════════════════════════════════════════════════════════════════
# CHAPTER 6: POPULATION HEALTH & EMERGENCY MEDICINE
# ════════════════════════════════════════════════════════════════
story.append(chapter_banner('Chapter 6: Population Health & Emergency Medicine',
    'Population Health + Emergency = 12.5% of blueprint | Australian-specific guidelines critical', TEAL))
story.append(sp(10))

story.append(Paragraph('POPULATION HEALTH & SCREENING (Australian Guidelines)', section_head))
story.append(hline())
story.append(info_table(
    ['Screening Program', 'Target Population', 'Frequency / Method', 'Key AMC Points'],
    [
        ['Cervical Screening', 'Women 25-74 years', 'HPV-based Cervical Screening Test every 5 years', 'Replaced 2-yearly Pap smear in 2017. HPV 16/18 = urgent colposcopy.'],
        ['Bowel Cancer Screening (NBCSP)', 'Ages 45-74 (free kit); priority 50-74', 'Biennial faecal immunochemical test (FIT/iFOBT)', 'Positive FIT → colonoscopy. Australian government funded.'],
        ['Breast Screening (BreastScreen)', 'Women 40-74 (free 50-74)', 'Biennial mammogram', '2-view mammography; diagnostic mammogram if symptomatic at any age.'],
        ['Cardiovascular Risk', 'Adults ≥45 years (≥30 if Aboriginal/Torres Strait Islander)', 'Absolute CVD risk calculator (smoking, BP, cholesterol, diabetes, age, sex)', '≥15% 5-year risk = pharmacotherapy threshold. Lifestyle modification for 10-15%.'],
        ['Diabetes Screening', 'Age ≥40 + risk factors; ≥18 if Aboriginal/Torres Strait Islander', 'Fasting glucose or HbA1c or OGTT every 1-3 years', 'AUSDRISK tool for risk assessment.'],
        ['Antenatal Screening', 'All pregnant women', '11-13wk combined screening; 18-20wk morphology USS; 24-28wk OGTT', 'OGTT at 24-28 weeks is Australian standard. GBS swab at 36 weeks.'],
    ],
    col_widths=[3.5*cm, 3.5*cm, 4*cm, 6*cm]
))
story.append(sp(6))

story.append(Paragraph('EMERGENCY MEDICINE - HIGH YIELD ALGORITHMS', section_head))
story.append(hline())

story.append(Paragraph('Anaphylaxis (ASCIA Australian Guidelines)', sub_head))
story.append(info_table(
    ['Step', 'Action'],
    [
        ['1. Call for help', 'Activate emergency response; lie patient flat (or seated if SOB); raise legs unless SOB'],
        ['2. Adrenaline (FIRST LINE)', 'IM adrenaline 0.01 mg/kg (max 0.5mg) into outer mid-thigh. Adult: 0.5mg (0.5mL of 1:1000)'],
        ['3. Repeat if needed', 'Repeat adrenaline every 5 minutes if no improvement'],
        ['4. Call ambulance', '000; observe minimum 4-6 hours post-reaction; 12-24hr if biphasic risk'],
        ['5. Adjuncts', 'IV fluids for hypotension; salbutamol for bronchospasm; antihistamines and steroids are ADJUNCTS only - NOT first line'],
        ['6. Discharge', 'EpiPen prescription x2; ASCIA action plan; refer to allergist; MedicAlert bracelet'],
    ],
    col_widths=[3*cm, 14*cm]
))
story.append(sp(4))
story.append(alert_box('Adrenaline is the ONLY first-line treatment for anaphylaxis. Antihistamines and steroids are adjuncts. Pressure immobilisation bandage is for snake/funnel-web spider envenomation - NOT anaphylaxis.'))
story.append(sp(6))

story.append(Paragraph('Advanced Life Support (ALS) - Australian Resuscitation Council', sub_head))
story.append(info_table(
    ['Component', 'Details'],
    [
        ['Compression rate', '100-120/min; 30:2 ratio until advanced airway placed, then continuous compressions'],
        ['Compression depth', '≥5cm (adult); 1/3 chest depth (paeds)'],
        ['Defibrillation', 'Biphasic 200J (360J monophasic); shock every 2 min for shockable rhythms (VF/pVT)'],
        ['Shockable rhythms', 'VF and pulseless VT → shock + CPR'],
        ['Non-shockable rhythms', 'Asystole and PEA → CPR; identify reversible causes (4Hs + 4Ts)'],
        ['Adrenaline', 'Non-shockable: 1mg IV every 3-5 min from cycle 1. Shockable: after 3rd shock, then every 3-5 min'],
        ['Amiodarone', '300mg IV bolus after 3rd shock (VF/pVT); second dose 150mg after 5th shock'],
        ['4Hs', 'Hypoxia, Hypovolaemia, Hypo/hyperkalaemia, Hypothermia'],
        ['4Ts', 'Tension pneumothorax, Tamponade, Toxins, Thrombosis (PE or coronary)'],
    ],
    col_widths=[4*cm, 13*cm]
))
story.append(sp(6))

story.append(Paragraph('SNAKE ENVENOMATION (Australian)', sub_head))
story.append(info_table(
    ['Action', 'Details'],
    [
        ['First aid', 'Pressure Immobilisation Bandage (PIB) immediately; firm bandage from bite site + limb immobilised; do NOT wash wound'],
        ['Do NOT', 'Cut, suck, tourniquet, remove bandage until in hospital with antivenom and resuscitation available'],
        ['Hospital', 'FBC, coag (fibrinogen, D-dimer), renal function, CK; 12hr observation minimum'],
        ['Antivenom', 'Specific antivenom based on polyvalent snake venom detection kit or clinical syndrome; give IV in ED with adrenaline drawn up'],
        ['Funnel-web spider', 'PIB; antivenom available - highly effective; atropine for bradycardia'],
    ],
    col_widths=[3.5*cm, 13.5*cm]
))
story.append(sp(6))

story.append(Paragraph('ETHICS, CONSENT & LEGAL FRAMEWORK', section_head))
story.append(hline())
story.append(info_table(
    ['Topic', 'Key Principles for AMC'],
    [
        ['Informed Consent', 'Patient must have capacity; be given material information; consent voluntarily. Must disclose risks a reasonable patient would want to know (Rogers v Whitaker, Australia).'],
        ['Capacity Assessment', '4 components: Understand information, Retain it, Weigh it, Communicate decision. Can have capacity for some decisions but not others.'],
        ['Refusal of Treatment', 'Adult with capacity can refuse ANY treatment, even life-saving. Respect autonomy.'],
        ['Children & Consent', 'Parental consent for under 16; Gillick competence if child demonstrates sufficient maturity. Emergency: treat in best interests.'],
        ['Mandatory Reporting', 'Child abuse: mandatory in all Australian states. Notifiable diseases to public health. Impaired drivers: varies by state.'],
        ['Confidentiality', 'Can be breached to prevent serious harm to identifiable third party (Tarasoff principle); to comply with law; to notify public health authorities.'],
        ['Advanced Care Directive', 'Legally binding if made when competent; must be followed. Enduring Power of Attorney (medical) for when capacity lost.'],
        ['Euthanasia/VAD', 'Voluntary Assisted Dying is legal in all Australian states (varies by criteria). Doctor may conscientiously object but must refer.'],
    ],
    col_widths=[4*cm, 13*cm]
))
story.append(sp(6))

story.append(Paragraph('INDIGENOUS HEALTH (AMC - Culturally Safe Practice)', section_head))
story.append(hline())
story.append(info_table(
    ['Topic', 'Key Points'],
    [
        ['Health disparities', 'Aboriginal and Torres Strait Islander peoples have 5.1 years lower life expectancy. Higher rates of CVD, diabetes, renal disease, mental health, infectious disease.'],
        ['Screening age differences', 'CVD risk screening from age 30; diabetes screening from age 18; bowel screening supported at younger ages.'],
        ['Cultural safety', 'Involve Aboriginal Health Workers; use interpreters; understand importance of family and community; avoid assumptions.'],
        ['Closing the Gap', 'Australian government strategy targeting Indigenous health equity. Includes health checks (MBS item 715 - annual Indigenous health assessment).'],
        ['MBS Item 715', 'Annual health assessment for Aboriginal and Torres Strait Islander people; includes BP, diabetes, smoking, alcohol, mental health, dental, eyes, ears.'],
        ['Communication', 'Allow silence; avoid interrupting; use plain language; acknowledge country; involve family in decisions when appropriate.'],
    ],
    col_widths=[4*cm, 13*cm]
))
story.append(sp(6))

# ── Final exam strategy ─────────────────────────────────────────
story.append(PageBreak())
story.append(chapter_banner('AMC MCQ Exam Strategy', 'Maximise your score on exam day', GOLD))
story.append(sp(10))
story.append(info_table(
    ['Strategy', 'Detail'],
    [
        ['Read the question last', 'Read the stem first, identify the clinical problem, THEN read the question. Prevents anchoring bias.'],
        ['Identify the "best answer"', 'AMC uses A-type questions: one BEST answer from 5 plausible options. Eliminate obvious wrong answers first.'],
        ['Australian guidelines priority', 'When in doubt between management options, choose what Australian guidelines (RCH, RANZCOG, Cardiac Society of Australia) recommend.'],
        ['Common > rare', 'AMC tests prevalence-based thinking. Always consider the most common diagnosis first unless red flag features point away.'],
        ['Emergency before investigation', 'For unstable patients: ALWAYS stabilise before investigating. Airway > Breathing > Circulation.'],
        ['Do not change answers', 'First instinct is usually correct unless you have a clear reason to change. Avoid second-guessing without new information.'],
        ['Timing', '3.5 hours for 150 questions = 84 seconds per question. Aim to finish 10-15 min early for review.'],
        ['Paediatrics is high-yield', 'Often underprepared by IMGs. Focus on immunisation schedule, developmental milestones, and GI emergencies.'],
        ['Indigenous health always relevant', 'At least a few questions will involve Aboriginal/Torres Strait Islander patients. Always consider culturally safe and equitable care.'],
    ],
    col_widths=[4.5*cm, 12.5*cm]
))
story.append(sp(8))

story.append(tip_box('TOP 5 AMC HIGHEST-YIELD TOPICS: (1) CVD risk management and ACS, (2) Diabetes and GDM, (3) Paediatric immunisation schedule, (4) Pre-eclampsia and eclampsia management, (5) Mental health first-line medications and risk assessment.', bg=LIGHT_GOLD, border=GOLD, label='FINAL TIP'))
story.append(sp(6))
story.append(hline(NAVY, 2))
story.append(sp(4))
story.append(Paragraph(
    'AMC MCQ Quick Reference Guide | Prepared for International Medical Graduates | '
    'Based on AMC MCQ Exam Specifications V8 (2025) | RCH, RANZCOG, Cardiac Society, '
    'RACGP, and Australian Government Health Guidelines | Last updated July 2026',
    make_style('disclaimer', fontSize=8, textColor=HexColor('#7F8C8D'),
               alignment=TA_CENTER, fontName='Helvetica')
))

# ── Build ────────────────────────────────────────────────────────
doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
print(f'PDF successfully created: {OUTPUT}')
Running Command

cd /home/daytona/workspace/amc-guidelines && python generate_amc_pdf.py

Running Command

ls -lh /home/daytona/workspace/amc-guidelines/AMC_Guidelines_Quick_Reference.pdf

Your PDF is ready for download:

AMC Guidelines Quick Reference

PDF Document · PDF


Here's what's inside the guide (all 6 AMC disciplines covered):
Chapter 1 - Internal Medicine (30% of exam)
  • Cardiology: ACS (STEMI vs NSTEMI), Heart Failure, AF management
  • Endocrinology: Diabetes diagnosis criteria, GDM (Australian OGTT), Thyroid disorders
  • Respiratory: Asthma, COPD, Pneumonia (CURB-65), PE, Tension pneumothorax
  • Gastroenterology: GORD, PUD, IBD, Pancreatitis, Colorectal Cancer
  • Neurology: Stroke, TIA, Meningitis, Epilepsy, Parkinson's
  • Renal: AKI types, CKD, Hyperkalaemia management
Chapter 2 - Surgery (20%)
  • Acute Abdomen: Appendicitis, Cholecystitis, SBO, Perforated PU, Mesenteric ischaemia
  • Hernia types and management
  • Orthopaedics: NOF fracture, Colles, Compartment syndrome, Septic arthritis
  • Urology: Testicular torsion, Renal colic, BPH, Bladder cancer
Chapter 3 - Paediatrics (12.5%)
  • Neonatal emergencies: Pyloric stenosis, Volvulus, Hirschsprung, NEC, Oesophageal atresia
  • Full paediatric GI vomiting reference (RCH guideline-based)
  • Paediatric respiratory: Croup, Bronchiolitis, Epiglottitis, Pertussis
  • Australian Immunisation Schedule (all ages)
  • Developmental milestones with red flags
Chapter 4 - O&G (12.5%)
  • Antenatal care schedule (Australian guideline)
  • Hypertensive disorders: GH, Pre-eclampsia, Eclampsia, HELLP
  • Labour complications: PPH, Shoulder dystocia, Cord prolapse, Abruption
  • Gynaecology: Ectopic, Endometriosis, PCOS, Cervical screening (5-yearly HPV test)
Chapter 5 - Mental Health (12.5%)
  • Mood disorders: MDD, Bipolar I & II, Postpartum depression
  • Psychosis: Schizophrenia, Schizoaffective, Clozapine monitoring
  • Anxiety: GAD, Panic, OCD, PTSD
  • Substance withdrawal: Alcohol, Opioids, Benzodiazepines (with Wernicke's alert)
Chapter 6 - Population Health & Emergency (12.5%)
  • All Australian screening programs (cervical, bowel, breast, CVD, diabetes)
  • Anaphylaxis (ASCIA guideline) - adrenaline dosing
  • ALS algorithm (Australian Resuscitation Council)
  • Snake envenomation + pressure immobilisation bandage
  • Ethics, consent, confidentiality, VAD
  • Indigenous health and culturally safe practice

All

Asking for Preferences
This is a shared conversation. Sign in to Orris to start your own chat.