Make apoeer point presentation of it
cd /tmp/workspace && python3 -c " import pdfplumber pdf_path = '/tmp/workspace/attachments/977069e0-ffc5-4c59-816c-5ff61151cb3d/Antecedent Traumatic Injuries Independently Predict Higher 90-Day Mortality For Patients Admitted To The ICU With Surgical Sepsis.pdf' with pdfplumber.open(pdf_path) as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): text = page.extract_text() print(f'--- PAGE {i+1} ---') print(text) print() " 2>&1 | head -400
mkdir -p /tmp/workspace/sepsis-trauma-pptx && python3 << '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.util import Inches, Pt from io import BytesIO # Color palette - medical/professional DARK_BLUE = RGBColor(0x0D, 0x2B, 0x55) # deep navy MED_BLUE = RGBColor(0x1A, 0x5F, 0x9B) # medium blue ACCENT_TEAL = RGBColor(0x00, 0x8B, 0x8B) # teal accent LIGHT_BLUE = RGBColor(0xE8, 0xF4, 0xFD) # very light blue bg WHITE = RGBColor(0xFF, 0xFF, 0xFF) LIGHT_GREY = RGBColor(0xF2, 0xF4, 0xF8) MID_GREY = RGBColor(0x8A, 0x99, 0xAA) DARK_GREY = RGBColor(0x2C, 0x3E, 0x50) ORANGE = RGBColor(0xE8, 0x6B, 0x1A) # stat highlight RED_ALERT = RGBColor(0xC0, 0x39, 0x2B) GREEN = RGBColor(0x1A, 0x7A, 0x50) prs = Presentation() prs.slide_width = Inches(13.333) prs.slide_height = Inches(7.5) blank = prs.slide_layouts[6] # fully blank def add_rect(slide, x, y, w, h, fill_color, alpha=None): shape = slide.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Inches(h)) shape.line.fill.background() shape.fill.solid() shape.fill.fore_color.rgb = fill_color return shape def add_textbox(slide, text, x, y, w, h, font_name="Calibri", font_size=18, bold=False, italic=False, color=DARK_GREY, align=PP_ALIGN.LEFT, wrap=True, v_anchor=MSO_ANCHOR.TOP, margin=True): tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h)) tf = tb.text_frame tf.word_wrap = wrap tf.vertical_anchor = v_anchor if not margin: tf.margin_left = tf.margin_right = tf.margin_top = tf.margin_bottom = 0 p = tf.paragraphs[0] p.alignment = align run = p.add_run() run.text = text run.font.name = font_name run.font.size = Pt(font_size) run.font.bold = bold run.font.italic = italic run.font.color.rgb = color return tb def add_bullet_box(slide, items, x, y, w, h, font_name="Calibri", font_size=15, color=DARK_GREY, bullet_color=None, bold_first=False, line_spacing=None): """items is list of strings. First item is used as-is, rest get bullet.""" tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h)) tf = tb.text_frame tf.word_wrap = True tf.margin_left = Pt(4) tf.margin_right = Pt(4) tf.margin_top = Pt(2) tf.margin_bottom = Pt(2) from pptx.oxml.ns import qn from lxml import etree for i, item in enumerate(items): if i == 0: p = tf.paragraphs[0] else: p = tf.add_paragraph() p.alignment = PP_ALIGN.LEFT if line_spacing: p.line_spacing = Pt(line_spacing) run = p.add_run() run.text = item run.font.name = font_name run.font.size = Pt(font_size) run.font.bold = (bold_first and i == 0) run.font.color.rgb = color return tb # ───────────────────────────────────────────────────────────── # SLIDE 1 – TITLE SLIDE # ───────────────────────────────────────────────────────────── slide = prs.slides.add_slide(blank) # Dark navy background add_rect(slide, 0, 0, 13.333, 7.5, DARK_BLUE) # Teal accent bar left add_rect(slide, 0, 0, 0.18, 7.5, ACCENT_TEAL) # White horizontal rule add_rect(slide, 0.35, 3.95, 12.6, 0.05, WHITE) # Title tb = slide.shapes.add_textbox(Inches(0.45), Inches(1.0), Inches(12.4), Inches(2.6)) tf = tb.text_frame tf.word_wrap = True tf.vertical_anchor = MSO_ANCHOR.MIDDLE p = tf.paragraphs[0] p.alignment = PP_ALIGN.CENTER run = p.add_run() run.text = "Antecedent Traumatic Injuries Independently Predict" run.font.name = "Calibri" run.font.size = Pt(34) run.font.bold = True run.font.color.rgb = WHITE p2 = tf.add_paragraph() p2.alignment = PP_ALIGN.CENTER r2 = p2.add_run() r2.text = "Higher 90-Day Mortality For Patients Admitted To The ICU With Surgical Sepsis" r2.font.name = "Calibri" r2.font.size = Pt(30) r2.font.bold = True r2.font.color.rgb = ACCENT_TEAL # Authors add_textbox(slide, "Collins CM, Jalilvand A, Kellett W, Baselice H, Wisler J", 0.45, 4.15, 12.4, 0.6, font_size=17, bold=True, color=WHITE, align=PP_ALIGN.CENTER) # Institution add_textbox(slide, "The Ohio State University — Department of General Surgery, Columbus, OH", 0.45, 4.75, 12.4, 0.5, font_size=14, italic=True, color=MID_GREY, align=PP_ALIGN.CENTER) # Journal / preprint note add_textbox(slide, "SSRN Preprint | Supported by NIH R35GM150968 & T32AI106704", 0.45, 5.4, 12.4, 0.45, font_size=12, color=MID_GREY, align=PP_ALIGN.CENTER) # ───────────────────────────────────────────────────────────── # SLIDE 2 – BACKGROUND & RATIONALE # ───────────────────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_rect(slide, 0, 0, 13.333, 7.5, LIGHT_GREY) add_rect(slide, 0, 0, 13.333, 1.05, DARK_BLUE) add_rect(slide, 0, 1.05, 0.12, 6.45, ACCENT_TEAL) add_textbox(slide, "Background & Rationale", 0.35, 0.08, 12.6, 0.88, font_size=26, bold=True, color=WHITE, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE) # Two column cards # Left card add_rect(slide, 0.3, 1.3, 5.9, 5.7, WHITE) add_rect(slide, 0.3, 1.3, 5.9, 0.5, MED_BLUE) add_textbox(slide, "Sepsis in the ICU", 0.35, 1.3, 5.8, 0.5, font_size=16, bold=True, color=WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE) bullets_left = [ "• Leading cause of in-hospital mortality — responsible for ~1/3 of all hospital deaths", "• ICU sepsis mortality approaches 25%, far higher than non-septic ICU patients", "• Sepsis causes dysregulation of innate & adaptive immune responses", "• Surviving Sepsis Campaign bundles have gradually improved outcomes", "• Post-sepsis survivors remain at risk of long-term immunosuppression & persistent inflammation", "• Comorbidities (age >65, cancer, CKD, CHF, cirrhosis) independently raise sepsis risk", ] add_bullet_box(slide, bullets_left, 0.45, 1.9, 5.7, 5.0, font_size=13.5, color=DARK_GREY) # Right card add_rect(slide, 7.13, 1.3, 5.9, 5.7, WHITE) add_rect(slide, 7.13, 1.3, 5.9, 0.5, ACCENT_TEAL) add_textbox(slide, "Trauma & Immune Dysfunction", 7.18, 1.3, 5.8, 0.5, font_size=16, bold=True, color=WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE) bullets_right = [ "• Unintentional injury = leading cause of death in adults under 45", "• Trauma incidence has increased from 1980 to 2020", "• Like sepsis, trauma triggers an intense acute inflammatory phase", "• After the acute phase, trauma patients progress to hyperinflammatory, immunosuppressed state", "• The interplay between trauma-induced immune dysfunction and later sepsis remains poorly understood", "• No universal trauma-specific sepsis screening protocol currently exists", ] add_bullet_box(slide, bullets_right, 7.25, 1.9, 5.7, 5.0, font_size=13.5, color=DARK_GREY) # Central hypothesis arrow / box add_rect(slide, 6.27, 2.6, 0.78, 2.0, LIGHT_BLUE) add_textbox(slide, "→", 6.27, 3.35, 0.78, 0.55, font_size=30, bold=True, color=DARK_BLUE, align=PP_ALIGN.CENTER) # ───────────────────────────────────────────────────────────── # SLIDE 3 – STUDY HYPOTHESIS & OBJECTIVES # ───────────────────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_rect(slide, 0, 0, 13.333, 7.5, LIGHT_GREY) add_rect(slide, 0, 0, 13.333, 1.05, DARK_BLUE) add_rect(slide, 0, 1.05, 0.12, 6.45, ACCENT_TEAL) add_textbox(slide, "Study Hypothesis & Objectives", 0.35, 0.08, 12.6, 0.88, font_size=26, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE) # Hypothesis box add_rect(slide, 0.4, 1.35, 12.5, 1.6, DARK_BLUE) tb = slide.shapes.add_textbox(Inches(0.6), Inches(1.42), Inches(12.1), Inches(1.4)) tf = tb.text_frame; tf.word_wrap = True; tf.vertical_anchor = MSO_ANCHOR.MIDDLE p = tf.paragraphs[0]; p.alignment = PP_ALIGN.CENTER r = p.add_run() r.text = "HYPOTHESIS" r.font.name = "Calibri"; r.font.size = Pt(11); r.font.bold = True; r.font.color.rgb = ACCENT_TEAL p2 = tf.add_paragraph(); p2.alignment = PP_ALIGN.CENTER r2 = p2.add_run() r2.text = ("Antecedent traumatic injuries contribute to worse outcomes in patients admitted to the SICU with sepsis, " "due to persistent post-traumatic immune dysregulation overlapping with sepsis-induced immune dysfunction.") r2.font.name = "Calibri"; r2.font.size = Pt(15); r2.font.bold = False; r2.font.color.rgb = WHITE # Objectives obj_items = [ ("PRIMARY", "Evaluate the association between antecedent trauma and in-hospital & 90-day mortality in SICU sepsis patients"), ("SECONDARY", "Identify baseline demographic and clinical characteristics that predict in-hospital mortality"), ("EXPLORATORY", "Analyze ICU/hospital LOS, mechanical ventilation use, renal replacement therapy, and discharge disposition"), ] colors_obj = [RED_ALERT, MED_BLUE, ACCENT_TEAL] for idx, (label, text) in enumerate(obj_items): ypos = 3.15 + idx * 1.25 add_rect(slide, 0.4, ypos, 12.5, 1.1, WHITE) add_rect(slide, 0.4, ypos, 1.5, 1.1, colors_obj[idx]) add_textbox(slide, label, 0.4, ypos, 1.5, 1.1, font_size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE) add_textbox(slide, text, 2.1, ypos + 0.1, 10.6, 0.9, font_size=14.5, color=DARK_GREY, v_anchor=MSO_ANCHOR.MIDDLE) # ───────────────────────────────────────────────────────────── # SLIDE 4 – METHODS # ───────────────────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_rect(slide, 0, 0, 13.333, 7.5, LIGHT_GREY) add_rect(slide, 0, 0, 13.333, 1.05, DARK_BLUE) add_rect(slide, 0, 1.05, 0.12, 6.45, ACCENT_TEAL) add_textbox(slide, "Methods", 0.35, 0.08, 12.6, 0.88, font_size=26, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE) method_boxes = [ ("Study Design", MED_BLUE, [ "Single-institution retrospective cohort study", "Ohio State University Wexner Medical Center", "September 2013 – January 2019", "IRB-approved protocol", ]), ("Population", ACCENT_TEAL, [ "All SICU admissions meeting Sepsis-3 criteria within 48h of SICU admission", "Total: n = 1,401 patients", "Antecedent trauma cohort: n = 109 (7.8%)", "Atraumatic cohort: n = 1,292 (92.2%)", "Exclusions: <18 years old or incarcerated", ]), ("Outcomes", RED_ALERT, [ "Primary: In-hospital death & 90-day mortality", "Secondary: ICU/hospital LOS, mechanical ventilation, RRT", "Discharge disposition (home, SNF/LTACH, hospice)", ]), ("Statistics", ORANGE, [ "Student's t-test (normal); Mann-Whitney U (non-normal)", "Chi-square / Fisher's exact for categorical variables", "Multivariable logistic regression (all variables simultaneous)", "Kaplan-Meier 90-day survival curve by trauma status", "Significance: p < 0.05 | Stata/SE 16.1", ]), ] positions = [(0.25, 1.2), (6.9, 1.2), (0.25, 4.15), (6.9, 4.15)] dims = [(6.35, 2.7), (6.15, 2.7), (6.35, 2.9), (6.15, 2.9)] for (label, color, items), (xp, yp), (wp, hp) in zip(method_boxes, positions, dims): add_rect(slide, xp, yp, wp, hp, WHITE) add_rect(slide, xp, yp, wp, 0.45, color) add_textbox(slide, label, xp + 0.1, yp, wp - 0.2, 0.45, font_size=14, bold=True, color=WHITE, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE) add_bullet_box(slide, items, xp + 0.15, yp + 0.5, wp - 0.25, hp - 0.6, font_size=12.5, color=DARK_GREY) # ───────────────────────────────────────────────────────────── # SLIDE 5 – PATIENT DEMOGRAPHICS # ───────────────────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_rect(slide, 0, 0, 13.333, 7.5, LIGHT_GREY) add_rect(slide, 0, 0, 13.333, 1.05, DARK_BLUE) add_rect(slide, 0, 1.05, 0.12, 6.45, ACCENT_TEAL) add_textbox(slide, "Patient Demographics & Baseline Characteristics", 0.35, 0.08, 12.6, 0.88, font_size=26, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE) # Table headers cols = ["Characteristic", "Trauma (n=109)", "Non-Trauma (n=1292)", "p-value"] col_x = [0.25, 4.1, 7.55, 11.2] col_w = [3.8, 3.4, 3.6, 1.9] # Header row for txt, cx, cw in zip(cols, col_x, col_w): add_rect(slide, cx, 1.2, cw, 0.48, DARK_BLUE) add_textbox(slide, txt, cx + 0.08, 1.2, cw - 0.15, 0.48, font_size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE) rows = [ ("Female sex", "32.1%", "45.3%", "0.008"), ("Type 2 Diabetes", "16.5%", "29.0%", "0.005"), ("COPD", "10.1%", "21.9%", "0.004"), ("Obesity", "43.0%", "58.4%", "0.002"), ("Metastatic Cancer", "0%", "6.3%", "0.002"), ("Charlson Comorbidity Index (p50)", "2", "4", "<0.0005"), ("Vasopressor use on admission", "22.9%", "39.2%", "0.001"), ("Median Hemoglobin (g/dL)", "9.7", "11.5", "<0.0005"), ] row_colors = [WHITE, LIGHT_BLUE, WHITE, LIGHT_BLUE, WHITE, LIGHT_BLUE, WHITE, LIGHT_BLUE] for ri, (r_data, rc) in enumerate(zip(rows, row_colors)): y_pos = 1.75 + ri * 0.68 for ci, (cell, cx, cw) in enumerate(zip(r_data, col_x, col_w)): add_rect(slide, cx, y_pos, cw, 0.63, rc) fsize = 13 if ci == 0 else 14 fbold = False fcol = DARK_GREY if ci == 3 and cell.replace("<","").replace(">","").replace("=","").replace(".","").replace("0","") != "": try: val = float(cell.replace("<","").replace(">","").replace("=","")) if val < 0.01: fcol = RED_ALERT; fbold = True except: pass add_textbox(slide, cell, cx + 0.08, y_pos + 0.03, cw - 0.15, 0.57, font_size=fsize, bold=fbold, color=fcol, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE) add_textbox(slide, "Trauma patients were YOUNGER and had FEWER comorbidities than non-trauma sepsis patients", 0.25, 7.1, 12.8, 0.38, font_size=12, italic=True, color=MED_BLUE, align=PP_ALIGN.CENTER) # ───────────────────────────────────────────────────────────── # SLIDE 6 – CLINICAL OUTCOMES # ───────────────────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_rect(slide, 0, 0, 13.333, 7.5, LIGHT_GREY) add_rect(slide, 0, 0, 13.333, 1.05, DARK_BLUE) add_rect(slide, 0, 1.05, 0.12, 6.45, ACCENT_TEAL) add_textbox(slide, "Clinical Outcomes: Trauma vs. Non-Trauma SICU Sepsis Patients", 0.35, 0.08, 12.6, 0.88, font_size=24, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE) outcome_data = [ ("ICU Length of Stay (median days)", "12.9", "6.7", "<0.001"), ("Hospital Length of Stay (median days)", "25", "19", "0.0005"), ("Mechanical Ventilation Required", "92.7%", "70.9%", "<0.0005"), ("Ventilator Days (median)", "7", "4", "0.00001"), ("Renal Replacement Therapy", "29.4%", "15.7%", "<0.0005"), ("Discharge to SNF/LTACH", "64.0%", "78.7%", "0.01"), ("Discharge to Hospice", "6.4%", "8.0%", "0.01"), ("Discharge to Home", "29.6%", "13.3%", "0.01"), ] headers2 = ["Outcome", "Non-Trauma (n=1292)", "Trauma (n=109)", "p-value"] col_x2 = [0.25, 4.55, 8.25, 11.55] col_w2 = [4.25, 3.65, 3.25, 1.65] for txt, cx, cw in zip(headers2, col_x2, col_w2): add_rect(slide, cx, 1.2, cw, 0.48, DARK_BLUE) add_textbox(slide, txt, cx + 0.08, 1.2, cw - 0.15, 0.48, font_size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE) row_colors2 = [WHITE, LIGHT_BLUE] * 4 for ri, (r_data, rc) in enumerate(zip(outcome_data, row_colors2)): y_pos = 1.75 + ri * 0.68 for ci, (cell, cx, cw) in enumerate(zip(r_data, col_x2, col_w2)): add_rect(slide, cx, y_pos, cw, 0.63, rc) fbold = False; fcol = DARK_GREY if ci == 2: # trauma column - highlight worse values fcol = RED_ALERT; fbold = True if ci == 3: fcol = ORANGE; fbold = True add_textbox(slide, cell, cx + 0.08, y_pos + 0.03, cw - 0.15, 0.57, font_size=13.5, bold=fbold, color=fcol, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE) add_textbox(slide, "Despite healthier baseline demographics, trauma patients had significantly WORSE clinical outcomes across all measures", 0.25, 7.1, 12.8, 0.38, font_size=12, italic=True, color=RED_ALERT, align=PP_ALIGN.CENTER) # ───────────────────────────────────────────────────────────── # SLIDE 7 – MULTIVARIATE REGRESSION KEY FINDING # ───────────────────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_rect(slide, 0, 0, 13.333, 7.5, LIGHT_GREY) add_rect(slide, 0, 0, 13.333, 1.05, DARK_BLUE) add_rect(slide, 0, 1.05, 0.12, 6.45, ACCENT_TEAL) add_textbox(slide, "Multivariable Regression: Independent Predictors of Mortality", 0.35, 0.08, 12.6, 0.88, font_size=24, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE) # Two panels predictors = [ ("In-Hospital Mortality", MED_BLUE, [ ("Antecedent Trauma", "p < 0.005", True), ("Transfer Status", "p < 0.005", True), ("Increasing Age", "p < 0.04", False), ("Charlson Comorbidity Index", "p < 0.0005", True), ("Admission Lactate", "p < 0.005", True), ("Admission SOFA Score", "p < 0.005", True), ]), ("90-Day Mortality", RED_ALERT, [ ("Antecedent Trauma", "p < 0.005", True), ("Transfer Status", "p < 0.005", True), ("Increasing Age", "p = 0.03", False), ("Charlson Comorbidity Index", "p < 0.0005", True), ("Admission Lactate", "p < 0.005", True), ("Admission SOFA Score", "p = 0.001", True), ]), ] for pi, (title, hdr_color, preds) in enumerate(predictors): xp = 0.3 + pi * 6.6 add_rect(slide, xp, 1.25, 6.25, 5.9, WHITE) add_rect(slide, xp, 1.25, 6.25, 0.55, hdr_color) add_textbox(slide, title, xp + 0.1, 1.25, 6.05, 0.55, font_size=17, bold=True, color=WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE) for ri, (pred_name, pval, is_sig) in enumerate(preds): y_row = 1.9 + ri * 0.87 row_bg = LIGHT_BLUE if ri % 2 == 0 else WHITE add_rect(slide, xp + 0.12, y_row, 6.0, 0.8, row_bg) # Predictor name add_textbox(slide, pred_name, xp + 0.22, y_row + 0.05, 4.0, 0.7, font_size=14, bold=is_sig, color=DARK_BLUE if is_sig else DARK_GREY, v_anchor=MSO_ANCHOR.MIDDLE) # p-value badge badge_col = RED_ALERT if is_sig else MID_GREY add_rect(slide, xp + 4.4, y_row + 0.12, 1.55, 0.55, badge_col) add_textbox(slide, pval, xp + 4.4, y_row + 0.12, 1.55, 0.55, font_size=12, bold=True, color=WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE) # Key takeaway box at bottom add_rect(slide, 0.3, 7.05, 12.7, 0.38, DARK_BLUE) add_textbox(slide, "Antecedent trauma is a significant, INDEPENDENT predictor of both in-hospital and 90-day mortality — even after adjusting for comorbidities and illness severity", 0.4, 7.05, 12.5, 0.38, font_size=12.5, bold=True, color=ACCENT_TEAL, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE) # ───────────────────────────────────────────────────────────── # SLIDE 8 – KAPLAN MEIER + DISCUSSION KEY POINTS # ───────────────────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_rect(slide, 0, 0, 13.333, 7.5, LIGHT_GREY) add_rect(slide, 0, 0, 13.333, 1.05, DARK_BLUE) add_rect(slide, 0, 1.05, 0.12, 6.45, ACCENT_TEAL) add_textbox(slide, "Survival Analysis & Key Discussion Points", 0.35, 0.08, 12.6, 0.88, font_size=26, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE) # KM curve schematic (drawn as shapes) add_rect(slide, 0.3, 1.25, 5.8, 5.85, WHITE) add_textbox(slide, "Kaplan-Meier 90-Day Survival Curve", 0.4, 1.3, 5.6, 0.45, font_size=14, bold=True, color=DARK_BLUE, align=PP_ALIGN.CENTER) # Draw schematic KM plot using rectangles and lines # Non-trauma line (higher) — using thin rectangles as bars km_x_start = 0.55 km_y_bottom = 6.7 km_width = 5.2 km_height = 4.4 # Grid for gi in range(5): y_g = km_y_bottom - gi * (km_height / 4) add_rect(slide, km_x_start, y_g - 0.01, km_width, 0.015, MID_GREY) # Non-Trauma curve (stays higher) nt_pts = [(0,0), (0.8,0.12), (1.8,0.22), (3.0,0.30), (4.5,0.36), (5.2,0.40)] for i in range(len(nt_pts)-1): x1, d1 = nt_pts[i]; x2, d2 = nt_pts[i+1] x_inch = km_x_start + x1 * (km_width / 5.2) w_inch = (x2 - x1) * (km_width / 5.2) y_inch = km_y_bottom - (km_height * (1 - d1)) add_rect(slide, x_inch, y_inch, w_inch + 0.01, 0.05, MED_BLUE) # Trauma curve (drops faster) t_pts = [(0,0), (0.5,0.18), (1.2,0.35), (2.5,0.50), (4.0,0.62), (5.2,0.70)] for i in range(len(t_pts)-1): x1, d1 = t_pts[i]; x2, d2 = t_pts[i+1] x_inch = km_x_start + x1 * (km_width / 5.2) w_inch = (x2 - x1) * (km_width / 5.2) y_inch = km_y_bottom - (km_height * (1 - d1)) add_rect(slide, x_inch, y_inch, w_inch + 0.01, 0.05, RED_ALERT) # Legend add_rect(slide, 0.7, 6.75, 0.35, 0.13, MED_BLUE) add_textbox(slide, "Non-Trauma", 1.1, 6.7, 2.2, 0.25, font_size=11, color=MED_BLUE, bold=True) add_rect(slide, 0.7, 7.0, 0.35, 0.13, RED_ALERT) add_textbox(slide, "Trauma (worse survival trend)", 1.1, 6.95, 3.2, 0.25, font_size=11, color=RED_ALERT, bold=True) add_textbox(slide, "Days", 2.6, 7.15, 2.0, 0.25, font_size=11, color=DARK_GREY, align=PP_ALIGN.CENTER) add_textbox(slide, "Survival Probability", 0.32, 3.4, 0.35, 2.0, font_size=11, color=DARK_GREY, align=PP_ALIGN.CENTER) # Right panel – discussion bullets disc_pts = [ ("Paradox of 'Healthier' Patients with Worse Outcomes", MED_BLUE, "Trauma patients were younger, with fewer comorbidities and less vasopressor use — yet showed significantly higher mortality."), ("Trauma as an Independent Risk Factor", RED_ALERT, "After multivariable adjustment, trauma status independently predicted both in-hospital and 90-day mortality."), ("Post-Traumatic Immune Dysfunction", ORANGE, "Parallels between trauma- and sepsis-induced immune dysregulation may compound each other, leading to worse outcomes."), ("Need for Tailored Screening & Protocols", ACCENT_TEAL, "No universal trauma-specific sepsis protocol exists. Early identification and intervention tailored to trauma patients is warranted."), ] for di, (hdr, col, body) in enumerate(disc_pts): yp = 1.25 + di * 1.55 add_rect(slide, 6.35, yp, 6.75, 1.4, WHITE) add_rect(slide, 6.35, yp, 0.1, 1.4, col) add_textbox(slide, hdr, 6.55, yp + 0.05, 6.4, 0.42, font_size=13, bold=True, color=col) add_textbox(slide, body, 6.55, yp + 0.48, 6.4, 0.85, font_size=12.5, color=DARK_GREY, wrap=True) # ───────────────────────────────────────────────────────────── # SLIDE 9 – LIMITATIONS # ───────────────────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_rect(slide, 0, 0, 13.333, 7.5, LIGHT_GREY) add_rect(slide, 0, 0, 13.333, 1.05, DARK_BLUE) add_rect(slide, 0, 1.05, 0.12, 6.45, ACCENT_TEAL) add_textbox(slide, "Study Limitations", 0.35, 0.08, 12.6, 0.88, font_size=26, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE) limits = [ ("Cohort Size Imbalance", ORANGE, "Large difference between trauma (n=109) and non-trauma (n=1,292) groups. The trauma cohort is underpowered for subgroup analyses."), ("Source of Sepsis Not Analyzed", MED_BLUE, "Sepsis source (respiratory, abdominal, urinary, etc.) was not investigated, limiting ability to attribute outcome differences to specific infections."), ("Pre-SICU Interventions Unknown", ACCENT_TEAL, "Interventions administered prior to SICU admission were not captured, making it unclear whether delays in sepsis identification contributed to worse outcomes."), ("Injury Pattern & Severity Not Explored", RED_ALERT, "Specific injury patterns and full ISS distribution were not analyzed in detail. Certain injury types or severity thresholds may disproportionately affect outcomes."), ("Single Institution, Retrospective Design", MID_GREY, "Results from one academic center may not be generalizable. Retrospective design limits causal inference."), ("Socioeconomic & Biopsychosocial Factors", DARK_BLUE, "Substance abuse, education level, and other social determinants known to influence trauma & sepsis outcomes were not captured."), ] for li, (title, col, body) in enumerate(limits): xp = 0.3 + (li % 2) * 6.6 yp = 1.25 + (li // 2) * 2.0 add_rect(slide, xp, yp, 6.3, 1.8, WHITE) add_rect(slide, xp, yp, 6.3, 0.44, col) add_textbox(slide, title, xp + 0.12, yp, 6.05, 0.44, font_size=13, bold=True, color=WHITE, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE) add_textbox(slide, body, xp + 0.12, yp + 0.48, 6.0, 1.25, font_size=12.5, color=DARK_GREY, wrap=True) # ───────────────────────────────────────────────────────────── # SLIDE 10 – CONCLUSIONS & FUTURE DIRECTIONS # ───────────────────────────────────────────────────────────── slide = prs.slides.add_slide(blank) add_rect(slide, 0, 0, 13.333, 7.5, DARK_BLUE) add_rect(slide, 0, 0, 0.18, 7.5, ACCENT_TEAL) add_textbox(slide, "Conclusions & Future Directions", 0.35, 0.2, 12.5, 0.8, font_size=26, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE) # Horizontal rule add_rect(slide, 0.35, 1.05, 12.6, 0.04, ACCENT_TEAL) # Conclusions conc_items = [ "Antecedent trauma is a significant, INDEPENDENT predictor of both in-hospital and 90-day mortality in SICU sepsis patients", "Trauma patients with sepsis are paradoxically younger and healthier, yet suffer worse outcomes — including higher rates of mechanical ventilation, RRT, and non-home discharge", "Kaplan-Meier analysis shows a clear trend toward decreased 90-day survival in the trauma cohort vs. non-trauma cohort", "These findings underscore the need for a more nuanced, trauma-specific approach to sepsis risk prediction and clinical management", ] for ci, txt in enumerate(conc_items): yp = 1.25 + ci * 1.15 add_rect(slide, 0.35, yp, 0.08, 0.85, ACCENT_TEAL) add_textbox(slide, txt, 0.58, yp, 12.2, 1.0, font_size=15.5, bold=(ci == 0), color=WHITE if ci == 0 else RGBColor(0xD0, 0xE8, 0xF5), wrap=True, v_anchor=MSO_ANCHOR.MIDDLE) # Future directions box add_rect(slide, 0.35, 5.9, 12.6, 1.35, MED_BLUE) add_textbox(slide, "Future Directions", 0.5, 5.92, 3.5, 0.4, font_size=14, bold=True, color=ACCENT_TEAL) future = ("Prospective studies examining trauma-specific immune biomarkers | " "Analysis of injury severity & type on sepsis outcomes | " "Investigation of socioeconomic risk factors | " "Development of validated trauma-specific sepsis screening tools") add_textbox(slide, future, 0.5, 6.35, 12.2, 0.85, font_size=13, color=WHITE, wrap=True) # ───────────────────────────────────────────────────────────── # SAVE # ───────────────────────────────────────────────────────────── out_path = "/tmp/workspace/sepsis-trauma-pptx/Trauma_Sepsis_Mortality_ICU.pptx" buf = BytesIO() prs.save(buf) with open(out_path, "wb") as f: f.write(buf.getvalue()) print(f"Saved to {out_path}") PYEOF
Trauma Sepsis Mortality ICU
Presentation · PPTX
| Slide | Content |
|---|---|
| 1 | Title slide - Authors, institution, NIH funding |
| 2 | Background & Rationale - Two-column layout: sepsis epidemiology vs. trauma immune dysfunction |
| 3 | Hypothesis & Objectives - Primary, secondary, and exploratory aims |
| 4 | Methods - Study design, population (n=1,401), outcomes, and statistical approach |
| 5 | Patient Demographics - Comparison table (trauma vs. non-trauma) with highlighted p-values |
| 6 | Clinical Outcomes - Full outcome comparison table (LOS, MV use, RRT, disposition) |
| 7 | Multivariable Regression - Independent predictors for both in-hospital and 90-day mortality with p-value badges |
| 8 | Kaplan-Meier & Discussion - Schematic survival curve + 4 key discussion points |
| 9 | Limitations - 6 study limitations in a grid layout |
| 10 | Conclusions & Future Directions - Dark closing slide with key takeaways |