Prepare a concise but informative presentation on naco guidelines for md medicine studies

Asking for Preferences

Comprehensive

Asking for Preferences

2 and 4

Reading File
Searching the Web

NACO India ART guidelines 2024 antiretroviral therapy first second third line regimens

Searching the Web

NACO India TB-HIV co-infection guidelines 2024 management diagnosis treatment

Reading Web Page

https://www.differentiatedservicedelivery.org/wp-content/upl…

Reading File
Running Command

mkdir -p /tmp/workspace/naco-pptx && ls /tmp/workspace/naco-pptx/

Writing File

~/naco-pptx/build_pptx.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.util import Inches, Pt
import copy

# ── Colour palette ──────────────────────────────────────────────
RED       = RGBColor(0xC0, 0x39, 0x2B)   # NACO red
DARK_RED  = RGBColor(0x96, 0x1A, 0x0F)
BLUE      = RGBColor(0x1A, 0x53, 0x76)   # deep teal-blue
LIGHT_BLU = RGBColor(0xD6, 0xE8, 0xF5)   # slide bg accent
ORANGE    = RGBColor(0xE6, 0x7E, 0x22)
GREEN     = RGBColor(0x1E, 0x8B, 0x4C)
WHITE     = RGBColor(0xFF, 0xFF, 0xFF)
DARK_GREY = RGBColor(0x2C, 0x3E, 0x50)
MID_GREY  = RGBColor(0x55, 0x6B, 0x7D)
LIGHT_GREY= RGBColor(0xEC, 0xF0, 0xF1)
YELLOW    = RGBColor(0xF3, 0x9C, 0x12)

prs = Presentation()
prs.slide_width  = Inches(13.333)
prs.slide_height = Inches(7.5)
blank = prs.slide_layouts[6]

# ── Helper functions ─────────────────────────────────────────────
def add_rect(slide, x, y, w, h, fill_color=None, line_color=None, line_width=None):
    shape = slide.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Inches(h))  # MSO_SHAPE_TYPE.RECTANGLE=1
    if fill_color:
        shape.fill.solid()
        shape.fill.fore_color.rgb = fill_color
    else:
        shape.fill.background()
    if line_color:
        shape.line.color.rgb = line_color
        if line_width:
            shape.line.width = Pt(line_width)
    else:
        shape.line.fill.background()
    return shape

def add_text(slide, text, x, y, w, h, size=18, bold=False, color=DARK_GREY,
             align=PP_ALIGN.LEFT, italic=False, wrap=True):
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = wrap
    tf.margin_left = Pt(4)
    tf.margin_right = Pt(4)
    tf.margin_top = Pt(2)
    tf.margin_bottom = Pt(2)
    p = tf.paragraphs[0]
    p.alignment = align
    run = p.add_run()
    run.text = text
    run.font.size = Pt(size)
    run.font.bold = bold
    run.font.italic = italic
    run.font.color.rgb = color
    run.font.name = "Calibri"
    return tb

def add_multiline(slide, lines, x, y, w, h, size=15, color=DARK_GREY,
                  bullet_char="▪ ", bold_first=False, line_spacing=1.15):
    from pptx.oxml.ns import qn
    from lxml import etree
    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_top = Pt(2)
    tf.margin_bottom = Pt(2)
    for i, line in enumerate(lines):
        if i == 0:
            p = tf.paragraphs[0]
        else:
            p = tf.add_paragraph()
        p.alignment = PP_ALIGN.LEFT
        run = p.add_run()
        bullet = bullet_char if bullet_char else ""
        run.text = bullet + line
        run.font.size = Pt(size)
        run.font.color.rgb = color
        run.font.name = "Calibri"
        run.font.bold = (bold_first and i == 0)
    return tb

def add_header_bar(slide, title, subtitle=None):
    """Dark blue top bar with title."""
    add_rect(slide, 0, 0, 13.333, 1.1, fill_color=BLUE)
    add_rect(slide, 0, 1.1, 13.333, 0.04, fill_color=RED)
    add_text(slide, title, 0.3, 0.08, 11, 0.65, size=28, bold=True,
             color=WHITE, align=PP_ALIGN.LEFT)
    if subtitle:
        add_text(slide, subtitle, 0.3, 0.72, 10, 0.42, size=14,
                 color=LIGHT_BLU, align=PP_ALIGN.LEFT, italic=True)

def add_section_box(slide, title, x, y, w, h, bg=LIGHT_BLU, title_color=BLUE):
    add_rect(slide, x, y, w, 0.42, fill_color=title_color)
    add_text(slide, title, x+0.1, y+0.03, w-0.2, 0.38,
             size=14, bold=True, color=WHITE, align=PP_ALIGN.LEFT)
    add_rect(slide, x, y+0.42, w, h-0.42, fill_color=bg)
    return (x, y+0.42, w, h-0.42)   # content area

def footer(slide, text="NACO Guidelines | MD Medicine Reference | 2021-2024"):
    add_rect(slide, 0, 7.2, 13.333, 0.3, fill_color=DARK_GREY)
    add_text(slide, text, 0.3, 7.21, 12, 0.28, size=9,
             color=MID_GREY, align=PP_ALIGN.LEFT)

# ═══════════════════════════════════════════════════════════════
# SLIDE 1 – Title Slide
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=BLUE)
add_rect(slide, 0, 0, 13.333, 0.12, fill_color=RED)
add_rect(slide, 0, 7.38, 13.333, 0.12, fill_color=RED)
# White content box
add_rect(slide, 1.2, 1.4, 10.9, 4.6, fill_color=WHITE)
add_rect(slide, 1.2, 1.4, 10.9, 0.08, fill_color=RED)
add_text(slide, "NACO Guidelines", 1.4, 1.55, 10.5, 1.0,
         size=40, bold=True, color=BLUE, align=PP_ALIGN.CENTER)
add_text(slide, "Antiretroviral Therapy (ART) &\nTB-HIV Co-infection Management",
         1.4, 2.55, 10.5, 1.2, size=26, bold=False, color=DARK_GREY, align=PP_ALIGN.CENTER)
add_rect(slide, 4.5, 3.85, 4.3, 0.05, fill_color=RED)
add_text(slide, "For MD Medicine Studies | Comprehensive Reference",
         1.4, 4.0, 10.5, 0.6, size=16, color=MID_GREY, align=PP_ALIGN.CENTER, italic=True)
add_text(slide, "National AIDS Control Organisation (NACO)\nMinistry of Health & Family Welfare, Government of India",
         1.4, 4.65, 10.5, 0.9, size=13, color=MID_GREY, align=PP_ALIGN.CENTER)
add_text(slide, "Guidelines Version: 2021 | Updated Guidance: 2024",
         1.4, 5.55, 10.5, 0.4, size=12, color=RED, align=PP_ALIGN.CENTER, bold=True)

# ═══════════════════════════════════════════════════════════════
# SLIDE 2 – Outline / Index
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "Presentation Outline", "NACO ART & TB-HIV Guidelines – MD Medicine")
footer(slide)

sections_left = [
    ("Part A: ART Guidelines", [
        "1. Overview of HIV in India & NACP",
        "2. When to Start ART – Criteria",
        "3. First-Line ART Regimens",
        "4. Special Populations: ART",
        "5. Monitoring ART Response",
        "6. Treatment Failure & Switching",
        "7. Second-Line ART Regimens",
        "8. Third-Line ART Regimens",
        "9. Drug Toxicities & Substitutions",
    ])
]
sections_right = [
    ("Part B: TB-HIV Co-infection", [
        "10. TB-HIV Epidemiology in India",
        "11. 3Is Strategy & ICF",
        "12. Diagnosis of TB in PLHIV",
        "13. When to Start ART in TB-HIV",
        "14. Drug Interactions (Rifampicin & ART)",
        "15. TB Preventive Therapy (TPT/IPT)",
        "16. DR-TB & ART Management",
        "17. Monitoring & Outcomes",
        "18. Key Takeaways & Summary",
    ])
]

# Left column
add_rect(slide, 0.4, 1.3, 6.0, 5.7, fill_color=WHITE, line_color=BLUE, line_width=0.5)
add_rect(slide, 0.4, 1.3, 6.0, 0.45, fill_color=BLUE)
add_text(slide, "Part A – Antiretroviral Therapy", 0.55, 1.33, 5.7, 0.4,
         size=13, bold=True, color=WHITE)
for i, txt in enumerate(sections_left[0][1]):
    yp = 1.85 + i*0.55
    add_rect(slide, 0.45, yp, 5.9, 0.48,
             fill_color=LIGHT_BLU if i%2==0 else WHITE)
    add_text(slide, txt, 0.6, yp+0.04, 5.6, 0.42, size=12.5, color=DARK_GREY)

# Right column
add_rect(slide, 6.9, 1.3, 6.0, 5.7, fill_color=WHITE, line_color=RED, line_width=0.5)
add_rect(slide, 6.9, 1.3, 6.0, 0.45, fill_color=RED)
add_text(slide, "Part B – TB-HIV Co-infection", 7.05, 1.33, 5.7, 0.4,
         size=13, bold=True, color=WHITE)
for i, txt in enumerate(sections_right[0][1]):
    yp = 1.85 + i*0.55
    add_rect(slide, 6.95, yp, 5.9, 0.48,
             fill_color=RGBColor(0xFF,0xEB,0xE9) if i%2==0 else WHITE)
    add_text(slide, txt, 7.1, yp+0.04, 5.6, 0.42, size=12.5, color=DARK_GREY)

# ═══════════════════════════════════════════════════════════════
# SLIDE 3 – HIV in India & NACP Overview
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "HIV in India & NACP Overview",
               "Slide 1 of Part A: Epidemiology & Programme Context")
footer(slide)

stats = [
    ("~23.4 Lakh", "PLHIV in India\n(2023 Estimates)"),
    ("~18 Lakh", "Registered on\nART nationally"),
    ("~62,000", "TB-HIV co-infected\npatients/year"),
    ("~5%", "HIV prevalence\namong TB patients"),
]
for i,(num,label) in enumerate(stats):
    xp = 0.4 + i*3.2
    add_rect(slide, xp, 1.25, 2.9, 1.5, fill_color=BLUE)
    add_text(slide, num, xp+0.1, 1.3, 2.7, 0.75, size=26, bold=True,
             color=YELLOW, align=PP_ALIGN.CENTER)
    add_text(slide, label, xp+0.1, 2.0, 2.7, 0.7, size=11.5,
             color=WHITE, align=PP_ALIGN.CENTER)

add_text(slide, "NACP (National AIDS Control Programme) – Key Pillars",
         0.4, 2.95, 12.5, 0.45, size=15, bold=True, color=BLUE)
add_rect(slide, 0.4, 3.35, 12.5, 0.04, fill_color=BLUE)

nacp_pts = [
    "Launched 1992; currently Phase V – 'Closing the Gap'",
    "Free ART rollout since 2004 through 550+ ART centres across India",
    "Services: ICTC (Integrated Counselling & Testing), PPTCT, ART, OST, Targeted Interventions",
    "90-90-90 target: 90% diagnosed, 90% on ART, 90% virally suppressed by 2030",
    "Key populations: Female sex workers, MSM, IDU, transgender, truckers, migrants",
    "HIV Counselling and Testing Guidelines updated 2024 (HCTS Guidelines)"
]
add_multiline(slide, nacp_pts, 0.5, 3.45, 12.2, 3.6, size=13, color=DARK_GREY,
              bullet_char="✦ ")

# ═══════════════════════════════════════════════════════════════
# SLIDE 4 – When to Start ART
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "When to Start ART – NACO Criteria",
               "Slide 2 of Part A: Initiation of Antiretroviral Therapy")
footer(slide)

# Main rule box
add_rect(slide, 0.4, 1.25, 12.5, 0.7, fill_color=RED)
add_text(slide, "Universal ART: All PLHIV should be started on ART regardless of CD4 count (Treat All Policy)",
         0.55, 1.3, 12.2, 0.6, size=16, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

# Two columns
add_rect(slide, 0.4, 2.1, 5.9, 0.42, fill_color=BLUE)
add_text(slide, "Priority Initiation (Urgent)", 0.5, 2.13, 5.7, 0.38,
         size=13, bold=True, color=WHITE)
priority = [
    "CD4 count < 200 cells/mm³",
    "WHO Clinical Stage 3 or 4",
    "Pregnant/breastfeeding (PPTCT)",
    "HIV-TB co-infection",
    "HIV-HBV co-infection",
    "Children < 5 years of age",
    "Serodiscordant couples (prevention)"
]
add_rect(slide, 0.4, 2.52, 5.9, 4.5, fill_color=WHITE)
add_multiline(slide, priority, 0.5, 2.55, 5.6, 4.3, size=13, color=DARK_GREY,
              bullet_char="▸ ")

add_rect(slide, 6.9, 2.1, 5.9, 0.42, fill_color=GREEN)
add_text(slide, "Pre-ART Workup & Counselling", 7.0, 2.13, 5.7, 0.38,
         size=13, bold=True, color=WHITE)
workup = [
    "CD4 count, CBC, LFT, RFT, Blood glucose",
    "Viral load (baseline) – for monitoring",
    "Screening for OIs: TB (4S screen), CMV, Crypto",
    "HBsAg, Anti-HCV, RPR (syphilis)",
    "Chest X-ray, Urine routine",
    "Cotrimoxazole Prophylaxis (CPT) if CD4 < 250",
    "Fluconazole prophylaxis if CD4 < 100",
    "Adherence counselling – minimum 3 sessions",
    "Disclosure support & social assessment"
]
add_rect(slide, 6.9, 2.52, 5.9, 4.5, fill_color=WHITE)
add_multiline(slide, workup, 7.0, 2.55, 5.6, 4.3, size=12.5, color=DARK_GREY,
              bullet_char="▸ ")

# ═══════════════════════════════════════════════════════════════
# SLIDE 5 – First-Line ART Regimens
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "First-Line ART Regimens – Adults & Adolescents",
               "Slide 3 of Part A: NACO Preferred & Alternative Regimens")
footer(slide)

# Preferred regimen box
add_rect(slide, 0.4, 1.25, 12.5, 0.55, fill_color=GREEN)
add_text(slide, "PREFERRED FIRST-LINE (NACO 2021): TDF + 3TC + DTG (Tenofovir + Lamivudine + Dolutegravir) – Once daily",
         0.55, 1.28, 12.1, 0.5, size=14, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

# Regimen table headers
headers = ["Category", "Preferred Regimen", "Alternative Regimen", "Notes"]
col_w = [2.5, 3.8, 3.8, 2.8]
col_x = [0.4, 2.9, 6.7, 10.5]
row_h = 0.52

for j,(h,cw,cx) in enumerate(zip(headers, col_w, col_x)):
    add_rect(slide, cx, 1.9, cw-0.05, 0.42, fill_color=BLUE)
    add_text(slide, h, cx+0.05, 1.92, cw-0.15, 0.38,
             size=11.5, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

rows = [
    ("Adults/Adolescents\n≥10 yrs, >25 kg", "TDF + 3TC + DTG", "TDF + 3TC + EFV600\nor ABC + 3TC + DTG", "DTG preferred; switch from EFV if tolerant"),
    ("Pregnant Women\n(1st trimester)", "TDF + 3TC + DTG\n(after counselling)", "TDF + 3TC + EFV600", "DTG safer than EFV in 1st trimester (post 2021)"),
    ("Pregnant Women\n(2nd/3rd trimester)", "TDF + 3TC + DTG", "AZT + 3TC + NVP\n(if TDF contraindicated)", "Avoid EFV in early pregnancy if possible"),
    ("TB-HIV Co-infection\n(DS-TB)", "TDF + 3TC + DTG 50mg BD\n(doubled dose)", "TDF + 3TC + EFV600", "Double DTG dose due to rifampicin interaction"),
    ("HBV Co-infection", "TDF + 3TC (or FTC) + DTG", "TDF + 3TC + EFV600", "TDF is backbone for HBV; do NOT use 3TC alone"),
    ("Renal Impairment\n(CrCl <50 mL/min)", "ABC + 3TC + DTG", "AZT + 3TC + DTG", "Avoid TDF; dose-adjust if needed"),
]
bg_colors = [WHITE, LIGHT_BLU, WHITE, LIGHT_BLU, WHITE, LIGHT_BLU]
for i, row in enumerate(rows):
    yp = 2.38 + i*row_h
    for j, (cell, cw, cx) in enumerate(zip(row, col_w, col_x)):
        add_rect(slide, cx, yp, cw-0.05, row_h-0.04,
                 fill_color=bg_colors[i],
                 line_color=RGBColor(0xCC,0xCC,0xCC), line_width=0.3)
        sz = 10 if j >= 2 else 10.5
        add_text(slide, cell, cx+0.08, yp+0.04, cw-0.2, row_h-0.1,
                 size=sz, color=DARK_GREY, wrap=True)

# ═══════════════════════════════════════════════════════════════
# SLIDE 6 – Special Populations
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "ART in Special Populations",
               "Slide 4 of Part A: Paediatrics, PWID, Serodiscordant, Post-Exposure")
footer(slide)

pop_data = [
    ("Paediatrics\n< 3 years", BLUE, [
        "ABC + 3TC + LPV/r (preferred)",
        "AZT + 3TC + LPV/r (alt)",
        "Weight-band based dosing",
        "DTG approved ≥4 weeks & ≥3 kg",
        "Syrup/dispersible formulations",
    ]),
    ("Children\n3-10 yrs", BLUE, [
        "ABC + 3TC + DTG (preferred)",
        "ABC + 3TC + EFV (alt)",
        "Weight-band dosing tables",
        "LPV/r if DTG unavailable",
        "Monitor growth & development",
    ]),
    ("PWID\n(IV Drug Users)", ORANGE, [
        "Same first-line regimen: TDF+3TC+DTG",
        "Opioid Substitution Therapy (OST)",
        "Buprenorphine-based OST at ARTC",
        "Screen for HCV co-infection",
        "Needle/syringe exchange (NSEP)",
    ]),
    ("Post-Exposure\nProphylaxis (PEP)", RED, [
        "TDF + 3TC + DTG (28 days)",
        "Start within 72 hrs of exposure",
        "Occupational & non-occupational PEP",
        "Baseline HIV test before starting",
        "Follow-up at 6 weeks, 3 months",
    ]),
    ("PrEP\n(Pre-Exposure)", GREEN, [
        "TDF + FTC once daily (approved)",
        "For high-risk HIV-negative persons",
        "Confirm HIV-negative before start",
        "Screen for STIs, renal function",
        "Re-test HIV every 3 months",
    ]),
]
for i,(title, col, pts) in enumerate(pop_data):
    xp = 0.3 + i*2.6
    add_rect(slide, xp, 1.25, 2.45, 0.55, fill_color=col)
    add_text(slide, title, xp+0.08, 1.28, 2.3, 0.5,
             size=12, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
    add_rect(slide, xp, 1.8, 2.45, 5.1, fill_color=WHITE)
    add_multiline(slide, pts, xp+0.1, 1.85, 2.25, 4.9, size=11,
                  color=DARK_GREY, bullet_char="• ")

# ═══════════════════════════════════════════════════════════════
# SLIDE 7 – Monitoring ART Response
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "Monitoring ART Response",
               "Slide 5 of Part A: Clinical, Immunological & Virological Monitoring")
footer(slide)

# Timeline row
timeline = [("Baseline", "Before ART start"),
            ("2 Weeks", "Clinical review"),
            ("4 Weeks", "Adherence review"),
            ("3 Months", "CD4 / clinical"),
            ("6 Months", "Viral Load (VL)"),
            ("12 Months", "VL + CD4"),
            ("Annually", "VL (if suppressed)")]
for i,(t,sub) in enumerate(timeline):
    xp = 0.4 + i*1.85
    add_rect(slide, xp, 1.28, 1.7, 0.55, fill_color=BLUE if i%2==0 else RED)
    add_text(slide, t, xp+0.05, 1.3, 1.6, 0.35,
             size=12, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
    add_text(slide, sub, xp+0.05, 1.65, 1.6, 0.25,
             size=9, color=WHITE, align=PP_ALIGN.CENTER)

# Three monitoring boxes
left_pts = [
    "Weight, MUAC",
    "Functional status (WHO)",
    "OI screening",
    "Adherence (pill count, VAS)",
    "Side-effect review",
    "Disclosure & social support"
]
mid_pts = [
    "CD4 count: Baseline & 6-monthly till suppressed",
    "Target: CD4 >200 (OI risk drops)",
    "CD4 >500 → annual monitoring acceptable",
    "CBC, LFT, RFT: 6-monthly",
    "Fasting glucose & lipids (EFV/PIs)",
    "Urine dipstick: TDF nephrotoxicity screen"
]
right_pts = [
    "Viral Load (VL) at 6 months, 12 months",
    "Suppressed: VL <1000 copies/mL (NACO threshold)",
    "Unsuppressed at 6 months → Enhanced adherence counselling",
    "Repeat VL after 3 months; if still >1000 → treatment failure",
    "Annual VL if suppressed (resource-limited settings)",
    "Point-of-care VL (COBAS, Abbott) – scale-up underway"
]

for (title, pts, col, xstart) in [
    ("Clinical Monitoring", left_pts, BLUE, 0.4),
    ("Immunological Monitoring", mid_pts, GREEN, 4.65),
    ("Virological Monitoring", right_pts, RED, 8.9),
]:
    add_rect(slide, xstart, 2.38, 4.1, 0.42, fill_color=col)
    add_text(slide, title, xstart+0.1, 2.4, 3.9, 0.38,
             size=13, bold=True, color=WHITE)
    add_rect(slide, xstart, 2.8, 4.1, 4.45, fill_color=WHITE)
    add_multiline(slide, pts, xstart+0.1, 2.85, 3.9, 4.3,
                  size=12, color=DARK_GREY, bullet_char="▸ ")

# ═══════════════════════════════════════════════════════════════
# SLIDE 8 – Treatment Failure & Switching
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "Treatment Failure & Switching Criteria",
               "Slide 6 of Part A: Virological, Immunological & Clinical Failure")
footer(slide)

fail_types = [
    ("Virological Failure\n(Primary Criterion)", RED, [
        "VL > 1000 copies/mL on 2 consecutive measures",
        "3 months apart, with adherence support",
        "Most sensitive & specific criterion",
        "Acts before clinical/immunological failure",
    ]),
    ("Immunological Failure", ORANGE, [
        "Fall in CD4 to pre-treatment level OR",
        "Persistent CD4 < 100 cells/mm³",
        "50% fall from peak CD4 on ART",
        "Less reliable – confirm with VL first",
    ]),
    ("Clinical Failure", BLUE, [
        "New/recurrent WHO Stage 3/4 event",
        "Minimum 6 months on ART",
        "Exclude IRIS (Immune Reconstitution)",
        "Objective evidence of disease progression",
    ]),
]
for i,(title, col, pts) in enumerate(fail_types):
    xp = 0.4 + i*4.3
    add_rect(slide, xp, 1.25, 4.1, 0.6, fill_color=col)
    add_text(slide, title, xp+0.1, 1.28, 3.9, 0.56,
             size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
    add_rect(slide, xp, 1.85, 4.1, 2.3, fill_color=WHITE)
    add_multiline(slide, pts, xp+0.1, 1.9, 3.9, 2.2,
                  size=12.5, color=DARK_GREY, bullet_char="▸ ")

add_text(slide, "Switching Process – NACO Algorithm", 0.4, 4.28, 12.5, 0.45,
         size=15, bold=True, color=BLUE)
add_rect(slide, 0.4, 4.68, 12.5, 0.04, fill_color=BLUE)

switch_steps = [
    "Step 1 – Confirm VL >1000 on repeat test (after 3-month enhanced adherence counselling, EAC)",
    "Step 2 – Rule out adherence failure (pill count, VAS scale, pharmacy records)",
    "Step 3 – Genotypic resistance testing (GRT) recommended via SACEP (State ART Committee for Expert Panel)",
    "Step 4 – Document all prior regimens; inform SACEP for 2nd/3rd line approval",
    "Step 5 – Switch to second-line ART regimen; baseline VL before switch"
]
add_multiline(slide, switch_steps, 0.5, 4.75, 12.2, 2.5,
              size=13, color=DARK_GREY, bullet_char="")

# ═══════════════════════════════════════════════════════════════
# SLIDE 9 – Second-Line ART Regimens
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "Second-Line ART Regimens",
               "Slide 7 of Part A: Regimens After First-Line Failure")
footer(slide)

add_rect(slide, 0.4, 1.28, 12.5, 0.52, fill_color=ORANGE)
add_text(slide, "Principle: Switch NRTI backbone + Add Boosted Protease Inhibitor (PI/r) OR switch to INSTI-based",
         0.55, 1.3, 12.1, 0.48, size=13.5, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

headers2 = ["Failed First-Line", "Recommended 2nd-Line Regimen", "PI of Choice", "Notes"]
col_w2 = [3.0, 4.2, 2.8, 3.2]
col_x2 = [0.4, 3.4, 7.6, 10.4]

for j,(h,cw,cx) in enumerate(zip(headers2, col_w2, col_x2)):
    add_rect(slide, cx, 1.88, cw-0.05, 0.42, fill_color=BLUE)
    add_text(slide, h, cx+0.05, 1.9, cw-0.15, 0.38,
             size=11.5, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

rows2 = [
    ("TDF + 3TC + DTG\n(INSTI-based)", "AZT + 3TC + ATV/r\nor AZT + 3TC + LPV/r",
     "ATV/r preferred\n(fewer SE)", "Switch NRTI backbone to AZT+3TC"),
    ("TDF + 3TC + EFV\n(NNRTI-based)", "AZT + 3TC + ATV/r\nor AZT + 3TC + LPV/r",
     "ATV/r or LPV/r", "Classic PI-based switch"),
    ("AZT + 3TC + EFV\n(NNRTI-based)", "TDF + 3TC + ATV/r\nor TDF + 3TC + LPV/r",
     "ATV/r or LPV/r", "Switch NRTI to TDF if tolerated"),
    ("AZT + 3TC + NVP\n(NNRTI-based)", "TDF + 3TC + ATV/r", "ATV/r preferred",
     "NVP → PI/r; Switch backbone"),
    ("ABC + 3TC + DTG", "TDF + 3TC + ATV/r\nor AZT + 3TC + LPV/r",
     "ATV/r or LPV/r", "Switch NRTI backbone away from ABC"),
    ("Renal impairment\n(CrCl <50)", "AZT + 3TC + ATV/r", "ATV/r",
     "Avoid TDF in 2nd line also"),
]
bg2 = [WHITE, LIGHT_BLU]*3
for i, row in enumerate(rows2):
    yp = 2.37 + i*0.72
    for j,(cell,cw,cx) in enumerate(zip(row, col_w2, col_x2)):
        add_rect(slide, cx, yp, cw-0.05, 0.68,
                 fill_color=bg2[i], line_color=RGBColor(0xCC,0xCC,0xCC), line_width=0.3)
        add_text(slide, cell, cx+0.08, yp+0.05, cw-0.2, 0.6, size=10.5, color=DARK_GREY)

add_text(slide, "Note: ATV/r = Atazanavir/ritonavir | LPV/r = Lopinavir/ritonavir | SACEP approval needed for 2nd line",
         0.4, 6.85, 12.5, 0.35, size=10, color=MID_GREY, italic=True)

# ═══════════════════════════════════════════════════════════════
# SLIDE 10 – Third-Line ART & Drug Toxicities
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "Third-Line ART & Major Drug Toxicities",
               "Slide 8 of Part A: Advanced Regimens & Toxicity Management")
footer(slide)

# Third-line box
add_rect(slide, 0.4, 1.25, 6.1, 0.45, fill_color=DARK_RED)
add_text(slide, "Third-Line ART (SACEP Approval Mandatory)",
         0.5, 1.27, 5.9, 0.4, size=13, bold=True, color=WHITE)
add_rect(slide, 0.4, 1.7, 6.1, 4.0, fill_color=WHITE)

third_rows = [
    ("Failed 2NRTI+NNRTI → PI → now failing PI", "DRV/r (BD) + DTG OD + existing NRTI backbone"),
    ("Failed 2NRTI+NNRTI → INSTI → now failing", "LPV/r + DTG 50 BD + 2NRTIs incl. 3TC"),
    ("Any 2nd line with documented resistance", "Genotype-guided: DRV/r + DTG ± RAL ± new NRTIs"),
]
for i,(scenario, regimen) in enumerate(third_rows):
    yp = 1.75 + i*1.25
    add_rect(slide, 0.45, yp, 5.9, 0.45, fill_color=RGBColor(0xFF,0xEB,0xE9))
    add_text(slide, scenario, 0.55, yp+0.03, 5.7, 0.4, size=11, color=DARK_RED, bold=True)
    add_rect(slide, 0.45, yp+0.45, 5.9, 0.72, fill_color=WHITE)
    add_text(slide, "→ " + regimen, 0.6, yp+0.5, 5.7, 0.62, size=11.5, color=DARK_GREY)

add_text(slide, "Key: DRV/r = Darunavir/ritonavir | RAL = Raltegravir | NRTIs reassessed by genotype",
         0.45, 5.75, 6.0, 0.35, size=9.5, color=MID_GREY, italic=True)

# Toxicity table
add_rect(slide, 6.8, 1.25, 6.1, 0.45, fill_color=RED)
add_text(slide, "Major Drug Toxicities & Substitutions",
         6.9, 1.27, 5.9, 0.4, size=13, bold=True, color=WHITE)

tox_headers = ["Drug", "Major Toxicity", "Substitute With"]
txcol_w = [1.4, 2.5, 2.0]
txcol_x = [6.8, 8.2, 10.7]
for j,(h,cw,cx) in enumerate(zip(tox_headers, txcol_w, txcol_x)):
    add_rect(slide, cx, 1.75, cw-0.05, 0.38, fill_color=BLUE)
    add_text(slide, h, cx+0.05, 1.77, cw-0.15, 0.34,
             size=11, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
tox_rows = [
    ("TDF", "Nephrotoxicity, Fanconi, Osteoporosis", "ABC or AZT"),
    ("AZT", "Anaemia, GI intolerance, Lipoatrophy", "TDF or ABC"),
    ("EFV", "CNS effects, Hepatotox, Teratogen (1st tri)", "DTG or NVP"),
    ("NVP", "Hepatotoxicity, Stevens-Johnson", "EFV or DTG"),
    ("LPV/r", "GI intolerance, Dyslipidaemia, QTc", "ATV/r or DRV/r"),
    ("ATV/r", "Hyperbilirubinaemia, Nephrolithiasis", "LPV/r or DRV/r"),
    ("DTG", "Weight gain, Insomnia, Neural tube (rare)", "EFV600 (if intolerable)"),
    ("3TC", "Minimal; Lactic acidosis (rare)", "FTC (equivalent)"),
]
for i, row in enumerate(tox_rows):
    yp = 2.18 + i*0.6
    for j,(cell,cw,cx) in enumerate(zip(row, txcol_w, txcol_x)):
        add_rect(slide, cx, yp, cw-0.05, 0.56,
                 fill_color=WHITE if i%2==0 else LIGHT_BLU,
                 line_color=RGBColor(0xCC,0xCC,0xCC), line_width=0.3)
        add_text(slide, cell, cx+0.06, yp+0.04, cw-0.15, 0.5, size=10, color=DARK_GREY)

# ═══════════════════════════════════════════════════════════════
# SLIDE 11 – TB-HIV Epidemiology (Part B begins)
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "TB-HIV Co-infection: Epidemiology & Overview",
               "Slide 1 of Part B: The Double Burden")
footer(slide)

epi_stats = [
    ("~1.1 Lakh", "HIV-TB co-infected\npatients in India/year"),
    ("5%", "HIV prevalence among\nnotified TB cases"),
    ("15-18%", "Mortality in HIV-TB\nco-infected patients"),
    ("20-40×", "Higher TB risk in\nPLHIV vs HIV-negative"),
]
for i,(num,label) in enumerate(epi_stats):
    xp = 0.4 + i*3.2
    add_rect(slide, xp, 1.28, 2.9, 1.4, fill_color=RED)
    add_text(slide, num, xp+0.1, 1.32, 2.7, 0.7, size=28, bold=True,
             color=YELLOW, align=PP_ALIGN.CENTER)
    add_text(slide, label, xp+0.1, 1.98, 2.7, 0.65, size=11,
             color=WHITE, align=PP_ALIGN.CENTER)

add_text(slide, "Why TB-HIV is a 'Fatal Combination'", 0.4, 2.85, 12.5, 0.45,
         size=15, bold=True, color=RED)
add_rect(slide, 0.4, 3.25, 12.5, 0.04, fill_color=RED)

epi_pts = [
    "HIV accelerates progression from latent TB to active disease – most common OI and leading cause of death in PLHIV",
    "TB accelerates HIV replication → rapid CD4 decline → immune deterioration",
    "Both infections share common risk factors: poverty, overcrowding, malnutrition, substance use",
    "India contributes ~25% of global TB burden and ~10% of HIV-TB co-infection globally",
    "National Framework for HIV/TB Collaborative Activities – joint NACP & NTEP (National TB Elimination Programme)",
    "Target: All TB patients screened for HIV; All PLHIV screened for TB at every visit",
    "Single-window services at ART centres for simultaneous treatment of both infections"
]
add_multiline(slide, epi_pts, 0.5, 3.35, 12.2, 3.8, size=12.5, color=DARK_GREY,
              bullet_char="✦ ")

# ═══════════════════════════════════════════════════════════════
# SLIDE 12 – 3Is Strategy & Intensified Case Finding
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "3Is Strategy for TB-HIV Management",
               "Slide 2 of Part B: ICF, AIC, IPT / TB Preventive Therapy")
footer(slide)

# Three I boxes
three_i = [
    ("I", "Intensified\nCase Finding\n(ICF)", BLUE, [
        "4-symptom screen (4S) at EVERY visit:",
        "  • Current cough (any duration)",
        "  • Fever",
        "  • Weight loss",
        "  • Night sweats",
        "4S+ve → refer for TB diagnostics immediately",
        "Stamp system: Red=4S+ve, Blue=4S-ve",
        "Use CBNAAT/GeneXpert as primary test",
        "Xpert MTB/RIF → detects TB + rifampicin resistance",
    ]),
    ("A", "Airborne\nInfection\nControl (AIC)", RED, [
        "Administrative controls:",
        "  • Triage, fast-track 4S+ve patients",
        "  • Separate waiting areas for TB suspects",
        "  • Cough hygiene education",
        "Environmental controls:",
        "  • Adequate ventilation (natural/mechanical)",
        "  • UV germicidal irradiation (UVGI)",
        "Personal respiratory protection:",
        "  • N95 masks for HCWs in high-risk areas",
    ]),
    ("I", "TB\nPreventive\nTherapy (TPT)", GREEN, [
        "After ruling out active TB:",
        "Preferred: 1HP regimen (2024 guidance)",
        "  • Isoniazid 300mg + Rifapentine weekly × 12 doses",
        "Alternative: 6H regimen",
        "  • Isoniazid 300mg + Pyridoxine daily × 6 months",
        "Older: 9H (9 months INH) – still acceptable",
        "All PLHIV eligible regardless of TST/IGRA status",
        "Enrol in Nikshay TPT module for tracking",
    ]),
]
for i,(letter, title, col, pts) in enumerate(three_i):
    xp = 0.35 + i*4.33
    add_rect(slide, xp, 1.25, 0.65, 5.95, fill_color=col)
    add_text(slide, letter, xp+0.05, 2.7, 0.55, 1.0,
             size=40, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
    add_rect(slide, xp+0.65, 1.25, 3.55, 0.65, fill_color=col)
    add_text(slide, title, xp+0.75, 1.28, 3.35, 0.62,
             size=13, bold=True, color=WHITE)
    add_rect(slide, xp+0.65, 1.9, 3.55, 5.3, fill_color=WHITE)
    add_multiline(slide, pts, xp+0.75, 1.95, 3.35, 5.1, size=11.5,
                  color=DARK_GREY, bullet_char="")

# ═══════════════════════════════════════════════════════════════
# SLIDE 13 – Diagnosis of TB in PLHIV
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "Diagnosis of TB in PLHIV",
               "Slide 3 of Part B: Challenges, Tools & Approach")
footer(slide)

# challenges box
add_rect(slide, 0.4, 1.28, 4.2, 0.42, fill_color=RED)
add_text(slide, "Diagnostic Challenges in PLHIV", 0.5, 1.3, 4.0, 0.38,
         size=12.5, bold=True, color=WHITE)
challenges = [
    "Atypical/smear-negative presentation common",
    "AFB smear sensitivity < 40% in PLHIV",
    "Extrapulmonary TB more frequent (lymph nodes, CNS, disseminated)",
    "CXR may be normal even with active TB",
    "Sputum production poor due to low bacillary load",
]
add_rect(slide, 0.4, 1.7, 4.2, 3.3, fill_color=RGBColor(0xFF,0xF5,0xF5))
add_multiline(slide, challenges, 0.5, 1.75, 4.0, 3.15, size=12, color=DARK_GREY,
              bullet_char="⚠ ")

# diagnostics
add_rect(slide, 4.8, 1.28, 7.5, 0.42, fill_color=BLUE)
add_text(slide, "Recommended Diagnostic Approach", 4.9, 1.3, 7.3, 0.38,
         size=12.5, bold=True, color=WHITE)
diag_pts = [
    "1st Line: CBNAAT/GeneXpert MTB/RIF on sputum (2 samples) – detects TB + RR",
    "CBNAAT preferred over smear microscopy in PLHIV (higher sensitivity)",
    "Truenat MTB assay – point-of-care, approved by NTEP at PHC level",
    "Culture (LJ / MGIT BACTEC) – gold standard; 4-8 wks turnaround",
    "TB-LAM (Lateral Flow) – urine test for disseminated/advanced HIV (CD4 <100)",
    "FNAC / biopsy with AFB stain + culture for lymphadenopathy",
    "CSF exam: ADA, AFB smear/culture, CBNAAT for TBM",
    "Abdominal USG: lymphadenopathy, ascites in disseminated TB",
    "Fundoscopy: choroid tubercles – pathognomonic of miliary TB",
    "HIV + TB – bidirectional screening is MANDATORY",
]
add_rect(slide, 4.8, 1.7, 7.5, 5.3, fill_color=WHITE)
add_multiline(slide, diag_pts, 4.9, 1.75, 7.25, 5.1, size=12, color=DARK_GREY,
              bullet_char="▸ ")

# lower box
add_rect(slide, 0.4, 5.1, 4.2, 1.85, fill_color=WHITE)
add_text(slide, "Types of TB in PLHIV", 0.5, 5.12, 4.0, 0.38,
         size=12, bold=True, color=BLUE)
types_pts = [
    "Drug-Sensitive TB (DS-TB) – ~95%",
    "Rifampicin-Resistant TB (RR-TB)",
    "MDR-TB (RIF + INH resistant)",
    "XDR-TB (MDR + FQ + injectables)",
    "Pre-XDR-TB (MDR + FQ resistant)"
]
add_multiline(slide, types_pts, 0.5, 5.5, 4.0, 1.4, size=11.5, color=DARK_GREY,
              bullet_char="• ")

# ═══════════════════════════════════════════════════════════════
# SLIDE 14 – When to Start ART in TB-HIV
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "When to Start ART in TB-HIV Co-infection",
               "Slide 4 of Part B: Timing of ART Initiation")
footer(slide)

add_rect(slide, 0.4, 1.28, 12.5, 0.55, fill_color=BLUE)
add_text(slide, "Key Principle: Start Anti-TB Treatment FIRST, then introduce ART as soon as patient is stable on ATT",
         0.55, 1.3, 12.1, 0.51, size=14, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

timing_rows = [
    ("CD4 < 50 cells/mm³\n(Severely immunocompromised)", RED,
     "Start ART within 2 WEEKS of starting ATT",
     "HIGH priority – mortality very high at this CD4; don't delay ART beyond 2 weeks"),
    ("CD4 50–200 cells/mm³\n(Moderate immunodeficiency)", ORANGE,
     "Start ART within 2–8 WEEKS of ATT",
     "Can allow 2-4 weeks to ensure ATT tolerability, then initiate ART"),
    ("CD4 > 200 cells/mm³\n(Relatively preserved)", GREEN,
     "Start ART within 8 WEEKS of ATT",
     "Less urgency; 8-week window acceptable; avoid IRIS risk"),
    ("TB Meningitis (Any CD4)", DARK_RED,
     "DELAY ART – Start 4–8 WEEKS after ATT",
     "Exception! ART within 2 weeks doubles IRIS risk in TBM – causes higher mortality"),
]
for i,(cd4, col, timing, note) in enumerate(timing_rows):
    yp = 2.0 + i*1.2
    add_rect(slide, 0.4, yp, 3.1, 1.1, fill_color=col)
    add_text(slide, cd4, 0.5, yp+0.1, 2.9, 0.9, size=12, bold=True,
             color=WHITE, align=PP_ALIGN.CENTER)
    add_rect(slide, 3.5, yp, 3.5, 1.1, fill_color=LIGHT_BLU)
    add_text(slide, timing, 3.6, yp+0.1, 3.3, 0.9, size=13, bold=True,
             color=BLUE, align=PP_ALIGN.CENTER)
    add_rect(slide, 7.0, yp, 6.0, 1.1, fill_color=WHITE,
             line_color=RGBColor(0xCC,0xCC,0xCC), line_width=0.3)
    add_text(slide, note, 7.1, yp+0.08, 5.8, 0.95, size=11.5, color=DARK_GREY)

add_rect(slide, 0.4, 6.85, 12.5, 0.35, fill_color=LIGHT_GREY)
add_text(slide,
         "IRIS (Immune Reconstitution Inflammatory Syndrome): Paradoxical worsening after ART initiation; manage with NSAIDs/steroids; do NOT stop ART",
         0.5, 6.87, 12.1, 0.3, size=10.5, color=RED, italic=True, bold=True)

# ═══════════════════════════════════════════════════════════════
# SLIDE 15 – Drug Interactions: Rifampicin & ART
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "Drug Interactions: Rifampicin & ART",
               "Slide 5 of Part B: CYP450 Interactions & Management")
footer(slide)

add_rect(slide, 0.4, 1.28, 12.5, 0.5, fill_color=RED)
add_text(slide, "Rifampicin is a potent CYP3A4 inducer – markedly reduces plasma levels of PIs, NNRTIs, and INSTIs",
         0.55, 1.3, 12.1, 0.46, size=13.5, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

int_data = [
    ("Rifampicin + DTG\n(INSTI)", GREEN, "DOUBLE DTG dose to 50mg TWICE daily", [
        "DTG levels reduced ~50% by rifampicin",
        "Dose: DTG 50mg BD (instead of OD)",
        "Rifapentine (1HP) + DTG: DTG 50mg BD",
        "Safe and effective combination",
        "Resume DTG OD when ATT completed",
    ]),
    ("Rifampicin + EFV\n(NNRTI)", ORANGE, "EFV 600mg once daily – STANDARD dose", [
        "Modest EFV level reduction (~20%)",
        "Standard 600mg dose adequate",
        "No dose adjustment needed",
        "Preferred alternative when DTG unavailable",
        "EFV 800mg NOT recommended (higher toxicity)",
    ]),
    ("Rifampicin + PIs\n(ATV/r, LPV/r, DRV/r)", RED, "AVOID – Use Rifabutin instead", [
        "Rifampicin reduces PI levels by 70-90%",
        "Sub-therapeutic PI levels → treatment failure",
        "SUBSTITUTE: Rifabutin 150mg daily for rifampicin",
        "Rifabutin dose: 150mg OD (with PI/r)",
        "Side effects: Orange discolouration, uveitis (rare)",
    ]),
    ("Rifampicin + NVP\n(NNRTI)", DARK_RED, "AVOID COMBINATION", [
        "NVP levels reduced significantly",
        "High risk of virological failure",
        "If unavoidable: NVP 200mg BD (no increase)",
        "Use EFV or DTG instead",
    ]),
]
for i,(title, col, rec, pts) in enumerate(int_data):
    xp = 0.35 + i*3.25
    add_rect(slide, xp, 1.88, 3.1, 0.55, fill_color=col)
    add_text(slide, title, xp+0.08, 1.9, 2.94, 0.52,
             size=12, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
    add_rect(slide, xp, 2.43, 3.1, 0.45, fill_color=LIGHT_BLU)
    add_text(slide, rec, xp+0.08, 2.45, 2.94, 0.42,
             size=10.5, bold=True, color=BLUE, align=PP_ALIGN.CENTER)
    add_rect(slide, xp, 2.88, 3.1, 4.12, fill_color=WHITE)
    add_multiline(slide, pts, xp+0.1, 2.93, 2.9, 3.95, size=11,
                  color=DARK_GREY, bullet_char="▸ ")

# ═══════════════════════════════════════════════════════════════
# SLIDE 16 – DR-TB & ART Management
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "Drug-Resistant TB (DR-TB) & ART Management",
               "Slide 6 of Part B: MDR-TB, XDR-TB & Drug Interactions")
footer(slide)

add_rect(slide, 0.4, 1.28, 6.2, 0.42, fill_color=BLUE)
add_text(slide, "DR-TB Regimens & ART Compatibility", 0.5, 1.3, 6.0, 0.38,
         size=13, bold=True, color=WHITE)

drtb_pts = [
    "ART regimen of CHOICE for DR-TB (MDR/XDR): TDF + 3TC + DTG",
    "DTG can be safely used with ALL DR-TB drugs including Bedaquiline (BDQ) and Delamanid (DLM)",
    "DTG dose: Standard 50mg OD when on BDQ/DLM (no interaction)",
    "If on rifampicin-containing regimen: DTG 50mg BD",
    "If PLHIV on PI-based 2nd/3rd line ART + DR-TB: Coordinate SACEP + DR-TB centre",
    "Rifabutin substitution for rifampicin if PI-based ART cannot be changed",
    "BDQ + PI: Avoid combination (QTc prolongation risk); switch to DTG-based ART",
    "DLM + LPV/r: Risk of QTc prolongation – use with caution; ECG monitoring required",
    "Fluoroquinolones (FQ) + ART: No major interactions",
    "BDQ + DTG: Safe combination – preferred regimen in MDR-HIV-TB",
]
add_rect(slide, 0.4, 1.7, 6.2, 5.55, fill_color=WHITE)
add_multiline(slide, drtb_pts, 0.5, 1.75, 6.0, 5.3, size=12, color=DARK_GREY,
              bullet_char="▸ ")

add_rect(slide, 6.9, 1.28, 6.0, 0.42, fill_color=RED)
add_text(slide, "QTc Prolongation Risk Matrix", 7.0, 1.3, 5.8, 0.38,
         size=13, bold=True, color=WHITE)

qtc_rows = [
    ("Drug Combination", "QTc Risk", "Recommendation"),
    ("BDQ + DTG", "Low", "PREFERRED – Safe"),
    ("BDQ + LPV/r", "HIGH", "AVOID"),
    ("BDQ + DLM", "VERY HIGH", "AVOID if possible"),
    ("DLM + LPV/r", "Moderate-High", "Caution + ECG"),
    ("BDQ + EFV", "Low-Moderate", "Monitor ECG"),
    ("DLM + DTG", "Low", "Safe – use if needed"),
    ("Moxifloxacin + BDQ", "HIGH", "Avoid; use Lfx instead"),
]
col_w3 = [2.5, 1.5, 1.85]
col_x3 = [6.95, 9.45, 10.95]
for i, row in enumerate(qtc_rows):
    yp = 1.75 + i*0.62
    bg3 = BLUE if i==0 else (WHITE if i%2==1 else LIGHT_BLU)
    fc3 = WHITE if i==0 else DARK_GREY
    for j,(cell,cw,cx) in enumerate(zip(row, col_w3, col_x3)):
        add_rect(slide, cx, yp, cw-0.05, 0.58, fill_color=bg3,
                 line_color=RGBColor(0xCC,0xCC,0xCC), line_width=0.3)
        c = fc3
        if i>0 and j==1:
            if "HIGH" in cell: c = RED
            elif "Low" in cell: c = GREEN
            elif "Moderate" in cell: c = ORANGE
        add_text(slide, cell, cx+0.07, yp+0.06, cw-0.18, 0.48,
                 size=10.5 if i>0 else 11, bold=(i==0), color=c,
                 align=PP_ALIGN.CENTER)

# ═══════════════════════════════════════════════════════════════
# SLIDE 17 – Monitoring TB-HIV Outcomes
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "Monitoring TB-HIV Co-infected Patients",
               "Slide 7 of Part B: Outcomes, IRIS, CPT & Follow-up")
footer(slide)

add_rect(slide, 0.4, 1.28, 6.1, 0.42, fill_color=BLUE)
add_text(slide, "Treatment Monitoring Schedule", 0.5, 1.3, 5.9, 0.38,
         size=13, bold=True, color=WHITE)
mon_pts = [
    "Week 2: Clinical review; assess ATT tolerability; start ART if not started",
    "Month 1: Weight, adherence, side-effect screen; CD4 (if CD4 was <100)",
    "Month 2: End of intensive phase (DOTS); sputum smear/culture for DS-TB",
    "Month 3: Viral load assessment in PLHIV on ART (if ART started early)",
    "Month 5: Sputum culture for DS-TB (end of follow-up phase)",
    "Month 6: End of DS-TB treatment; complete TB card; CD4, VL assessment",
    "Post-TB: Restart CPT if stopped; continue ART indefinitely",
    "DR-TB: Minimum 18-20 months treatment; intensive monitoring for adverse effects",
    "Nikshay: All TB-HIV co-infected patients registered in Nikshay portal",
]
add_rect(slide, 0.4, 1.7, 6.1, 5.55, fill_color=WHITE)
add_multiline(slide, mon_pts, 0.5, 1.75, 5.9, 5.3, size=11.5, color=DARK_GREY,
              bullet_char="▸ ")

add_rect(slide, 6.8, 1.28, 6.1, 0.42, fill_color=RED)
add_text(slide, "IRIS, CPT & Outcomes", 6.9, 1.3, 5.9, 0.38,
         size=13, bold=True, color=WHITE)

iris_pts = [
    "IRIS – Paradoxical type: Pre-existing TB worsens after ART start",
    "IRIS – Unmasking type: Previously undetected TB appears after ART",
    "Risk factors: CD4 <50, high VL at ART start, early ART initiation",
    "Management: Do NOT stop ART/ATT; NSAIDs for mild; Prednisolone for severe",
    "Exception: TBM – stop ART + give steroids if IRIS develops",
]
cpt_pts = [
    "Cotrimoxazole Preventive Therapy (CPT): ALL HIV-TB co-infected patients",
    "Dose: Cotrimoxazole 960mg OD; reduces PCP, toxoplasma, diarrhoea",
    "Continue CPT until CD4 >350 cells/mm³ for 6 months on stable ART",
    "TB treatment outcomes: Cured, Treatment completed, Failed, Died, LTFU, Not evaluated",
    "Priority indicators: Death rate, VL suppression at 12 months, CD4 recovery"
]
add_rect(slide, 6.8, 1.7, 6.1, 2.85, fill_color=RGBColor(0xFF,0xF5,0xF5))
add_text(slide, "IRIS", 6.9, 1.73, 5.9, 0.3, size=11, bold=True, color=RED)
add_multiline(slide, iris_pts, 6.9, 2.05, 5.9, 2.45, size=11, color=DARK_GREY, bullet_char="▸ ")

add_rect(slide, 6.8, 4.6, 6.1, 2.65, fill_color=RGBColor(0xF5,0xFF,0xF5))
add_text(slide, "Cotrimoxazole Preventive Therapy (CPT)", 6.9, 4.63, 5.9, 0.3,
         size=11, bold=True, color=GREEN)
add_multiline(slide, cpt_pts, 6.9, 4.95, 5.9, 2.2, size=11, color=DARK_GREY, bullet_char="▸ ")

# ═══════════════════════════════════════════════════════════════
# SLIDE 18 – Key Takeaways & Summary
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=BLUE)
add_rect(slide, 0, 0, 13.333, 0.1, fill_color=RED)
add_rect(slide, 0, 7.4, 13.333, 0.1, fill_color=RED)
add_text(slide, "Key Takeaways & Examination Points",
         0.4, 0.12, 12.5, 0.75, size=28, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
add_rect(slide, 0.4, 0.88, 12.5, 0.06, fill_color=YELLOW)

art_key = [
    "TREAT ALL: ART for ALL PLHIV regardless of CD4 count",
    "Preferred 1st line: TDF + 3TC + DTG once daily",
    "TB-HIV 1st line: TDF + 3TC + DTG 50mg TWICE daily (rifampicin interaction)",
    "Virological failure = VL >1000 copies/mL on 2 tests, 3 months apart",
    "2nd line: Switch NRTI backbone + add PI/r (ATV/r or LPV/r)",
    "3rd line: DRV/r + DTG ± NRTIs (SACEP approval mandatory)",
    "CPT: All PLHIV with CD4 <250 cells/mm³ (or all TB-HIV patients)",
    "ART monitoring: VL at 6 months → target <1000 copies/mL",
]
tbhiv_key = [
    "TB is leading OI and cause of death in PLHIV",
    "4S symptom screen at EVERY PLHIV visit (Cough, Fever, Weight loss, Night sweats)",
    "Start ATT FIRST → then ART: within 2 weeks (CD4 <50), 8 weeks (CD4 >50)",
    "Exception: TB Meningitis → delay ART to 4-8 weeks (IRIS risk)",
    "Rifampicin + PI → AVOID; substitute Rifabutin 150mg OD",
    "Rifampicin + DTG → Double DTG to 50mg BD (NOT contraindicated)",
    "BDQ/DLM + DTG → SAFE; BDQ + LPV/r → AVOID (QTc risk)",
    "TPT (1HP preferred) for all PLHIV after ruling out active TB",
]
# Left box
add_rect(slide, 0.4, 1.0, 6.1, 0.48, fill_color=RGBColor(0x1E,0x8B,0x4C))
add_text(slide, "⚡ ART Guidelines – Must-Know Points", 0.5, 1.02, 5.9, 0.44,
         size=13, bold=True, color=WHITE)
add_rect(slide, 0.4, 1.48, 6.1, 5.72, fill_color=WHITE)
add_multiline(slide, art_key, 0.5, 1.52, 5.9, 5.6, size=12.5, color=DARK_GREY,
              bullet_char="✔ ")
# Right box
add_rect(slide, 6.8, 1.0, 6.1, 0.48, fill_color=RED)
add_text(slide, "⚡ TB-HIV Co-infection – Must-Know Points", 6.9, 1.02, 5.9, 0.44,
         size=13, bold=True, color=WHITE)
add_rect(slide, 6.8, 1.48, 6.1, 5.72, fill_color=WHITE)
add_multiline(slide, tbhiv_key, 6.9, 1.52, 5.9, 5.6, size=12.5, color=DARK_GREY,
              bullet_char="✔ ")

footer(slide)

# ═══════════════════════════════════════════════════════════════
# SLIDE 19 – References & Resources
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GREY)
add_header_bar(slide, "References & Further Resources",
               "Authoritative NACO & WHO Guidelines")
footer(slide)

refs = [
    "1.  National Guidelines for HIV Care and Treatment 2021 – NACO, Ministry of Health & Family Welfare, Government of India",
    "     URL: naco.gov.in/sites/default/files/National_Guidelines_for_HIV_Care_and_Treatment%202021.pdf",
    "2.  National HIV Counselling and Testing Service (HCTS) Guidelines 2024 – NACO/FOGSI",
    "3.  Guidelines for Prevention and Management of TB in PLHIV at ART Centres – NACO & Central TB Division",
    "     URL: tbcindia.mohfw.gov.in (Guidelines for PMDT in India, 2023)",
    "4.  Revised NACO Guidance on 1HP as TPT Regimen in PLHIV – NACO, May 2024",
    "     Reference: T-11020/36/2005/NACO(ART)-Part 2, Dated 20.05.2024",
    "5.  India TB Report 2024 – Central TB Division, Ministry of Health & Family Welfare",
    "6.  India HIV Estimates 2023 – NACO/UNAIDS",
    "7.  WHO Consolidated Guidelines on HIV (2021) – World Health Organization",
    "8.  WHO End TB Strategy – Global Targets 2015-2035",
    "9.  Guidelines for Programmatic Management of Drug-Resistant TB in India (PMDT) – CTD 2023",
    "10. UNAIDS Global AIDS Monitoring 2023 – 90-90-90 Target Update",
]
add_rect(slide, 0.4, 1.28, 12.5, 5.75, fill_color=WHITE)
add_multiline(slide, refs, 0.55, 1.38, 12.1, 5.55, size=12, color=DARK_GREY,
              bullet_char="")

add_rect(slide, 0.4, 7.05, 12.5, 0.1, fill_color=RED)
add_text(slide,
         "Prepared for MD Medicine Academic Use | NACO Guidelines Version 2021 with 2024 Updates | Orris AI Medical Reference",
         0.4, 7.16, 12.5, 0.3, size=9.5, color=MID_GREY, align=PP_ALIGN.CENTER, italic=True)

# ── Save ──────────────────────────────────────────────────────
out_path = "/tmp/workspace/naco-pptx/NACO_Guidelines_MD_Medicine.pptx"
prs.save(out_path)
print(f"Saved to {out_path}")
print(f"Total slides: {len(prs.slides)}")
Running Command

cd /tmp/workspace/naco-pptx && python build_pptx.py 2>&1

Running Command

ls -lh /tmp/workspace/naco-pptx/NACO_Guidelines_MD_Medicine.pptx

Your presentation is ready:

NACO Guidelines MD Medicine

Presentation · PPTX


What's Inside - 19 Slides, 16:9 Widescreen

Part A: ART Guidelines (Slides 1-10)

SlideContent
1Title slide
2Full presentation outline / index
3HIV in India & NACP overview - epidemiology stats, 90-90-90 targets
4When to Start ART - Treat All policy, priority initiation criteria, pre-ART workup
5First-Line ART regimens table - adults, pregnancy, TB-HIV, HBV, renal impairment
6Special populations - paediatrics, PWID, PEP, PrEP
7Monitoring ART - clinical / immunological / virological (VL targets)
8Treatment failure - virological/immunological/clinical criteria, switching algorithm
9Second-Line ART regimens table (PI-based, scenario-wise)
10Third-Line ART & drug toxicities with substitution guide

Part B: TB-HIV Co-infection (Slides 11-19)

SlideContent
11TB-HIV epidemiology - burden, NACP-NTEP collaboration
123Is Strategy - ICF (4S screen), AIC, IPT/TPT (1HP vs 6H regimens)
13Diagnosis of TB in PLHIV - CBNAAT, TB-LAM, extrapulmonary TB
14When to start ART in TB-HIV - CD4-based timing, TBM exception
15Drug interactions: Rifampicin + ART (DTG dose doubling, PI/Rifabutin)
16DR-TB & ART - BDQ/DLM interactions, QTc risk matrix
17Monitoring TB-HIV outcomes - IRIS management, CPT protocol
18Key Takeaways & Exam high-yield summary (both parts)
19References (NACO 2021, HCTS 2024, CTD guidelines)

High-Yield Exam Points Highlighted

  • TDF + 3TC + DTG is preferred 1st-line; double DTG to 50mg BD with rifampicin
  • Rifampicin + PI = AVOID; use Rifabutin 150mg instead
  • TB meningitis = delay ART to 4-8 weeks (critical exception)
  • Virological failure threshold = VL >1000 copies/mL on 2 tests 3 months apart
  • 2024 update: 1HP regimen (Isoniazid + Rifapentine weekly x12) is preferred TPT

Isbit same for 2026

Searching the Web

NACO India HIV ART guidelines 2025 2026 updated changes new recommendations

Searching the Web

NACO India TB-HIV guidelines 2025 2026 new updates TPT dolutegravir

Reading Web Page

https://www.who.int/news/item/07-01-2026-who-releases-update…

Good data. Here is a clear answer:

Is the Presentation Still Current for 2026?

Largely yes - the core content is accurate and exam-relevant. The NACO 2021 guidelines remain the last formally published Indian national guidelines, and NACP Phase V (running until March 2026) confirmed continuation of the same framework. However, there are a few important updates you should be aware of:

✅ What Remains the Same (Still Valid)

AreaStatus
TDF + 3TC + DTG as preferred 1st-lineUnchanged
Treat All policy (regardless of CD4)Unchanged
DTG 50mg BD with rifampicin (TB-HIV)Unchanged
Rifampicin + PI → use Rifabutin insteadUnchanged
TBM → delay ART to 4-8 weeksUnchanged
VL >1000 copies/mL = virological failureUnchanged
4S symptom screen at every visitUnchanged
CPT for all HIV-TB patientsUnchanged

⚠️ Key Updates for 2025-2026

1. WHO January 2026 Guidelines (likely to be adopted by NACO soon):
  • DRV/r (Darunavir/ritonavir) is now the preferred PI, replacing ATV/r and LPV/r in 2nd/3rd-line regimens. The presentation uses ATV/r as preferred - this is now outdated per WHO 2026.
  • Long-acting injectable ART (Cabotegravir + Rilpivirine LA, monthly/bimonthly injections) now recommended for patients with adherence challenges - not yet widely available under NACO but endorsed globally.
  • Oral 2-drug regimens (DTG + 3TC) endorsed for stable, virally suppressed patients.
  • Reuse of TDF and ABC in subsequent regimens is now explicitly supported.
2. TB Preventive Therapy (TPT) - 2026 WHO Update:
  • 3HP (weekly Isoniazid + Rifapentine × 12 weeks / 3 months) is now WHO's preferred TPT for adults & adolescents with HIV - superseding 1HP (12 weeks) and 6H.
  • NACO's 2024 guidance endorsed 1HP; 3HP is the current WHO recommendation for 2026.
3. DR-TB - BPaLM Regimen (India NTEP 2025):
  • For MDR/RR-TB, the 6-month BPaLM regimen (Bedaquiline + Pretomanid + Linezolid + Moxifloxacin) is now the preferred shorter oral regimen under NTEP - replacing older injectable-based MDR regimens. Kerala PSC 2026 exam questions already reflect this.
4. NACP Phase VI (expected 2026-27):
  • Phase V ended March 2026. India is transitioning to Phase VI; new guidelines revision expected, likely incorporating WHO 2026 recommendations including DRV/r preference and 3HP for TPT.

Bottom Line for Your Exams

  • For MD Medicine viva/theory: Quote NACO 2021 as the base, then mention WHO 2026 updates (DRV/r preference, 3HP for TPT, LA-ART).
  • Most critical update to remember: In 2nd-line ART, DRV/r is now preferred over ATV/r or LPV/r per WHO 2026 - NACO is expected to align.
  • The rest of the presentation (1st-line, TB timing, drug interactions, DTG dosing, IRIS management) is all still accurate for 2026.

Make same guidelines for 2026 navo with a bit more details and not abbreviation as in prev slides

?

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