Assignment on HIV Infection in children and ART Therapy for both children and adults make a pdf
mkdir -p /tmp/workspace/hiv-assignment && ls /tmp/workspace/hiv-assignment/
~/hiv-assignment/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.lib import colors
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table,
TableStyle, PageBreak, HRFlowable, KeepTogether)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import ListFlowable, ListItem
import os
OUTPUT = "/tmp/workspace/hiv-assignment/HIV_Infection_Children_ART_Therapy.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
rightMargin=2.2*cm,
leftMargin=2.2*cm,
topMargin=2.5*cm,
bottomMargin=2.2*cm,
title="HIV Infection in Children and ART Therapy",
author="Medical Assignment"
)
styles = getSampleStyleSheet()
# Custom styles
TEAL = colors.HexColor("#006272")
DARK = colors.HexColor("#1a1a2e")
ACCENT = colors.HexColor("#e8f4f8")
LIGHT_TEAL = colors.HexColor("#d0e8ee")
cover_title = ParagraphStyle("cover_title", parent=styles["Title"],
fontName="Helvetica-Bold", fontSize=26, textColor=TEAL,
alignment=TA_CENTER, spaceAfter=12, leading=32)
cover_sub = ParagraphStyle("cover_sub", parent=styles["Normal"],
fontName="Helvetica", fontSize=14, textColor=DARK,
alignment=TA_CENTER, spaceAfter=8, leading=20)
cover_info = ParagraphStyle("cover_info", parent=styles["Normal"],
fontName="Helvetica", fontSize=11, textColor=colors.HexColor("#555555"),
alignment=TA_CENTER, spaceAfter=6)
h1 = ParagraphStyle("h1", parent=styles["Heading1"],
fontName="Helvetica-Bold", fontSize=16, textColor=colors.white,
backColor=TEAL, spaceBefore=18, spaceAfter=8, leading=22,
leftIndent=-10, rightIndent=-10, borderPadding=(6, 10, 6, 10))
h2 = ParagraphStyle("h2", parent=styles["Heading2"],
fontName="Helvetica-Bold", fontSize=13, textColor=TEAL,
spaceBefore=14, spaceAfter=6, leading=18,
borderPadding=(0, 0, 3, 0))
h3 = ParagraphStyle("h3", parent=styles["Heading3"],
fontName="Helvetica-BoldOblique", fontSize=11, textColor=DARK,
spaceBefore=10, spaceAfter=4, leading=15)
body = ParagraphStyle("body", parent=styles["Normal"],
fontName="Helvetica", fontSize=10.5, textColor=DARK,
spaceAfter=7, leading=16, alignment=TA_JUSTIFY)
bullet = ParagraphStyle("bullet", parent=styles["Normal"],
fontName="Helvetica", fontSize=10.5, textColor=DARK,
spaceAfter=4, leading=15, leftIndent=16, bulletIndent=4)
note = ParagraphStyle("note", parent=styles["Normal"],
fontName="Helvetica-Oblique", fontSize=9.5, textColor=colors.HexColor("#555"),
spaceAfter=6, leading=14, leftIndent=12,
backColor=colors.HexColor("#f0f8fa"), borderPadding=6)
caption = ParagraphStyle("caption", parent=styles["Normal"],
fontName="Helvetica-BoldOblique", fontSize=9, textColor=colors.HexColor("#777"),
alignment=TA_CENTER, spaceAfter=4)
story = []
# ─── COVER PAGE ────────────────────────────────────────────────────────────────
story.append(Spacer(1, 3.5*cm))
# Big colored bar
t = Table([["HIV Infection in Children\n& ART Therapy"]], colWidths=[16*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), TEAL),
("TEXTCOLOR", (0,0), (-1,-1), colors.white),
("FONTNAME", (0,0), (-1,-1), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 22),
("ALIGN", (0,0), (-1,-1), "CENTER"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 22),
("BOTTOMPADDING", (0,0), (-1,-1), 22),
("ROWBACKGROUNDS", (0,0), (-1,-1), [TEAL]),
]))
story.append(t)
story.append(Spacer(1, 0.6*cm))
story.append(Paragraph("A Comprehensive Medical Assignment", cover_sub))
story.append(Spacer(1, 0.4*cm))
story.append(HRFlowable(width="100%", thickness=1.5, color=LIGHT_TEAL))
story.append(Spacer(1, 1.5*cm))
info_data = [
["Subject:", "Paediatrics & Internal Medicine"],
["Topic:", "HIV in Children | ART in Children & Adults"],
["Sources:", "Red Book 2021 | Harrison's Principles (22E, 2025)"],
["Date:", "July 22, 2026"],
]
info_table = Table(info_data, colWidths=[4*cm, 12*cm])
info_table.setStyle(TableStyle([
("FONTNAME", (0,0), (0,-1), "Helvetica-Bold"),
("FONTNAME", (1,0), (1,-1), "Helvetica"),
("FONTSIZE", (0,0), (-1,-1), 11),
("TEXTCOLOR", (0,0), (0,-1), TEAL),
("TEXTCOLOR", (1,0), (1,-1), DARK),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("TOPPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(info_table)
story.append(Spacer(1, 2*cm))
story.append(HRFlowable(width="100%", thickness=0.5, color=LIGHT_TEAL))
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph("Compiled from Red Book 2021 (AAP) and Harrison's Principles of Internal Medicine, 22nd Edition (McGraw-Hill, 2025)", cover_info))
story.append(PageBreak())
# ─── TABLE OF CONTENTS ─────────────────────────────────────────────────────────
story.append(Paragraph("Table of Contents", h1))
story.append(Spacer(1, 0.3*cm))
toc_items = [
("1.", "HIV Infection in Children", "3"),
(" 1.1", "Overview and Epidemiology", "3"),
(" 1.2", "Etiology and Virology", "3"),
(" 1.3", "Modes of Transmission (MTCT)", "4"),
(" 1.4", "Clinical Features and Incubation", "4"),
(" 1.5", "Diagnostic Tests", "5"),
(" 1.6", "WHO Clinical Staging in Children", "6"),
(" 1.7", "Opportunistic Infections in Children", "6"),
("2.", "ART Therapy in Children", "7"),
(" 2.1", "When to Start ART in Children", "7"),
(" 2.2", "Preferred Regimens for Children", "7"),
(" 2.3", "Special Considerations in Pediatric ART", "8"),
("3.", "ART Therapy in Adults", "9"),
(" 3.1", "Principles of ART", "9"),
(" 3.2", "Drug Classes and Mechanisms", "9"),
(" 3.3", "Recommended Initial Regimens", "10"),
(" 3.4", "Monitoring Response to ART", "11"),
(" 3.5", "ART in Special Populations", "12"),
("4.", "Prevention of Mother-to-Child Transmission", "13"),
("5.", "Summary and Key Points", "14"),
("6.", "References", "15"),
]
toc_data = [[Paragraph(f"<b>{n}</b>", body), Paragraph(t, body), Paragraph(f"<i>{p}</i>", body)] for n, t, p in toc_items]
toc_table = Table(toc_data, colWidths=[1.5*cm, 12.5*cm, 1.5*cm])
toc_table.setStyle(TableStyle([
("FONTSIZE", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("TOPPADDING", (0,0), (-1,-1), 3),
("VALIGN", (0,0), (-1,-1), "TOP"),
("ROWBACKGROUNDS", (0,0), (-1,-1), [colors.white, colors.HexColor("#f7fbfc")]),
]))
story.append(toc_table)
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 1: HIV INFECTION IN CHILDREN
# ═══════════════════════════════════════════════════════════════════════════════
story.append(Paragraph("1. HIV Infection in Children", h1))
story.append(Spacer(1, 0.2*cm))
# 1.1
story.append(Paragraph("1.1 Overview and Epidemiology", h2))
story.append(Paragraph(
"Human Immunodeficiency Virus (HIV) infection in children remains a significant global health challenge. "
"Since the mid-1990s, the number of reported pediatric AIDS cases has decreased dramatically, primarily "
"because of prevention of mother-to-child transmission (MTCT) of HIV and the widespread availability "
"of antiretroviral therapy (ART) for children. However, in resource-limited settings, HIV continues to "
"pose a major burden on child health.", body))
story.append(Paragraph(
"Malignant neoplasms in children with HIV infection are relatively uncommon, but leiomyosarcomas and "
"non-Hodgkin B-cell lymphomas (including those in the CNS) occur more commonly than in immunocompetent "
"children. Kaposi sarcoma, caused by human herpesvirus 8, is rare in children in the United States but "
"has been documented in HIV-infected children from sub-Saharan Africa. The incidence of these neoplasms "
"has decreased during the ART era.", body))
story.append(Paragraph(
"The rate of new HIV infections among adolescents and young adults (ages 13-24) is also decreasing overall, "
"though increasing for young men who have sex with men. HIV infection in adolescents disproportionately "
"affects youth of minority race or ethnicity.", body))
# 1.2
story.append(Paragraph("1.2 Etiology and Virology", h2))
story.append(Paragraph(
"HIV-1 and HIV-2 are cytopathic lentiviruses (genus Lentivirus) of the family Retroviridae. Three distinct "
"genetic groups of HIV exist:", body))
for item in [
"<b>Group M (Major)</b> - Most prevalent worldwide; comprises 8 genetic subtypes (clades A through K), each with a distinct geographic distribution.",
"<b>Group O (Outlier)</b> - Less common variant.",
"<b>Group N (New)</b> - Rare variant.",
]:
story.append(Paragraph(f"• {item}", bullet))
story.append(Paragraph(
"HIV-2, the second AIDS-causing virus, is found predominantly in West Africa. It has a milder disease course "
"with a longer time to development of AIDS compared to HIV-1. Importantly, HIV-2 is intrinsically resistant to "
"nonnucleoside reverse transcriptase inhibitors (NNRTIs) and the fusion inhibitor enfuvirtide - a critical "
"consideration for treatment selection.", body))
story.append(Paragraph(
"Latent virus persists in peripheral blood mononuclear cells and in cells of the brain, bone marrow, and "
"genital tract even when plasma viral load is undetectable. Humans are the only known reservoir for HIV-1 "
"and HIV-2.", body))
# 1.3
story.append(Paragraph("1.3 Modes of Transmission (MTCT)", h2))
story.append(Paragraph(
"Only blood, semen, cervicovaginal secretions, and human milk have been implicated in transmission. "
"In children, mother-to-child transmission (MTCT) is the predominant route:", body))
modes = [
("Prepartum", "Transplacental spread during pregnancy (minority of cases)"),
("Intrapartum", "Exposure to infected blood/secretions during delivery (~65-70% of MTCT)"),
("Postpartum", "Through breastfeeding (accounts for 1/3 to 1/2 of MTCT worldwide)"),
("Other (rare)", "Pre-masticated food from HIV-infected caregivers; non-intact skin contact with blood-containing fluids"),
]
mode_table = Table(
[[Paragraph(f"<b>{m}</b>", body), Paragraph(d, body)] for m, d in modes],
colWidths=[3.5*cm, 12*cm]
)
mode_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,-1), LIGHT_TEAL),
("FONTSIZE", (0,0), (-1,-1), 10),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#cce4ea")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
("ROWBACKGROUNDS", (0,0), (-1,-1), [ACCENT, colors.white]),
]))
story.append(mode_table)
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
"In the absence of breastfeeding, the risk of HIV infection for infants born to untreated women living with "
"HIV (WLHIV) in the United States is approximately 25%, with most transmission occurring near the time of "
"delivery. Maternal viral load is the critical determinant affecting the likelihood of MTCT.", body))
story.append(Paragraph(
"US guidelines recommend cesarean section before labor and before rupture of membranes at 38 completed weeks "
"of gestation for WLHIV with viral load ≥1000 copies/mL (irrespective of ARV use in pregnancy).", note))
# 1.4
story.append(Paragraph("1.4 Clinical Features and Incubation Period", h2))
story.append(Paragraph(
"The usual age of onset of symptoms is approximately 12 to 18 months of age for untreated infants and "
"children in the United States who acquire HIV infection through MTCT. However, the clinical spectrum is wide:", body))
for item in [
"Some HIV-infected children become ill in the first few months of life (rapid progressors).",
"Others remain relatively asymptomatic for more than 5 years and, rarely, until early adolescence (slow progressors).",
"Acute retroviral syndrome in adolescents and adults occurs 7-14 days following viral acquisition and lasts 5-7 days.",
]:
story.append(Paragraph(f"• {item}", bullet))
story.append(Paragraph("<b>Common Clinical Manifestations in Children:</b>", h3))
clinical_data = [
["System", "Manifestations"],
["Constitutional", "Failure to thrive, weight loss, fever, lymphadenopathy"],
["Respiratory", "Lymphoid interstitial pneumonitis (LIP), recurrent pneumonia, PCP"],
["Neurological", "HIV encephalopathy, developmental delay, spasticity, seizures"],
["GI/Hepatic", "Chronic diarrhea, oral candidiasis, hepatosplenomegaly"],
["Haematological", "Anaemia, thrombocytopenia, neutropenia"],
["Neoplastic", "Non-Hodgkin lymphoma, leiomyosarcoma (rare: Kaposi sarcoma)"],
["Infections", "Recurrent bacterial infections, CMV, MAC, PCP, cryptosporidiosis"],
]
ct = Table(clinical_data, colWidths=[4.5*cm, 11*cm])
ct.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 10),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#cce4ea")),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, ACCENT]),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(ct)
story.append(Spacer(1, 0.3*cm))
# 1.5
story.append(Paragraph("1.5 Diagnostic Tests", h2))
story.append(Paragraph(
"Accurate and timely diagnosis is essential. The 2018 CDC HIV laboratory testing algorithm recommends:", body))
story.append(Paragraph(
"<b>Step 1 - Initial Screening:</b> FDA-approved HIV-1/HIV-2 antigen/antibody combination immunoassay "
"(fourth-generation assay) that detects HIV-1/HIV-2 antibodies plus HIV-1 p24 antigen.", body))
story.append(Paragraph(
"<b>Step 2 - Supplemental Confirmatory Testing:</b> Reactive specimens are tested with an FDA-approved "
"HIV-1/HIV-2 antibody differentiation immunoassay.", body))
story.append(Paragraph(
"<b>Step 3 - NAAT Testing:</b> Specimens reactive on initial assay but nonreactive/indeterminate on "
"differentiation assay are tested with an FDA-approved HIV-1 nucleic acid amplification test (NAAT).", body))
story.append(Paragraph("<b>Special Considerations for Perinatal Diagnosis:</b>", h3))
story.append(Paragraph(
"In infants born to HIV-infected mothers, passive transfer of maternal HIV antibodies complicates "
"antibody-based testing for the first 12-18 months. Therefore:", body))
for item in [
"DNA PCR (qualitative) or RNA qualitative assay is the preferred method for infants under 18 months.",
"Testing is recommended at birth, 14-21 days, 1-2 months, and 4-6 months of age.",
"Quantitative RNA PCR (viral load) assays serve as predictor of disease progression and are used to monitor response to ART.",
"Two or more positive virologic tests confirm HIV infection in infants.",
]:
story.append(Paragraph(f"• {item}", bullet))
# 1.6 WHO Staging
story.append(Paragraph("1.6 WHO Clinical Staging in Children", h2))
staging_data = [
["WHO Stage", "Clinical Features", "CD4 Count"],
["Stage 1\n(Asymptomatic)", "Asymptomatic or persistent generalized lymphadenopathy", "≥35% (or age-appropriate)"],
["Stage 2\n(Mild)", "Unexplained hepatosplenomegaly, papular pruritic eruptions, extensive warts, recurrent oral ulcers, parotid enlargement", "25-34%"],
["Stage 3\n(Advanced)", "Unexplained anaemia, neutropenia, thrombocytopenia; TB, severe bacterial infections, LIP, HIV wasting syndrome", "15-24%"],
["Stage 4\n(Severe)", "Pneumocystis pneumonia, CMV disease, HIV encephalopathy, disseminated mycobacterial infections, Kaposi sarcoma, cryptococcal meningitis", "<15%"],
]
st = Table(staging_data, colWidths=[3.2*cm, 8.5*cm, 3.8*cm])
st.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9.5),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#cce4ea")),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, ACCENT]),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(st)
story.append(Spacer(1, 0.3*cm))
# 1.7
story.append(Paragraph("1.7 Opportunistic Infections in Children with HIV", h2))
story.append(Paragraph(
"The spectrum of opportunistic infections (OIs) in HIV-infected children is similar to that in adults, "
"but certain infections occur with greater frequency or severity:", body))
oi_items = [
"<b>Pneumocystis jirovecii Pneumonia (PCP):</b> Most common severe OI in infants; occurs at higher CD4 counts than in adults. Prophylaxis with TMP-SMX is indicated from 4-6 weeks of age in HIV-exposed infants.",
"<b>Lymphoid Interstitial Pneumonitis (LIP):</b> Pathognomonic of pediatric HIV; presents with bilateral reticular nodular infiltrates, hypoxemia, and parotid enlargement.",
"<b>CMV Disease:</b> Retinitis, colitis, and pneumonitis; reflects severe immunodeficiency.",
"<b>Mycobacterium avium Complex (MAC):</b> Disseminated disease with fever, weight loss, anaemia; CD4 <75 cells/μL.",
"<b>Cryptosporidiosis:</b> Profuse watery diarrhea; can be life-threatening in immunocompromised children.",
"<b>Candidiasis:</b> Oral thrush and esophageal candidiasis are common; recurrence suggests immunodeficiency.",
"<b>Toxoplasmosis:</b> CNS disease; seizures, focal neurological deficits.",
"<b>Cryptococcal Meningitis:</b> Subacute meningitis; headache, fever, altered consciousness.",
]
for item in oi_items:
story.append(Paragraph(f"• {item}", bullet))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 2: ART IN CHILDREN
# ═══════════════════════════════════════════════════════════════════════════════
story.append(Paragraph("2. Antiretroviral Therapy (ART) in Children", h1))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
"The same principles of ART apply to both children and adults, but treatment of HIV-infected children "
"involves unique pharmacologic, virologic, and immunologic considerations. Pediatric HIV management "
"requires age-appropriate drug formulations, weight-based dosing, attention to drug palatability, and "
"caregiver adherence support.", body))
# 2.1
story.append(Paragraph("2.1 When to Start ART in Children", h2))
story.append(Paragraph(
"Current guidelines recommend initiating ART in all HIV-infected children regardless of CD4 count "
"or clinical status, given the benefits of early treatment and the risks of disease progression:", body))
timing_data = [
["Age Group", "Recommendation"],
["Infants < 12 months", "Start ART immediately upon diagnosis, regardless of CD4 count or clinical status. Risk of rapid disease progression is highest."],
["Children 1-5 years", "Initiate ART promptly. Consider urgency based on CD4 count (<25%) or clinical stage 3/4."],
["Children ≥5 years", "ART indicated for all. Urgency increases with advanced immune suppression (CD4 <350 cells/μL) or AIDS-defining illness."],
["HIV-exposed neonates\n(prophylaxis)", "ARV prophylaxis within hours of birth; regimen depends on maternal viral load and gestational age."],
]
tt = Table(timing_data, colWidths=[4*cm, 11.5*cm])
tt.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 10),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#cce4ea")),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, ACCENT]),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(tt)
story.append(Spacer(1, 0.3*cm))
# 2.2
story.append(Paragraph("2.2 Preferred ART Regimens for Children", h2))
story.append(Paragraph(
"Preferred regimens are typically built as a 'backbone' of two NRTIs plus a third agent from another "
"class (INSTI, PI, or NNRTI). The selection depends on the child's age, weight, and available formulations:", body))
ped_regimen_data = [
["Age/Weight Band", "Preferred Backbone (NRTIs)", "Third Agent"],
["Neonates/Infants\n(<4 weeks)", "Zidovudine (ZDV) + Lamivudine (3TC)", "Nevirapine (NVP) - preferred for neonates"],
["Infants 4 wks - 3 years\n(<10 kg)", "Abacavir (ABC) + Lamivudine (3TC)", "Lopinavir/ritonavir (LPV/r)"],
["Children 3-6 years\n(10-19.9 kg)", "Abacavir (ABC) + Lamivudine (3TC)", "Dolutegravir (DTG) or LPV/r"],
["Children ≥6 years\n(≥20 kg)", "Abacavir (ABC) + Lamivudine (3TC)\nor TDF/FTC if renal suitable", "Dolutegravir (DTG) or Efavirenz (EFV)"],
["Adolescents\n(Adult weight)", "TDF/FTC or ABC/3TC", "Dolutegravir (DTG) or Bictegravir (BIC)"],
]
prt = Table(ped_regimen_data, colWidths=[4*cm, 6*cm, 5.5*cm])
prt.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9.5),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#cce4ea")),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, ACCENT]),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(prt)
story.append(Spacer(1, 0.3*cm))
# 2.3
story.append(Paragraph("2.3 Special Considerations in Pediatric ART", h2))
story.append(Paragraph("<b>Drug Resistance Testing:</b>", h3))
story.append(Paragraph(
"Baseline HIV genotype resistance testing is recommended prior to initiating therapy in children, "
"particularly in perinatally infected infants who may have been exposed to NVP-based PMTCT regimens "
"and thus harbour NNRTI resistance mutations.", body))
story.append(Paragraph("<b>Adherence:</b>", h3))
story.append(Paragraph(
"Adherence is fundamental to ART success. In children, adherence depends on caregivers. Strategies include:", body))
for item in [
"Use of palatable liquid formulations for young children.",
"Transition to age-appropriate fixed-dose combinations (FDCs) as soon as possible.",
"Regular adherence counselling of caregivers and, as the child matures, the child themselves.",
"Identifying and addressing social, economic, and psychosocial barriers.",
]:
story.append(Paragraph(f"• {item}", bullet))
story.append(Paragraph("<b>Immune Reconstitution Inflammatory Syndrome (IRIS):</b>", h3))
story.append(Paragraph(
"IRIS may occur following ART initiation, particularly in children with advanced immunosuppression and "
"concurrent OIs such as tuberculosis, MAC, or cryptococcal disease. Vigilance is required during the "
"first weeks of ART.", body))
story.append(Paragraph("<b>ARV Prophylaxis for HIV-Exposed Neonates:</b>", h3))
story.append(Paragraph(
"All infants born to HIV-infected mothers should receive ARV prophylaxis starting within hours of birth. "
"The regimen (2-drug vs 3-drug) depends on the mother's viral load at delivery, gestational age, and birth weight. "
"Neonates at high risk of HIV infection (maternal viral load >1000 copies/mL or no antenatal care) receive a "
"3-drug presumptive ART regimen.", body))
story.append(Paragraph("<b>Cotrimoxazole Prophylaxis:</b>", h3))
story.append(Paragraph(
"TMP-SMX prophylaxis is recommended for all HIV-infected and HIV-exposed infants starting at 4-6 weeks of age "
"to prevent PCP. It is continued until HIV infection has been excluded or, if confirmed, until immune reconstitution "
"is achieved with ART (CD4 >25% in children <5 years, or >200 cells/μL in older children).", body))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 3: ART IN ADULTS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(Paragraph("3. Antiretroviral Therapy (ART) in Adults", h1))
story.append(Spacer(1, 0.2*cm))
# 3.1
story.append(Paragraph("3.1 Principles of ART", h2))
story.append(Paragraph(
"Combination ART (also referred to as highly active antiretroviral therapy - HAART) is the cornerstone "
"of management of patients with HIV infection and should be initiated as soon as possible following diagnosis. "
"Following the widespread use of ART in the United States from 1995-1996, marked declines were noted in the "
"incidence of most AIDS-defining conditions.", body))
story.append(Paragraph("The key principles of ART (USPHS/Kaiser Family Foundation) are:", body))
principles = [
"Ongoing HIV replication leads to immune system damage, progression to AIDS, and systemic immune activation.",
"Plasma HIV RNA levels indicate the magnitude of HIV replication; CD4+ T cell counts indicate the current level of immune competence.",
"Maximal suppression of viral replication is the goal of therapy; greater suppression reduces the likelihood of drug-resistant quasispecies.",
"The most effective strategies involve simultaneous initiation of combinations of effective anti-HIV drugs not previously used by the patient.",
"Antiretroviral drugs must be used according to optimum schedules and dosages.",
"Any decisions on ART have long-term impact on future options - drug choices must be made carefully.",
"Women should receive optimal ART regardless of pregnancy status.",
"The same principles apply to children and adults, but children require unique pharmacologic, virologic, and immunologic considerations.",
"Compliance is critical - the simpler the regimen, the easier it is for the patient to be compliant.",
]
for i, p in enumerate(principles, 1):
story.append(Paragraph(f"{i}. {p}", bullet))
story.append(Spacer(1, 0.2*cm))
# 3.2
story.append(Paragraph("3.2 Drug Classes and Mechanisms", h2))
drug_classes = [
["Drug Class", "Mechanism", "Key Agents"],
["Nucleoside/Nucleotide RTIs\n(NRTIs/NtRTIs)", "Inhibit reverse transcriptase; incorporate as chain terminators into viral DNA",
"Tenofovir alafenamide (TAF), Tenofovir disoproxil (TDF), Emtricitabine (FTC), Lamivudine (3TC), Abacavir (ABC), Zidovudine (ZDV)"],
["Non-Nucleoside RTIs\n(NNRTIs)", "Bind non-competitively to reverse transcriptase; highly selective for HIV-1 (not HIV-2)",
"Efavirenz (EFV), Rilpivirine (RPV), Doravirine (DOR), Etravirine (ETR)"],
["Protease Inhibitors\n(PIs)", "Block viral protease enzyme, preventing maturation of viral particles",
"Darunavir/r (DRV/r), Atazanavir/r (ATV/r), Lopinavir/r (LPV/r)"],
["Integrase Strand Transfer\nInhibitors (INSTIs)", "Prevent integration of viral DNA into host genome; current first-line choice",
"Dolutegravir (DTG), Bictegravir (BIC), Cabotegravir (CAB), Raltegravir (RAL), Elvitegravir (EVG)"],
["Entry/Fusion Inhibitors", "Block viral entry at multiple steps: CD4 attachment, CCR5 co-receptor binding, or membrane fusion",
"Enfuvirtide (T-20), Maraviroc (MVC), Fostemsavir (FTR), Ibalizumab (IBA)"],
["Capsid Inhibitors\n(Newest Class)", "Target viral capsid protein; prevent uncoating and nuclear import",
"Lenacapavir (LEN) - long-acting injectable"],
]
dct = Table(drug_classes, colWidths=[3.8*cm, 5.2*cm, 6.5*cm])
dct.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#cce4ea")),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, ACCENT]),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(dct)
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
"Note: NNRTIs and enfuvirtide are NOT active against HIV-2. Patients with epidemiologic link to West Africa "
"should be screened for HIV-2, and ART regimens must exclude these agents.", note))
# 3.3
story.append(Paragraph("3.3 Recommended Initial Regimens for Treatment-Naïve Adults", h2))
story.append(Paragraph(
"Prior to initiation of therapy (and whenever a change is being considered), drug resistance genotype "
"testing is strongly recommended. The DHHS-recommended initial combination regimens are:", body))
regimen_data = [
["Regimen", "Components", "Notes"],
["Biktarvy\n(PREFERRED)", "Bictegravir + Tenofovir alafenamide\n+ Emtricitabine", "Once daily single-tablet; high barrier to resistance; preferred for most patients"],
["Dolutegravir-based\n(PREFERRED)", "Dolutegravir + Tenofovir* + Emtricitabine*\n(* TAF or TDF depending on renal function)", "High barrier to resistance; avoid in first trimester of pregnancy (neural tube defect risk)"],
["Dovato\n(PREFERRED, select)", "Dolutegravir + Lamivudine", "Two-drug regimen; only for HIV RNA <500,000 copies/mL; HBV-negative patients"],
["Cabotegravir-LA\n+ Rilpivirine-LA\n(LONG-ACTING)", "Monthly or every-2-month injectable", "Approved for virologically stable patients; requires baseline HIV RNA <50 copies/mL"],
["Lenacapavir\n(LONG-ACTING)", "Twice-yearly subcutaneous injection", "Combined with other ARVs; for treatment-experienced patients or as PrEP"],
]
rt = Table(regimen_data, colWidths=[3.5*cm, 6*cm, 6*cm])
rt.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9.5),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#cce4ea")),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, ACCENT]),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(rt)
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
"Rilpivirine is approved only in ART-naïve patients with HIV RNA <100,000 copies/mL and is "
"contraindicated in patients taking proton pump inhibitors.", note))
# 3.4
story.append(Paragraph("3.4 Monitoring Response to ART", h2))
story.append(Paragraph(
"Following initiation of therapy, the expected response pattern is:", body))
for item in [
"<b>1-2 months:</b> Rapid, at least 1-log (10-fold) reduction in plasma HIV RNA levels.",
"<b>6 months:</b> Plasma HIV RNA should decline to <50 copies/mL (undetectable).",
"<b>CD4 recovery:</b> Rise of 100-150 cells/μL in CD4+ T cell count during the first year.",
"<b>Viral rebound:</b> If HIV RNA rises above 50-200 copies/mL, adherence should be assessed, and drug resistance testing performed.",
]:
story.append(Paragraph(f"• {item}", bullet))
mon_data = [
["Parameter", "Baseline", "Monitoring Frequency"],
["HIV RNA (Viral Load)", "Yes", "2-4 weeks post-initiation, then every 3-6 months once stable"],
["CD4+ T Cell Count", "Yes", "Every 3-6 months initially, then annually if stable >300"],
["Resistance Genotype", "Yes (before starting)", "At any treatment failure"],
["CBC, LFTs, Renal Panel", "Yes", "Every 3-6 months; TAF/TDF requires eGFR monitoring"],
["Lipid Profile", "Yes", "Annually; more frequently if PI-based regimen"],
["HBV/HCV screening", "Yes", "At baseline; critical before selecting NRTI backbone"],
["Drug-drug interactions", "Yes", "At every visit (PIs are potent CYP3A4 inhibitors)"],
]
mt = Table(mon_data, colWidths=[4.5*cm, 2.5*cm, 8.5*cm])
mt.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9.5),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#cce4ea")),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, ACCENT]),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(mt)
story.append(Spacer(1, 0.3*cm))
# 3.5
story.append(Paragraph("3.5 ART in Special Adult Populations", h2))
special_pops = [
("Pregnant Women",
"ART should be continued throughout pregnancy. Dolutegravir carries a small risk of neural tube defects "
"if used periconceptionally. Efavirenz is also teratogenic in the first trimester. Preferred options include "
"Atazanavir/ritonavir + TDF/FTC or Raltegravir + TDF/FTC. IV ZDV is recommended intrapartum if viral load ≥1000 copies/mL."),
("HIV/TB Coinfection",
"ART initiation should be delayed 2-8 weeks after starting TB treatment to reduce risk of paradoxical IRIS. "
"Rifampicin significantly reduces PI and INSTI levels; preferred ART is Efavirenz or Dolutegravir (with dose adjustment). "
"Rifabutin is preferred over rifampicin when a PI is required."),
("HIV/HBV Coinfection",
"TDF or TAF combined with FTC or 3TC is preferred as it treats both HBV and HIV. "
"Lamivudine or emtricitabine alone is insufficient for HBV. Stopping these drugs can cause HBV flare."),
("Renal Impairment",
"Tenofovir disoproxil (TDF) should be limited to CrCl >70 mL/min. "
"Tenofovir alafenamide (TAF) is preferred (safer for kidneys and bones) and can be used down to CrCl >30 mL/min. "
"Abacavir/3TC backbone is an option when TDF and TAF are contraindicated."),
("Cryptococcal Meningitis",
"Delay ART initiation for at least 4 weeks after starting antifungal therapy (fluconazole/amphotericin B) "
"to reduce risk of IRIS-related death."),
("HIV-2 Infection",
"NNRTIs (efavirenz, rilpivirine, etc.) and enfuvirtide are NOT active against HIV-2. "
"Use INSTI- or PI-based regimens. Monitor viral load carefully as HIV-2 viral load assays may be less sensitive."),
]
for title, content in special_pops:
story.append(Paragraph(f"<b>{title}</b>", h3))
story.append(Paragraph(content, body))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 4: PMTCT
# ═══════════════════════════════════════════════════════════════════════════════
story.append(Paragraph("4. Prevention of Mother-to-Child Transmission (PMTCT)", h1))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
"PMTCT is one of the most successful global health interventions. Before ARV interventions, perinatal "
"transmission of HIV-1 was 12-25% in the United States/Europe and 25-35% in Africa. With comprehensive "
"PMTCT programs, transmission rates have been reduced to below 1% in high-income settings.", body))
story.append(Paragraph("The Four Prongs of PMTCT:", h2))
prongs = [
("Prong 1", "Primary prevention of HIV infection among women of childbearing age"),
("Prong 2", "Prevention of unintended pregnancies among women living with HIV"),
("Prong 3", "Prevention of HIV transmission from a woman living with HIV to her infant"),
("Prong 4", "Provision of appropriate treatment, care and support to mothers living with HIV and their children and families"),
]
pt = Table([[Paragraph(f"<b>{p}</b>", body), Paragraph(d, body)] for p, d in prongs],
colWidths=[2.5*cm, 13*cm])
pt.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,-1), LIGHT_TEAL),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#cce4ea")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
("ROWBACKGROUNDS", (0,0), (-1,-1), [ACCENT, colors.white]),
("FONTSIZE", (0,0), (-1,-1), 10),
]))
story.append(pt)
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("Key PMTCT Interventions:", h2))
for item in [
"<b>Antenatal ART:</b> All pregnant WLHIV must receive combination ART, regardless of CD4 count or viral load, to suppress viral replication and minimize MTCT risk.",
"<b>Intrapartum Care:</b> IV ZDV infusion during labour is recommended if viral load ≥1000 copies/mL; caesarean section at 38 weeks if VL ≥1000 copies/mL.",
"<b>Neonatal ARV Prophylaxis:</b> All HIV-exposed newborns receive ZDV (or regimen based on maternal viral load) starting within hours of birth.",
"<b>Infant Feeding:</b> In resource-rich settings, formula feeding is recommended to avoid breastfeeding transmission. In resource-limited settings, WHO recommends exclusive breastfeeding for 6 months with concurrent maternal ART.",
"<b>Infant HIV Testing:</b> NAAT-based virologic testing at birth, 4-6 weeks, and 4-6 months; antibody testing at 18 months to document clearance of maternal antibodies.",
"<b>Premastication Avoidance:</b> HIV-infected caregivers should be counselled not to pre-masticate (pre-chew) food for infants.",
]:
story.append(Paragraph(f"• {item}", bullet))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
"Transmission of HIV by breastfeeding accounts for one third to one half of MTCT of HIV worldwide. "
"Breastfeeding transmission is more likely among mothers who acquire HIV infection late in pregnancy "
"or during the postpartum period.", note))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 5: SUMMARY
# ═══════════════════════════════════════════════════════════════════════════════
story.append(Paragraph("5. Summary and Key Points", h1))
story.append(Spacer(1, 0.2*cm))
summary_sections = [
("HIV in Children - Key Points", [
"MTCT (peripartum + breastfeeding) is the predominant route of HIV in children.",
"Maternal viral load is the single most important determinant of MTCT risk.",
"Perinatally acquired HIV has a bimodal course: rapid progressors (first months) and slow progressors (years).",
"Virologic (NAAT) rather than serologic testing is required for diagnosis in infants <18 months.",
"LIP is a characteristic manifestation of pediatric HIV (not commonly seen in adults).",
"PCP prophylaxis with TMP-SMX is mandatory for all HIV-exposed infants from 4-6 weeks of age.",
]),
("ART in Children - Key Points", [
"Initiate ART in all HIV-infected children, regardless of CD4 count - with urgency highest in infants.",
"Preferred pediatric ART backbone: ABC + 3TC; third drug: LPV/r (infants), DTG or EFV (older children).",
"Weight-based dosing and palatable formulations are essential; transition to FDCs as soon as feasible.",
"Baseline resistance genotype testing is mandatory before initiating ART.",
"Caregiver adherence support is the cornerstone of pediatric ART success.",
"IRIS can occur in the weeks following ART initiation - monitor closely in those with advanced disease.",
]),
("ART in Adults - Key Points", [
"Initiate ART in all HIV-positive adults immediately after diagnosis (with exceptions for cryptococcal meningitis and TB).",
"INSTIs (DTG, BIC, CAB) are now the backbone of first-line ART due to efficacy, tolerability, and high barrier to resistance.",
"Preferred initial regimen: Bictegravir/TAF/FTC (Biktarvy) - once daily single tablet.",
"HIV RNA should be undetectable (<50 copies/mL) within 6 months of ART initiation.",
"Drug resistance genotype testing is mandatory before starting therapy.",
"Long-acting injectables (Cabotegravir-LA + Rilpivirine-LA monthly; Lenacapavir 6-monthly) are available for appropriate patients.",
"NNRTIs and enfuvirtide are inactive against HIV-2 - always determine HIV type before prescribing.",
"TB/HIV coinfection requires careful timing and regimen selection; rifampicin has major drug interactions.",
]),
]
for sec_title, points in summary_sections:
story.append(Paragraph(sec_title, h2))
for p in points:
story.append(Paragraph(f"✔ {p}", bullet))
story.append(Spacer(1, 0.2*cm))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 6: REFERENCES
# ═══════════════════════════════════════════════════════════════════════════════
story.append(Paragraph("6. References", h1))
story.append(Spacer(1, 0.2*cm))
refs = [
"American Academy of Pediatrics (AAP). <i>Red Book: 2021 Report of the Committee on Infectious Diseases</i>, 32nd Edition. Elk Grove Village, IL: American Academy of Pediatrics; 2021. (Human Immunodeficiency Virus Infection, pp. 690-724).",
"Fauci AS, Lane HC. Chapter 208: Human Immunodeficiency Virus Disease: AIDS and Related Disorders. In: Loscalzo J, Fauci AS, Kasper DL, Hauser SL, Longo DL, Jameson JL, eds. <i>Harrison's Principles of Internal Medicine</i>, 22nd Edition. New York: McGraw-Hill Medical; 2025.",
"World Health Organization (WHO). <i>Consolidated Guidelines on HIV Prevention, Testing, Treatment, Service Delivery and Monitoring: Recommendations for a Public Health Approach</i>. Geneva: WHO; 2021.",
"US Department of Health and Human Services (DHHS) Panel on Antiretroviral Guidelines for Adults and Adolescents. <i>Guidelines for the Use of Antiretroviral Agents in Adults and Adolescents with HIV</i>. Available at: https://clinicalinfo.hiv.gov/en/guidelines.",
"US Department of Health and Human Services (DHHS) Panel on Antiretroviral Therapy and Medical Management of Children Living with HIV. <i>Guidelines for the Use of Antiretroviral Agents in Pediatric HIV Infection</i>. Available at: https://clinicalinfo.hiv.gov/en/guidelines/pediatric-arv.",
"US Department of Health and Human Services (DHHS) Panel on Treatment of HIV During Pregnancy and Prevention of Perinatal Transmission. <i>Recommendations for the Use of Antiretroviral Drugs During Pregnancy and Interventions to Reduce Perinatal HIV Transmission in the United States</i>. Available at: https://clinicalinfo.hiv.gov/en/guidelines/perinatal.",
"Goodman & Gilman's <i>The Pharmacological Basis of Therapeutics</i>. Chapter on Antiretroviral Drugs. 14th Edition. McGraw-Hill; 2023.",
"Creasy RK, Resnik R, eds. <i>Maternal-Fetal Medicine: Principles and Practice</i>. 9th Edition. Philadelphia: Elsevier; 2023. (HIV Mother-to-Child Transmission, Chapter).",
"UNAIDS. <i>Global AIDS Update 2025: Uniting for Equity</i>. Geneva: UNAIDS; 2025.",
"Centers for Disease Control and Prevention (CDC). <i>HIV Laboratory Testing Algorithm</i>. Available at: https://stacks.cdc.gov/view/cdc/50872. Revised 2018.",
]
for i, ref in enumerate(refs, 1):
story.append(Paragraph(f"{i}. {ref}", bullet))
story.append(Spacer(1, 1*cm))
story.append(HRFlowable(width="100%", thickness=1, color=LIGHT_TEAL))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
"This assignment was compiled from authoritative medical textbooks and international guidelines. "
"Clinical decisions should always be made in consultation with qualified healthcare professionals "
"and current national/institutional guidelines.",
note))
# ─── BUILD ─────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF created: {OUTPUT}")
cd /tmp/workspace/hiv-assignment && python generate_pdf.py
ls -lh /tmp/workspace/hiv-assignment/HIV_Infection_Children_ART_Therapy.pdf
HIV Infection Children ART Therapy
PDF Document · PDF