HIV enters cell ↓ Uses reverse transcriptase enzyme to make DNA ↓ NRTIs enter the cell ↓ NRTIs get activated (phosphorylation → triphosphate form) ↓ NRTIs mimic normal DNA building blocks ↓ They get inserted into viral DNA ↓ ❌ No 3′-OH group present ↓ DNA chain stops growing (chain termination) ↓ ❌ No viral DNA formed ↓ ❌ HIV replication stops
NRTI nucleoside reverse transcriptase inhibitor mechanism HIV DNA chain termination

Molecular dynamics simulation snapshots depicting the interactions between various Nucleoside Reverse Transcriptase Inhibitor (NRTI) drug molecules and model phospholipid membranes. The figure is organized into two columns: the left column (panels c, e, g) represents a POPC lipid monolayer system, while the right column (panels d, f, h) represents a POPC lipid bilayer system. The color coding identifies the components: red spheres represent drug molecules (stavudine/d4T in row 2, didanosine/ddI in row 3, and apricitabine/ATC in row 4), blue signifies POPC lipid headgroups, gray denotes hydrophobic tails, and cyan represents the aqueous (water) phase. In the monolayer systems, the drug molecules are seen dispersed in the water phase and accumulating at the lipid-water interface. In the bilayer systems, drug molecules are distributed within the central aqueous compartment and interacting with the polar headgroups. Apricitabine (panels g and h) demonstrates the highest degree of membrane association and penetration into the hydrophilic headgroup region compared to stavudine and didanosine, illustrating differences in drug-membrane affinity.

A two-part pathophysiology diagram illustrating the cellular mechanisms of non-nucleoside reverse transcriptase inhibitor (NNRTI)-induced hepatotoxicity for (a) Nevirapine (NVP) and (b) Efavirenz (EFV). Section (a) shows NVP-induced liver injury mediated by DAMP release, LSER (lipid droplets surrounded by smooth endoplasmic reticulum) formation, mitochondrial dysfunction, and increased bile acid synthesis, leading to immune system activation and hepatocyte death. Section (b) details the metabolic impact of EFV, highlighting mitochondrial dysfunction (decreased O2 consumption and membrane potential, increased ROS), ER stress (IRE1α/XBP1 pathway), lipid accumulation, and inhibited bile acid transport. The diagram illustrates how these stressors alter autophagic flux and activate the JNK/BimEL signaling pathway. Both pathways culminate in hepatocyte death, represented by jagged starburst icons. This schematic provides a comparative overview of idiosyncratic versus metabolic drug-induced liver injury (DILI) mechanisms relevant to HIV antiretroviral therapy (cART).

This pathophysiology diagram illustrates the antiviral mechanisms of phlorotannins (specifically 6,6'-bieckol, 8,4'-dieckol, and 8,8'-bieckol) against a virus, such as HIV, within a host cell. The diagram identifies three primary inhibitory pathways. First, phlorotannins block the initial 'Adherence & penetration' stage by preventing the virus from binding to the host cell surface receptor. Second, the diagram shows the inhibition of 'Reverse transcriptase', which halts the replication cycle by preventing the conversion of viral RNA into DNA. Third, 'Protease inhibition' is depicted as a mechanism that disrupts the 'Proteolysis' stage, preventing the processing of large precursor proteins into functional viral proteins. The visual components include a generic enveloped virus with surface spikes, an intracellular replication pathway involving viral RNA, DNA, mRNA, and protein synthesis, and red arrows indicating where phlorotannins exert their inhibitory effects. This educational visual is intended for clinical pharmacology and microbiology audiences to understand the multi-target therapeutic potential of marine-derived polyphenols in managing viral infections.

<table><thead><tr><th>Adverse Effects</th><th>Associated ARVs</th><th>Onset/Clinical Manifestations</th><th>Estimated Frequency</th><th>Risk Factors</th><th>Prevention/ Monitoring</th><th>Management</th></tr></thead><tbody><tr><td></td><td></td><td>Presentation<br>• Emesis, abdominal pain, and elevated amylase and lipase levels (asymptomatic hyperamylasemia or elevated lipase do not in and of themselves indicate pancreatitis)</td><td></td><td>Hypertriglyceridemia<br><br>Advanced HIV infection<br><br>Previous episode of pancreatitis<br><br>Alcohol use</td><td></td><td>If pancreatitis is associated with hypertriglyceridemia, consider using interventions to lower TG levels.</td></tr></tbody></table> Key: ART = antiretroviral therapy; ARV = antiretroviral; FDA = U.S. Food and Drug Administration; NRTI = nucleoside reverse transcriptase inhibitor; PI = protease inhibitor; RTV = ritonavir; TG = triglyceride; TMP-SMX = trimethoprim sulfamethoxazole
| NRTI | Analog of | Brand Name |
|---|---|---|
| Zidovudine (AZT) | Thymidine | Retrovir |
| Lamivudine (3TC) | Cytidine | Epivir |
| Emtricitabine (FTC) | Cytidine | Emtriva |
| Abacavir (ABC) | Guanosine | Ziagen |
| Tenofovir (TDF/TAF) | Adenosine | Viread |
"Each agent requires intracytoplasmic activation via phosphorylation by cellular enzymes to the triphosphate form." - Katzung's Basic and Clinical Pharmacology, 16th Ed.
"The NRTIs act by competitive inhibition of HIV-1 reverse transcriptase; incorporation into the growing viral DNA chain causes chain termination due to inhibition of binding with the incoming nucleotide." - Katzung's Basic and Clinical Pharmacology, 16th Ed.
Normal DNA synthesis:
...nucleotide-3'OH + new nucleotide → chain extends ✓
After NRTI incorporation:
...NRTI (no 3'OH) + new nucleotide → ❌ chain stops
| Mutation | Associated NRTI |
|---|---|
| M184V | Lamivudine, Emtricitabine, Abacavir |
| K65R | Tenofovir |
| Thymidine Analog Mutations (TAMs) | Zidovudine, Stavudine |
HIV enters cell
↓
Reverse transcriptase converts viral RNA → DNA
↓
NRTIs enter cell (inactive prodrug form)
↓
Cellular kinases phosphorylate NRTIs → NRTI-triphosphate (active)
↓
NRTI-triphosphate mimics normal dNTPs, gets inserted by RT
↓
❌ No 3′-OH group on NRTI (structural mismatch)
↓
Next nucleotide cannot bind → chain termination
↓
❌ Incomplete viral DNA cannot integrate
↓
❌ HIV replication halted
Explain NRTI mitochondrial toxicity and how to monitor for it clinically
Can u shoe this mechanism of action visually following all steps
A detailed step-by-step educational pharmacology diagram showing the complete mechanism of action of NRTIs (Nucleoside Reverse Transcriptase Inhibitors) against HIV. The diagram should show these sequential steps in a clean flowchart style with icons and labels: Step 1 - HIV virus particle with RNA genome entering a CD4+ T cell. Step 2 - Inside the cell, reverse transcriptase enzyme converting viral RNA to DNA (show RNA strand and DNA strand being built). Step 3 - NRTI drug molecule entering the cell as an inactive prodrug. Step 4 - Cellular kinase enzyme phosphorylating the NRTI: monophosphate to diphosphate to triphosphate (show 3 phosphate groups). Step 5 - Active NRTI-triphosphate competing with normal dNTP at the active site of reverse transcriptase (show normal nucleotide vs fake NRTI side by side, highlighting the missing 3-OH group with a red X). Step 6 - NRTI incorporated into growing viral DNA chain (show the chain stopping with a red X and "chain termination" label). Step 7 - Incomplete viral DNA cannot integrate into host nucleus (show nucleus with X). Step 8 - HIV replication halted (show red stop sign). Use a clean medical education style with blue and red color coding, white background, clear arrows between steps, and bold text labels.

"The selective toxicity of these drugs depends on their ability to inhibit the HIV reverse transcriptase without inhibiting host cell DNA polymerases. Although the intracellular triphosphates for all these drugs have low affinity for human DNA polymerase α and β, some can inhibit human DNA polymerase γ, which is the mitochondrial enzyme." - Goodman & Gilman's, 13th Ed.
HIGH mitochondrial toxicity LOW mitochondrial toxicity
(older, rarely used now) (modern, preferred)
|-----------------------------------|--------------------------------|
Stavudine (d4T) Tenofovir (TDF/TAF)
Didanosine (ddI) Lamivudine (3TC)
Zidovudine (AZT) - moderate Emtricitabine (FTC)
Abacavir (ABC)
"Phosphorylated emtricitabine, lamivudine, and tenofovir have low affinity for DNA polymerase γ and are largely devoid of mitochondrial toxicity." - Goodman & Gilman's

| Organ / System | Manifestation | Worst Culprit |
|---|---|---|
| Liver | Hepatic steatosis (micro/macrovesicular), elevated transaminases | Stavudine, Zidovudine, Didanosine |
| Blood/Whole body | Lactic acidosis (potentially fatal) | Stavudine > Didanosine > Zidovudine |
| Peripheral nerves | Peripheral neuropathy (numbness, pain in hands/feet) | Didanosine, Stavudine |
| Pancreas | Pancreatitis | Didanosine |
| Muscle | Myopathy, myalgia | Zidovudine |
| Bone marrow | Anemia, granulocytopenia | Zidovudine |
| Adipose tissue | Lipoatrophy (fat loss from limbs/face), lipodystrophy | Stavudine, Zidovudine |
| Kidney | Renal tubular dysfunction, loss of bone mineral density | TDF (tenofovir disoproxil) |
| Test | Frequency | What you're looking for |
|---|---|---|
| ALT / AST | Baseline, then every 3-6 months | Rising transaminases = early hepatotoxicity |
| HIV viral load + CD4 | Every 3-6 months | Virologic failure may indicate resistance |
| Serum lactate | Only if symptomatic | Elevated > 2 mmol/L = hyperlactatemia; > 5 mmol/L + symptoms = lactic acidosis |
| Renal function (Cr, eGFR) | Baseline, 3-6 months | Especially for TDF - nephrotoxicity |
| Bone mineral density (DEXA) | Baseline + follow-up if on TDF | TDF can cause osteoporosis/fractures |
| Blood glucose, lipids | Baseline, annually | Lipoatrophy/insulin resistance with thymidine analogs |
| CBC | Baseline + monitoring | Zidovudine-related anemia / neutropenia |
"Any new aminotransferase elevation should trigger immediate measurement of serum lactate, creatine kinase, and pancreatic enzyme levels." - Sleisenger & Fordtran's GI Disease
| Feature | Detail |
|---|---|
| Root cause | Inhibition of mitochondrial DNA pol-γ |
| Worst NRTIs | Stavudine > Didanosine > Zidovudine |
| Safest NRTIs | Tenofovir (TAF), Lamivudine, Emtricitabine |
| Class warning | Black box: lactic acidosis + hepatic steatosis (ALL NRTIs) |
| Key labs to monitor | ALT/AST, serum lactate (if symptomatic), CK, lipase, CBC, renal function |
| Action threshold | Rising transaminases or any metabolic acidosis → check lactate immediately → consider stopping |
Simplify under headings very easy language
| Drug Name | Common Name |
|---|---|
| Abacavir | ABC |
| Didanosine | ddI |
| Emtricitabine | FTC |
| Lamivudine | 3TC |
| Stavudine | d4T |
| Tenofovir | TDF/TAF |
| Zidovudine | AZT |
2 NRTIs
+
Either:
- 1 Protease Inhibitor (boosted with ritonavir or cobicistat)
OR
- 1 NNRTI
OR
- 1 Integrase Inhibitor
| Topic | Key Point |
|---|---|
| Main toxicity | Mitochondrial damage |
| Most dangerous side effect | Lactic acidosis (fatal) - black box on ALL NRTIs |
| Worst culprits | Stavudine, Didanosine (rarely used now) |
| Abacavir special | Hypersensitivity - test HLA-B*5701 first, never rechallenge |
| Few drug interactions | Except zidovudine and tenofovir |
| Resistance | M184 mutation (codon 184) - resists lamivudine/emtricitabine |
| Don't combine | Zidovudine + stavudine (same analog = antagonism) |
| NNRTIs difference | No activation needed, bind different site on RT |
Think of it like: HIV assembles itself but comes out "broken" and useless.
| Feature | Detail |
|---|---|
| Food effect | High-fat meals INCREASE absorption of nelfinavir and saquinavir; DECREASE absorption of indinavir; others not affected |
| Protein binding | All PIs are heavily bound to plasma proteins |
| Metabolism | All broken down by the CYP3A4 enzyme in the liver |
| Excretion | Very little is excreted unchanged in urine - mostly liver metabolism |
| Drug Given With PI | Problem |
|---|---|
| Simvastatin / Lovastatin (cholesterol drugs) | Rhabdomyolysis (muscle breakdown) |
| Midazolam / Triazolam (sedatives) | Excessive, dangerous sedation |
| Fentanyl (painkiller) | Respiratory depression (stops breathing) |
| Warfarin (blood thinner) | Dose needs adjustment |
| Sildenafil (Viagra) | Dose needs adjustment |
| Phenytoin (anti-seizure) | Dose needs adjustment |
| Feature | Detail |
|---|---|
| Food | Must be taken WITH food to improve absorption |
| Acid requirement | Needs acidic stomach environment - avoid with PPIs (omeprazole etc.), space away from H₂ blockers and antacids |
| Boosting | Can be "boosted" with ritonavir or cobicistat (these block its breakdown, raising blood levels) |
| Metabolism | CYP3A4 enzyme; half-life ~7 hours; given once daily |
| Special side effects | Benign jaundice (yellow skin/eyes) and high bilirubin - harmless but visible |
| Advantage over other PIs | Lower risk of hyperlipidemia (less fat/cholesterol disturbance) |
| Caution | May prolong the PR interval (affects heart rhythm - ECG monitoring) |
| Topic | Key Point |
|---|---|
| Mechanism | Block protease → virus matures but is non-infectious |
| Preferred PIs today | Atazanavir, Darunavir |
| Main side effects | GI upset + fat redistribution + metabolic syndrome (diabetes, high cholesterol) |
| Buffalo hump | Classic visible sign of PI use |
| Drug interactions | HUGE problem - CYP450 inhibitors - avoid statins, sedatives, fentanyl |
| Contraindicated with | Rifampin, St. John's Wort |
| Resistance | Step-by-step mutations; low drug levels = faster resistance |
| Atazanavir | Take with food, no PPIs, causes benign jaundice, fewer lipid problems |
No one can remember such difficult names and interactions everytime so what's best solution for pharm D students
If you know ONE drug in a class well, you know 80% of all drugs in that class.
| Suffix | Drug Class | What they do |
|---|---|---|
| -navir | Protease Inhibitors | Block protease, cause metabolic issues |
| -vudine | NRTIs | Chain termination |
| -ciclovir | Antivirals (herpes) | Block viral DNA polymerase |
| -mab | Monoclonal antibodies | Target specific receptors |
| -pril | ACE inhibitors | Block angiotensin conversion |
| -sartan | ARBs | Block angiotensin receptor |
| -olol | Beta blockers | Block beta receptors |
| -statin | Statins | Block HMG-CoA reductase |
"CYP3A4 is the king enzyme" - most drugs are metabolized by it.
| Type | What happens | Examples |
|---|---|---|
| CYP3A4 Inhibitors (block the enzyme) | Other drugs BUILD UP → toxicity | All -navir PIs, azole antifungals, erythromycin, grapefruit juice |
| CYP3A4 Inducers (speed up enzyme) | Other drugs DISAPPEAR → treatment failure | Rifampin, St. John's Wort, carbamazepine, phenytoin |
| CYP3A4 Substrates (broken down by enzyme) | Affected by inhibitors/inducers | Statins, benzodiazepines, fentanyl, warfarin |
"PRICSS"
- Phenytoin
- Rifampin
- Isoniazid (weak)
- Carbamazepine
- St. John's Wort
- Smoking (CYP1A2)
"FACE + Ketoconazole"
- Fluconazole / azole antifungals
- Amiodarone
- Clarithromycin / erythromycin (macrolides)
- Erythromycin
- Ketoconazole
- All -navir PIs
"HIV sneaks into a cell. It tries to build its DNA using reverse transcriptase. But we send in a FAKE building block (NRTI). The fake block gets activated (phosphorylated). Reverse transcriptase picks it up and inserts it. But it has no 3'-OH group - so the chain just STOPS. HIV can't finish its DNA. Game over."
"HIV assembles all its parts inside the cell. It makes one giant protein. Protease is the SCISSORS that cuts this protein into working pieces. PIs are BLUNT SCISSORS - they fit into protease but can't cut. So the virus comes out as a broken, useless particle."
15 minutes of Anki daily beats 3 hours of re-reading notes.
| Question Type | What to Know |
|---|---|
| Mechanism of each class | NRTIs = chain termination; PIs = block protease; NNRTIs = allosteric RT inhibition |
| Class-wide side effects | NRTIs = lactic acidosis; PIs = buffalo hump + metabolic syndrome |
| The "unique" drug in each class | Abacavir (hypersensitivity, HLA-B*5701); Atazanavir (jaundice, fewer lipid problems) |
| Drug interactions | PIs inhibit CYP3A4 → no statins, careful with sedatives |
| Contraindicated combos | Rifampin + PIs; Zidovudine + Stavudine |
1. Learn suffixes → know the class instantly
2. Learn CYP3A4 (inhibitor/inducer/substrate) → explains most interactions
3. Make one story per mechanism → never forget it
4. Anki for 15 min/day → long-term retention
5. Focus on unique drugs per class (the exceptions) → exam favourites
6. Think clinically → connect drugs to real patient scenarios
Generate a quick reference PDF for CYP3A4 interactions and contraindications
Moa of entry inhibitors
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "created"
mkdir -p /tmp/workspace/cyp3a4-pdf && echo "ready"
cat << 'PYEOF' > /tmp/workspace/cyp3a4-pdf/generate.py from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm, mm from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, KeepTogether) from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY from reportlab.platypus import PageBreak OUTPUT = "/tmp/workspace/cyp3a4-pdf/CYP3A4_Quick_Reference.pdf" doc = SimpleDocTemplate(OUTPUT, pagesize=A4, leftMargin=1.5*cm, rightMargin=1.5*cm, topMargin=1.5*cm, bottomMargin=1.5*cm) # ── Colours ────────────────────────────────────────────────────────────────── DARK_BLUE = colors.HexColor("#1A3A5C") MED_BLUE = colors.HexColor("#2E6DA4") LIGHT_BLUE = colors.HexColor("#D6E8F7") RED_DARK = colors.HexColor("#8B0000") RED_LIGHT = colors.HexColor("#FFE4E4") GREEN_DARK = colors.HexColor("#1B5E20") GREEN_LIGHT = colors.HexColor("#E8F5E9") ORANGE_DARK = colors.HexColor("#E65100") ORANGE_LIGHT= colors.HexColor("#FFF3E0") YELLOW_LIGHT= colors.HexColor("#FFFDE7") GREY_LIGHT = colors.HexColor("#F5F5F5") WHITE = colors.white BLACK = colors.black # ── Styles ─────────────────────────────────────────────────────────────────── styles = getSampleStyleSheet() def S(name, **kw): return ParagraphStyle(name, **kw) title_style = S("Title", fontSize=20, textColor=WHITE, alignment=TA_CENTER, spaceAfter=2, fontName="Helvetica-Bold", leading=24) subtitle_style = S("Sub", fontSize=10, textColor=LIGHT_BLUE, alignment=TA_CENTER, fontName="Helvetica", spaceAfter=4) section_style = S("Section", fontSize=13, textColor=WHITE, fontName="Helvetica-Bold", leading=16, spaceBefore=4, spaceAfter=2) body_style = S("Body", fontSize=9, textColor=BLACK, fontName="Helvetica", leading=13, spaceAfter=2) bold_body = S("BoldBody", fontSize=9, textColor=BLACK, fontName="Helvetica-Bold", leading=13, spaceAfter=2) small_style = S("Small", fontSize=8, textColor=colors.HexColor("#444444"), fontName="Helvetica", leading=11) drug_style = S("Drug", fontSize=9, textColor=DARK_BLUE, fontName="Helvetica-Bold", leading=12) red_style = S("Red", fontSize=9, textColor=RED_DARK, fontName="Helvetica-Bold", leading=12) warn_style = S("Warn", fontSize=8.5, textColor=RED_DARK, fontName="Helvetica-Bold", leading=12, alignment=TA_CENTER) center_style = S("Center", fontSize=9, textColor=BLACK, fontName="Helvetica", leading=12, alignment=TA_CENTER) center_bold = S("CenterBold", fontSize=9, textColor=WHITE, fontName="Helvetica-Bold", leading=12, alignment=TA_CENTER) note_style = S("Note", fontSize=8, textColor=colors.HexColor("#555555"), fontName="Helvetica-Oblique", leading=11) # ── Helper: coloured section header ───────────────────────────────────────── def section_header(text, bg=DARK_BLUE): data = [[Paragraph(text, section_style)]] t = Table(data, colWidths=[17.5*cm]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), bg), ("LEFTPADDING", (0,0), (-1,-1), 8), ("RIGHTPADDING", (0,0), (-1,-1), 8), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING",(0,0), (-1,-1), 5), ("ROUNDEDCORNERS", (0,0), (-1,-1), [3,3,3,3]), ])) return t def sub_header(text, bg=MED_BLUE, textcolor=WHITE): st = S("sh", fontSize=10, textColor=textcolor, fontName="Helvetica-Bold", leading=13, alignment=TA_LEFT) data = [[Paragraph(text, st)]] t = Table(data, colWidths=[17.5*cm]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), bg), ("LEFTPADDING", (0,0), (-1,-1), 8), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING",(0,0), (-1,-1), 4), ])) return t # ── Build story ────────────────────────────────────────────────────────────── story = [] # ═══════════════════════════ TITLE BANNER ══════════════════════════════════ banner_data = [[Paragraph("CYP3A4 Drug Interactions", title_style)], [Paragraph("Quick Reference Card for Pharm D Students", subtitle_style)], [Paragraph("Focus: HIV Antiretrovirals + Clinical Pharmacology", subtitle_style)]] banner = Table(banner_data, colWidths=[17.5*cm]) banner.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), DARK_BLUE), ("TOPPADDING", (0,0), (-1,-1), 8), ("BOTTOMPADDING", (0,0), (-1,-1), 8), ("LEFTPADDING", (0,0), (-1,-1), 10), ])) story.append(banner) story.append(Spacer(1, 6)) # ═══════════════════════ 1. THE GOLDEN RULE ════════════════════════════════ story.append(section_header("⚡ THE GOLDEN RULE OF CYP3A4")) story.append(Spacer(1, 4)) rule_data = [[ Paragraph("🔴 INHIBITOR\nBlocks CYP3A4\n→ Substrate levels GO UP\n→ Risk of TOXICITY", S("r", fontSize=9, textColor=RED_DARK, fontName="Helvetica-Bold", leading=14, alignment=TA_CENTER)), Paragraph("+\nSubstrate\n(drug metabolised\nby CYP3A4)", S("p", fontSize=9, textColor=DARK_BLUE, fontName="Helvetica-Bold", leading=14, alignment=TA_CENTER)), Paragraph("🟢 INDUCER\nSpeeds up CYP3A4\n→ Substrate levels GO DOWN\n→ Risk of TREATMENT FAILURE", S("g", fontSize=9, textColor=GREEN_DARK, fontName="Helvetica-Bold", leading=14, alignment=TA_CENTER)), ]] rule_t = Table(rule_data, colWidths=[6*cm, 4*cm, 6.5*cm]) rule_t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (0,0), RED_LIGHT), ("BACKGROUND", (1,0), (1,0), YELLOW_LIGHT), ("BACKGROUND", (2,0), (2,0), GREEN_LIGHT), ("BOX", (0,0), (0,0), 1.5, RED_DARK), ("BOX", (1,0), (1,0), 1.5, MED_BLUE), ("BOX", (2,0), (2,0), 1.5, GREEN_DARK), ("ALIGN", (0,0), (-1,-1), "CENTER"), ("VALIGN", (0,0), (-1,-1), "MIDDLE"), ("TOPPADDING", (0,0), (-1,-1), 10), ("BOTTOMPADDING", (0,0), (-1,-1), 10), ("LEFTPADDING", (0,0), (-1,-1), 6), ("RIGHTPADDING", (0,0), (-1,-1), 6), ])) story.append(rule_t) story.append(Spacer(1, 8)) # ═══════════════════════ 2. INHIBITORS TABLE ═══════════════════════════════ story.append(section_header("🔴 CYP3A4 INHIBITORS (Raise substrate drug levels → TOXICITY)", RED_DARK)) story.append(Spacer(1, 4)) inhib_headers = [ Paragraph("Drug / Drug Class", center_bold), Paragraph("Examples", center_bold), Paragraph("Key Substrates Affected (+ Consequence)", center_bold), ] inhib_rows = [ ["🔴 HIV Protease Inhibitors\n(-navir suffix)", "Ritonavir, Cobicistat\n(boosting agents)\nAtazanavir, Darunavir", "Statins → Rhabdomyolysis\nMidazolam/Triazolam → Excess sedation\nFentanyl → Resp. depression\nSildenafil → Hypotension\nWarfarin → Bleeding\nImmuno-suppressants → Toxicity"], ["🔴 Azole Antifungals", "Ketoconazole\nItraconazole\nFluconazole\nVoriconazole", "Statins → Rhabdomyolysis\nBenzodiazepines → Sedation\nCalcineurin inhibitors → Nephrotox\nAntiretrovirals → Drug build-up"], ["🔴 Macrolide Antibiotics", "Erythromycin\nClarithromycin\n(NOT Azithromycin)", "Statins → Rhabdomyolysis\nBenzodiazepines → Sedation\nWarfarin → Bleeding\nDigoxin → Toxicity"], ["🔴 Calcium Channel Blockers", "Diltiazem\nVerapamil", "Statins → Rhabdomyolysis\nCyclosporine → Nephrotox\nBenzodiazepines → Sedation"], ["🔴 Grapefruit Juice", "Any amount of\ngrapefruit juice", "Statins → Rhabdomyolysis\nCalcium channel blockers → Hypotension\nImmunosuppressants → Toxicity"], ["🔴 Other Notable Inhibitors", "Amiodarone\nCimetidine\nAprepitant\nCobicistat", "Multiple substrates elevated.\nAmiodarone + warfarin = serious bleed risk\nCimetidine = avoid with many narrow TI drugs"], ] def make_inhib_row(row): return [ Paragraph(row[0], S("ir", fontSize=8.5, textColor=RED_DARK, fontName="Helvetica-Bold", leading=12)), Paragraph(row[1], S("ir2", fontSize=8.5, textColor=BLACK, fontName="Helvetica", leading=12)), Paragraph(row[2], S("ir3", fontSize=8.5, textColor=BLACK, fontName="Helvetica", leading=12)), ] inhib_data = [inhib_headers] + [make_inhib_row(r) for r in inhib_rows] inhib_t = Table(inhib_data, colWidths=[4.5*cm, 4.5*cm, 8.5*cm]) inhib_t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), RED_DARK), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("ROWBACKGROUNDS",(0,1), (-1,-1), [RED_LIGHT, WHITE]), ("BOX", (0,0), (-1,-1), 1, RED_DARK), ("INNERGRID", (0,0), (-1,-1), 0.5, colors.HexColor("#FFAAAA")), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 5), ("RIGHTPADDING", (0,0), (-1,-1), 5), ("VALIGN", (0,0), (-1,-1), "TOP"), ])) story.append(inhib_t) story.append(Spacer(1, 8)) # ═══════════════════════ 3. INDUCERS TABLE ═════════════════════════════════ story.append(section_header("🟢 CYP3A4 INDUCERS (Lower drug levels → TREATMENT FAILURE)", GREEN_DARK)) story.append(Spacer(1, 4)) ind_headers = [ Paragraph("Drug / Class", center_bold), Paragraph("Examples", center_bold), Paragraph("Key Substrates Affected (+ Consequence)", center_bold), ] ind_rows = [ ["🟢 Rifamycins\n(TB drugs)", "Rifampin (Rifampicin)\nRifabutin (weaker)\nRifapentine", "HIV PIs → Sub-therapeutic → Treatment failure\nNNRTIs → Reduced levels (except efavirenz adjustment)\nOral contraceptives → Contraception failure\nWarfarin → Clotting (reduce INR)\n⚠️ RIFAMPIN CONTRAINDICATED with most PIs"], ["🟢 Anticonvulsants\n(seizure drugs)", "Phenytoin\nCarbamazepine\nPhenobarbital\nOxcarbazepine", "HIV PIs → Treatment failure\nOral contraceptives → Contraception failure\nWarfarin → Clotting\nSteroids → Reduced anti-inflammatory effect"], ["🟢 St. John's Wort\n(herbal supplement)", "Hypericum perforatum\n(OTC herbal product)", "HIV PIs → Treatment failure\nOral contraceptives → Unwanted pregnancy\nWarfarin → Clotting\n⚠️ Patients may not mention it — ALWAYS ASK"], ["🟢 Glucocorticoids\n(high dose)", "Dexamethasone\n(high dose, prolonged)", "HIV drugs → Reduced levels\nImmunosuppressants → Reduced effect"], ["🟢 Nevirapine\n(NNRTI itself)", "Nevirapine\n(induces its own metabolism)", "PIs → Reduced levels if co-administered\n⚠️ Nevirapine induces CYP3A4 and auto-induces itself"], ] def make_ind_row(row): return [ Paragraph(row[0], S("gr", fontSize=8.5, textColor=GREEN_DARK, fontName="Helvetica-Bold", leading=12)), Paragraph(row[1], S("gr2", fontSize=8.5, textColor=BLACK, fontName="Helvetica", leading=12)), Paragraph(row[2], S("gr3", fontSize=8.5, textColor=BLACK, fontName="Helvetica", leading=12)), ] ind_data = [ind_headers] + [make_ind_row(r) for r in ind_rows] ind_t = Table(ind_data, colWidths=[4.5*cm, 4.5*cm, 8.5*cm]) ind_t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), GREEN_DARK), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("ROWBACKGROUNDS",(0,1), (-1,-1), [GREEN_LIGHT, WHITE]), ("BOX", (0,0), (-1,-1), 1, GREEN_DARK), ("INNERGRID", (0,0), (-1,-1), 0.5, colors.HexColor("#AADDAA")), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 5), ("RIGHTPADDING", (0,0), (-1,-1), 5), ("VALIGN", (0,0), (-1,-1), "TOP"), ])) story.append(ind_t) story.append(Spacer(1, 8)) # ═══════════════════ PAGE 2 ════════════════════════════ story.append(PageBreak()) # ═══════════════════════ 4. SUBSTRATES TABLE ═══════════════════════════════ story.append(section_header("🔵 CYP3A4 SUBSTRATES (Drugs AFFECTED by inhibitors/inducers)", MED_BLUE)) story.append(Spacer(1, 4)) sub_headers = [ Paragraph("Drug Class", center_bold), Paragraph("Examples", center_bold), Paragraph("With INHIBITOR\n(levels go UP)", S("ch", fontSize=8.5, textColor=WHITE, fontName="Helvetica-Bold", leading=11, alignment=TA_CENTER)), Paragraph("With INDUCER\n(levels go DOWN)", S("ch2", fontSize=8.5, textColor=WHITE, fontName="Helvetica-Bold", leading=11, alignment=TA_CENTER)), ] sub_rows = [ ["Statins", "Simvastatin\nLovastatin\nAtorvastatin*", "⬆️ Rhabdomyolysis\n(muscle breakdown,\ndark urine)", "⬇️ Poor cholesterol\ncontrol"], ["Benzodiazepines", "Midazolam\nTriazolam\nAlprazolam", "⬆️ Excess sedation\nrespiratory depression", "⬇️ Inadequate\nsedation"], ["Opioids", "Fentanyl\nOxycodone\nAlfentanil", "⬆️ Respiratory\ndepression, overdose", "⬇️ Poor pain control"], ["Anticoagulants", "Warfarin (minor)\nRivaroxaban\nApixaban", "⬆️ Bleeding risk", "⬇️ Thrombosis risk"], ["Immunosuppressants", "Cyclosporine\nTacrolimus\nSirolimus", "⬆️ Nephrotoxicity\nneurotoxicity", "⬇️ Rejection risk"], ["Oral Contraceptives", "Ethinyl estradiol\nProgesterone", "⬆️ Spotting/nausea\n(minor)", "⬇️ Contraception\nFAILURE ⚠️"], ["PDE5 Inhibitors", "Sildenafil (Viagra)\nTadalafil", "⬆️ Severe hypotension\npriapism", "⬇️ Reduced efficacy"], ["HIV PIs (-navir)", "Atazanavir\nDarunavir\nLopinavir", "⬆️ Drug toxicity\n(metabolic effects)", "⬇️ Viral rebound\nTreatment failure"], ["Anticonvulsants", "Carbamazepine\nPhenytoin", "⬆️ Drug toxicity", "⬇️ Seizure\nbreakthrough"], ["Corticosteroids", "Methylprednisolone\nDexamethasone", "⬆️ Cushingoid effects\nadrenal suppression", "⬇️ Reduced\nanti-inflam. effect"], ] def make_sub_row(row): st_n = S("sr", fontSize=8.5, textColor=DARK_BLUE, fontName="Helvetica-Bold", leading=12) st_e = S("se", fontSize=8.5, textColor=BLACK, fontName="Helvetica", leading=12) st_r = S("sR", fontSize=8.5, textColor=RED_DARK, fontName="Helvetica", leading=12) st_g = S("sG", fontSize=8.5, textColor=GREEN_DARK, fontName="Helvetica", leading=12) return [Paragraph(row[0], st_n), Paragraph(row[1], st_e), Paragraph(row[2], st_r), Paragraph(row[3], st_g)] sub_data_rows = [sub_headers] + [make_sub_row(r) for r in sub_rows] sub_t = Table(sub_data_rows, colWidths=[4*cm, 4.5*cm, 4.5*cm, 4.5*cm]) sub_t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), MED_BLUE), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("ROWBACKGROUNDS",(0,1), (-1,-1), [LIGHT_BLUE, WHITE]), ("BOX", (0,0), (-1,-1), 1, MED_BLUE), ("INNERGRID", (0,0), (-1,-1), 0.5, colors.HexColor("#AACCEE")), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4), ("LEFTPADDING", (0,0), (-1,-1), 5), ("RIGHTPADDING", (0,0), (-1,-1), 5), ("VALIGN", (0,0), (-1,-1), "TOP"), ])) story.append(sub_t) story.append(Spacer(1, 4)) story.append(Paragraph("* Atorvastatin is less affected than simvastatin/lovastatin and can sometimes be used cautiously with PIs at low doses.", note_style)) story.append(Spacer(1, 8)) # ═══════════════════════ 5. ABSOLUTE CONTRAINDICATIONS ═════════════════════ story.append(section_header("⛔ ABSOLUTE CONTRAINDICATIONS (Never combine these)", RED_DARK)) story.append(Spacer(1, 4)) ci_headers = [ Paragraph("Combination", center_bold), Paragraph("Reason", center_bold), Paragraph("Consequence", center_bold), ] ci_rows = [ ["HIV PI (-navir) + Rifampin", "Rifampin = potent CYP3A4 INDUCER", "PI levels drop 75-90% → Complete treatment failure → Viral rebound → Resistance"], ["PI + Simvastatin or Lovastatin", "PI = CYP3A4 INHIBITOR; statin = substrate", "Statin levels 10x → Rhabdomyolysis → Renal failure → Death possible"], ["PI + Midazolam (oral) or Triazolam", "PI inhibits CYP3A4 metabolism of benzodiazepine", "Extreme sedation, respiratory arrest"], ["PI + Ergot alkaloids\n(ergotamine)", "Inhibition causes ergot accumulation", "Vasospasm, severe ischaemia, gangrene"], ["PI + St. John's Wort", "St. John's Wort = potent CYP3A4 INDUCER", "PI levels drop → HIV treatment failure"], ["PI + Pimozide or Terfenadine", "CYP3A4 inhibition → drug accumulation", "QT prolongation → Torsades de pointes → Cardiac arrest"], ["Zidovudine + Stavudine\n(two NRTIs)", "Both are thymidine analogs", "Competitive antagonism → Reduced efficacy of both drugs"], ["Nevirapine + Rifampin", "Dual inducers + Rifampin reduces NVP levels", "Nevirapine sub-therapeutic → Viral breakthrough"], ] def make_ci_row(row): return [ Paragraph(row[0], S("ci1", fontSize=8.5, textColor=RED_DARK, fontName="Helvetica-Bold", leading=12)), Paragraph(row[1], S("ci2", fontSize=8.5, textColor=DARK_BLUE, fontName="Helvetica", leading=12)), Paragraph(row[2], S("ci3", fontSize=8.5, textColor=BLACK, fontName="Helvetica", leading=12)), ] ci_data = [ci_headers] + [make_ci_row(r) for r in ci_rows] ci_t = Table(ci_data, colWidths=[5*cm, 5.5*cm, 7*cm]) ci_t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), RED_DARK), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("ROWBACKGROUNDS",(0,1), (-1,-1), [RED_LIGHT, WHITE]), ("BOX", (0,0), (-1,-1), 1.5, RED_DARK), ("INNERGRID", (0,0), (-1,-1), 0.5, colors.HexColor("#FFBBBB")), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 5), ("RIGHTPADDING", (0,0), (-1,-1), 5), ("VALIGN", (0,0), (-1,-1), "TOP"), ])) story.append(ci_t) story.append(Spacer(1, 8)) # ═══════════════════════ 6. MNEMONIC BOX ═══════════════════════════════════ story.append(section_header("🧠 MNEMONICS FOR EXAM", colors.HexColor("#4A148C"))) story.append(Spacer(1, 4)) mnem_data = [ [ Paragraph("INHIBITORS: \"CRACK GF\"\nC – Clarithromycin / macrolides\nR – Ritonavir / all -navir PIs\nA – Azole antifungals\nC – Cobicistat\nK – Ketoconazole\nG – Grapefruit juice\nF – Fluconazole", S("m1", fontSize=8.5, textColor=RED_DARK, fontName="Helvetica-Bold", leading=13)), Paragraph("INDUCERS: \"PRICSS\"\nP – Phenytoin\nR – Rifampin\nI – Isoniazid (weak)\nC – Carbamazepine\nS – St. John's Wort\nS – Smoking (CYP1A2)", S("m2", fontSize=8.5, textColor=GREEN_DARK, fontName="Helvetica-Bold", leading=13)), Paragraph("SUBSTRATES: \"SWOB CIF\"\nS – Statins\nW – Warfarin\nO – Opioids (fentanyl)\nB – Benzodiazepines\nC – Cyclosporine\nI – Immunosuppressants\nF – Female hormones (OCP)", S("m3", fontSize=8.5, textColor=DARK_BLUE, fontName="Helvetica-Bold", leading=13)), ] ] mnem_t = Table(mnem_data, colWidths=[5.8*cm, 5.8*cm, 5.9*cm]) mnem_t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (0,0), RED_LIGHT), ("BACKGROUND", (1,0), (1,0), GREEN_LIGHT), ("BACKGROUND", (2,0), (2,0), LIGHT_BLUE), ("BOX", (0,0), (0,0), 1, RED_DARK), ("BOX", (1,0), (1,0), 1, GREEN_DARK), ("BOX", (2,0), (2,0), 1, MED_BLUE), ("TOPPADDING", (0,0), (-1,-1), 8), ("BOTTOMPADDING", (0,0), (-1,-1), 8), ("LEFTPADDING", (0,0), (-1,-1), 8), ("RIGHTPADDING", (0,0), (-1,-1), 8), ("VALIGN", (0,0), (-1,-1), "TOP"), ])) story.append(mnem_t) story.append(Spacer(1, 6)) # ═══════════════════════ 7. CLINICAL DECISION BOX ══════════════════════════ story.append(section_header("🩺 CLINICAL DECISION ALGORITHM", ORANGE_DARK)) story.append(Spacer(1, 4)) algo_data = [[ Paragraph( "<b>Patient on a PI + new drug added?</b>\n\n" "STEP 1: Is the new drug a CYP3A4 SUBSTRATE?\n" "→ YES: PI will INHIBIT its metabolism → levels go UP → CHECK for toxicity dose\n" "→ NO: Likely safe (but check for other CYP isozymes)\n\n" "STEP 2: Is the new drug a CYP3A4 INDUCER?\n" "→ YES: New drug will LOWER PI levels → TREAT FAILURE risk → AVOID if possible\n" "→ Rifampin + any PI = ABSOLUTE CONTRAINDICATION\n\n" "STEP 3: High-risk combos ALWAYS requiring dose adjustment:\n" "→ Sildenafil + PI: reduce sildenafil to 25 mg, max once in 48h\n" "→ Warfarin + PI: increase INR monitoring frequency\n" "→ Statins + PI: switch to pravastatin or rosuvastatin (less CYP3A4 dependent)", S("algo", fontSize=8.5, textColor=BLACK, fontName="Helvetica", leading=14)), ]] algo_t = Table(algo_data, colWidths=[17.5*cm]) algo_t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), ORANGE_LIGHT), ("BOX", (0,0), (-1,-1), 1.5, ORANGE_DARK), ("LEFTPADDING", (0,0), (-1,-1), 10), ("RIGHTPADDING", (0,0), (-1,-1), 10), ("TOPPADDING", (0,0), (-1,-1), 8), ("BOTTOMPADDING", (0,0), (-1,-1), 8), ])) story.append(algo_t) story.append(Spacer(1, 6)) # ═══════════════════════ FOOTER ════════════════════════════════════════════ footer_data = [[ Paragraph("📚 Sources: Katzung's Basic & Clinical Pharmacology 16e | Goodman & Gilman's 13e | Harrison's 22e | Washington Manual of Medical Therapeutics | For educational use only — verify all doses clinically", S("ft", fontSize=7.5, textColor=WHITE, fontName="Helvetica", leading=10, alignment=TA_CENTER)) ]] footer_t = Table(footer_data, colWidths=[17.5*cm]) footer_t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), DARK_BLUE), ("TOPPADDING", (0,0), (-1,-1), 6), ("BOTTOMPADDING", (0,0), (-1,-1), 6), ])) story.append(footer_t) # ── Build PDF ───────────────────────────────────────────────────────────────── doc.build(story) print(f"PDF created: {OUTPUT}") PYEOF python /tmp/workspace/cyp3a4-pdf/generate.py
CYP3A4 Quick Reference
PDF Document · PDF
HIV
↓
Step 1: gp120 binds to CD4 receptor on host cell
↓
Step 2: gp120 binds to co-receptor (CCR5 or CXCR4)
↓
Step 3: gp41 unfolds → brings viral and cell membranes together
↓
Step 4: Membrane FUSION occurs
↓
Viral contents (RNA + enzymes) enter the cell
gp120 → CD4 → Fostemsavir BLOCKS (binds gp120)
→ Ibalizumab BLOCKS (binds CD4, prevents conformation change)
gp120 → CCR5/CXCR4 → Maraviroc BLOCKS (binds CCR5)
gp41 folds → fusion → Enfuvirtide BLOCKS (binds gp41)
| Drug | Target | Route | Key Point |
|---|---|---|---|
| Fostemsavir | Viral gp120 | Oral | Multidrug-resistant HIV only |
| Ibalizumab | Host CD4 (domain 2) | IV infusion | Monoclonal antibody |
| Maraviroc | Host CCR5 | Oral | Test HIV tropism FIRST |
| Enfuvirtide | Viral gp41 | SC injection | Injection site reactions |
Simple story: gp41 is like a hinge that opens the door. Enfuvirtide jams the hinge so the door never opens.
Simple story: CCR5 is a second lock. Maraviroc fills that lock with a fake key so HIV's key cannot fit.
| HIV Type | Uses | Will Maraviroc Work? |
|---|---|---|
| R5-tropic | CCR5 only | ✅ YES |
| X4-tropic | CXCR4 only | ❌ NO |
| Dual-tropic | Both CCR5 + CXCR4 | ❌ NO |
| Situation | Action |
|---|---|
| Given WITH a PI or strong CYP450 inhibitor | Reduce the dose of maraviroc (enzyme blocked → maraviroc builds up) |
| Given WITH efavirenz, etravirine or strong CYP450 inducer | Increase the dose of maraviroc (enzyme induced → maraviroc broken down faster) |
| Feature | Enfuvirtide | Maraviroc |
|---|---|---|
| Target | Viral gp41 | Host CCR5 co-receptor |
| Step blocked | Membrane fusion | Co-receptor binding |
| Route | SC injection only | Oral |
| Pre-test needed? | No | Yes - tropism test |
| Main side effect | Injection site reactions | Hepatotoxicity |
| Patient type | Treatment-experienced | CCR5-tropic HIV only |
| CYP interaction? | No | Yes - CYP3A4 substrate |
"E-F blocks Fusion (gp41) M-C blocks CCR5 Co-receptor"
Can u do follow up suggestions 1 and 4 both
Generate a visual diagram comparing all HIV entry stages and where each drug class blocks
A detailed medical education diagram showing all stages of HIV entry into a CD4+ T cell and where each drug class blocks the process. The diagram should be a horizontal step-by-step flowchart with clear stages and colored drug intervention labels. Layout: Left to right flow showing HIV virus approaching and entering a host CD4+ T cell. Stage 1 - ATTACHMENT: HIV virus particle (show spikes labeled gp120) approaching a CD4+ T cell. Show gp120 binding to CD4 receptor on host cell. Label with red blocking arrow: "FOSTEMSAVIR blocks gp120 from binding CD4" and "IBALIZUMAB blocks CD4 receptor (domain 2)" Stage 2 - CO-RECEPTOR BINDING: Show gp120 now also binding to CCR5 co-receptor on the host cell surface. Label with orange blocking arrow: "MARAVIROC blocks CCR5 co-receptor". Add small note: "Test tropism first - CCR5 vs CXCR4" Stage 3 - FUSION: Show viral gp41 protein unfolding and acting like a harpoon pulling the viral membrane toward the cell membrane. Show membranes merging. Label with purple blocking arrow: "ENFUVIRTIDE blocks gp41 conformational change - prevents membrane fusion" Stage 4 - VIRAL RNA ENTRY: Show viral RNA and reverse transcriptase entering the cytoplasm of the cell. Stage 5 - REVERSE TRANSCRIPTION: Show RNA being converted to DNA by reverse transcriptase enzyme. Label with blue blocking arrow: "NRTIs and NNRTIs block reverse transcriptase" Stage 6 - INTEGRATION: Show viral DNA entering nucleus and integrating into host chromosome. Label with green blocking arrow: "Integrase Inhibitors (INSTIs) block integration" Stage 7 - PROTEIN SYNTHESIS + MATURATION: Show new viral proteins being cut by protease enzyme into functional pieces. Label with teal blocking arrow: "Protease Inhibitors block viral protease - produces non-infectious virions" At the bottom, include a color-coded legend box: - Red: Entry/Attachment Inhibitors (Fostemsavir, Ibalizumab) - Orange: Co-receptor Inhibitor (Maraviroc) - Purple: Fusion Inhibitor (Enfuvirtide) - Blue: NRTIs / NNRTIs - Green: INSTIs - Teal: Protease Inhibitors Style: Clean white background, professional medical illustration style, bold clear labels, color-coded arrows for each drug class, large readable text. Title at top: "HIV Life Cycle and Sites of Drug Action"

| Stage | What Happens | Drug Class | Specific Drugs |
|---|---|---|---|
| 1. Attachment | gp120 binds CD4 receptor | Attachment Inhibitors | Fostemsavir (blocks gp120), Ibalizumab (blocks CD4) |
| 2. Co-receptor Binding | gp120 binds CCR5 or CXCR4 | CCR5 Antagonist | Maraviroc (blocks CCR5 only) |
| 3. Membrane Fusion | gp41 changes shape, membranes merge | Fusion Inhibitor | Enfuvirtide (binds gp41, stops shape change) |
| 4. Reverse Transcription | Viral RNA → DNA via reverse transcriptase | NRTIs / NNRTIs | Zidovudine, Tenofovir, Efavirenz, Nevirapine |
| 5. Integration | Viral DNA inserts into host chromosome | INSTIs | Dolutegravir, Raltegravir, Bictegravir, Elvitegravir |
| 6. Maturation | Viral polyprotein cut into functional pieces by protease | Protease Inhibitors | Atazanavir, Darunavir, Lopinavir |
Make a clinical case study PDF: Patient with multidrug-resistant HIV - which drugs to choose?
mkdir -p /tmp/workspace/mdr-hiv-case && cat << 'PYEOF' > /tmp/workspace/mdr-hiv-case/generate.py from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak, HRFlowable) from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY OUTPUT = "/tmp/workspace/mdr-hiv-case/MDR_HIV_Clinical_Case.pdf" doc = SimpleDocTemplate(OUTPUT, pagesize=A4, leftMargin=1.5*cm, rightMargin=1.5*cm, topMargin=1.5*cm, bottomMargin=1.5*cm) # ── Colours ────────────────────────────────────────────────────────────────── DARK_BLUE = colors.HexColor("#1A3A5C") MED_BLUE = colors.HexColor("#2E6DA4") LIGHT_BLUE = colors.HexColor("#D6E8F7") TEAL = colors.HexColor("#00695C") TEAL_LIGHT = colors.HexColor("#E0F2F1") RED_DARK = colors.HexColor("#8B0000") RED_LIGHT = colors.HexColor("#FFE4E4") GREEN_DARK = colors.HexColor("#1B5E20") GREEN_LIGHT = colors.HexColor("#E8F5E9") ORANGE_DARK = colors.HexColor("#E65100") ORANGE_LIGHT = colors.HexColor("#FFF3E0") PURPLE_DARK = colors.HexColor("#4A148C") PURPLE_LIGHT = colors.HexColor("#F3E5F5") YELLOW_LIGHT = colors.HexColor("#FFFDE7") GREY_LIGHT = colors.HexColor("#F5F5F5") GREY_MED = colors.HexColor("#E0E0E0") WHITE = colors.white BLACK = colors.black W = 17.5*cm # full content width def S(name, **kw): return ParagraphStyle(name, **kw) def hdr(text, bg=DARK_BLUE, fg=WHITE, fs=12): st = S("h", fontSize=fs, textColor=fg, fontName="Helvetica-Bold", leading=fs+4, alignment=TA_LEFT) t = Table([[Paragraph(text, st)]], colWidths=[W]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), bg), ("LEFTPADDING", (0,0),(-1,-1), 10), ("TOPPADDING", (0,0),(-1,-1), 6), ("BOTTOMPADDING", (0,0),(-1,-1), 6), ])) return t def box(content_rows, bg=GREY_LIGHT, border_color=MED_BLUE, col_widths=None): if col_widths is None: col_widths = [W] t = Table(content_rows, colWidths=col_widths) t.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), bg), ("BOX", (0,0),(-1,-1), 1.5, border_color), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 8), ("RIGHTPADDING", (0,0),(-1,-1), 8), ("VALIGN", (0,0),(-1,-1), "TOP"), ])) return t def p(text, fs=9, bold=False, color=BLACK, align=TA_LEFT, italic=False): fn = "Helvetica-BoldOblique" if bold and italic else \ "Helvetica-Bold" if bold else \ "Helvetica-Oblique" if italic else "Helvetica" return Paragraph(text, S("p", fontSize=fs, textColor=color, fontName=fn, leading=fs+4, alignment=align)) story = [] # ══════════════════════════ TITLE BANNER ═══════════════════════════════════ banner = Table([ [p("CLINICAL CASE STUDY", 11, bold=True, color=colors.HexColor("#90CAF9"), align=TA_CENTER)], [p("Multidrug-Resistant HIV Infection", 20, bold=True, color=WHITE, align=TA_CENTER)], [p("Which Drugs to Choose? — A Pharm D Learning Case", 10, color=colors.HexColor("#B0BEC5"), align=TA_CENTER)], [p("Based on: Goldman-Cecil Medicine | Goodman & Gilman's | Harrison's 22e", 8, color=colors.HexColor("#78909C"), align=TA_CENTER)], ], colWidths=[W]) banner.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), DARK_BLUE), ("TOPPADDING", (0,0),(-1,-1), 6), ("BOTTOMPADDING", (0,0),(-1,-1), 6), ])) story.append(banner) story.append(Spacer(1, 8)) # ══════════════════════════ PATIENT PRESENTATION ═══════════════════════════ story.append(hdr("🏥 PATIENT PRESENTATION", bg=MED_BLUE)) story.append(Spacer(1, 4)) pres_data = [ [p("Name:", bold=True), p("Mr. A.K., 38-year-old male")], [p("Known History:", bold=True), p("HIV-positive for 12 years. On antiretroviral therapy (ART) for 10 years.")], [p("Current Complaint:", bold=True), p("Recurrent opportunistic infections (oral candidiasis, recurrent pneumonia). Feeling increasingly unwell for 3 months.")], [p("Recent Labs:", bold=True), p("CD4 count: 68 cells/μL (severely low — normal >500)\nHIV viral load: 125,000 copies/mL (detectable = treatment failing)\nLiver function: mildly elevated ALT (52 U/L)\nRenal function: Normal (eGFR 82 mL/min)")], [p("ART History:", bold=True), p("Past 10 years on multiple regimens:\n→ Regimen 1 (4 yrs): Zidovudine + Lamivudine + Efavirenz\n→ Regimen 2 (3 yrs): Tenofovir DF + Emtricitabine + Lopinavir/Ritonavir\n→ Regimen 3 (3 yrs): Tenofovir DF + Emtricitabine + Darunavir/Ritonavir + Raltegravir\nNow on Regimen 3 but viral load rising — treatment failure confirmed")], [p("Resistance Test:", bold=True), p("Genotype + Phenotype resistance testing ordered (indicated for advanced failure)\nTropism test: HIV uses CCR5 co-receptor\nHLA-B*5701: NEGATIVE")], ] pres_t = Table(pres_data, colWidths=[3.5*cm, 14*cm]) pres_t.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), LIGHT_BLUE), ("BOX", (0,0),(-1,-1), 1.5, MED_BLUE), ("INNERGRID", (0,0),(-1,-1), 0.5, colors.HexColor("#AACCEE")), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 7), ("VALIGN", (0,0),(-1,-1), "TOP"), ])) story.append(pres_t) story.append(Spacer(1, 8)) # ══════════════════════════ RESISTANCE PROFILE ═════════════════════════════ story.append(hdr("🧬 RESISTANCE PROFILE FROM GENOTYPE/PHENOTYPE TESTING", bg=RED_DARK)) story.append(Spacer(1, 4)) res_headers = [ p("Drug Class", bold=True, color=WHITE), p("Specific Drugs", bold=True, color=WHITE), p("Resistance Status", bold=True, color=WHITE), p("Key Mutation", bold=True, color=WHITE), ] res_rows = [ ["NRTIs", "Zidovudine, Lamivudine,\nEmtricitabine, Tenofovir", "❌ RESISTANT (all)", "TAMs (K70R, T215F),\nM184V, K65R"], ["NNRTIs", "Efavirenz, Nevirapine,\nEtravirine, Rilpivirine", "❌ RESISTANT (all)", "K103N, Y181C,\nE138A"], ["Protease Inhibitors", "Lopinavir, Ritonavir\nAtazanavir", "❌ RESISTANT", "V82A, I84V,\nL90M"], ["Protease Inhibitors", "Darunavir", "⚠️ REDUCED SUSCEPTIBILITY\n(not fully resistant)", "V32I, I47V"], ["INSTIs", "Raltegravir, Elvitegravir", "❌ RESISTANT", "N155H, Q148H"], ["INSTIs", "Dolutegravir, Bictegravir", "✅ STILL ACTIVE\n(high barrier to resistance)", "No primary mutations"], ] def res_row(r, bg): cols = [RED_DARK, RED_DARK, RED_DARK, RED_DARK] tcs = [BLACK, BLACK, BLACK, colors.HexColor("#555555")] return [p(r[i], fs=8.5) for i in range(4)] res_data = [res_headers] for i, r in enumerate(res_rows): bg = RED_LIGHT if i % 2 == 0 else WHITE status_color = RED_DARK if "RESISTANT" in r[2] and "REDUCED" not in r[2] else \ ORANGE_DARK if "REDUCED" in r[2] else GREEN_DARK row = [ p(r[0], fs=8.5, bold=True), p(r[1], fs=8.5), p(r[2], fs=8.5, bold=True, color=status_color), p(r[3], fs=8.5, color=colors.HexColor("#555555")), ] res_data.append(row) res_t = Table(res_data, colWidths=[3.5*cm, 4.5*cm, 5.5*cm, 4*cm]) res_t.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,0), RED_DARK), ("TEXTCOLOR", (0,0),(-1,0), WHITE), ("ROWBACKGROUNDS",(0,1),(-1,-1), [RED_LIGHT, WHITE]), ("BOX", (0,0),(-1,-1), 1.5, RED_DARK), ("INNERGRID", (0,0),(-1,-1), 0.5, colors.HexColor("#FFAAAA")), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 6), ("VALIGN", (0,0),(-1,-1), "TOP"), ])) story.append(res_t) story.append(Spacer(1, 8)) # ══════════════════════════ CLINICAL QUESTIONS ═════════════════════════════ story.append(hdr("❓ CLINICAL QUESTIONS TO SOLVE", bg=PURPLE_DARK)) story.append(Spacer(1, 4)) q_data = [ [p("Q1", bold=True, color=PURPLE_DARK), p("What defines 'treatment failure' in this patient?")], [p("Q2", bold=True, color=PURPLE_DARK), p("Which drug classes are still viable options given the resistance profile?")], [p("Q3", bold=True, color=PURPLE_DARK), p("Which specific drugs should form the new regimen?")], [p("Q4", bold=True, color=PURPLE_DARK), p("Are there any drug interactions or contraindications to watch for?")], [p("Q5", bold=True, color=PURPLE_DARK), p("What monitoring is required after starting the new regimen?")], ] q_t = Table(q_data, colWidths=[1.5*cm, 16*cm]) q_t.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), PURPLE_LIGHT), ("BOX", (0,0),(-1,-1), 1.5, PURPLE_DARK), ("INNERGRID", (0,0),(-1,-1), 0.5, colors.HexColor("#CE93D8")), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 7), ("VALIGN", (0,0),(-1,-1), "MIDDLE"), ])) story.append(q_t) story.append(Spacer(1, 4)) story.append(PageBreak()) # ══════════════════════════ ANSWERS ════════════════════════════════════════ # Q1 story.append(hdr("✅ ANSWER Q1 — What Defines Treatment Failure Here?", bg=TEAL)) story.append(Spacer(1, 4)) q1_data = [[p( "Treatment failure is confirmed when ALL of these are present:\n\n" "• Viral load NOT suppressed to <50 copies/mL after 6 months of ART — this patient has 125,000 copies/mL\n" "• CD4 count declining (now 68 cells/μL — severely immunocompromised)\n" "• Clinical deterioration — recurrent opportunistic infections (oral candidiasis, pneumonia)\n" "• History of multiple regimen changes suggests accumulated resistance\n\n" "Classification: This patient is 'HEAVILY TREATMENT-EXPERIENCED' with multidrug resistance across\n" "3 or more drug classes — this is the most challenging HIV management scenario.", fs=9)]] q1_t = Table(q1_data, colWidths=[W]) q1_t.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), TEAL_LIGHT), ("BOX", (0,0),(-1,-1), 1.5, TEAL), ("LEFTPADDING", (0,0),(-1,-1), 10), ("TOPPADDING", (0,0),(-1,-1), 8), ("BOTTOMPADDING", (0,0),(-1,-1), 8), ])) story.append(q1_t) story.append(Spacer(1, 8)) # Q2 story.append(hdr("✅ ANSWER Q2 — Which Drug Classes Are Still Viable?", bg=GREEN_DARK)) story.append(Spacer(1, 4)) viable_headers = [ p("Drug Class", bold=True, color=WHITE), p("Still Active?", bold=True, color=WHITE), p("Reasoning", bold=True, color=WHITE), ] viable_rows = [ ["Dolutegravir / Bictegravir\n(2nd-gen INSTIs)", "✅ YES — ACTIVE", "High genetic barrier. No primary INSTI resistance mutations detected despite raltegravir resistance. Cross-resistance between 1st/2nd gen INSTIs is NOT automatic."], ["Darunavir (boosted)\n(PI)", "⚠️ PARTIALLY ACTIVE", "Reduced susceptibility but NOT full resistance. Boosted darunavir (with ritonavir or cobicistat) retains activity. High barrier PI."], ["Fostemsavir\n(Attachment inhibitor)", "✅ YES — ACTIVE", "Novel mechanism — binds viral gp120. Resistance to NRTIs/NNRTIs/PIs/INSTIs does NOT confer cross-resistance to fostemsavir. Specifically approved for heavily treatment-experienced patients."], ["Maraviroc\n(CCR5 antagonist)", "✅ YES — ACTIVE", "Tropism test confirms CCR5-tropic virus. Maraviroc will work. Dose must be adjusted with boosted PIs (CYP3A4 interaction)."], ["Ibalizumab\n(Post-attachment inhibitor)", "✅ YES — ACTIVE", "Monoclonal antibody targeting host CD4. Unique mechanism — no cross-resistance with any other drug class."], ["Lenacapavir\n(Capsid inhibitor)", "✅ YES — ACTIVE", "Newest drug (2022). Novel mechanism — blocks HIV capsid protein. Active against multidrug-resistant strains. Long-acting SC injection every 6 months."], ["NRTIs (all)", "❌ RESISTANT", "TAMs + M184V + K65R = resistance across all standard NRTIs."], ["NNRTIs (all)", "❌ RESISTANT", "K103N + Y181C = pan-NNRTI resistance."], ["1st-gen INSTIs\n(Raltegravir, Elvitegravir)", "❌ RESISTANT", "N155H, Q148H mutations confirmed."], ] viable_data = [viable_headers] for r in viable_rows: active_color = GREEN_DARK if "YES" in r[1] else \ ORANGE_DARK if "PARTIALLY" in r[1] else RED_DARK viable_data.append([ p(r[0], fs=8.5, bold=True), p(r[1], fs=8.5, bold=True, color=active_color), p(r[2], fs=8.5), ]) viable_t = Table(viable_data, colWidths=[4.5*cm, 3.5*cm, 9.5*cm]) viable_t.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,0), GREEN_DARK), ("TEXTCOLOR", (0,0),(-1,0), WHITE), ("ROWBACKGROUNDS",(0,1),(-1,-1), [GREEN_LIGHT, WHITE]), ("BOX", (0,0),(-1,-1), 1.5, GREEN_DARK), ("INNERGRID", (0,0),(-1,-1), 0.5, colors.HexColor("#A5D6A7")), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 6), ("VALIGN", (0,0),(-1,-1), "TOP"), ])) story.append(viable_t) story.append(Spacer(1, 8)) # Q3 story.append(hdr("✅ ANSWER Q3 — Recommended Salvage Regimen", bg=DARK_BLUE)) story.append(Spacer(1, 4)) reg_note = p( "PRINCIPLE (Goldman-Cecil Medicine): The goal is at least 2 FULLY ACTIVE antiretroviral agents,\n" "with at least ONE having a HIGH BARRIER to resistance.", fs=9, bold=True, color=DARK_BLUE) story.append(Table([[reg_note]], colWidths=[W], style=TableStyle([("BACKGROUND",(0,0),(-1,-1),YELLOW_LIGHT), ("BOX",(0,0),(-1,-1),1.5,DARK_BLUE), ("LEFTPADDING",(0,0),(-1,-1),10), ("TOPPADDING",(0,0),(-1,-1),7), ("BOTTOMPADDING",(0,0),(-1,-1),7)]))) story.append(Spacer(1, 5)) reg_data = [ [p("Component", bold=True, color=WHITE), p("Drug", bold=True, color=WHITE), p("Dose", bold=True, color=WHITE), p("Rationale", bold=True, color=WHITE)], [p("Backbone\n(High barrier PI)", bold=True), p("Darunavir 800mg\n+ Ritonavir 100mg", bold=True, color=DARK_BLUE), p("Once daily\n(with food)"), p("Reduced susceptibility but still partially active. High genetic barrier. Boosting maintains levels.")], [p("INSTI\n(2nd generation)", bold=True), p("Dolutegravir 50mg", bold=True, color=GREEN_DARK), p("Twice daily\n(twice daily due to resistance history)"), p("Active against raltegravir-resistant virus. Highest barrier to INSTI resistance. Proven in salvage therapy.")], [p("Novel Entry\nInhibitor", bold=True), p("Fostemsavir 600mg", bold=True, color=PURPLE_DARK), p("Twice daily\n(oral)"), p("Unique mechanism — no cross-resistance. Approved specifically for heavily treatment-experienced adults.")], [p("CCR5 Antagonist\n(Optional — if needed)", bold=True), p("Maraviroc 150mg", bold=True, color=ORANGE_DARK), p("Twice daily\n(reduced dose — on PI)"), p("CCR5-tropic confirmed. Dose REDUCED to 150mg BD because darunavir/ritonavir inhibits CYP3A4 (maraviroc is CYP3A4 substrate).")], ] reg_t = Table(reg_data, colWidths=[3*cm, 3.5*cm, 3.5*cm, 7.5*cm]) reg_t.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,0), DARK_BLUE), ("TEXTCOLOR", (0,0),(-1,0), WHITE), ("ROWBACKGROUNDS",(0,1),(-1,-1), [LIGHT_BLUE, WHITE]), ("BOX", (0,0),(-1,-1), 1.5, DARK_BLUE), ("INNERGRID", (0,0),(-1,-1), 0.5, colors.HexColor("#AACCEE")), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 6), ("VALIGN", (0,0),(-1,-1), "TOP"), ])) story.append(reg_t) story.append(Spacer(1, 8)) # Q4 story.append(hdr("✅ ANSWER Q4 — Drug Interactions & Contraindications", bg=RED_DARK)) story.append(Spacer(1, 4)) int_data = [ [p("Interaction", bold=True, color=WHITE), p("Mechanism", bold=True, color=WHITE), p("Action Required", bold=True, color=WHITE)], [p("Darunavir/Ritonavir\n+\nMaraviroc"), p("Ritonavir INHIBITS CYP3A4\n→ Maraviroc levels increase"), p("✅ REDUCE Maraviroc to 150mg BD\n(standard dose would be 300mg BD)")], [p("Darunavir/Ritonavir\n+\nStatins (if prescribed)"), p("PI inhibits CYP3A4\n→ Statin levels rise dramatically"), p("❌ AVOID simvastatin/lovastatin\n✅ Use pravastatin or rosuvastatin if needed")], [p("Darunavir/Ritonavir\n+\nRifampin (if TB co-infection)"), p("Rifampin INDUCES CYP3A4\n→ Darunavir levels drop 75-90%"), p("❌ ABSOLUTE CONTRAINDICATION\n✅ Use rifabutin instead (weaker inducer)")], [p("Fostemsavir\n+\nStrong CYP inducers\n(rifampin, phenytoin)"), p("Fostemsavir metabolised by CYP3A4\n→ Inducers reduce fostemsavir levels"), p("❌ AVOID rifampin with fostemsavir\n✅ Rifabutin acceptable")], [p("Dolutegravir\n+\nMetformin (if diabetic)"), p("Dolutegravir inhibits renal OCT2 transporter\n→ Metformin levels rise"), p("⚠️ Monitor — reduce metformin dose if needed\nor switch to alternative antidiabetic")], [p("Fostemsavir\n+\nStatins (OATP substrates)"), p("Fostemsavir inhibits OATP1B1/1B3\n→ Certain statins accumulate"), p("❌ Avoid atorvastatin, rosuvastatin high dose\n✅ Use pravastatin preferably")], ] int_t = Table(int_data, colWidths=[4.5*cm, 6.5*cm, 6.5*cm]) int_t.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,0), RED_DARK), ("TEXTCOLOR", (0,0),(-1,0), WHITE), ("ROWBACKGROUNDS",(0,1),(-1,-1), [RED_LIGHT, WHITE]), ("BOX", (0,0),(-1,-1), 1.5, RED_DARK), ("INNERGRID", (0,0),(-1,-1), 0.5, colors.HexColor("#FFBBBB")), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 6), ("VALIGN", (0,0),(-1,-1), "TOP"), ])) story.append(int_t) story.append(Spacer(1, 8)) # Q5 story.append(hdr("✅ ANSWER Q5 — Monitoring Plan", bg=TEAL)) story.append(Spacer(1, 4)) mon_data = [ [p("Parameter", bold=True, color=WHITE), p("Timing", bold=True, color=WHITE), p("Target / Action", bold=True, color=WHITE)], [p("HIV Viral Load", bold=True), p("4-6 weeks, then 12 weeks,\nthen every 3-6 months"), p("Expected: 10-fold (1 log) reduction at 4-6 weeks\nGoal: <50 copies/mL by 24 weeks")], [p("CD4 Count", bold=True), p("Every 3-6 months"), p("Expect gradual rise. Immune reconstitution syndrome may occur\nas immune system recovers (watch for new inflammation)")], [p("Liver Function Tests\n(ALT, AST, Bilirubin)", bold=True), p("Baseline, 4-8 weeks,\nthen 3-6 monthly"), p("Maraviroc can cause hepatotoxicity — fever/rash may precede liver injury\nDarunavir may elevate transaminases")], [p("Renal Function\n(Creatinine, eGFR)", bold=True), p("Baseline, 3-6 monthly"), p("Dolutegravir can slightly raise serum creatinine (inhibits renal tubular secretion of creatinine)\nThis is NOT true kidney damage — do not panic, check cystatin C if unsure")], [p("Fasting Lipids\n(Cholesterol, TG)", bold=True), p("Baseline, 3-6 monthly"), p("Boosted darunavir (ritonavir) causes metabolic syndrome\nManage dyslipidemia with pravastatin if needed (avoid simvastatin)")], [p("Blood Glucose", bold=True), p("Baseline, 6 monthly"), p("PI-related insulin resistance / glucose intolerance — screen for new-onset diabetes")], [p("Adherence Assessment", bold=True), p("Every visit"), p("MOST IMPORTANT — suboptimal adherence accelerates resistance\nKey point from Goldman-Cecil: Adherence is the key factor for success")], [p("Opportunistic Infection\nProphylaxis", bold=True), p("Immediately", p), p("CD4 68 = high OI risk:\n• PCP prophylaxis: TMP-SMX (Bactrim)\n• MAC prophylaxis: Azithromycin if CD4 <50\n• CMV retinitis screen if CD4 <50")], ] mon_t = Table(mon_data, colWidths=[4*cm, 4.5*cm, 9*cm]) mon_t.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,0), TEAL), ("TEXTCOLOR", (0,0),(-1,0), WHITE), ("ROWBACKGROUNDS",(0,1),(-1,-1), [TEAL_LIGHT, WHITE]), ("BOX", (0,0),(-1,-1), 1.5, TEAL), ("INNERGRID", (0,0),(-1,-1), 0.5, colors.HexColor("#80CBC4")), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 6), ("VALIGN", (0,0),(-1,-1), "TOP"), ])) story.append(mon_t) story.append(Spacer(1, 8)) # ═════════════════════ EXAM PEARL BOX ══════════════════════════════════════ story.append(hdr("💎 PHARM D EXAM PEARLS — MDR-HIV", bg=PURPLE_DARK)) story.append(Spacer(1, 4)) pearls = [ "1. Salvage regimen goal = at least 2 fully active drugs, one must have HIGH barrier to resistance (dolutegravir or boosted darunavir).", "2. 2nd-gen INSTIs (dolutegravir, bictegravir) are NOT cross-resistant with 1st-gen INSTIs (raltegravir, elvitegravir) — this is a frequent exam trap.", "3. Fostemsavir is the ONLY drug approved specifically for heavily treatment-experienced adults with MDR-HIV.", "4. ALWAYS do tropism testing before maraviroc. If CXCR4-tropic → maraviroc WILL NOT WORK.", "5. Maraviroc dose with PI: REDUCE to 150mg BD (PI inhibits CYP3A4 → maraviroc levels rise).", "6. Maraviroc dose with NNRTI inducer (efavirenz, etravirine): INCREASE to 600mg BD (CYP3A4 induced → maraviroc breaks down faster).", "7. Dolutegravir raises serum creatinine slightly — this is NOT nephrotoxicity, it inhibits tubular secretion of creatinine.", "8. Rifampin is CONTRAINDICATED with all PIs — use rifabutin for TB co-infection management.", "9. CD4 < 200 = start OI prophylaxis (PCP). CD4 < 50 = add MAC and CMV prophylaxis.", "10. ADHERENCE is the single most important factor in HIV treatment success and resistance prevention.", ] for pearl in pearls: story.append(Table([[p(pearl, fs=8.5)]], colWidths=[W], style=TableStyle([ ("BACKGROUND",(0,0),(-1,-1), PURPLE_LIGHT), ("BOX",(0,0),(-1,-1),0.5,PURPLE_DARK), ("LEFTPADDING",(0,0),(-1,-1),10), ("TOPPADDING",(0,0),(-1,-1),4), ("BOTTOMPADDING",(0,0),(-1,-1),4), ]))) story.append(Spacer(1, 2)) story.append(Spacer(1, 6)) # ─────── FOOTER ─────────────────────────────────────────────────────────────── footer = Table([[p( "📚 References: Goldman-Cecil Medicine 27e | Goodman & Gilman's 13e | Harrison's Principles 22e | Washington Manual of Medical Therapeutics | For educational use only.", fs=7.5, color=WHITE, align=TA_CENTER)]], colWidths=[W]) footer.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1),DARK_BLUE), ("TOPPADDING",(0,0),(-1,-1),6), ("BOTTOMPADDING",(0,0),(-1,-1),6), ])) story.append(footer) doc.build(story) print(f"PDF created: {OUTPUT}") PYEOF python /tmp/workspace/mdr-hiv-case/generate.py
~/mdr-hiv-case/generate.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/mdr-hiv-case/generate.py'
python /tmp/workspace/mdr-hiv-case/generate.py
MDR HIV Clinical Case
PDF Document · PDF
| Section | Content |
|---|---|
| 🏥 Patient Presentation | Full case: 38-yr-old male, 12 years HIV, CD4=68, VL=125,000, 3 prior failed regimens |
| 🧬 Resistance Profile | Genotype/phenotype table showing which mutations were found and which drugs are still active |
| ❓ Clinical Questions | 5 questions to solve before reading the answers |
| ✅ Q1 - Treatment Failure | Definition of failure + classification as "heavily treatment-experienced" |
| ✅ Q2 - Viable Options | Full table: dolutegravir, darunavir, fostemsavir, maraviroc, ibalizumab, lenacapavir — why each still works |
| ✅ Q3 - Salvage Regimen | Recommended regimen with doses and rationale for each drug chosen |
| ✅ Q4 - Drug Interactions | 6 key interactions in this specific regimen with actions required |
| ✅ Q5 - Monitoring Plan | Full monitoring schedule: viral load, CD4, LFTs, renal, lipids, adherence, OI prophylaxis |
| 💎 10 Exam Pearls | High-yield points specifically about MDR-HIV for Pharm D exams |