Liberalise the points into bulletins to so i can make ppts
Create a PPTX presentation with these bullet points
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && ls -la /tmp/workspace/
mkdir -p /tmp/workspace/tga-ppt && cat > /tmp/workspace/tga-ppt/create_pptx.py << 'PYEOF' from pptx import Presentation from pptx.util import Inches, Pt, Emu from pptx.dml.color import RGBColor from pptx.enum.text import PP_ALIGN, MSO_ANCHOR from pptx.oxml.ns import qn from lxml import etree from io import BytesIO # Color scheme - medical/clinical blue theme DARK_BLUE = RGBColor(0x0D, 0x3D, 0x6B) MID_BLUE = RGBColor(0x1A, 0x6D, 0xA8) LIGHT_BLUE = RGBColor(0xD6, 0xEA, 0xF8) WHITE = RGBColor(0xFF, 0xFF, 0xFF) DARK_TEXT = RGBColor(0x1A, 0x1A, 0x2E) ACCENT = RGBColor(0xE8, 0x4C, 0x4C) LIGHT_GRAY = RGBColor(0xF4, 0xF6, 0xF9) MID_GRAY = RGBColor(0xBD, 0xC3, 0xC7) prs = Presentation() prs.slide_width = Inches(13.333) prs.slide_height = Inches(7.5) blank = prs.slide_layouts[6] def add_rect(slide, x, y, w, h, color, transparency=None): shape = slide.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Inches(h)) shape.fill.solid() shape.fill.fore_color.rgb = color shape.line.fill.background() return shape def add_textbox(slide, x, y, w, h, text, font_size, bold=False, color=None, align=PP_ALIGN.LEFT, italic=False): tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h)) tf = tb.text_frame tf.word_wrap = True tf.margin_left = Inches(0.05) tf.margin_right = Inches(0.05) tf.margin_top = Inches(0.02) tf.margin_bottom = Inches(0.02) p = tf.paragraphs[0] p.alignment = align run = p.add_run() run.text = text run.font.size = Pt(font_size) run.font.bold = bold run.font.italic = italic if color: run.font.color.rgb = color return tf def add_bullet_slide(slide, title, bullets, sub_bullets=None): """sub_bullets: dict of {bullet_index: [sub_bullet_strings]}""" # Background add_rect(slide, 0, 0, 13.333, 7.5, LIGHT_GRAY) # Top accent bar add_rect(slide, 0, 0, 13.333, 1.1, DARK_BLUE) # Side accent add_rect(slide, 0, 1.1, 0.08, 6.4, MID_BLUE) # Title add_textbox(slide, 0.25, 0.18, 12.8, 0.78, title, 26, bold=True, color=WHITE, align=PP_ALIGN.LEFT) # Content area content_tb = slide.shapes.add_textbox(Inches(0.3), Inches(1.22), Inches(12.8), Inches(6.1)) content_tf = content_tb.text_frame content_tf.word_wrap = True content_tf.margin_left = Inches(0.1) content_tf.margin_top = Inches(0.05) first = True for i, bullet in enumerate(bullets): if first: p = content_tf.paragraphs[0] first = False else: p = content_tf.add_paragraph() p.space_before = Pt(5) p.space_after = Pt(2) # Bullet character run = p.add_run() run.text = "▸ " + bullet run.font.size = Pt(17) run.font.color.rgb = DARK_TEXT run.font.bold = False # Add sub-bullets if any if sub_bullets and i in sub_bullets: for sb in sub_bullets[i]: sp = content_tf.add_paragraph() sp.space_before = Pt(1) sp.space_after = Pt(1) sr = sp.add_run() sr.text = " ◦ " + sb sr.font.size = Pt(14.5) sr.font.color.rgb = RGBColor(0x2C, 0x3E, 0x50) sr.font.italic = False # Slide number / footer area add_rect(slide, 0, 7.25, 13.333, 0.25, MID_BLUE) def add_title_slide(slide): # Full background add_rect(slide, 0, 0, 13.333, 7.5, DARK_BLUE) # Diagonal accent strip add_rect(slide, 0, 4.8, 13.333, 0.06, MID_BLUE) add_rect(slide, 0, 4.86, 13.333, 2.64, RGBColor(0x0A, 0x2A, 0x4A)) # Main title add_textbox(slide, 0.6, 1.3, 12, 2.2, "Transposition of\nGreat Vessels (TGA)", 46, bold=True, color=WHITE, align=PP_ALIGN.CENTER) # Subtitle add_textbox(slide, 0.6, 3.7, 12, 0.8, "Congenital Cyanotic Heart Disease", 22, bold=False, color=RGBColor(0xAD, 0xD8, 0xE6), align=PP_ALIGN.CENTER) # Bottom info add_textbox(slide, 0.6, 5.1, 12, 0.5, "Pathophysiology • Clinical Features • Management", 16, bold=False, color=RGBColor(0x7F, 0xB3, 0xD3), align=PP_ALIGN.CENTER) # ───────────────────────────────────────────────── # SLIDE 1: Title # ───────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_title_slide(slide) # ───────────────────────────────────────────────── # SLIDE 2: Definition & Classification # ───────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_bullet_slide(slide, "Definition & Classification", [ "Aorta arises from right ventricle; pulmonary artery from left ventricle", "Aorta lies anterior and to the right of pulmonary artery → called D-TGA", "Systemic and pulmonary circulations are completely separate", "Survival depends on atrial, ventricular, or aortopulmonary communications", "Classification:", ], sub_bullets={ 4: [ "(a) TGA with intact ventricular septum", "(b) TGA with VSD — further divided: with / without pulmonic stenosis", "TGA + VSD + pulmonic stenosis → resembles tetralogy physiology but with more intense cyanosis", ] } ) # ───────────────────────────────────────────────── # SLIDE 3: Pathophysiology # ───────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_bullet_slide(slide, "Pathophysiology", [ "Oxygenated pulmonary venous blood recirculates in the lungs", "Deoxygenated systemic venous blood recirculates systemically", "Pulmonary artery O₂ saturation is always higher than aortic saturation", "Survival depends on mixing between the two parallel circulations", "Best mixing site (intact septum) = patent foramen ovale (PFO) → small → very poor mixing", "Neonates develop severe hypoxemia soon after birth", "Large VSD improves mixing", "Pulmonary vasculature regresses → ↑ pulmonary blood flow → congestive failure at 4–10 weeks", "↑ Pulmonary blood flow → ↑ left atrial pressure → pulmonary venous hypertension", "Survivors may develop Eisenmenger physiology relatively early in life", ] ) # ───────────────────────────────────────────────── # SLIDE 4: Clinical Features — TGA with Intact Septum # ───────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_bullet_slide(slide, "Clinical Features — TGA with Intact Ventricular Septum", [ "Cyanotic at birth", "Poor interatrial mixing → presents within first few days of life with:", "Physical Examination:", "ECG: Right axis deviation + right ventricular hypertrophy", "CXR:", ], sub_bullets={ 1: [ "Rapid breathing", "Congestive cardiac failure secondary to hypoxemia", ], 2: [ "Severe cyanosis", "Congestive failure", "Normal first sound, single second sound", "Grade 1–2 insignificant ejection systolic murmur", ], 4: [ "Cardiomegaly with narrow base and plethoric lung fields", "\"Egg on side\" appearance (~1/3 of cases)", "Thymic shadow often absent", ] } ) # ───────────────────────────────────────────────── # SLIDE 5: Clinical Features — TGA with VSD # ───────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_bullet_slide(slide, "Clinical Features — TGA with VSD", [ "Increased pulmonary blood flow", "Mixing at ventricular level determines cyanosis severity", "Congestive failure develops at 4–10 weeks of age", "Physical Examination:", "ECG: Right axis deviation with biventricular / RV / LV hypertrophy", "CXR: Cardiomegaly, plethoric lung fields, pulmonary venous hypertension", ], sub_bullets={ 3: [ "Cyanosis, cardiomegaly, congestive failure", "Normal first sound, single or split second sound", "Grade II–IV ejection systolic murmur", "Apical third sound gallop or mid-diastolic rumble may be present", ] } ) # ───────────────────────────────────────────────── # SLIDE 6: Treatment — Medical / Interim Palliation # ───────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_bullet_slide(slide, "Treatment — Medical & Interim Palliation", [ "Prostaglandin E₁:", "Balloon Atrial Septostomy (BAS):", ], sub_bullets={ 0: [ "Keeps PDA open → reduces cyanosis in selected cases", ], 1: [ "Performed in cath lab or ICU under echocardiographic guidance", "Creates opening in atrial septum → improves mixing → reduces left atrial pressure", "Effective only up to 6–12 weeks of age", "Provides temporary relief pending definitive surgery", ] } ) # ───────────────────────────────────────────────── # SLIDE 7: Arterial Switch Operation # ───────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_bullet_slide(slide, "Surgical Treatment — Arterial Switch Operation (Definitive)", [ "Treatment of choice for TGA — well established worldwide", "Procedure steps:", "Timing — TGA with Intact Septum: Ideally within first 4 weeks of life", "Timing — TGA with VSD/PDA: Within 2–3 months (many centers prefer first month)", ], sub_bullets={ 1: [ "Pulmonary artery and aorta are transected", "Distal aorta anastomosed to proximal pulmonary stump (→ neo-aortic root)", "Pulmonary artery anastomosed to proximal aortic stump (→ neo-pulmonary artery)", "Coronary arteries relocated to neo-aortic root with a cuff of aortic tissue", ], 2: [ "After birth, pulmonary vascular resistance falls → LV regresses rapidly", "In first 1–2 months: LV can still adapt via muscle hyperplasia", "Beyond this window: LV cannot adapt to systemic pressures", ], 3: [ "LV does not regress early — PA pressure still elevated", "Window limited by rapid development of pulmonary vascular obstructive disease", ] } ) # ───────────────────────────────────────────────── # SLIDE 8: Late Presentation — Senning Operation # ───────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_bullet_slide(slide, "Late Presentation — Atrial Switch (Senning) Operation", [ "Used if arterial switch window is missed (later in infancy)", "Not ideal long-term: right ventricle remains the systemic ventricle", "Long-term complications:", "Alternative — 'Training' the LV:", ], sub_bullets={ 2: [ "Progressive RV dysfunction", "Tricuspid regurgitation", "Atrial arrhythmias", ], 3: [ "Ductal stenting OR pulmonary artery banding + BT shunt for 1–2 weeks", "Followed by arterial switch operation", ] } ) # ───────────────────────────────────────────────── # SLIDE 9: Outcomes # ───────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_bullet_slide(slide, "Outcomes & Long-term Follow-up", [ "Operative mortality: < 3%", "20-year survival: > 90%", "Long-term concerns after arterial switch:", ], sub_bullets={ 2: [ "Aortic root dilation", "Aortic regurgitation", "Right ventricular outflow tract (RVOT) obstruction", "Coronary artery occlusion", ] } ) # ───────────────────────────────────────────────── # Save # ───────────────────────────────────────────────── out_path = "/tmp/workspace/tga-ppt/TGA_Presentation.pptx" buf = BytesIO() prs.save(buf) with open(out_path, "wb") as f: f.write(buf.getvalue()) print(f"Saved to: {out_path}") PYEOF python /tmp/workspace/tga-ppt/create_pptx.py
python3 -c " from pptx import Presentation prs = Presentation('/tmp/workspace/tga-ppt/TGA_Presentation.pptx') print(f'Total slides: {len(prs.slides)}') for i, slide in enumerate(prs.slides, 1): texts = [] for shape in slide.shapes: if shape.has_text_frame: t = shape.text_frame.text.strip() if t: texts.append(t[:80]) print(f'Slide {i}: {texts[:2]}') "
TGA Presentation
Presentation · PPTX
| Slide | Title |
|---|---|
| 1 | Title slide - Transposition of Great Vessels |
| 2 | Definition & Classification |
| 3 | Pathophysiology |
| 4 | Clinical Features - TGA with Intact Septum |
| 5 | Clinical Features - TGA with VSD |
| 6 | Treatment - Medical & Interim Palliation |
| 7 | Surgical Treatment - Arterial Switch Operation |
| 8 | Late Presentation - Senning Operation |
| 9 | Outcomes & Long-term Follow-up |