Do a 12 to 15 pages ppt of this uploaded topic
hydrops fetalis stillborn edematous infant rhesus alloimmunization
Rh isoimmunization mechanism fetomaternal hemorrhage diagram
mkdir -p /tmp/workspace/rh_ppt/assets && ls -la /tmp/workspace/attachments/bc3b6ab4-6062-4251-a501-77031d4791e9/ && python3 -c "from PIL import Image; im=Image.open('/tmp/workspace/attachments/bc3b6ab4-6062-4251-a501-77031d4791e9/1000107105.jpg'); print(im.size)"
cd /tmp/workspace/rh_ppt/assets && python3 << 'EOF' from PIL import Image # Crop hydrops fetalis photo from 1000107105.jpg (top-left photo) im = Image.open('/tmp/workspace/attachments/bc3b6ab4-6062-4251-a501-77031d4791e9/1000107105.jpg') w,h = im.size print("full size", w,h) # crop top-left region roughly (based on visual: photo occupies top ~22% height, left ~48% width) crop1 = im.crop((0,0, int(w*0.50), int(h*0.24))) crop1.save('hydrops_fetalis.jpg') print("crop1 size", crop1.size) # Crop mating flowchart from 1000107103.jpg (top portion, full width) im2 = Image.open('/tmp/workspace/attachments/bc3b6ab4-6062-4251-a501-77031d4791e9/1000107103.jpg') w2,h2 = im2.size print("full size2", w2,h2) crop2 = im2.crop((0,0,w2,int(h2*0.27))) crop2.save('mating_flowchart.jpg') print("crop2 size", crop2.size) EOF ls -la /tmp/workspace/rh_ppt/assets/
cd /tmp/workspace/rh_ppt/assets && python3 << 'EOF' from PIL import Image im = Image.open('/tmp/workspace/attachments/bc3b6ab4-6062-4251-a501-77031d4791e9/1000107104.jpg') w,h = im.size print(w,h) # anti-D dosing table is left column, roughly y 15%-38% crop = im.crop((0,int(h*0.14), int(w*0.52), int(h*0.40))) crop.save('antid_table.jpg') print(crop.size) EOF
~/rh_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
import os
ASSETS = "/tmp/workspace/rh_ppt/assets"
# ---------- Color palette ----------
NAVY = RGBColor(0x0B, 0x2E, 0x59)
BLUE = RGBColor(0x1F, 0x5C, 0x99)
LIGHT_BLUE = RGBColor(0xE8, 0xF1, 0xFA)
ACCENT = RGBColor(0xC0, 0x39, 0x2B) # deep red accent for alerts
GOLD = RGBColor(0xD4, 0xA0, 0x17)
WHITE = RGBColor(0xFF, 0xFF, 0xFF)
DARK = RGBColor(0x2B, 0x2B, 0x2B)
GREY = RGBColor(0x60, 0x60, 0x60)
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
BLANK = prs.slide_layouts[6]
SW, SH = prs.slide_width, prs.slide_height
def add_slide():
return prs.slides.add_slide(BLANK)
def bg(slide, color=WHITE):
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = color
def rect(slide, x, y, w, h, color, line=False):
shp = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, x, y, w, h)
shp.fill.solid()
shp.fill.fore_color.rgb = color
if line:
shp.line.color.rgb = color
else:
shp.line.fill.background()
shp.shadow.inherit = False
return shp
def textbox(slide, x, y, w, h, text, size=18, color=DARK, bold=False, italic=False,
align=PP_ALIGN.LEFT, font="Calibri", anchor=MSO_ANCHOR.TOP, line_spacing=1.0):
tb = slide.shapes.add_textbox(x, y, w, h)
tf = tb.text_frame
tf.word_wrap = True
tf.vertical_anchor = anchor
tf.margin_left = 0
tf.margin_right = 0
tf.margin_top = 0
tf.margin_bottom = 0
lines = text.split("\n")
for i, line in enumerate(lines):
p = tf.paragraphs[0] if i == 0 else tf.add_paragraph()
p.text = line
p.alignment = align
p.line_spacing = line_spacing
for r in p.runs:
r.font.size = Pt(size)
r.font.color.rgb = color
r.font.bold = bold
r.font.italic = italic
r.font.name = font
return tb
def header(slide, kicker, title, num, total=15):
rect(slide, 0, 0, SW, Inches(1.15), NAVY)
rect(slide, 0, Inches(1.15), SW, Pt(3), GOLD)
textbox(slide, Inches(0.55), Inches(0.12), Inches(9.5), Inches(0.35), kicker.upper(),
size=13, color=GOLD, bold=True, font="Calibri")
textbox(slide, Inches(0.55), Inches(0.42), Inches(11.5), Inches(0.65), title,
size=28, color=WHITE, bold=True, font="Calibri")
textbox(slide, Inches(12.4), Inches(6.95), Inches(0.7), Inches(0.4), f"{num:02d}",
size=13, color=GREY, align=PP_ALIGN.RIGHT)
def footer(slide, text="Red Cell Alloimmunization | Rh-Negative Pregnancy"):
textbox(slide, Inches(0.55), Inches(6.95), Inches(8), Inches(0.4), text,
size=10, color=GREY, italic=True)
def bullets(slide, x, y, w, h, items, size=16, color=DARK, bold_lead=False,
gap=8, bullet_color=BLUE, font="Calibri", line_spacing=1.08):
"""items: list of (text, level) or (lead, text, level) tuples."""
tb = slide.shapes.add_textbox(x, y, w, h)
tf = tb.text_frame
tf.word_wrap = True
for i, item in enumerate(items):
if len(item) == 3:
lead, text, level = item
else:
lead, text, level = None, item[0], item[1]
p = tf.paragraphs[0] if i == 0 else tf.add_paragraph()
p.line_spacing = line_spacing
p.space_after = Pt(gap)
indent = " " * level
marker = "▸ " if level == 0 else "– "
p.text = ""
if lead:
r1 = p.add_run()
r1.text = f"{indent}{marker}{lead}: "
r1.font.bold = True
r1.font.size = Pt(size)
r1.font.color.rgb = bullet_color if level == 0 else color
r1.font.name = font
r2 = p.add_run()
r2.text = text
r2.font.size = Pt(size)
r2.font.color.rgb = color
r2.font.name = font
else:
r1 = p.add_run()
r1.text = f"{indent}{marker}"
r1.font.size = Pt(size)
r1.font.bold = (level == 0)
r1.font.color.rgb = bullet_color if level == 0 else GREY
r1.font.name = font
r2 = p.add_run()
r2.text = text
r2.font.size = Pt(size)
r2.font.color.rgb = color
r2.font.name = font
return tb
def stat_card(slide, x, y, w, h, number, label, color=BLUE):
rect(slide, x, y, w, h, LIGHT_BLUE)
textbox(slide, x, y + Inches(0.12), w, Inches(0.6), number, size=28, color=color,
bold=True, align=PP_ALIGN.CENTER)
textbox(slide, x + Inches(0.1), y + Inches(0.75), w - Inches(0.2), h - Inches(0.85), label,
size=12, color=DARK, align=PP_ALIGN.CENTER, line_spacing=1.0)
def picture_framed(slide, path, x, y, w, h, caption=None, cap_size=11):
slide.shapes.add_picture(path, x, y, width=w, height=h)
frame = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, x, y, w, h)
frame.fill.background()
frame.line.color.rgb = BLUE
frame.line.width = Pt(1.5)
frame.shadow.inherit = False
if caption:
textbox(slide, x, y + h + Inches(0.05), w, Inches(0.4), caption, size=11,
color=GREY, italic=True, align=PP_ALIGN.CENTER)
# =========================================================
# SLIDE 1 — TITLE
# =========================================================
s = add_slide()
bg(s, NAVY)
rect(s, 0, Inches(6.6), SW, Inches(0.9), GOLD)
textbox(s, Inches(0.9), Inches(2.3), Inches(11.5), Inches(0.5), "OBSTETRICS • COMPLICATED PREGNANCY",
size=16, color=GOLD, bold=True)
textbox(s, Inches(0.9), Inches(2.85), Inches(11.5), Inches(1.7), "Red Cell Alloimmunization",
size=48, color=WHITE, bold=True)
textbox(s, Inches(0.9), Inches(3.95), Inches(11.5), Inches(0.8),
"(Syn: Pregnancy in a Rh-Negative Woman)", size=22, color=WHITE, italic=True)
textbox(s, Inches(0.9), Inches(6.75), Inches(9), Inches(0.6),
"Nomenclature • Genetics • Pathophysiology • HDFN • Prevention with Anti-D",
size=14, color=NAVY, bold=True)
# =========================================================
# SLIDE 2 — NOMENCLATURE & DISCOVERY
# =========================================================
s = add_slide(); bg(s)
header(s, "Background", "Nomenclature & Discovery of the Rh Antigen", 2)
bullets(s, Inches(0.6), Inches(1.55), Inches(7.4), Inches(5),
[
("Landsteiner & Wiener (1940)", "discovered a previously unknown antigen in human red cells.", 0),
(None, "The antigen was also found in Rhesus monkeys, hence named the Rh antigen.", 1),
("Rh-positive", "individual in whom the antigen IS present on red cells.", 0),
("Rh-negative", "individual in whom the antigen is ABSENT.", 0),
("Clinical relevance", "Rh incompatibility between an Rh-negative mother and Rh-positive fetus underlies most cases of hemolytic disease of the fetus and newborn (HDFN).", 0),
], size=17, gap=14)
rect(s, Inches(8.3), Inches(1.55), Inches(4.4), Inches(3.2), LIGHT_BLUE)
textbox(s, Inches(8.55), Inches(1.75), Inches(3.9), Inches(0.4), "KEY TERM", size=13, bold=True, color=BLUE)
textbox(s, Inches(8.55), Inches(2.15), Inches(3.9), Inches(2.4),
"\u201cAlloimmunization\u201d = production of immune antibodies in an individual in response to a "
"foreign red-cell antigen from another individual of the same species, when the first individual "
"lacks that antigen.", size=15, color=DARK, line_spacing=1.2)
footer(s)
# =========================================================
# SLIDE 3 — INCIDENCE
# =========================================================
s = add_slide(); bg(s)
header(s, "Epidemiology", "Incidence of Rh-Negative Blood Group", 3)
stat_card(s, Inches(0.6), Inches(1.6), Inches(2.7), Inches(1.5), "15-17%", "European & American Whites")
stat_card(s, Inches(3.5), Inches(1.6), Inches(2.7), Inches(1.5), "~1%", "China")
stat_card(s, Inches(6.4), Inches(1.6), Inches(2.7), Inches(1.5), "Almost Nil", "Japan")
stat_card(s, Inches(9.3), Inches(1.6), Inches(3.4), Inches(1.5), "5-10%", "India (hospital statistics)")
bullets(s, Inches(0.6), Inches(3.5), Inches(11.6), Inches(3),
[
("India regional split", "South India ~5% | North India ~10%", 0),
("Paternal zygosity", "Among Rh-positive men, about 60% are heterozygous (Dd) and 40% are homozygous (DD) at the D locus.", 0),
("Overall fetal risk", "An Rh-negative woman has ~60% chance of carrying a Rh-positive fetus, irrespective of the father's genotype.", 0),
], size=17, gap=16)
footer(s)
# =========================================================
# SLIDE 4 — GENOTYPES
# =========================================================
s = add_slide(); bg(s)
header(s, "Genetics", "Genotypes of the Rh Blood Group", 4)
bullets(s, Inches(0.6), Inches(1.55), Inches(7.2), Inches(5),
[
("Antenatal testing", "All pregnant women should have ABO-Rh grouping and typing plus serum antibody testing at the first antenatal visit, repeated at 28 weeks.", 0),
("Genotype", "the complete genetic make-up of the Rh blood group of an individual.", 0),
("D antigen", "the most potent Rh antigen - responsible for almost 95% of all damage due to Rh incompatibility. Its presence/absence defines Rh-positive/negative status.", 0),
("Homozygous (DD)", "D antigen on both chromosomes - 65% of Rh-positive men.", 0),
("Heterozygous (Dd)", "D antigen on only one chromosome - 35% of Rh-positive men. Always classified Rh-positive since D is dominant over d.", 0),
("Common genotypes", "CDe/cde, CDe/CDe, CDe/cDE.", 0),
], size=16, gap=11)
rect(s, Inches(8.15), Inches(1.55), Inches(4.6), Inches(4.9), LIGHT_BLUE)
textbox(s, Inches(8.4), Inches(1.75), Inches(4.1), Inches(0.4), "CONVENTION USED", size=13, bold=True, color=BLUE)
textbox(s, Inches(8.4), Inches(2.2), Inches(4.1), Inches(2.0),
"Throughout this topic:\nRh-positive = D-positive\nRh-negative = D-negative (absence of D)",
size=16, color=DARK, line_spacing=1.3)
textbox(s, Inches(8.4), Inches(4.5), Inches(4.1), Inches(1.8),
"The Rh locus lies on the short arm of chromosome 1. RhCe and RhD are two distinct genes at this locus.",
size=14, color=DARK, italic=True, line_spacing=1.2)
footer(s)
# =========================================================
# SLIDE 5 — INHERITANCE / MATING FLOWCHART (image)
# =========================================================
s = add_slide(); bg(s)
header(s, "Genetics", "Inheritance Pattern: Rh-Positive Father x Rh-Negative Mother", 5)
picture_framed(s, os.path.join(ASSETS, "mating_flowchart.jpg"), Inches(0.6), Inches(1.6), Inches(11.9), Inches(3.6),
caption="Flowchart: Mating of Rh-positive male with Rh-negative female and resultant fetal Rh-group")
bullets(s, Inches(0.6), Inches(5.55), Inches(11.9), Inches(1.5),
[
("Homozygous father (DD)", "ALL children will be Rh-positive (Dd) - every pregnancy is at risk.", 0),
("Heterozygous father (Dd)", "50% children Rh-positive (Dd, incompatible), 50% Rh-negative (dd, compatible).", 0),
], size=15, gap=6)
footer(s)
# =========================================================
# SLIDE 6 — GRANDMOTHER THEORY
# =========================================================
s = add_slide(); bg(s)
header(s, "Genetics", "The \u201cGrandmother Theory\u201d", 6)
rect(s, Inches(0.6), Inches(1.7), Inches(7.4), Inches(4.6), LIGHT_BLUE)
textbox(s, Inches(0.9), Inches(1.95), Inches(6.9), Inches(4.1),
"During delivery, Rh-D positive fetal red cells may transfer from an Rh-positive fetus into the "
"circulation of its Rh-negative mother (the future 'grandmother').\n\n"
"This mother may become sensitized and produce anti-D antibodies even BEFORE her own daughter's "
"first pregnancy.\n\n"
"Later, when that daughter (who is Rh-negative, having inherited it from the grandmother) becomes "
"pregnant with an Rh-positive fetus, maternal anti-D antibodies that trace back to the grandmother's "
"sensitization can affect the current pregnancy - even though this is technically the daughter's "
"'first' exposure.",
size=16, color=DARK, line_spacing=1.25)
rect(s, Inches(8.3), Inches(1.7), Inches(4.4), Inches(4.6), NAVY)
textbox(s, Inches(8.55), Inches(1.9), Inches(3.9), Inches(0.5), "KEY FACT", size=13, bold=True, color=GOLD)
textbox(s, Inches(8.55), Inches(2.4), Inches(3.9), Inches(1.2), "~25%", size=44, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
textbox(s, Inches(8.55), Inches(3.6), Inches(3.9), Inches(2.4),
"of Rh-negative babies have been found to be immunized by this grandmother-theory mechanism.",
size=15, color=WHITE, align=PP_ALIGN.CENTER, line_spacing=1.2)
footer(s)
# =========================================================
# SLIDE 7 — CAUSES: PREGNANCY-RELATED FETOMATERNAL HEMORRHAGE
# =========================================================
s = add_slide(); bg(s)
header(s, "Etiology", "Causes of Alloimmunization (1): Fetomaternal Hemorrhage", 7)
textbox(s, Inches(0.6), Inches(1.4), Inches(11.9), Inches(0.5),
"As a result of pregnancy - Rh-negative woman bearing a Rh-positive fetus", size=16, bold=True, color=BLUE)
cols = [
("Early Pregnancy", ["Miscarriage", "MTP (medical termination)", "Ectopic pregnancy", "Hydatidiform mole"]),
("Procedures", ["Genetic amniocentesis", "Embryoreduction", "CVS (chorionic villus sampling)", "Cordocentesis"]),
("Late Pregnancy", ["Placenta previa with bleeding", "Placental abruption", "IUFD", "External cephalic version",
"Abdominal trauma", "Manual removal of placenta"]),
]
x0 = Inches(0.6); colw = Inches(3.95); gap = Inches(0.2)
for i, (title, items) in enumerate(cols):
x = x0 + i * (colw + gap)
rect(s, x, Inches(2.05), colw, Inches(0.55), BLUE)
textbox(s, x, Inches(2.05), colw, Inches(0.55), title, size=16, bold=True, color=WHITE,
align=PP_ALIGN.CENTER, anchor=MSO_ANCHOR.MIDDLE)
rect(s, x, Inches(2.6), colw, Inches(3.1), LIGHT_BLUE)
bl = [(it, 0) for it in items]
bullets(s, x + Inches(0.2), Inches(2.8), colw - Inches(0.4), Inches(2.8), bl, size=14, gap=8)
textbox(s, Inches(0.6), Inches(5.9), Inches(11.9), Inches(1.0),
"Delivery of an Rh-D positive infant to a Rh-negative mother carries the highest risk (15-50%), especially "
"during the 3rd stage of labor, following cesarean section, or manual removal of placenta. Continuous "
"fetomaternal bleed also occurs throughout normal pregnancy (~1%).",
size=14, italic=True, color=DARK)
footer(s)
# =========================================================
# SLIDE 8 — CAUSES: MISMATCHED TRANSFUSION + ANTI-D DOSING TABLE
# =========================================================
s = add_slide(); bg(s)
header(s, "Etiology & Practice Points", "Causes (2): Mismatched Transfusion & Anti-D Dosage Guide", 8)
bullets(s, Inches(0.6), Inches(1.55), Inches(5.9), Inches(3.0),
[
("Mismatched blood transfusion", "In ABO incompatibility, naturally-occurring anti-A/anti-B cause an immediate reaction. In Rh, there is no naturally occurring antibody - but transfused Rh-positive cells sensitize the recipient if the amount is sufficiently large.", 0),
("Threshold", "Immunization is unlikely unless at least 0.1 mL of fetal blood enters the maternal circulation - the critical sensitizing volume.", 0),
], size=15, gap=12)
picture_framed(s, os.path.join(ASSETS, "antid_table.jpg"), Inches(6.75), Inches(1.55), Inches(6.0), Inches(4.0),
caption="Anti-D dosage by clinical scenario (illustrative reference table)")
footer(s)
# =========================================================
# SLIDE 9 — IMMUNE RESPONSE VARIATION / LOW AFFECTION RATE
# =========================================================
s = add_slide(); bg(s)
header(s, "Immunology", "Why Not All Exposures Cause Disease: Reasons for Low Affection Rate", 9)
bullets(s, Inches(0.6), Inches(1.5), Inches(11.9), Inches(5.3),
[
("Low prevalence", "of incompatible red cell antigens in the population.", 0),
("Insufficient placental transfer", "of fetal antigens or maternal antibodies.", 0),
("Variable maternal immune response", "Responder (60-70%), Hyporesponder (10-20%), Nonresponder (20%).", 0),
("Inborn inability to respond", "to the Rh antigen stimulus in some women.", 0),
("ABO incompatibility - protective effect:", "significant when mother is type O and father is A, B, or AB, because (i) ABO-incompatible fetal cells are cleared rapidly before splenic trapping, and (ii) maternal anti-A/anti-B damage the Rh antigen so it is no longer immunogenic.", 0),
("Variable antigenic stimulus", "of the D antigen, depending on fetal Rh genotype (e.g., CDe/cde).", 0),
("Volume of fetal blood entering maternal circulation", "0.1 mL is the critical sensitizing volume.", 0),
("Small number (1-2.7%)", "of Rh-negative women express D-antigen weakly on their own red cells and do not need Rh IG as they are not truly alloimmunized.", 0),
("Without Rh IG prophylaxis", "about 16% of Rh-negative women become alloimmunized with an Rh-positive delivery (2% at delivery, 7% by 6 months postpartum, 7% in the next pregnancy).", 0),
], size=14.5, gap=9)
footer(s)
# =========================================================
# SLIDE 10 — MECHANISM OF ANTIBODY FORMATION
# =========================================================
s = add_slide(); bg(s)
header(s, "Pathophysiology", "Mechanism of Antibody Formation in the Mother", 10)
bullets(s, Inches(0.6), Inches(1.55), Inches(11.9), Inches(3.3),
[
(None, "If mother and fetus are ABO-compatible (or the fetus is group 'O'), Rh-positive fetal red cells persist in the maternal circulation for their full lifespan.", 0),
(None, "These cells are eventually broken down by the reticuloendothelial system, liberating the Rh antigen.", 0),
(None, "Antibody production depends on reticuloendothelial responsiveness AND the number of fetal cells entering maternal blood.", 0),
(None, "Because this process takes time, immunization in a FIRST pregnancy is unlikely.", 0),
("Timeline", "Detectable antibodies usually develop 10-16 weeks after a large fetomaternal bleed. If the bleed is under 0.1 mL, antibody may not be detected until boosted by further Rh stimulus.", 0),
(None, "Antibodies once formed remain throughout life.", 0),
], size=16, gap=12)
rect(s, Inches(0.6), Inches(5.3), Inches(11.9), Inches(1.4), ACCENT)
textbox(s, Inches(0.9), Inches(5.45), Inches(11.3), Inches(1.1),
"First exposure = SENSITIZATION (silent). Subsequent exposure = IMMUNIZATION - a rapid, severe "
"hemolytic antibody response that can affect the current pregnancy or a mismatched transfusion.",
size=16, bold=True, color=WHITE, align=PP_ALIGN.CENTER, anchor=MSO_ANCHOR.MIDDLE)
footer(s)
# =========================================================
# SLIDE 11 — TYPES OF ANTIBODIES: IgM vs IgG
# =========================================================
s = add_slide(); bg(s)
header(s, "Pathophysiology", "Types of Antibodies Formed", 11)
colw = Inches(5.75)
rect(s, Inches(0.6), Inches(1.6), colw, Inches(4.8), LIGHT_BLUE)
textbox(s, Inches(0.6), Inches(1.6), colw, Inches(0.7), "IgM", size=30, bold=True, color=BLUE, align=PP_ALIGN.CENTER)
bullets(s, Inches(0.9), Inches(2.5), colw - Inches(0.6), Inches(3.7),
[
("First to appear", "in the maternal circulation.", 0),
(None, "Agglutinates red cells containing D when suspended in saline.", 0),
("Large molecule", "cannot cross the placental barrier.", 0),
("Clinical impact", "NOT harmful to the fetus.", 0),
], size=16, gap=14)
x2 = Inches(6.95)
rect(s, x2, Inches(1.6), colw, Inches(4.8), NAVY)
textbox(s, x2, Inches(1.6), colw, Inches(0.7), "IgG", size=30, bold=True, color=GOLD, align=PP_ALIGN.CENTER)
bullets(s, x2 + Inches(0.3), Inches(2.5), colw - Inches(0.6), Inches(3.7),
[
("Also called", "incomplete / blocking antibody.", 0),
(None, "Agglutinates D-containing red cells only when suspended in 20% albumin.", 0),
("Small molecular size", "crosses the placental barrier.", 0),
("Clinical impact", "Causes fetal damage - appears LATER than IgM. The proportion of IgM vs IgG matters more than the absolute antibody titer.", 0),
], size=16, gap=14, color=WHITE, bullet_color=GOLD)
footer(s)
# =========================================================
# SLIDE 12 — FETAL AFFECTION BY Rh ANTIBODY
# =========================================================
s = add_slide(); bg(s)
header(s, "Pathophysiology", "Fetal Affection by the Rh Antibody (HDFN)", 12)
bullets(s, Inches(0.6), Inches(1.55), Inches(11.9), Inches(4.2),
[
(None, "Maternal IgG crosses the placental barrier and enters the fetal circulation.", 0),
("Prevalence", "D-alloimmunization complicates about 0.5-0.9% of pregnancies.", 0),
(None, "The antibody has NO effect if the fetus is Rh-negative.", 0),
("If fetus is Rh-positive:", "antibody binds antigen sites on fetal erythrocytes -> affected cells are rapidly removed by the reticuloendothelial system.", 0),
("Severity spectrum", "The degree of agglutination and destruction of fetal red cells determines the severity of the resulting hemolytic disease - loosely termed erythroblastosis fetalis (reflecting the nucleated red cells seen in peripheral blood from compensatory erythropoiesis).", 0),
], size=17, gap=14)
rect(s, Inches(0.6), Inches(6.0), Inches(11.9), Inches(0.8), LIGHT_BLUE)
textbox(s, Inches(0.9), Inches(6.12), Inches(11.3), Inches(0.6),
"Three principal clinical manifestations of HDFN follow -> Hydrops fetalis, Icterus gravis neonatorum, Congenital anemia of the newborn",
size=14, bold=True, color=BLUE)
footer(s)
# =========================================================
# SLIDE 13 — HYDROPS FETALIS (image)
# =========================================================
s = add_slide(); bg(s)
header(s, "Manifestations of HDFN", "Hydrops Fetalis - the Most Severe Form", 13)
picture_framed(s, os.path.join(ASSETS, "hydrops_fetalis.jpg"), Inches(0.6), Inches(1.6), Inches(4.6), Inches(2.75),
caption="Fig: Stillborn edematous infant due to rhesus alloimmunization")
bullets(s, Inches(5.55), Inches(1.55), Inches(7.0), Inches(4.9),
[
(None, "Excessive fetal red cell destruction -> severe anemia, tissue anoxemia and metabolic acidosis.", 0),
(None, "Damages the fetal heart, brain and placenta.", 0),
("Placental hyperplasia", "occurs to compensate for reduced oxygen-carrying capacity.", 0),
("Hepatic damage -> hypoproteinemia", "causing generalized edema (hydrops), ascites and hydrothorax.", 0),
("Sex difference", "Rh-positive male fetuses are 13x more likely to become hydropic and 3x more likely to die than female fetuses.", 0),
("Outcome", "Death occurs due to cardiac failure - baby is stillborn or macerated; if born alive, usually dies soon after.", 0),
("Bilirubin handling in utero", "excess bilirubin is cleared via the placenta, so the baby is NOT born jaundiced - but jaundice develops rapidly once the cord is clamped.", 0),
("Kernicterus risk", "if bilirubin rises above 20 mg/100 mL (340 \u00b5mol/L), it crosses the blood-brain barrier and damages the basal nuclei.", 0),
], size=13.5, gap=8)
footer(s)
# =========================================================
# SLIDE 14 — OTHER MANIFESTATIONS + AFFECTION OF THE MOTHER
# =========================================================
s = add_slide(); bg(s)
header(s, "Manifestations of HDFN", "Icterus Gravis Neonatorum, Congenital Anemia & Maternal Effects", 14)
colw = Inches(5.75)
rect(s, Inches(0.6), Inches(1.55), colw, Inches(2.3), LIGHT_BLUE)
textbox(s, Inches(0.85), Inches(1.68), colw - Inches(0.5), Inches(0.4), "Icterus Gravis Neonatorum", size=16, bold=True, color=BLUE)
textbox(s, Inches(0.85), Inches(2.1), colw - Inches(0.5), Inches(1.6),
"Effect of the lesser form of HDFN. Baby is born alive without evidence of jaundice, but soon "
"develops it within 24 hours of birth.", size=14, color=DARK, line_spacing=1.2)
rect(s, Inches(0.6), Inches(4.0), colw, Inches(2.4), LIGHT_BLUE)
textbox(s, Inches(0.85), Inches(4.13), colw - Inches(0.5), Inches(0.4), "Congenital Anemia of the Newborn", size=16, bold=True, color=BLUE)
textbox(s, Inches(0.85), Inches(4.55), colw - Inches(0.5), Inches(1.75),
"Mildest form. Hemolysis proceeds slowly; anemia develops within the first weeks of life though "
"jaundice is not usually evident. Hemolysis continues up to 6 weeks. Liver and spleen enlarge as "
"sites of extramedullary erythropoiesis.", size=14, color=DARK, line_spacing=1.2)
x2 = Inches(6.95)
rect(s, x2, Inches(1.55), colw, Inches(4.85), NAVY)
textbox(s, x2 + Inches(0.25), Inches(1.75), colw - Inches(0.5), Inches(0.5), "AFFECTION OF THE MOTHER", size=16, bold=True, color=GOLD)
bullets(s, x2 + Inches(0.25), Inches(2.35), colw - Inches(0.5), Inches(3.9),
[
("Increased incidence of:", "Pre-eclampsia", 0),
(None, "Polyhydramnios", 0),
(None, "Big-size baby with its hazards", 0),
(None, "Hypofibrinogenemia (prolonged retention of dead fetus)", 0),
(None, "Postpartum hemorrhage (big placenta, coagulopathy)", 0),
("Mirror syndrome", "fetal hydrops + maternal generalized edema, proteinuria and pruritus (cholestasis) - ominous sign of imminent fetal death in utero.", 0),
], size=13.5, gap=8, color=WHITE, bullet_color=GOLD)
footer(s)
# =========================================================
# SLIDE 15 — PREVENTION
# =========================================================
s = add_slide(); bg(s)
header(s, "Management", "Prevention of Rh-D Alloimmunization", 15)
textbox(s, Inches(0.6), Inches(1.45), Inches(11.9), Inches(0.4), "Three strategic goals:", size=16, bold=True, color=BLUE)
goals = ["Prevent active immunization", "Prevent / minimize fetomaternal bleed", "Avoid mismatched transfusion"]
colw = Inches(3.85); gap = Inches(0.2)
for i, g in enumerate(goals):
x = Inches(0.6) + i * (colw + gap)
rect(s, x, Inches(1.9), colw, Inches(0.9), BLUE)
textbox(s, x + Inches(0.15), Inches(1.9), colw - Inches(0.3), Inches(0.9), g, size=14, bold=True,
color=WHITE, align=PP_ALIGN.CENTER, anchor=MSO_ANCHOR.MIDDLE, line_spacing=1.1)
bullets(s, Inches(0.6), Inches(3.05), Inches(11.9), Inches(2.9),
[
("Agent", "Rh anti-D immunoglobulin (IgG) given intramuscularly to unimmunized Rh-negative mothers, classically following childbirth (also after other sensitizing events).", 0),
("Mode of action (antibody-mediated immune suppression, AMIS):", "", 0),
(None, "(i) Anti-D blocks the Rh-antigen sites on fetal red cells when injected.", 1),
(None, "(ii) Antibody-coated fetal red cells are removed from maternal circulation by the spleen/lymph nodes.", 1),
(None, "(iii) Central inhibition - D-antibody-coated fetal cells suppress IgG production by maternal B cells.", 1),
("Timing", "Should be administered within 72 hours of the sensitizing event for maximum efficacy.", 0),
], size=15.5, gap=9)
footer(s)
prs.save("/tmp/workspace/rh_ppt/Red_Cell_Alloimmunization.pptx")
print("Saved. Slide count:", len(prs.slides.__iter__.__self__._sldIdLst))
EOF
EOF line at the end from the heredoc pattern. Let me remove it and run the script.~/rh_ppt/build_ppt.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/rh_ppt/build_ppt.py'
cd /tmp/workspace/rh_ppt && python3 build_ppt.py
Red Cell Alloimmunization
Presentation · PPTX