What are the pharmacist interventions present in this case
"cerebral venous thrombosis" AND anticoagulation duration
Give me 10 points to keep in ppt that are loop holes in this cases to highlight and explain with it give point wise
"cerebral venous thrombosis" thrombophilia workup oral contraceptive
Create a ppt in soap format
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace
mkdir -p /tmp/workspace/cvt-soap-ppt/output
~/cvt-soap-ppt/build_ppt.py
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.enum.shapes import MSO_SHAPE
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
blank = prs.slide_layouts[6]
# Colors
NAVY = RGBColor(0x1B, 0x2A, 0x4A)
WHITE = RGBColor(0xFF, 0xFF, 0xFF)
GREY = RGBColor(0x40, 0x40, 0x40)
LIGHT = RGBColor(0xF2, 0xF4, 0xF8)
SECTION_COLORS = {
"S": RGBColor(0x1F, 0x77, 0xB4), # blue - Subjective
"O": RGBColor(0x2C, 0xA0, 0x2C), # green - Objective
"A": RGBColor(0xE0, 0x8E, 0x00), # orange - Assessment
"P": RGBColor(0x8E, 0x3A, 0xC0), # purple - Plan
}
def add_bg(slide, color=WHITE):
bg = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, 0, 0, prs.slide_width, prs.slide_height)
bg.fill.solid()
bg.fill.fore_color.rgb = color
bg.line.fill.background()
bg.shadow.inherit = False
slide.shapes._spTree.remove(bg._element)
slide.shapes._spTree.insert(2, bg._element)
return bg
def section_header(slide, letter, title, subtitle=""):
color = SECTION_COLORS[letter]
# colored top bar
bar = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, 0, 0, prs.slide_width, Inches(1.15))
bar.fill.solid(); bar.fill.fore_color.rgb = color; bar.line.fill.background(); bar.shadow.inherit = False
# letter badge
badge = slide.shapes.add_shape(MSO_SHAPE.OVAL, Inches(0.35), Inches(0.2), Inches(0.75), Inches(0.75))
badge.fill.solid(); badge.fill.fore_color.rgb = WHITE; badge.line.color.rgb = color; badge.line.width = Pt(2)
badge.shadow.inherit = False
tf = badge.text_frame; tf.word_wrap = True
tf.margin_left=0; tf.margin_right=0; tf.margin_top=0; tf.margin_bottom=0
p = tf.paragraphs[0]; p.alignment = PP_ALIGN.CENTER
r = p.add_run(); r.text = letter
r.font.size = Pt(28); r.font.bold = True; r.font.color.rgb = color
tf.vertical_anchor = MSO_ANCHOR.MIDDLE
# title text
tb = slide.shapes.add_textbox(Inches(1.3), Inches(0.15), Inches(11.5), Inches(0.55))
tf = tb.text_frame; tf.word_wrap = True
p = tf.paragraphs[0]
r = p.add_run(); r.text = title
r.font.size = Pt(26); r.font.bold = True; r.font.color.rgb = WHITE
if subtitle:
tb2 = slide.shapes.add_textbox(Inches(1.3), Inches(0.62), Inches(11.5), Inches(0.45))
tf2 = tb2.text_frame; tf2.word_wrap = True
p2 = tf2.paragraphs[0]
r2 = p2.add_run(); r2.text = subtitle
r2.font.size = Pt(14); r2.font.italic = True; r2.font.color.rgb = WHITE
def add_bullets(slide, items, left=Inches(0.6), top=Inches(1.45), width=Inches(12.1), height=Inches(5.7),
font_size=16, bold_color=None, line_space=Pt(8)):
tb = slide.shapes.add_textbox(left, top, width, height)
tf = tb.text_frame; tf.word_wrap = True
first = True
for item in items:
if isinstance(item, tuple):
text, level, bold = item
else:
text, level, bold = item, 0, False
p = tf.paragraphs[0] if first else tf.add_paragraph()
first = False
p.level = level
p.space_after = line_space
bullet = "• " if level == 0 else "‒ "
r = p.add_run()
r.text = bullet + text
r.font.size = Pt(font_size if level == 0 else font_size - 2)
r.font.bold = bold
r.font.color.rgb = GREY if not bold else NAVY
return tb
def add_table(slide, rows, col_widths, top=Inches(1.5), left=Inches(0.6), header_color=RGBColor(0x1B,0x2A,0x4A), font_size=13):
n_rows = len(rows)
n_cols = len(rows[0])
total_width = sum(col_widths)
height = Inches(0.45) * n_rows
tbl_shape = slide.shapes.add_table(n_rows, n_cols, left, top, Inches(total_width), height)
tbl = tbl_shape.table
for c, w in enumerate(col_widths):
tbl.columns[c].width = Inches(w)
for r_idx, row in enumerate(rows):
for c_idx, val in enumerate(row):
cell = tbl.cell(r_idx, c_idx)
cell.text = str(val)
cell.margin_left = Pt(4); cell.margin_right = Pt(4)
cell.margin_top = Pt(2); cell.margin_bottom = Pt(2)
cell.vertical_anchor = MSO_ANCHOR.MIDDLE
for p in cell.text_frame.paragraphs:
p.alignment = PP_ALIGN.LEFT
for run in p.runs:
run.font.size = Pt(font_size)
if r_idx == 0:
run.font.bold = True
run.font.color.rgb = WHITE
else:
run.font.color.rgb = GREY
if r_idx == 0:
cell.fill.solid(); cell.fill.fore_color.rgb = header_color
else:
cell.fill.solid()
cell.fill.fore_color.rgb = LIGHT if r_idx % 2 == 0 else WHITE
return tbl_shape
def footer(slide, text):
tb = slide.shapes.add_textbox(Inches(0.4), Inches(7.15), Inches(12.5), Inches(0.3))
tf = tb.text_frame
p = tf.paragraphs[0]
r = p.add_run(); r.text = text
r.font.size = Pt(10); r.font.italic = True; r.font.color.rgb = RGBColor(0x99,0x99,0x99)
# ---------------------------------------------------------------
# SLIDE 1 - TITLE
# ---------------------------------------------------------------
slide = prs.slides.add_slide(blank)
add_bg(slide, NAVY)
accent = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, 0, Inches(5.3), prs.slide_width, Inches(0.08))
accent.fill.solid(); accent.fill.fore_color.rgb = RGBColor(0xE0,0x8E,0x00); accent.line.fill.background(); accent.shadow.inherit=False
tb = slide.shapes.add_textbox(Inches(1), Inches(2.3), Inches(11.3), Inches(1.3))
tf = tb.text_frame; tf.word_wrap = True
p = tf.paragraphs[0]; p.alignment = PP_ALIGN.CENTER
r = p.add_run(); r.text = "Clinical Case Presentation"
r.font.size = Pt(44); r.font.bold = True; r.font.color.rgb = WHITE
tb2 = slide.shapes.add_textbox(Inches(1), Inches(3.5), Inches(11.3), Inches(0.9))
tf2 = tb2.text_frame; tf2.word_wrap = True
p2 = tf2.paragraphs[0]; p2.alignment = PP_ALIGN.CENTER
r2 = p2.add_run(); r2.text = "SOAP Format: Cerebral Venous Thrombosis (CVT) Secondary to OCP Use"
r2.font.size = Pt(22); r2.font.color.rgb = RGBColor(0xE0,0x8E,0x00); r2.font.bold=True
tb3 = slide.shapes.add_textbox(Inches(1), Inches(4.4), Inches(11.3), Inches(0.6))
tf3 = tb3.text_frame; tf3.word_wrap = True
p3 = tf3.paragraphs[0]; p3.alignment = PP_ALIGN.CENTER
r3 = p3.add_run(); r3.text = "with Benign Intracranial Hypertension & Nutritional Deficiency Anemia"
r3.font.size = Pt(16); r3.font.italic = True; r3.font.color.rgb = RGBColor(0xCC,0xCC,0xCC)
tb4 = slide.shapes.add_textbox(Inches(1), Inches(5.8), Inches(11.3), Inches(1))
tf4 = tb4.text_frame; tf4.word_wrap = True
p4 = tf4.paragraphs[0]; p4.alignment = PP_ALIGN.CENTER
r4 = p4.add_run(); r4.text = "Department of Pharmacy Practice | Patient Profile No. 32 | Female, 26 yrs"
r4.font.size = Pt(14); r4.font.color.rgb = WHITE
# ---------------------------------------------------------------
# SLIDE 2 - PATIENT DEMOGRAPHICS
# ---------------------------------------------------------------
slide = prs.slides.add_slide(blank)
add_bg(slide, WHITE)
section_header(slide, "S", "Patient Demographics & Identification", "Baseline case information")
rows = [
["Parameter", "Details"],
["Age / Sex", "26 years / Female"],
["IP No.", "20264844"],
["Ward / Bed", "FMW"],
["Speciality", "General Medicine (GM)"],
["Date of Admission", "07/02/2026"],
["Allergies", "Nil Known"],
["General Exam", "Well built & nourished (Obese)"],
]
add_table(slide, rows, [4.0, 8.0], top=Inches(1.5))
footer(slide, "SOAP Case Presentation - Cerebral Venous Thrombosis")
# ---------------------------------------------------------------
# SLIDE 3 - S: CHIEF COMPLAINTS & HPI
# ---------------------------------------------------------------
slide = prs.slides.add_slide(blank)
add_bg(slide, WHITE)
section_header(slide, "S", "SUBJECTIVE - Chief Complaints & History", "Patient-reported symptoms and history")
items = [
("Chief Complaints", 0, True),
("Headache x 2 weeks", 1, False),
("Blurring of vision x 1 week", 1, False),
("Double vision x 1 week", 1, False),
("History of Present Illness", 0, True),
("Dull-aching headache in occipital region, not relieved by medication, no associated vomiting", 1, False),
("Blurring of vision x 1 week, double vision x 1 week", 1, False),
("Past History", 0, True),
("Irregular menstruation x 2-3 years", 1, False),
("Past Medication", 0, True),
("T. Norethisterone 10 mg (for irregular menses) - suspected causative agent for CVT", 1, False),
("Obstetric / Menstrual History", 0, True),
("P1L1, male child 5 yrs (alive & healthy), delivered by LSCS; irregular menses once in 2-3 months since 2022", 1, False),
("Personal / Social History", 0, True),
("Mixed diet, good appetite, no addictions, normal sleep/bowel/bladder habits", 1, False),
]
add_bullets(slide, items, font_size=15)
footer(slide, "SOAP Case Presentation - Cerebral Venous Thrombosis")
# ---------------------------------------------------------------
# SLIDE 4 - O: VITALS & PHYSICAL EXAM
# ---------------------------------------------------------------
slide = prs.slides.add_slide(blank)
add_bg(slide, WHITE)
section_header(slide, "O", "OBJECTIVE - Vitals & Physical Examination", "Clinical findings at admission")
rows = [
["Vital Sign", "Value", "Reference"],
["Blood Pressure", "130/70 mmHg", "Normal"],
["Pulse Rate", "112 bpm", "Tachycardia (likely 2° anemia)"],
["SpO2", "99% on RA", "Normal"],
]
add_table(slide, rows, [4.0, 4.0, 4.0], top=Inches(1.5), font_size=14)
items = [
("Systemic Examination", 0, True),
("CNS: Conscious & oriented, Pupils - BERL (Bilateral Equal Reactive to Light)", 1, False),
("CVS: S1S2 heard, no murmur", 1, False),
("RS: Bilateral normal vesicular breath sounds, no added sounds", 1, False),
("PA: Soft, non-tender", 1, False),
("Fundoscopy: Grade IV Papilledema (severe - correlates with raised ICP)", 1, True),
]
add_bullets(slide, items, top=Inches(3.6), font_size=15)
footer(slide, "SOAP Case Presentation - Cerebral Venous Thrombosis")
# ---------------------------------------------------------------
# SLIDE 5 - O: LAB INVESTIGATIONS
# ---------------------------------------------------------------
slide = prs.slides.add_slide(blank)
add_bg(slide, WHITE)
section_header(slide, "O", "OBJECTIVE - Key Laboratory & Imaging Findings", "Abnormal results driving diagnosis")
rows = [
["Investigation", "Result", "Reference Range", "Interpretation"],
["Hemoglobin", "7.3 g/dl", "12-16 g/dl", "Severe Anemia"],
["MCV / MCH", "62.5 / 19.2", "76-100 / 27-32", "Microcytic Hypochromic"],
["Platelets", "5.71 lakh/cumm", "1.5-4.5 lakh", "Thrombocytosis"],
["Serum Potassium", "2.6 mEq/L", "3.5-5.0 mEq/L", "Hypokalemia"],
["Vitamin B12", "120 pg/ml", "Low", "B12 Deficiency"],
["Free T4", "0.72 ng/dl", "0.82-1.63 ng/dl", "Low (subclinical)"],
["ECG", "Sinus Tachycardia", "-", "2° to Anemia"],
["Fundoscopy", "Grade IV Papilledema", "-", "Raised ICP"],
["USG Abdomen", "Grade 1 Fatty Liver", "-", "Incidental"],
["ANA / ANCA", "Negative", "-", "Rules out vasculitis"],
["MRI Brain c Venogram", "Left transverse sinus thrombosis", "-", "Confirms CVT"],
]
add_table(slide, rows, [3.2, 3.0, 3.0, 3.0], top=Inches(1.45), font_size=12.5)
footer(slide, "SOAP Case Presentation - Cerebral Venous Thrombosis")
# ---------------------------------------------------------------
# SLIDE 6 - A: DIAGNOSIS
# ---------------------------------------------------------------
slide = prs.slides.add_slide(blank)
add_bg(slide, WHITE)
section_header(slide, "A", "ASSESSMENT - Diagnosis", "Clinical reasoning and final diagnosis")
items = [
("Provisional Diagnosis", 0, True),
("Cerebral Venous Thrombosis (CVT) secondary to OCP use", 1, False),
("Intracranial Hypertension", 1, False),
("Final Diagnosis", 0, True),
("Cerebral Venous Thrombosis - Left Transverse Sinus", 1, False),
("Benign Intracranial Hypertension", 1, False),
("Nutritional Deficiency - Severe Anemia", 1, False),
("Clinical Reasoning", 0, True),
("Young female with progestin (Norethisterone) exposure + headache, visual disturbance, papilledema, and pulse >100 -> classic CVT presentation", 1, False),
("Microcytic anemia + low Vit B12 explains fatigue, tachycardia, and contributes to overall risk profile", 1, False),
("MRI Venogram confirmatory; ANA/ANCA negative excludes autoimmune/vasculitic cause", 1, False),
]
add_bullets(slide, items, font_size=15)
footer(slide, "SOAP Case Presentation - Cerebral Venous Thrombosis")
# ---------------------------------------------------------------
# SLIDE 7 - A: DRUG THERAPY PROBLEMS / PHARMACIST INTERVENTIONS
# ---------------------------------------------------------------
slide = prs.slides.add_slide(blank)
add_bg(slide, WHITE)
section_header(slide, "A", "ASSESSMENT - Drug Therapy Problems Identified", "Pharmacist interventions in this case")
items = [
("Drug Interaction: Acetazolamide + Iron-Folic Acid (IFA)", 0, True),
("Documented in chart: reduces folate absorption/efficacy -> IFA discontinued, switched to Inj. Methylcobalamin", 1, False),
("Drug-Induced Hypokalemia", 0, True),
("Acetazolamide + Mannitol both cause renal K+ wasting; K+ = 2.6 mEq/L left uncorrected in chart", 1, False),
("Causative Agent Identified", 0, True),
("T. Norethisterone (progestin) recognized as trigger for CVT; discontinued, counseling needed on future contraception", 1, False),
("Anticoagulation Initiated & Monitored", 0, True),
("Baseline BT/CT/PT checked before starting Inj. Enoxaparin for CVT treatment", 1, False),
("Gap: Missing Thrombophilia Work-up", 0, True),
("No protein C/S, antithrombin, antiphospholipid antibody testing despite unprovoked-appearing CVT", 1, False),
("Gap: No Oral Anticoagulant Bridge at Discharge", 0, True),
("CVT requires 3-12 months anticoagulation; discharge list has no warfarin/DOAC continuation", 1, False),
]
add_bullets(slide, items, font_size=14.5)
footer(slide, "SOAP Case Presentation - Cerebral Venous Thrombosis")
# ---------------------------------------------------------------
# SLIDE 8 - P: INPATIENT MEDICATIONS
# ---------------------------------------------------------------
slide = prs.slides.add_slide(blank)
add_bg(slide, WHITE)
section_header(slide, "P", "PLAN - Inpatient Medications", "Regular medication chart during admission")
rows = [
["Medication", "Dose / Route", "Frequency", "Indication"],
["Inj. Mannitol", "100 ml IV", "1-1-1", "Treat raised ICP"],
["T. Acetazolamide", "250 mg PO", "1-1-1", "Reduce CSF production"],
["Inj. Pantoprazole", "40 mg IV", "1-0-0", "Treat GI irritation"],
["IV Fluids", "IV", "Continuous", "Supportive treatment"],
["Supp. Glycerol", "15 ml PR", "1-1-1", "Treat raised ICP"],
["Inj. Enoxaparin", "60 mg SC", "1-0-1", "Treat CVT (anticoagulation)"],
["T. IFA (D/C'd)", "333 mg PO", "discontinued", "Was: Treat anemia"],
["Inj. Methylcobalamin", "1500 mcg IV/IM", "Weekly x 6 wks", "Treat anemia"],
]
add_table(slide, rows, [3.3, 2.8, 2.8, 4.1], top=Inches(1.6), font_size=13)
footer(slide, "SOAP Case Presentation - Cerebral Venous Thrombosis")
# ---------------------------------------------------------------
# SLIDE 9 - P: DISCHARGE MEDICATIONS
# ---------------------------------------------------------------
slide = prs.slides.add_slide(blank)
add_bg(slide, WHITE)
section_header(slide, "P", "PLAN - Discharge Medications", "Take-home regimen at discharge")
rows = [
["Medication", "Dose / Route", "Frequency", "Indication"],
["T. Acetazolamide", "250 mg PO", "1-1-1", "Intracranial HTN treatment"],
["T. Vit B Complex", "PO", "0-0-1", "Treat anemia"],
["Syp. Multivitamin", "5 ml PO", "1-0-1", "Treat anemia"],
["T. IFA", "333 mg PO", "0-1-0", "Treat anemia (spaced from Acetazolamide)"],
["Syp. Glycerol", "15 ml PO", "1-1-1", "Reduce ICP"],
["Inj. Methylcobalamin", "1500 mcg IM", "Weekly x 6 wks", "Treat anemia"],
]
add_table(slide, rows, [3.3, 2.8, 2.8, 4.1], top=Inches(1.6), font_size=13)
items = [
("Note: No oral anticoagulant present on discharge list despite CVT diagnosis - flagged as a care gap requiring team clarification.", 0, True),
]
add_bullets(slide, items, top=Inches(4.7), font_size=14)
footer(slide, "SOAP Case Presentation - Cerebral Venous Thrombosis")
# ---------------------------------------------------------------
# SLIDE 10 - P: MONITORING & COUNSELING
# ---------------------------------------------------------------
slide = prs.slides.add_slide(blank)
add_bg(slide, WHITE)
section_header(slide, "P", "PLAN - Monitoring Parameters & Patient Counseling", "Ensuring safe and effective therapy")
items = [
("Monitoring Parameters", 0, True),
("Daily BP, pulse rate, SpO2 (trending toward normal by Day 6: BP 130/80, PR 72 bpm)", 1, False),
("Serum potassium and renal function while on Acetazolamide/Mannitol", 1, False),
("Repeat CBC/Hemoglobin to track anemia correction", 1, False),
("Repeat fundoscopy to confirm resolution of papilledema", 1, False),
("Follow-up MRI Brain venogram to assess clot resolution", 1, False),
("Patient Counseling Points", 0, True),
("Avoid future estrogen/progestin-containing contraceptives or hormonal menstrual therapy", 1, False),
("Importance of adherence to anticoagulation and anemia therapy", 1, False),
("Diet counseling for iron/B12-rich foods; correct spacing of IFA from Acetazolamide", 1, False),
("Warning signs to report: worsening headache, vision changes, seizures", 1, False),
]
add_bullets(slide, items, font_size=15)
footer(slide, "SOAP Case Presentation - Cerebral Venous Thrombosis")
# ---------------------------------------------------------------
# SLIDE 11 - SUMMARY
# ---------------------------------------------------------------
slide = prs.slides.add_slide(blank)
add_bg(slide, NAVY)
tb = slide.shapes.add_textbox(Inches(0.8), Inches(0.5), Inches(11.5), Inches(0.9))
tf = tb.text_frame
p = tf.paragraphs[0]
r = p.add_run(); r.text = "Summary"
r.font.size = Pt(34); r.font.bold = True; r.font.color.rgb = WHITE
items = [
("26-year-old female with OCP-associated Cerebral Venous Thrombosis (left transverse sinus), benign intracranial hypertension, and severe nutritional deficiency anemia", 0, False),
("Managed with anti-edema measures (Mannitol, Acetazolamide, Glycerol), anticoagulation (Enoxaparin), and anemia correction (Methylcobalamin, IFA, multivitamins)", 0, False),
("Key pharmacist contribution: identification of Acetazolamide-IFA interaction and drug-induced hypokalemia", 0, False),
("Care gaps identified: incomplete thrombophilia work-up and missing discharge anticoagulation bridge - both merit clinical team follow-up", 0, False),
]
tb2 = slide.shapes.add_textbox(Inches(0.8), Inches(1.7), Inches(11.7), Inches(5))
tf2 = tb2.text_frame; tf2.word_wrap = True
first = True
for text, level, bold in items:
p = tf2.paragraphs[0] if first else tf2.add_paragraph()
first = False
p.space_after = Pt(16)
r = p.add_run(); r.text = "• " + text
r.font.size = Pt(18); r.font.color.rgb = WHITE
prs.save("/tmp/workspace/cvt-soap-ppt/output/CVT_Case_SOAP.pptx")
print("Saved successfully")
cd /tmp/workspace/cvt-soap-ppt && python build_ppt.py
cd /tmp/workspace/cvt-soap-ppt/output && ls -la && python3 -c " from pptx import Presentation prs = Presentation('CVT_Case_SOAP.pptx') print('Total slides:', len(prs.slides)) for i, slide in enumerate(prs.slides,1): texts = [s.text_frame.text for s in slide.shapes if s.has_text_frame and s.text_frame.text.strip()] print(i, texts[:1]) "
CVT Case SOAP
Presentation · PPTX
Give definition and symptoms for benign intracranial hypertension and nutritional deficiency severe anaemia
Just add definations not more containt
cd /tmp/workspace/cvt-soap-ppt && python3 -c " from pptx import Presentation prs = Presentation('output/CVT_Case_SOAP.pptx') print(len(prs.slides)) for i,s in enumerate(prs.slides,1): texts=[sh.text_frame.text for sh in s.shapes if sh.has_text_frame and sh.text_frame.text.strip()] print(i, texts[:2]) "
cd /tmp/workspace/cvt-soap-ppt && cat > add_definitions.py << 'EOF' from pptx import Presentation from pptx.util import Inches, Pt from pptx.dml.color import RGBColor from pptx.enum.text import PP_ALIGN, MSO_ANCHOR from pptx.enum.shapes import MSO_SHAPE path = "output/CVT_Case_SOAP.pptx" prs = Presentation(path) NAVY = RGBColor(0x1B, 0x2A, 0x4A) ORANGE = RGBColor(0xE0, 0x8E, 0x00) WHITE = RGBColor(0xFF, 0xFF, 0xFF) GREY = RGBColor(0x40, 0x40, 0x40) blank = prs.slide_layouts[6] slide = prs.slides.add_slide(blank) # background bg = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, 0, 0, prs.slide_width, prs.slide_height) bg.fill.solid(); bg.fill.fore_color.rgb = WHITE; bg.line.fill.background(); bg.shadow.inherit = False slide.shapes._spTree.remove(bg._element) slide.shapes._spTree.insert(2, bg._element) # header bar (orange = Assessment section color) bar = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, 0, 0, prs.slide_width, Inches(1.15)) bar.fill.solid(); bar.fill.fore_color.rgb = ORANGE; bar.line.fill.background(); bar.shadow.inherit = False badge = slide.shapes.add_shape(MSO_SHAPE.OVAL, Inches(0.35), Inches(0.2), Inches(0.75), Inches(0.75)) badge.fill.solid(); badge.fill.fore_color.rgb = WHITE; badge.line.color.rgb = ORANGE; badge.line.width = Pt(2) badge.shadow.inherit = False tf = badge.text_frame; tf.word_wrap = True tf.margin_left = 0; tf.margin_right = 0; tf.margin_top = 0; tf.margin_bottom = 0 p = tf.paragraphs[0]; p.alignment = PP_ALIGN.CENTER r = p.add_run(); r.text = "A" r.font.size = Pt(28); r.font.bold = True; r.font.color.rgb = ORANGE tf.vertical_anchor = MSO_ANCHOR.MIDDLE tb = slide.shapes.add_textbox(Inches(1.3), Inches(0.15), Inches(11.5), Inches(0.55)) tf = tb.text_frame; tf.word_wrap = True p = tf.paragraphs[0] r = p.add_run(); r.text = "ASSESSMENT - Key Term Definitions" r.font.size = Pt(26); r.font.bold = True; r.font.color.rgb = WHITE tb2 = slide.shapes.add_textbox(Inches(1.3), Inches(0.62), Inches(11.5), Inches(0.45)) tf2 = tb2.text_frame; tf2.word_wrap = True p2 = tf2.paragraphs[0] r2 = p2.add_run(); r2.text = "Definitions of diagnoses in this case" r2.font.size = Pt(14); r2.font.italic = True; r2.font.color.rgb = WHITE # content tb3 = slide.shapes.add_textbox(Inches(0.6), Inches(1.6), Inches(12.1), Inches(5.4)) tf3 = tb3.text_frame; tf3.word_wrap = True p = tf3.paragraphs[0] r = p.add_run(); r.text = "Benign Intracranial Hypertension (Idiopathic Intracranial Hypertension)" r.font.bold = True; r.font.size = Pt(18); r.font.color.rgb = NAVY p.space_after = Pt(8) p = tf3.add_paragraph() r = p.add_run(); r.text = ("A condition of increased intracranial pressure that occurs without an identifiable " "structural cause - neuroimaging is normal, venous thrombosis is excluded, and CSF composition is normal " "despite an elevated opening pressure (>25 cm CSF). It occurs almost exclusively in obese young women.") r.font.size = Pt(16); r.font.color.rgb = GREY p.space_after = Pt(28) p = tf3.add_paragraph() r = p.add_run(); r.text = "Nutritional Deficiency Severe Anemia" r.font.bold = True; r.font.size = Pt(18); r.font.color.rgb = NAVY p.space_after = Pt(8) p = tf3.add_paragraph() r = p.add_run(); r.text = ("A marked reduction in the oxygen-carrying capacity of the blood (hemoglobin well " "below normal) resulting from inadequate intake, absorption, or utilization of essential hematopoietic " "nutrients such as iron, vitamin B12, or folate.") r.font.size = Pt(16); r.font.color.rgb = GREY # footer tb4 = slide.shapes.add_textbox(Inches(0.4), Inches(7.15), Inches(12.5), Inches(0.3)) tf4 = tb4.text_frame p4 = tf4.paragraphs[0] r4 = p4.add_run(); r4.text = "SOAP Case Presentation - Cerebral Venous Thrombosis" r4.font.size = Pt(10); r4.font.italic = True; r4.font.color.rgb = RGBColor(0x99, 0x99, 0x99) # Reorder: move new slide (currently last) to position right after slide 6 (Diagnosis, index 5) -> new index 6 sldIdLst = prs.slides._sldIdLst slides = list(sldIdLst) new_elem = slides[-1] sldIdLst.remove(new_elem) sldIdLst.insert(6, new_elem) prs.save(path) print("Total slides now:", len(prs.slides)) EOF python3 add_definitions.py
cd /tmp/workspace/cvt-soap-ppt && python3 -c " from pptx import Presentation prs = Presentation('output/CVT_Case_SOAP.pptx') print('Total slides:', len(prs.slides)) for i,s in enumerate(prs.slides,1): texts=[sh.text_frame.text.split(chr(10))[0] for sh in s.shapes if sh.has_text_frame and sh.text_frame.text.strip()] print(i, texts[:2]) "
CVT Case SOAP
Presentation · PPTX