attachment
attachment

Give me the answer for this according to bppk 4th year pharma d for 2 marks

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
The library doesn't have a dedicated biopharmaceutics textbook, but I have enough knowledge to give comprehensive 2-mark answers for all questions. Let me now provide complete answers from my pharmacokinetics/biopharmaceutics knowledge.

Pharm.D 4th Year - Biopharmaceutics & Pharmacokinetics (2 Marks Each)


1. Modified Noyes-Whitney Equation

The original Noyes-Whitney equation describes the dissolution rate of a solid drug. The modified form (by Brunner and Tolloczko) is:
$$\frac{dC}{dt} = \frac{DA(C_s - C_t)}{Vh}$$
Where:
  • dC/dt = rate of dissolution
  • D = diffusion coefficient of drug in the dissolution medium
  • A = surface area of the dissolving solid
  • C_s = drug concentration at the saturation layer (solubility)
  • C_t = drug concentration in the bulk solution at time t
  • V = volume of dissolution medium
  • h = thickness of the diffusion layer
The modification added V (volume) and A (surface area) to make the equation more practically applicable to pharmaceutical systems.

2. Examples of Drugs Unstable in the GIT

Drugs that are degraded/destroyed in the gastrointestinal tract (acid hydrolysis, enzymatic degradation):
  1. Insulin - degraded by proteolytic enzymes (peptidases) in the GIT
  2. Penicillin G - hydrolyzed/destroyed by gastric acid (low pH)
Other examples: Erythromycin (acid labile), Nitroglycerin (extensive first-pass + enzymatic degradation), Heparin (degraded by enzymes).

3. Methods to Study Absorption of Drugs

In Vivo Methods:
  • Blood/plasma level studies (measuring drug concentration vs. time)
  • Urinary excretion studies
  • Pharmacological response method
In Vitro Methods:
  • Dissolution testing (USP dissolution apparatus)
  • Everted gut sac technique
  • Intestinal perfusion method
In Situ Methods:
  • Intestinal loop technique (Doluisio method)
  • Single-pass perfusion
Ex Vivo Methods:
  • Everted intestinal sac
  • Caco-2 cell monolayer model

4. Distribution Characteristics of Protein-Bound Drugs

  • Only free (unbound) drug is pharmacologically active, distributes to tissues, and is available for metabolism/excretion
  • Protein binding reduces the volume of distribution (Vd) - drug stays in vascular compartment
  • It prolongs the drug's half-life by acting as a reservoir
  • Bound drug is not filtered by the glomerulus (not renally excreted)
  • Displacement interactions occur when two drugs compete for the same binding sites on albumin (e.g., warfarin + NSAIDs)
  • Highly protein-bound drugs (>90%) show a small apparent Vd (~0.1 L/kg)

5. Enterohepatic Cycle

The enterohepatic cycle (circulation) is the recycling process of drugs/metabolites between the liver and intestine:
  1. Drug is absorbed from intestine → enters liver via portal circulation
  2. Liver conjugates the drug (glucuronide/sulfate conjugates) → excretes into bile
  3. Bile is released into the duodenum
  4. Intestinal bacteria (beta-glucuronidase) hydrolyze the conjugate → regenerate the free drug
  5. Free drug is reabsorbed from intestine → back to liver (cycle repeats)
Effect: Prolongs drug action and extends half-life. Examples: Oral contraceptives (ethinyl estradiol), morphine, chloramphenicol.

6. Extraction Ratio (ER)

Definition: The extraction ratio is the fraction of the drug that is irreversibly removed (extracted) from the blood by an eliminating organ (usually liver or kidney) during a single pass through that organ.
$$ER = \frac{C_{in} - C_{out}}{C_{in}}$$
Where C_in = drug concentration entering the organ, C_out = drug concentration leaving the organ.
  • ER ranges from 0 to 1
  • High ER (>0.7): extensive first-pass effect (e.g., lidocaine, propranolol)
  • Low ER (<0.3): minimal extraction (e.g., warfarin, diazepam)

7. Formula to Calculate Hepatic Extraction Ratio

$$E_H = \frac{C_A - C_V}{C_A}$$
Or in terms of hepatic clearance:
$$E_H = \frac{Cl_H}{Q_H} = \frac{f_u \cdot Cl_{int}}{Q_H + f_u \cdot Cl_{int}}$$
Where:
  • C_A = arterial drug concentration (entering liver)
  • C_V = venous drug concentration (leaving liver)
  • Q_H = hepatic blood flow (~1500 mL/min)
  • f_u = fraction unbound in plasma
  • Cl_int = intrinsic clearance
  • Cl_H = hepatic clearance = Q_H × E_H

8. Why Phase II Reactions Are Called True Detoxication Reactions

Phase II reactions (conjugation reactions) are called true detoxication reactions because:
  1. They add large polar groups (glucuronic acid, sulfate, glycine, glutathione, acetyl, methyl groups) to drugs or Phase I metabolites
  2. The conjugated products are highly water-soluble, facilitating rapid renal/biliary excretion
  3. They inactivate most pharmacologically active compounds and toxic metabolites
  4. The resulting conjugates are too large and polar to cross biological membranes - preventing tissue accumulation
  5. They convert reactive/toxic intermediates (e.g., from Phase I oxidation) into non-toxic, excretable forms
In contrast, Phase I reactions (oxidation, reduction, hydrolysis) may sometimes generate more toxic metabolites (e.g., reactive epoxides), hence Phase I alone is not true detoxication.

9. Why Excretion Takes Place from the Central Compartment in Compartment Modelling

In a two-compartment model:
  • Central compartment = blood, plasma, and highly perfused organs (liver, kidneys, lungs) - rapidly equilibrating
  • Peripheral compartment = tissues with poor perfusion (muscle, fat, bone)
Excretion occurs from the central compartment because:
  1. Kidneys and liver (the primary organs of elimination) are highly perfused and belong to the central compartment
  2. Drug must be present in blood/plasma to be filtered by glomeruli or extracted by hepatocytes
  3. The peripheral compartment only equilibrates with the central compartment - it does not have direct access to excretory organs
  4. Glomerular filtration, tubular secretion, and hepatic metabolism all operate on drug in plasma (central compartment)
Thus, the drug in the peripheral compartment must first redistribute back into the central compartment before it can be excreted - explaining the characteristic biphasic decline seen on a semi-log concentration-time plot.

All answers are framed for 2 marks each, appropriate for Pharm.D 4th year Biopharmaceutics & Pharmacokinetics as per standard BPPK curriculum. Each answer covers the key definition/equation + brief explanation, which is the expected format for short-answer questions.

Create a study guide PDF for all BPPK 4th year biopharmaceutics topics

Reading File
Finding Sources
Searching the Web

BPPK 4th year Pharm.D biopharmaceutics syllabus topics list India

Reading Web Page

https://stpaulscollege.ac.in/wp-content/uploads/2023/10/phar…

Running Command

mkdir -p /tmp/workspace/bppk-pharmd-study-guide && ls /tmp/workspace/

Writing File

~/bppk-pharmd-study-guide/generate_pdf.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, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import Flowable
import datetime

OUTPUT = "/tmp/workspace/bppk-pharmd-study-guide/BPPK_4thYear_Biopharmaceutics_StudyGuide.pdf"

# ── Color palette ────────────────────────────────────────────────────────────
NAVY      = colors.HexColor("#1a2a5e")
TEAL      = colors.HexColor("#0d7377")
GOLD      = colors.HexColor("#f4a900")
LIGHTBLUE = colors.HexColor("#e8f4f8")
LIGHTGOLD = colors.HexColor("#fff8e7")
WHITE     = colors.white
DARKGRAY  = colors.HexColor("#333333")
MIDGRAY   = colors.HexColor("#666666")
BOXBG     = colors.HexColor("#f0f7fa")
GREENBG   = colors.HexColor("#e8f5e9")
REDBG     = colors.HexColor("#fce4ec")

# ── Styles ───────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()

def S(name, **kw):
    return ParagraphStyle(name, **kw)

COVER_TITLE   = S("CoverTitle",   fontName="Helvetica-Bold",  fontSize=28, textColor=WHITE,     alignment=TA_CENTER, spaceAfter=6)
COVER_SUB     = S("CoverSub",     fontName="Helvetica",       fontSize=14, textColor=LIGHTBLUE, alignment=TA_CENTER, spaceAfter=4)
COVER_DETAIL  = S("CoverDetail",  fontName="Helvetica",       fontSize=11, textColor=GOLD,      alignment=TA_CENTER)

UNIT_HEADING  = S("UnitHeading",  fontName="Helvetica-Bold",  fontSize=16, textColor=WHITE,     spaceAfter=4, spaceBefore=10, leftIndent=0)
TOPIC_HEADING = S("TopicHeading", fontName="Helvetica-Bold",  fontSize=13, textColor=NAVY,      spaceAfter=3, spaceBefore=8)
SUBTOPIC      = S("Subtopic",     fontName="Helvetica-Bold",  fontSize=11, textColor=TEAL,      spaceAfter=2, spaceBefore=5)
BODY          = S("Body",         fontName="Helvetica",       fontSize=9.5,textColor=DARKGRAY,  spaceAfter=3, spaceBefore=1, leading=14)
BODY_JUSTIFY  = S("BodyJ",        fontName="Helvetica",       fontSize=9.5,textColor=DARKGRAY,  spaceAfter=3, spaceBefore=1, leading=14, alignment=TA_JUSTIFY)
BULLET        = S("Bullet",       fontName="Helvetica",       fontSize=9.5,textColor=DARKGRAY,  spaceAfter=2, leftIndent=14, bulletIndent=4, leading=13)
BULLET2       = S("Bullet2",      fontName="Helvetica",       fontSize=9,  textColor=MIDGRAY,   spaceAfter=2, leftIndent=28, bulletIndent=14, leading=12)
EQUATION      = S("Equation",     fontName="Helvetica-Bold",  fontSize=10, textColor=NAVY,      spaceAfter=3, spaceBefore=3, alignment=TA_CENTER, backColor=LIGHTBLUE, borderPadding=6)
KEYPOINT      = S("KeyPoint",     fontName="Helvetica-Bold",  fontSize=9.5,textColor=colors.HexColor("#1b5e20"), spaceAfter=2, leftIndent=10, leading=13)
REMEMBER      = S("Remember",     fontName="Helvetica-Oblique",fontSize=9, textColor=colors.HexColor("#bf360c"), spaceAfter=2, leftIndent=10, leading=13)
TABLE_HEADER  = S("TableHeader",  fontName="Helvetica-Bold",  fontSize=9,  textColor=WHITE,     alignment=TA_CENTER)
TABLE_BODY    = S("TableBody",    fontName="Helvetica",       fontSize=8.5,textColor=DARKGRAY,  alignment=TA_LEFT, leading=12)

# ── Helper flowables ─────────────────────────────────────────────────────────
def unit_banner(text, unit_num):
    data = [[Paragraph(f"UNIT {unit_num}  |  {text}", UNIT_HEADING)]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",  (0,0), (-1,-1), NAVY),
        ("TOPPADDING",  (0,0), (-1,-1), 8),
        ("BOTTOMPADDING",(0,0),(-1,-1), 8),
        ("LEFTPADDING", (0,0), (-1,-1), 12),
        ("RIGHTPADDING",(0,0), (-1,-1), 12),
        ("ROUNDEDCORNERS", [4]),
    ]))
    return t

def topic_box(title):
    data = [[Paragraph(title, TOPIC_HEADING)]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), LIGHTBLUE),
        ("TOPPADDING",   (0,0), (-1,-1), 6),
        ("BOTTOMPADDING",(0,0), (-1,-1), 6),
        ("LEFTPADDING",  (0,0), (-1,-1), 10),
        ("LINEBELOW",    (0,0), (-1,-1), 2, TEAL),
    ]))
    return t

def key_box(items, color=LIGHTGOLD, border=GOLD):
    content = "\n".join(f"<b>★</b>  {i}" for i in items)
    data = [[Paragraph(content, KEYPOINT)]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), color),
        ("TOPPADDING",   (0,0), (-1,-1), 6),
        ("BOTTOMPADDING",(0,0), (-1,-1), 6),
        ("LEFTPADDING",  (0,0), (-1,-1), 10),
        ("BOX",          (0,0), (-1,-1), 1.5, border),
        ("ROUNDEDCORNERS",[4]),
    ]))
    return t

def eq_box(text):
    data = [[Paragraph(text, EQUATION)]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), LIGHTBLUE),
        ("TOPPADDING",   (0,0), (-1,-1), 8),
        ("BOTTOMPADDING",(0,0), (-1,-1), 8),
        ("LEFTPADDING",  (0,0), (-1,-1), 14),
        ("BOX",          (0,0), (-1,-1), 1.5, TEAL),
    ]))
    return t

def make_table(headers, rows, col_widths=None):
    if col_widths is None:
        col_widths = [17*cm/len(headers)]*len(headers)
    header_row = [Paragraph(h, TABLE_HEADER) for h in headers]
    data = [header_row] + [[Paragraph(str(c), TABLE_BODY) for c in row] for row in rows]
    t = Table(data, colWidths=col_widths)
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,0),  TEAL),
        ("BACKGROUND",    (0,1), (-1,-1), BOXBG),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, BOXBG]),
        ("FONTNAME",      (0,0), (-1,0),  "Helvetica-Bold"),
        ("FONTSIZE",      (0,0), (-1,-1), 8.5),
        ("GRID",          (0,0), (-1,-1), 0.5, colors.HexColor("#b0bec5")),
        ("TOPPADDING",    (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ]))
    return t

def sp(n=1):
    return Spacer(1, n*4*mm)

def hr():
    return HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#b0bec5"), spaceAfter=4)

def b(text):
    return Paragraph(f"• {text}", BULLET)

def b2(text):
    return Paragraph(f"◦ {text}", BULLET2)

def rem(text):
    return Paragraph(f"⚠  {text}", REMEMBER)

# ── Page template callbacks ───────────────────────────────────────────────────
def header_footer(canvas, doc):
    canvas.saveState()
    w, h = A4
    # Header bar
    canvas.setFillColor(NAVY)
    canvas.rect(0, h-22*mm, w, 22*mm, fill=1, stroke=0)
    canvas.setFont("Helvetica-Bold", 10)
    canvas.setFillColor(WHITE)
    canvas.drawString(15*mm, h-13*mm, "BPPK 4th Year Pharm.D  |  Biopharmaceutics & Pharmacokinetics Study Guide")
    canvas.setFont("Helvetica", 9)
    canvas.setFillColor(GOLD)
    canvas.drawRightString(w-15*mm, h-13*mm, f"Page {doc.page}")
    # Footer
    canvas.setFillColor(NAVY)
    canvas.rect(0, 0, w, 10*mm, fill=1, stroke=0)
    canvas.setFont("Helvetica-Oblique", 7.5)
    canvas.setFillColor(colors.HexColor("#aaaaaa"))
    canvas.drawCentredString(w/2, 3.5*mm, "PCI Pharm.D Regulations 2008  |  Unit 4.5 Biopharmaceutics & Pharmacokinetics  |  For Educational Use Only")
    canvas.restoreState()

def cover_page(canvas, doc):
    canvas.saveState()
    w, h = A4
    # Full-page gradient background (simulate with two rects)
    canvas.setFillColor(NAVY)
    canvas.rect(0, h*0.42, w, h*0.58, fill=1, stroke=0)
    canvas.setFillColor(TEAL)
    canvas.rect(0, 0, w, h*0.42, fill=1, stroke=0)
    # Gold accent bar
    canvas.setFillColor(GOLD)
    canvas.rect(0, h*0.42-4*mm, w, 4*mm, fill=1, stroke=0)
    canvas.restoreState()

# ── Build story ───────────────────────────────────────────────────────────────
story = []

# ══ COVER ══════════════════════════════════════════════════════════════════
story.append(Spacer(1, 40*mm))
story.append(Paragraph("BIOPHARMACEUTICS &amp;", COVER_TITLE))
story.append(Paragraph("PHARMACOKINETICS", COVER_TITLE))
story.append(Spacer(1, 6*mm))
story.append(HRFlowable(width="60%", thickness=2, color=GOLD, spaceAfter=6))
story.append(Paragraph("COMPREHENSIVE STUDY GUIDE", COVER_SUB))
story.append(Spacer(1, 4*mm))
story.append(Paragraph("Pharm.D  •  4th Year  •  Subject Code 4.5", COVER_DETAIL))
story.append(Spacer(1, 6*mm))
story.append(Paragraph("PCI Regulations 2008  |  Theory + Key Equations + Tables", COVER_DETAIL))
story.append(Spacer(1, 30*mm))

# TOC summary box on cover
toc_data = [
    [Paragraph("<b>Unit</b>", TABLE_HEADER), Paragraph("<b>Topics Covered</b>", TABLE_HEADER)],
    [Paragraph("1", TABLE_BODY), Paragraph("Introduction to Biopharmaceutics – Absorption, Distribution, Elimination", TABLE_BODY)],
    [Paragraph("2", TABLE_BODY), Paragraph("Introduction to Pharmacokinetics – Models, Parameters, Drug Levels", TABLE_BODY)],
    [Paragraph("3", TABLE_BODY), Paragraph("One Compartment Open Model – IV Bolus, IV Infusion, Oral", TABLE_BODY)],
    [Paragraph("4", TABLE_BODY), Paragraph("Multicompartment Models – Two-Compartment, IV / Oral", TABLE_BODY)],
    [Paragraph("5", TABLE_BODY), Paragraph("Multiple Dosage Regimens – Repetitive IV, Extravascular, MDR", TABLE_BODY)],
    [Paragraph("6", TABLE_BODY), Paragraph("Nonlinear Pharmacokinetics – Michaelis-Menten Kinetics", TABLE_BODY)],
    [Paragraph("7", TABLE_BODY), Paragraph("Noncompartmental PK – Statistical Moment Theory, MRT, Physiological Models", TABLE_BODY)],
    [Paragraph("8", TABLE_BODY), Paragraph("Bioavailability &amp; Bioequivalence – Study Design, Methods, Criteria", TABLE_BODY)],
]
toc_t = Table(toc_data, colWidths=[1.5*cm, 15.5*cm])
toc_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0),  GOLD),
    ("BACKGROUND",    (0,1), (-1,-1), colors.HexColor("#1a3a5c")),
    ("ROWBACKGROUNDS",(0,1), (-1,-1), [colors.HexColor("#1a3a5c"), colors.HexColor("#152f4e")]),
    ("FONTNAME",      (0,0), (-1,-1), "Helvetica"),
    ("FONTSIZE",      (0,0), (-1,-1), 9),
    ("GRID",          (0,0), (-1,-1), 0.5, colors.HexColor("#0d4f6e")),
    ("TOPPADDING",    (0,0), (-1,-1), 5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("LEFTPADDING",   (0,0), (-1,-1), 8),
    ("TEXTCOLOR",     (0,1), (-1,-1), WHITE),
    ("TEXTCOLOR",     (0,0), (-1,0),  NAVY),
    ("FONTNAME",      (0,0), (-1,0),  "Helvetica-Bold"),
]))
story.append(toc_t)
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# UNIT 1 — BIOPHARMACEUTICS
# ══════════════════════════════════════════════════════════════════════════════
story.append(unit_banner("INTRODUCTION TO BIOPHARMACEUTICS", 1))
story.append(sp(1))

# 1A: Introduction
story.append(topic_box("1.1 Introduction & Scope of Biopharmaceutics"))
story.append(Paragraph(
    "Biopharmaceutics is the study of the relationship between the physicochemical properties of a drug, "
    "the dosage form in which it is given, and the route of administration on the rate and extent of systemic "
    "drug absorption. It bridges pharmaceutical sciences and pharmacokinetics.", BODY_JUSTIFY))
story.append(b("LADME Scheme: Liberation → Absorption → Distribution → Metabolism → Excretion"))
story.append(b("Aim: To design drug products that deliver predictable, reproducible drug concentrations at the site of action."))
story.append(sp())

# 1B: Drug Absorption from GIT
story.append(topic_box("1.2 Absorption of Drugs from the Gastrointestinal Tract"))
story.append(Paragraph(Paragraph("<b>Mechanisms of Drug Absorption</b>", SUBTOPIC).text, SUBTOPIC))
story.append(make_table(
    ["Mechanism", "Description", "Energy Required", "Examples"],
    [
        ["Passive Diffusion", "Drug moves from high → low conc across lipid membrane (Fick's law)", "No", "Most drugs"],
        ["Active Transport", "Carrier-mediated, against concentration gradient", "Yes (ATP)", "Levodopa, 5-FU, Methyldopa"],
        ["Facilitated Diffusion", "Carrier-mediated, along concentration gradient", "No", "Riboflavin, Vit B12"],
        ["Pinocytosis / Endocytosis", "Engulfment of drug particles by cell membrane", "Yes", "Oral vaccines, fat-soluble vitamins"],
        ["Ion-pair Transport", "Drug forms neutral pair with counter-ion, diffuses across membrane", "No", "Quaternary ammonium compounds"],
        ["Convective Transport", "Drug carried with bulk water flow through pores", "No", "Small hydrophilic molecules"],
    ],
    [3.5*cm, 6*cm, 2.5*cm, 4*cm]
))
story.append(sp())

story.append(Paragraph("<b>Fick's First Law of Diffusion</b>", SUBTOPIC))
story.append(eq_box("dQ/dt  =  D·A·(C₁ – C₂) / h"))
story.append(Paragraph("Where: D = diffusion coefficient, A = surface area, C₁–C₂ = concentration gradient, h = membrane thickness", BODY))
story.append(sp())

story.append(Paragraph("<b>Factors Affecting GI Drug Absorption</b>", SUBTOPIC))
story.append(Paragraph("<b>(A) Physicochemical Factors:</b>", BODY))
story.append(b("pKa and pH – Henderson-Hasselbalch equation governs ionization"))
story.append(b("Lipid solubility (log P / partition coefficient) – higher log P = better membrane permeability"))
story.append(b("Molecular size & weight – smaller molecules absorbed faster"))
story.append(b("Solubility – rate-limiting for poorly water-soluble drugs (BCS Class II, IV)"))
story.append(b("Crystal form / Polymorphism – amorphous > crystalline in dissolution rate"))
story.append(b("Particle size – smaller particles → increased surface area → faster dissolution"))
story.append(b("Salt form – affects solubility and dissolution rate"))
story.append(sp(0.5))
story.append(Paragraph("<b>(B) Physiological Factors:</b>", BODY))
story.append(b("GI pH: Stomach pH 1–3, Duodenum pH 5–6, Ileum pH 7–8, Colon pH 5.5–7"))
story.append(b("GI motility – gastric emptying rate (t½ ~20–30 min) is critical for absorption rate"))
story.append(b("Surface area – small intestine has largest SA (~200 m²) due to villi and microvilli"))
story.append(b("Blood flow – mesenteric blood flow maintains concentration gradient"))
story.append(b("Presence of food – delays gastric emptying, affects absorption of many drugs"))
story.append(b("First-pass metabolism – hepatic and gut wall metabolism reduces bioavailability"))
story.append(b("GI flora – may metabolize drugs before absorption (e.g., enterohepatic cycling)"))
story.append(sp(0.5))
story.append(Paragraph("<b>(C) Dosage Form Factors:</b>", BODY))
story.append(b("Dissolution rate – the Noyes-Whitney equation governs this"))
story.append(b("Disintegration – tablet/capsule breakdown precedes dissolution"))
story.append(b("Excipients – binders, disintegrants, surfactants, coatings affect release"))
story.append(b("Drug release pattern – immediate vs. modified release"))
story.append(sp())

story.append(Paragraph("<b>Modified Noyes-Whitney Equation</b>", SUBTOPIC))
story.append(eq_box("dC/dt  =  D·A·(Cs – Ct) / (V·h)"))
story.append(Paragraph(
    "D = diffusion coefficient | A = surface area of dissolving solid | Cs = saturation solubility at diffusion layer | "
    "Ct = drug concentration in bulk at time t | V = volume of dissolution medium | h = diffusion layer thickness", BODY))
story.append(rem("To increase dissolution rate: reduce particle size (↑A), increase solubility (↑Cs), use surfactants (reduce h), use amorphous form."))
story.append(sp())

story.append(Paragraph("<b>Drugs Unstable in GIT</b>", SUBTOPIC))
story.append(make_table(
    ["Drug", "Reason for Instability", "Route Used Instead"],
    [
        ["Insulin", "Digested by proteolytic enzymes (proteases, peptidases)", "Subcutaneous injection"],
        ["Penicillin G", "Hydrolyzed by gastric acid (low pH) → penicilloic acid", "IM/IV injection"],
        ["Erythromycin base", "Unstable in acid; destroyed in stomach pH 1–3", "Enteric-coated or estolate salt"],
        ["Nitroglycerin", "Extensive first-pass metabolism in GIT wall and liver", "Sublingual/transdermal"],
        ["Heparin", "Large, polar macromolecule; degraded by gut enzymes", "IV/subcutaneous only"],
        ["Oxytocin", "Proteolytic degradation in GIT", "IV infusion"],
        ["Streptokinase", "Protein; inactivated by enzymes in GIT", "IV only"],
    ],
    [4*cm, 7.5*cm, 5.5*cm]
))
story.append(sp())

story.append(Paragraph("<b>pH-Partition Hypothesis</b>", SUBTOPIC))
story.append(b("Only unionized (lipid-soluble) drug crosses biological membranes"))
story.append(b("Acids (pKa < stomach pH): mostly absorbed from stomach"))
story.append(b("Bases (pKa > intestinal pH): mostly absorbed from small intestine"))
story.append(eq_box("Henderson-Hasselbalch (Acid):  pH = pKa + log [Ionized] / [Unionized]"))
story.append(eq_box("Henderson-Hasselbalch (Base):  pH = pKa + log [Unionized] / [Ionized]"))
story.append(sp())

story.append(topic_box("1.3 Drug Distribution"))
story.append(Paragraph(
    "After absorption, drug distributes throughout the body. The extent of distribution is described by "
    "the apparent Volume of Distribution (Vd).", BODY_JUSTIFY))
story.append(eq_box("Vd  =  Dose (D) / Cp₀     or     Vd  =  Amount of drug in body / Plasma concentration"))
story.append(Paragraph("<b>Distribution Characteristics of Protein-Bound Drugs</b>", SUBTOPIC))
story.append(b("Only FREE (unbound) drug is pharmacologically active, crosses membranes, metabolized, excreted"))
story.append(b("Protein binding acts as a drug RESERVOIR → prolongs t½"))
story.append(b("Plasma proteins: Albumin (acidic drugs), Alpha-1-acid glycoprotein (basic drugs), Globulins, Lipoproteins"))
story.append(b("High protein binding → small Vd (~0.1 L/kg) → drug confined to vascular space"))
story.append(b("Displacement interactions: Two drugs competing for same binding site on albumin"))
story.append(b("Bound drug NOT filtered by glomerulus → less renal excretion"))
story.append(b("Disease states (hepatic failure, renal failure, malnutrition) alter protein binding"))
story.append(b("Neonates and elderly have lower albumin levels → higher free drug fraction"))
story.append(sp(0.5))
story.append(make_table(
    ["Drug", "% Protein Bound", "Vd (L/kg)", "Major Binding Protein"],
    [
        ["Warfarin", "99%", "0.14", "Albumin"],
        ["Diazepam", "98%", "1.1", "Albumin"],
        ["Propranolol", "87%", "4.3", "AAG + Albumin"],
        ["Phenytoin", "90%", "0.6", "Albumin"],
        ["Digoxin", "25%", "7.3", "Tissue binding"],
        ["Heparin", "80%", "0.06", "Albumin"],
    ],
    [4*cm, 4*cm, 3.5*cm, 5.5*cm]
))
story.append(sp())
story.append(Paragraph("<b>Blood-Brain Barrier (BBB) and Distribution</b>", SUBTOPIC))
story.append(b("BBB: tight junctions in cerebral capillaries restrict hydrophilic/ionized drugs"))
story.append(b("Only lipid-soluble, unionized, low MW drugs cross BBB freely"))
story.append(b("P-glycoprotein efflux pump at BBB further limits CNS entry of many drugs"))
story.append(sp())

story.append(topic_box("1.4 Drug Elimination (Metabolism + Excretion)"))
story.append(Paragraph("<b>Drug Metabolism (Biotransformation)</b>", SUBTOPIC))
story.append(Paragraph("Primarily occurs in liver (also gut wall, lung, kidney, plasma).", BODY))
story.append(make_table(
    ["Phase", "Reactions", "Purpose", "Examples"],
    [
        ["Phase I (Functionalization)", "Oxidation, Reduction, Hydrolysis\n(CYP450 enzymes – mainly CYP3A4)", "Introduce/expose functional groups; may activate or inactivate drug", "Codeine→Morphine (activation), Phenytoin→active metabolite"],
        ["Phase II (Conjugation / True Detoxication)", "Glucuronidation, Sulfation, Methylation, Acetylation, Glutathione, Glycine conjugation", "Conjugate with polar groups → highly water-soluble, inactive, easily excreted", "Morphine-6-glucuronide, Paracetamol-sulfate"],
    ],
    [3*cm, 5*cm, 4.5*cm, 4.5*cm]
))
story.append(sp(0.5))
story.append(key_box([
    "Phase II reactions are called TRUE DETOXICATION because they produce water-soluble, non-toxic, excretable conjugates",
    "Phase I may generate MORE toxic reactive intermediates (e.g., NAPQI from paracetamol)",
    "Glucuronidation is the most common Phase II reaction (UGT enzymes)",
]))
story.append(sp())
story.append(Paragraph("<b>First-Pass Effect (Presystemic Metabolism)</b>", SUBTOPIC))
story.append(b("Drug absorbed from GIT → portal vein → liver → systemic circulation"))
story.append(b("Drugs with high first-pass extraction have very low oral bioavailability"))
story.append(b("Examples: Propranolol (F=26%), Lidocaine (F=35%), Morphine (F=30%), Nitroglycerin (F<10%)"))
story.append(b("To bypass first-pass: sublingual, transdermal, rectal, inhalation routes"))
story.append(sp())
story.append(Paragraph("<b>Hepatic Extraction Ratio &amp; Hepatic Clearance</b>", SUBTOPIC))
story.append(eq_box("Extraction Ratio (ER)  =  (C_in – C_out) / C_in"))
story.append(eq_box("Hepatic Clearance (Cl_H)  =  Q_H × E_H  =  Q_H × [f_u · Cl_int] / [Q_H + f_u · Cl_int]"))
story.append(make_table(
    ["ER Value", "Classification", "Hepatic Clearance", "Affected by", "Examples"],
    [
        [">0.7", "High ER (Flow-limited)", "= Liver blood flow (≈1500 mL/min)", "Liver blood flow mainly", "Lidocaine, Propranolol, Morphine, Verapamil"],
        ["0.3–0.7", "Intermediate ER", "Moderate", "Both flow and enzyme activity", "Aspirin, Codeine"],
        ["<0.3", "Low ER (Capacity-limited)", "= Protein binding & enzyme activity", "Enzyme induction/inhibition, protein binding", "Warfarin, Diazepam, Phenytoin"],
    ],
    [1.5*cm, 3.5*cm, 3*cm, 4*cm, 5*cm]
))
story.append(sp())
story.append(Paragraph("<b>Enterohepatic Cycle (EHC)</b>", SUBTOPIC))
story.append(Paragraph(
    "The enterohepatic cycle is the recycling of drugs/metabolites between the liver and intestine, "
    "prolonging drug action and half-life.", BODY_JUSTIFY))
story.append(b("Step 1: Drug absorbed from intestine → portal blood → liver"))
story.append(b("Step 2: Liver conjugates drug (glucuronide/sulfate) → excretes into bile"))
story.append(b("Step 3: Bile released into duodenum → conjugate travels to large intestine"))
story.append(b("Step 4: Gut bacteria (β-glucuronidase) cleave conjugate → regenerates free drug"))
story.append(b("Step 5: Free drug reabsorbed → returns to liver (cycle repeats)"))
story.append(b("Effect: Multiple peaks on plasma concentration-time curve; prolonged t½"))
story.append(b("Examples: Oral contraceptives (ethinyl estradiol), morphine, chloramphenicol, digoxin"))
story.append(rem("Antibiotics that kill gut bacteria (e.g., ampicillin) can disrupt EHC → reduce OC efficacy!"))
story.append(sp())

story.append(Paragraph("<b>Methods to Study Drug Absorption</b>", SUBTOPIC))
story.append(make_table(
    ["Method", "Type", "Details"],
    [
        ["Blood/Plasma level studies", "In Vivo", "Measure drug conc. vs. time in plasma/blood; calculate Cmax, Tmax, AUC"],
        ["Urinary excretion studies", "In Vivo", "Measure cumulative drug excreted in urine; dXu/dt vs. t plots"],
        ["Pharmacological response", "In Vivo", "Correlate pharmacological effect with absorption (e.g., BP lowering)"],
        ["Dissolution testing", "In Vitro", "USP App I (basket), App II (paddle), App III, IV – measure % dissolved vs. time"],
        ["Everted gut sac", "Ex Vivo", "Segment of intestine everted on glass rod; drug placed in serosal side"],
        ["Intestinal perfusion (Doluisio)", "In Situ", "Drug perfused through intestinal segment of anesthetized rat"],
        ["Single-pass intestinal perfusion", "In Situ", "Gold standard for measuring permeability in rat/human intestine"],
        ["Caco-2 cell monolayer", "In Vitro", "Human colon adenocarcinoma cells; differentiates into enterocyte-like cells"],
        ["PAMPA (Parallel Artificial Membrane Permeability Assay)", "In Vitro", "High-throughput screening of passive permeability"],
    ],
    [5*cm, 2.5*cm, 9.5*cm]
))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# UNIT 2 — INTRODUCTION TO PHARMACOKINETICS
# ══════════════════════════════════════════════════════════════════════════════
story.append(unit_banner("INTRODUCTION TO PHARMACOKINETICS", 2))
story.append(sp(1))
story.append(topic_box("2.1 Definitions & Fundamental Concepts"))
story.append(b("<b>Pharmacokinetics (PK):</b> Quantitative study of drug absorption, distribution, metabolism, and excretion (ADME) with respect to time."))
story.append(b("<b>Pharmacodynamics (PD):</b> Study of the biochemical and physiological effects of drugs and their mechanisms."))
story.append(b("<b>Clinical Pharmacokinetics:</b> Application of PK principles to optimize drug therapy in individual patients."))
story.append(sp())
story.append(topic_box("2.2 Key Pharmacokinetic Parameters"))
story.append(make_table(
    ["Parameter", "Symbol", "Formula", "Units", "Clinical Significance"],
    [
        ["Elimination Rate Constant", "K (Ke)", "K = 0.693/t½  or  K = Cl/Vd", "h⁻¹", "Rate of drug removal from body"],
        ["Half-life", "t½", "t½ = 0.693/K  =  0.693·Vd/Cl", "hours", "Time to reduce conc by 50%; guides dosing interval"],
        ["Volume of Distribution", "Vd", "Vd = Dose/Cp₀  or  Vd = Cl/K", "L or L/kg", "Extent of drug distribution into tissues"],
        ["Total Body Clearance", "Cl", "Cl = K·Vd  =  Dose/AUC", "mL/min", "Efficiency of drug elimination"],
        ["AUC (Area Under Curve)", "AUC", "AUC = Cp₀/K (IV)  or  Trapezoidal rule", "mg·h/L", "Total drug exposure; proportional to bioavailability"],
        ["Bioavailability", "F", "F = AUC_oral/AUC_IV × 100%", "%", "Fraction of dose reaching systemic circulation"],
        ["Mean Residence Time", "MRT", "MRT = AUMC/AUC", "hours", "Average time a drug molecule spends in body"],
    ],
    [3.5*cm, 1.5*cm, 4*cm, 2*cm, 6*cm]
))
story.append(sp())
story.append(topic_box("2.3 Mathematical Models & Drug Levels in Blood"))
story.append(Paragraph("<b>Plasma Concentration-Time Profile (Single IV Dose)</b>", SUBTOPIC))
story.append(b("Linear (monoexponential) decline on semi-log plot = First-order elimination"))
story.append(eq_box("Cp(t)  =  Cp₀ · e^(–Kt)     or in log form:     log Cp = log Cp₀ – Kt/2.303"))
story.append(Paragraph("<b>Types of Drug Levels in Blood</b>", SUBTOPIC))
story.append(make_table(
    ["Term", "Definition"],
    [
        ["Cmax", "Maximum (peak) plasma concentration after extravascular dose"],
        ["Tmax", "Time to reach Cmax; related to absorption rate constant (Ka)"],
        ["Cmin (Ctrough)", "Minimum plasma concentration; measured just before next dose"],
        ["Css (Steady State)", "Plasma concentration when rate of input = rate of elimination"],
        ["MEC (Minimum Effective Conc.)", "Lowest plasma conc. producing desired pharmacological effect"],
        ["MTC (Minimum Toxic Conc.)", "Plasma conc. above which adverse/toxic effects occur"],
        ["Therapeutic Window", "Range between MEC and MTC; target for drug dosing"],
    ],
    [4.5*cm, 12.5*cm]
))
story.append(sp())
story.append(topic_box("2.4 Compartment Models"))
story.append(Paragraph(
    "Compartment models are mathematical descriptions that treat the body as one or more hypothetical "
    "compartments into which the drug distributes. A compartment is NOT an anatomical entity but a group "
    "of tissues with similar drug affinity and kinetic behavior.", BODY_JUSTIFY))
story.append(make_table(
    ["Model", "Description", "Features", "Examples"],
    [
        ["One-Compartment Open Model",
         "Body treated as single, kinetically homogeneous unit; drug distributes instantaneously",
         "Monoexponential decline; simple log-linear plot; easiest to analyze",
         "Gentamicin, some antibiotics"],
        ["Two-Compartment Open Model",
         "Central compartment (blood + highly perfused organs) + peripheral compartment (muscle, fat)",
         "Biexponential decline (alpha phase: distribution, beta phase: elimination)",
         "Lidocaine, digoxin, theophylline"],
        ["Multi-Compartment Models",
         "Three or more compartments for drugs distributing into multiple tissue types",
         "Complex polyexponential decline",
         "Amiodarone"],
        ["Physiological PK Model",
         "Based on actual organ volumes and blood flow rates",
         "Most realistic; requires extensive data; used in drug development",
         "Research use"],
    ],
    [3.5*cm, 5.5*cm, 4*cm, 4*cm]
))
story.append(sp())
story.append(rem("Excretion occurs FROM the central compartment because kidneys, liver, and lungs are highly perfused organs belonging to the central compartment. Drug in peripheral compartment must redistribute to central compartment first."))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# UNIT 3 — ONE-COMPARTMENT OPEN MODEL
# ══════════════════════════════════════════════════════════════════════════════
story.append(unit_banner("ONE-COMPARTMENT OPEN MODEL", 3))
story.append(sp(1))
story.append(topic_box("3.1 IV Bolus (Intravenous Injection)"))
story.append(Paragraph("Drug is injected rapidly into blood; instantly distributes throughout body. No absorption phase.", BODY))
story.append(eq_box("Cp(t)  =  Cp₀ · e^(–Ket)"))
story.append(eq_box("log Cp(t)  =  log Cp₀ – Ke·t / 2.303"))
story.append(Paragraph("<b>Key equations for IV Bolus:</b>", SUBTOPIC))
story.append(b("Cp₀ = Dose / Vd  (intercept on log-linear plot)"))
story.append(b("Ke = 0.693 / t½  (slope = –Ke/2.303)"))
story.append(b("AUC₀→∞ = Cp₀ / Ke  =  Dose / Cl"))
story.append(b("Cl = Ke × Vd  =  Dose / AUC"))
story.append(b("t½ = 0.693 × Vd / Cl"))
story.append(sp())
story.append(Paragraph("<b>Urinary Excretion Method (IV Bolus)</b>", SUBTOPIC))
story.append(b("Rate method (sigma-minus method): Used when drug is excreted unchanged in urine"))
story.append(eq_box("log (dXu/dt)  =  log (Ke · D)  –  Ke · t / 2.303   [Rate Method]"))
story.append(eq_box("log (Xu∞ – Xu)  =  log Xu∞  –  Ke · t / 2.303   [Sigma-Minus / Amount Remaining Method]"))
story.append(b("Xu∞ = total amount of drug eventually excreted in urine"))
story.append(sp())

story.append(topic_box("3.2 Intravenous Infusion (Zero-Order Input)"))
story.append(Paragraph("Drug is administered at a constant rate (R₀) by continuous IV infusion.", BODY))
story.append(eq_box("Cp(t)  =  R₀ / Cl × [1 – e^(–Ket)]   (during infusion)"))
story.append(eq_box("Css  =  R₀ / Cl  =  R₀ / (Ke × Vd)   (steady state)"))
story.append(b("Steady state is reached after ~4-5 half-lives regardless of infusion rate"))
story.append(b("At steady state: Rate of infusion (R₀) = Rate of elimination (Cl × Css)"))
story.append(b("Post-infusion: Cp(t) = Css × e^[–Ke(t – T)]  where T = duration of infusion"))
story.append(sp(0.5))
story.append(Paragraph("<b>Loading Dose to achieve Css immediately:</b>", SUBTOPIC))
story.append(eq_box("Loading Dose (DL)  =  Css × Vd  =  Css / (Ke × t½ / 0.693)"))
story.append(sp())

story.append(topic_box("3.3 Oral / Extravascular Administration"))
story.append(Paragraph("Drug must first be absorbed (first-order absorption) before reaching systemic circulation.", BODY))
story.append(eq_box("Cp(t)  =  (F·Ka·D) / [Vd(Ka–Ke)] × [e^(–Ket) – e^(–Kat)]"))
story.append(Paragraph("<b>Key parameters for oral model:</b>", SUBTOPIC))
story.append(b("Ka = absorption rate constant (from feathering/residuals method)"))
story.append(b("Ke = elimination rate constant (terminal slope of log-linear plot)"))
story.append(b("F = fraction absorbed (bioavailability)"))
story.append(b("Tmax = ln(Ka/Ke) / (Ka – Ke)  [time of peak concentration]"))
story.append(b("Cmax = (F·D/Vd) × e^(–Ke·Tmax)  [peak plasma concentration]"))
story.append(b("Lag time (t_lag) = delay before absorption begins (included as: Ka[t – t_lag])"))
story.append(sp(0.5))
story.append(Paragraph("<b>Method of Residuals (Feathering) – Estimating Ka:</b>", SUBTOPIC))
story.append(b("Plot log Cp vs. time on semi-log paper"))
story.append(b("Extrapolate the terminal straight line (elimination phase) back to y-axis"))
story.append(b("Subtract real Cp values from extrapolated line values → get residuals"))
story.append(b("Plot residuals vs. time → slope = –Ka/2.303"))
story.append(sp())

story.append(topic_box("3.4 Wagner-Nelson Method (Absorption Fraction)"))
story.append(eq_box("Fraction Absorbed (Fa)  =  [Cp(t) + Ke · AUC₀→t] / [Ke · AUC₀→∞]"))
story.append(b("Allows estimation of Ka without assuming first-order absorption"))
story.append(b("Useful for extended-release formulations"))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# UNIT 4 — MULTICOMPARTMENT MODELS
# ══════════════════════════════════════════════════════════════════════════════
story.append(unit_banner("MULTICOMPARTMENT MODELS", 4))
story.append(sp(1))
story.append(topic_box("4.1 Two-Compartment Open Model"))
story.append(Paragraph(
    "The body is divided into: (1) Central compartment [Vc] – plasma + highly perfused organs "
    "(heart, lungs, liver, kidneys) and (2) Peripheral (tissue) compartment [Vt] – muscle, fat, bone, skin.", BODY_JUSTIFY))
story.append(sp(0.5))
story.append(Paragraph("<b>IV Bolus – Biexponential Equation:</b>", SUBTOPIC))
story.append(eq_box("Cp(t)  =  A·e^(–αt)  +  B·e^(–βt)"))
story.append(make_table(
    ["Phase", "Symbol", "Rate Constant", "Description"],
    [
        ["Distribution (α) phase", "α", "Faster (larger)", "Drug rapidly distributes from central to peripheral compartment; α = (K12 + K21 + K10 + √Δ)/2"],
        ["Elimination (β) phase", "β", "Slower (smaller)", "Drug eliminated from central compartment; β = K21·K10/α"],
    ],
    [3.5*cm, 2*cm, 3.5*cm, 8*cm]
))
story.append(sp(0.5))
story.append(b("A = intercept of alpha phase; B = intercept of beta phase"))
story.append(b("A + B = Cp₀ (initial concentration at t=0)"))
story.append(b("Volume of central compartment: Vc = Dose / (A + B)"))
story.append(b("Total apparent Vd (at steady state): Vdss = Dose(AUMC) / AUC²"))
story.append(b("Overall elimination t½ = 0.693/β"))
story.append(sp())

story.append(topic_box("4.2 IV Infusion – Two-Compartment Model"))
story.append(b("More complex biexponential equations during and after infusion"))
story.append(b("Steady state Css = R₀ / (β × Vdβ) where Vdβ = Dose / (β · AUC)"))
story.append(b("Css independent of distribution process; depends only on β and Cl"))
story.append(sp())

story.append(topic_box("4.3 Oral Administration – Two-Compartment Model"))
story.append(b("Triexponential equation (absorption + distribution + elimination)"))
story.append(b("Method of residuals extended to separate Ka, α, β"))
story.append(b("Ka must be greater than both α and β for absorption to be clearly defined"))
story.append(sp())

story.append(topic_box("4.4 Intercompartmental Transfer Rate Constants"))
story.append(make_table(
    ["Constant", "Meaning"],
    [
        ["K12", "Transfer rate constant from central (compartment 1) to peripheral (compartment 2)"],
        ["K21", "Transfer rate constant from peripheral back to central compartment"],
        ["K10 (Ke)", "Elimination rate constant from central compartment (to outside body)"],
        ["α", "Hybrid rate constant (distribution): α > β always"],
        ["β", "Hybrid rate constant (elimination): equivalent to Ke in one-compartment"],
    ],
    [2*cm, 15*cm]
))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# UNIT 5 — MULTIPLE DOSAGE REGIMENS
# ══════════════════════════════════════════════════════════════════════════════
story.append(unit_banner("MULTIPLE DOSAGE REGIMENS", 5))
story.append(sp(1))
story.append(topic_box("5.1 Principles of Multiple Dosing"))
story.append(Paragraph(
    "When a drug is administered repeatedly at fixed intervals (τ), drug accumulates in the body until "
    "the rate of administration equals the rate of elimination = STEADY STATE.", BODY_JUSTIFY))
story.append(b("Steady state reached after 4–5 half-lives (irrespective of dose or route)"))
story.append(b("At steady state: Cmax,ss and Cmin,ss remain constant each dosing interval"))
story.append(b("Accumulation factor (R) = 1 / (1 – e^(–Ke·τ))"))
story.append(sp())

story.append(topic_box("5.2 Repetitive IV Injections – One-Compartment Model"))
story.append(eq_box("Cp,max,ss  =  (Dose/Vd) / (1 – e^(–Ke·τ))"))
story.append(eq_box("Cp,min,ss  =  Cp,max,ss × e^(–Ke·τ)"))
story.append(eq_box("Cp(t) at any time t after nth dose  =  (Dose/Vd) × [(1–e^(–nKe·τ))/(1–e^(–Ke·τ))] × e^(–Ke·t)"))
story.append(b("Average steady-state concentration: Css,avg = Dose / (Cl × τ)"))
story.append(b("Loading dose: DL = Css,avg × Vd  (to reach Css immediately)"))
story.append(sp())

story.append(topic_box("5.3 Repetitive Extravascular Dosing – One-Compartment Model"))
story.append(b("Both Ka and Ke contribute to the steady-state profile"))
story.append(b("Absorption superimposed on accumulation and elimination"))
story.append(eq_box("Cp,max,ss  =  (F·Dose·Ka) / [Vd(Ka–Ke)] × [e^(–Ke·Tmax) – e^(–Ka·Tmax)] / (1–e^(–Ke·τ))"))
story.append(b("Tmax,ss is the same as Tmax after a single oral dose"))
story.append(b("Fluctuation index: (Cmax,ss – Cmin,ss) / Css,avg × 100%"))
story.append(sp())

story.append(topic_box("5.4 Multiple Dose Regimen – Two-Compartment Model"))
story.append(b("At steady state: drug distributes throughout both compartments"))
story.append(b("Cmax,ss and Cmin,ss determined using biexponential equations with accumulation factors"))
story.append(b("More complex calculations; often handled with PK software (WinNonlin, NONMEM)"))
story.append(b("Important for drugs like theophylline, digoxin, lidocaine"))
story.append(sp())

story.append(topic_box("5.5 Dosing Regimen Design"))
story.append(make_table(
    ["Parameter", "Formula", "Notes"],
    [
        ["Maintenance Dose (DM)", "DM = Css,avg × Cl × τ  =  Css,avg × Vd × Ke × τ", "F must be incorporated for oral: DM/F"],
        ["Loading Dose (DL)", "DL = Css × Vd  =  DM / (1 – e^(–Ke·τ))", "Achieves Css immediately"],
        ["Dosing Interval (τ)", "τ = t½ × ln(Cmax/Cmin) / 0.693", "For target Cmax and Cmin"],
        ["Renal dose adjustment", "Dose_adjusted = Normal dose × (Clcr,patient / Clcr,normal)", "For drugs with renal elimination"],
    ],
    [3.5*cm, 8*cm, 5.5*cm]
))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# UNIT 6 — NONLINEAR PHARMACOKINETICS
# ══════════════════════════════════════════════════════════════════════════════
story.append(unit_banner("NONLINEAR PHARMACOKINETICS", 6))
story.append(sp(1))
story.append(topic_box("6.1 Introduction to Nonlinear PK"))
story.append(Paragraph(
    "Most drugs follow LINEAR (first-order) pharmacokinetics: AUC is proportional to dose, and "
    "Cl, Vd, t½ are dose-independent. NONLINEAR (dose-dependent/saturable) PK occurs when these "
    "parameters change with dose or concentration.", BODY_JUSTIFY))
story.append(sp(0.5))
story.append(topic_box("6.2 Factors Causing Nonlinearity"))
story.append(make_table(
    ["Factor", "Mechanism", "Example"],
    [
        ["Saturable Metabolism", "Enzymatic pathways become saturated at high doses → zero-order kinetics", "Phenytoin, Ethanol, Salicylates (high dose)"],
        ["Saturable Protein Binding", "All binding sites on albumin occupied → disproportionate increase in free drug", "Warfarin, Phenytoin"],
        ["Saturable Active Transport", "Carrier proteins for absorption/secretion saturated", "Riboflavin, Levodopa"],
        ["Saturable Renal Tubular Secretion", "Tubular secretion capacity exceeded", "Penicillin, PAH"],
        ["Saturable Active Reabsorption", "Renal tubular reabsorption becomes saturated", "Glucose (renal threshold)"],
        ["Self-Induction/Inhibition", "Drug induces or inhibits its own metabolism", "Carbamazepine (auto-induction)"],
        ["Saturable Biliary Excretion", "Biliary transport capacity saturated", "Some antibiotics"],
    ],
    [3.5*cm, 6.5*cm, 7*cm]
))
story.append(sp())
story.append(topic_box("6.3 Michaelis-Menten Method – Estimating Parameters"))
story.append(Paragraph(
    "Nonlinear PK is best described by Michaelis-Menten (capacity-limited) kinetics, analogous to enzyme kinetics.", BODY_JUSTIFY))
story.append(eq_box("–dCp/dt  =  Vmax · Cp / (Km + Cp)"))
story.append(make_table(
    ["Parameter", "Symbol", "Definition", "Significance"],
    [
        ["Maximum velocity", "Vmax", "Maximum rate of drug metabolism when enzymes are fully saturated", "Determines maximum metabolic capacity"],
        ["Michaelis constant", "Km", "Plasma concentration at which rate = Vmax/2", "Affinity; low Km = high affinity"],
        ["Rate of metabolism", "–dCp/dt", "Rate of decrease in plasma concentration", "Dependent on Cp relative to Km"],
    ],
    [3.5*cm, 2*cm, 6*cm, 5.5*cm]
))
story.append(sp(0.5))
story.append(Paragraph("<b>When Cp >> Km:</b> Rate = Vmax (zero-order – saturation; constant rate of elimination)", BODY))
story.append(Paragraph("<b>When Cp << Km:</b> Rate = (Vmax/Km) × Cp (pseudo-first-order – linear kinetics)", BODY))
story.append(sp(0.5))
story.append(Paragraph("<b>Methods to Estimate Vmax and Km:</b>", SUBTOPIC))
story.append(b("Direct Linear Plot (Eisenthal & Cornish-Bowden)"))
story.append(b("Lineweaver-Burk Plot: 1/rate vs. 1/Cp → intercept = 1/Vmax, slope = Km/Vmax"))
story.append(b("Hanes-Woolf Plot: Cp/rate vs. Cp"))
story.append(b("Steady-State Method: Measure Css at different infusion rates → Vmax = R₀ + R₀Km/Css"))
story.append(sp(0.5))
story.append(Paragraph("<b>Phenytoin – Classic Example of Nonlinear PK:</b>", SUBTOPIC))
story.append(b("Therapeutic range: 10–20 mg/L"))
story.append(b("Km ≈ 4 mg/L (typical); Vmax ≈ 6–10 mg/kg/day"))
story.append(b("Small dose increases near saturation cause disproportionate rise in Cp"))
story.append(b("Clearance is not constant: Cl = Vmax / (Km + Cp)"))
story.append(b("t½ increases as dose increases – unpredictable PK at high doses"))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# UNIT 7 — NONCOMPARTMENTAL PHARMACOKINETICS
# ══════════════════════════════════════════════════════════════════════════════
story.append(unit_banner("NONCOMPARTMENTAL PHARMACOKINETICS", 7))
story.append(sp(1))
story.append(topic_box("7.1 Statistical Moment Theory (SMT)"))
story.append(Paragraph(
    "Noncompartmental analysis (NCA) uses statistical moment theory to calculate PK parameters "
    "WITHOUT assuming a specific compartmental model. It is model-independent and relies on AUC and AUMC.", BODY_JUSTIFY))
story.append(sp(0.5))
story.append(Paragraph("<b>Zeroth Moment (AUC):</b>", SUBTOPIC))
story.append(eq_box("AUC₀→∞  =  ∫₀^∞ Cp · dt  =  (Trapezoidal sum) + Cp_last/λz"))
story.append(Paragraph("<b>First Moment (AUMC):</b>", SUBTOPIC))
story.append(eq_box("AUMC₀→∞  =  ∫₀^∞ t · Cp · dt  =  Area under the first moment curve"))
story.append(sp())

story.append(topic_box("7.2 Mean Residence Time (MRT)"))
story.append(eq_box("MRT  =  AUMC / AUC"))
story.append(make_table(
    ["Route / Model", "MRT Formula", "Interpretation"],
    [
        ["IV Bolus", "MRT = AUMC/AUC = 1/Ke = 1.443 × t½", "Average time molecule spends in body"],
        ["IV Infusion", "MRT = AUMC/AUC – T/2  (T = infusion duration)", "Corrected for infusion time"],
        ["Oral", "MRT = AUMC/AUC – MAT  where MAT = 1/Ka", "Includes absorption time"],
        ["One-compartment", "MRT = 1/Ke", "Simple; = 1.44 × t½"],
        ["Two-compartment IV Bolus", "MRT = (A/α² + B/β²)/(A/α + B/β)", "Uses alpha and beta phases"],
    ],
    [3.5*cm, 7*cm, 6.5*cm]
))
story.append(sp(0.5))
story.append(b("Mean Absorption Time (MAT) = MRT_oral – MRT_IV = 1/Ka"))
story.append(b("Mean Dissolution Time (MDT): Used for solid dosage forms; MRT_solid – MRT_solution"))
story.append(b("Vdss = Cl × MRT = Dose × AUMC / AUC²"))
story.append(b("Cl = Dose / AUC (for IV) or F·Dose / AUC (for oral)"))
story.append(sp())

story.append(topic_box("7.3 Trapezoidal Rule for AUC Calculation"))
story.append(eq_box("AUC (trapezoid) = Σ [(Cp₁ + Cp₂)/2 × (t₂ – t₁)]   [Linear Trapezoidal]"))
story.append(eq_box("AUC_last→∞ = Cp_last / λz   [Extrapolation to infinity]"))
story.append(b("Log-trapezoidal rule preferred for declining Cp segments (more accurate)"))
story.append(b("λz (terminal rate constant) = slope of terminal log-linear phase"))
story.append(sp())

story.append(topic_box("7.4 Physiological Pharmacokinetic Models (PBPK)"))
story.append(Paragraph(
    "PBPK models incorporate actual anatomical and physiological parameters: organ volumes, "
    "blood flow rates, tissue-to-plasma partition coefficients.", BODY_JUSTIFY))
story.append(make_table(
    ["Feature", "Description"],
    [
        ["Based on", "Real organ volumes (liver 1.5 L, kidney 0.3 L, lung 0.6 L) and blood flows"],
        ["Parameters needed", "Cardiac output, organ blood flows, tissue partition coefficients (Kp), protein binding"],
        ["Advantages", "Predicts tissue concentrations; scalable across species; extrapolation to humans from animals"],
        ["Disadvantages", "Complex; requires extensive data; difficult for all drugs"],
        ["Applications", "Drug development, toxicology risk assessment, pediatric/geriatric dose predictions"],
        ["Types", "Perfusion-limited (blood flow rate-limiting), Diffusion-limited (membrane rate-limiting)"],
    ],
    [3.5*cm, 13.5*cm]
))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# UNIT 8 — BIOAVAILABILITY & BIOEQUIVALENCE
# ══════════════════════════════════════════════════════════════════════════════
story.append(unit_banner("BIOAVAILABILITY & BIOEQUIVALENCE", 8))
story.append(sp(1))
story.append(topic_box("8.1 Bioavailability – Introduction"))
story.append(Paragraph(
    "Bioavailability (F) is defined as the rate and extent to which the active drug ingredient or "
    "therapeutic moiety is absorbed from the drug product and becomes available at the site of action.", BODY_JUSTIFY))
story.append(eq_box("Absolute Bioavailability:  F  =  (AUC_oral / AUC_IV) × (Dose_IV / Dose_oral) × 100%"))
story.append(eq_box("Relative Bioavailability:  Fr  =  (AUC_test / AUC_reference) × (Dose_ref / Dose_test) × 100%"))
story.append(sp(0.5))
story.append(Paragraph("<b>Types of Bioavailability:</b>", SUBTOPIC))
story.append(make_table(
    ["Type", "Definition", "Route Comparison", "Use"],
    [
        ["Absolute", "Fraction of dose reaching systemic circulation compared to IV", "Test route vs. IV", "Determining true oral F"],
        ["Relative", "Comparison of two extravascular formulations", "Test vs. Reference product", "Generic vs. Innovator comparisons"],
    ],
    [2.5*cm, 5*cm, 4.5*cm, 5*cm]
))
story.append(sp())
story.append(Paragraph("<b>Factors Affecting Bioavailability:</b>", SUBTOPIC))
story.append(b("Physicochemical: solubility, dissolution rate, particle size, pKa, stability"))
story.append(b("Physiological: GI pH, motility, first-pass effect, gut wall metabolism"))
story.append(b("Formulation: excipients, coating, disintegration, dissolution aids"))
story.append(b("Drug interactions: P-gp inhibitors/inducers, CYP3A4 inhibitors (grapefruit juice)"))
story.append(b("Food effect: fatty food increases absorption of lipophilic drugs (e.g., griseofulvin)"))
story.append(sp())

story.append(topic_box("8.2 Bioavailability Study Protocol"))
story.append(Paragraph("<b>Study Design:</b>", SUBTOPIC))
story.append(b("Crossover design (2×2): Each subject receives both test and reference products in randomized order"))
story.append(b("Washout period: ≥5 half-lives between treatments to eliminate carryover effect"))
story.append(b("Single dose study preferred; steady-state studies for modified-release products"))
story.append(b("Subjects: Healthy adult volunteers (18–50 years); fasting state (10 hours before dose)"))
story.append(b("Sample collection: Blood samples at frequent intervals (pre-dose to at least 3× t½)"))
story.append(b("Sample analysis: Validated bioanalytical method (HPLC, LC-MS/MS)"))
story.append(sp(0.5))
story.append(Paragraph("<b>Parameters Measured:</b>", SUBTOPIC))
story.append(make_table(
    ["Parameter", "Purpose", "How to Measure"],
    [
        ["AUC₀→∞", "Extent of absorption (primary parameter)", "Trapezoidal rule + extrapolation"],
        ["Cmax", "Rate of absorption (primary parameter)", "Directly from plasma-time data"],
        ["Tmax", "Rate of absorption (secondary)", "Directly observed; non-parametric test"],
        ["AUC₀→t", "Extent up to last measurable Cp", "Trapezoidal rule"],
        ["t½", "Elimination half-life", "From terminal slope"],
        ["Cmax/AUC", "Relative rate measure", "Ratio of primary parameters"],
    ],
    [3*cm, 6*cm, 8*cm]
))
story.append(sp())

story.append(topic_box("8.3 Methods of Assessment of Bioavailability"))
story.append(make_table(
    ["Method", "Parameter(s)", "Details & Limitations"],
    [
        ["Plasma level studies", "Cmax, Tmax, AUC", "Most direct & preferred method; reflects systemic availability"],
        ["Urinary excretion studies", "Cumulative Xu∞, rate of excretion", "Used when Cp too low to measure; only for renally excreted drugs"],
        ["Pharmacological response", "Effect magnitude vs. time", "Used when drug concentrations cannot be measured; less precise"],
        ["Acute pharmacological effect", "Pupil diameter, ECG changes, BP", "Useful for drugs with measurable, quantifiable effects"],
        ["Clinical response", "Therapeutic outcome", "Least precise; used when no alternative; ethical considerations"],
        ["In vitro dissolution", "% drug dissolved vs. time", "BCS-based biowaiver; correlates with in vivo if IVIVC established"],
    ],
    [4*cm, 4.5*cm, 8.5*cm]
))
story.append(sp())

story.append(topic_box("8.4 Bioequivalence (BE)"))
story.append(Paragraph(
    "Two drug products are bioequivalent if they are pharmaceutically equivalent or pharmaceutical alternatives "
    "whose rate and extent of absorption do not show a significant difference under similar experimental conditions.", BODY_JUSTIFY))
story.append(sp(0.5))
story.append(Paragraph("<b>Regulatory BE Criteria (FDA/CDSCO):</b>", SUBTOPIC))
story.append(eq_box("90% CI of Test/Reference ratio must fall within 80.00% – 125.00% for Cmax and AUC"))
story.append(b("Statistical test: Two One-Sided Tests (TOST) procedure"))
story.append(b("Logarithmic transformation of data before analysis (log-normal distribution assumed)"))
story.append(b("Minimum 12 subjects; usually 24–36 for adequate power"))
story.append(b("For narrow therapeutic index (NTI) drugs: tighter limits (90–111% for FDA)"))
story.append(sp(0.5))
story.append(Paragraph("<b>Types of Bioequivalence:</b>", SUBTOPIC))
story.append(make_table(
    ["Type", "Definition", "Implication"],
    [
        ["Pharmaceutical Equivalence", "Same active ingredient, strength, dosage form; may differ in excipients", "Same drug but not necessarily same performance"],
        ["Pharmaceutical Alternatives", "Same active moiety, different salt/ester/dosage form", "Different molecular entity but same therapeutic moiety"],
        ["Bioequivalence", "Same rate and extent of absorption (statistical equivalence of PK parameters)", "Interchangeable at pharmacy level"],
        ["Therapeutic Equivalence", "Bioequivalent AND clinically equivalent in safety/efficacy", "Can substitute for branded product"],
    ],
    [3.5*cm, 6.5*cm, 7*cm]
))
story.append(sp())
story.append(Paragraph("<b>BCS (Biopharmaceutics Classification System):</b>", SUBTOPIC))
story.append(make_table(
    ["BCS Class", "Solubility", "Permeability", "Rate-Limiting Step", "Biowaiver Eligible?"],
    [
        ["Class I", "High", "High", "Gastric emptying", "Yes (if rapid dissolution)"],
        ["Class II", "Low", "High", "Dissolution rate", "Possible (pH 6.8 similar products)"],
        ["Class III", "High", "Low", "Permeability / absorption", "Possible with strict conditions"],
        ["Class IV", "Low", "Low", "Both solubility and permeability", "No (case-by-case)"],
    ],
    [2*cm, 2.5*cm, 2.5*cm, 5*cm, 5*cm]
))
story.append(sp())
story.append(key_box([
    "High solubility: ≥dose dissolves in 250 mL at pH 1–7.5",
    "High permeability: ≥90% of dose absorbed in humans",
    "Biowaiver allows waiving in vivo BE study based on in vitro dissolution data",
]))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# QUICK REFERENCE – KEY EQUATIONS
# ══════════════════════════════════════════════════════════════════════════════
story.append(unit_banner("QUICK REFERENCE – MASTER EQUATION SHEET", "★"))
story.append(sp(1))

eq_data = [
    [Paragraph("<b>Parameter</b>", TABLE_HEADER), Paragraph("<b>Equation</b>", TABLE_HEADER), Paragraph("<b>Units</b>", TABLE_HEADER)],
    [Paragraph("Elimination rate constant", TABLE_BODY), Paragraph("K = 0.693 / t½ = Cl / Vd", TABLE_BODY), Paragraph("h⁻¹", TABLE_BODY)],
    [Paragraph("Half-life", TABLE_BODY), Paragraph("t½ = 0.693 / K = 0.693 × Vd / Cl", TABLE_BODY), Paragraph("h", TABLE_BODY)],
    [Paragraph("Volume of distribution", TABLE_BODY), Paragraph("Vd = Dose / Cp₀  or  Cl / K", TABLE_BODY), Paragraph("L or L/kg", TABLE_BODY)],
    [Paragraph("Total body clearance", TABLE_BODY), Paragraph("Cl = K × Vd = Dose / AUC", TABLE_BODY), Paragraph("mL/min", TABLE_BODY)],
    [Paragraph("AUC (IV Bolus)", TABLE_BODY), Paragraph("AUC = Cp₀ / K", TABLE_BODY), Paragraph("mg·h/L", TABLE_BODY)],
    [Paragraph("Bioavailability (Absolute)", TABLE_BODY), Paragraph("F = (AUC_oral/AUC_IV) × (DoseIV/Doseoral)", TABLE_BODY), Paragraph("Fraction", TABLE_BODY)],
    [Paragraph("Oral Cp(t)", TABLE_BODY), Paragraph("Cp = [FKaD / Vd(Ka-Ke)] × [e^(-Ket) - e^(-Kat)]", TABLE_BODY), Paragraph("mg/L", TABLE_BODY)],
    [Paragraph("Tmax (oral)", TABLE_BODY), Paragraph("Tmax = ln(Ka/Ke) / (Ka - Ke)", TABLE_BODY), Paragraph("h", TABLE_BODY)],
    [Paragraph("IV Infusion – Css", TABLE_BODY), Paragraph("Css = R₀ / Cl = R₀ / (K × Vd)", TABLE_BODY), Paragraph("mg/L", TABLE_BODY)],
    [Paragraph("Loading dose", TABLE_BODY), Paragraph("DL = Css × Vd", TABLE_BODY), Paragraph("mg", TABLE_BODY)],
    [Paragraph("Maintenance dose", TABLE_BODY), Paragraph("DM = Css × Cl × τ", TABLE_BODY), Paragraph("mg", TABLE_BODY)],
    [Paragraph("Extraction ratio", TABLE_BODY), Paragraph("ER = (Cin - Cout) / Cin = Cl_H / Q_H", TABLE_BODY), Paragraph("Unitless", TABLE_BODY)],
    [Paragraph("Hepatic clearance", TABLE_BODY), Paragraph("Cl_H = Q_H × (fu × Cl_int) / (Q_H + fu × Cl_int)", TABLE_BODY), Paragraph("mL/min", TABLE_BODY)],
    [Paragraph("Renal clearance", TABLE_BODY), Paragraph("Cl_R = (dXu/dt) / Cp = Ke_renal × Vd", TABLE_BODY), Paragraph("mL/min", TABLE_BODY)],
    [Paragraph("MRT (IV Bolus)", TABLE_BODY), Paragraph("MRT = AUMC / AUC = 1/K = 1.443 × t½", TABLE_BODY), Paragraph("h", TABLE_BODY)],
    [Paragraph("Vdss", TABLE_BODY), Paragraph("Vdss = Cl × MRT = Dose × AUMC / AUC²", TABLE_BODY), Paragraph("L", TABLE_BODY)],
    [Paragraph("Michaelis-Menten", TABLE_BODY), Paragraph("–dCp/dt = Vmax × Cp / (Km + Cp)", TABLE_BODY), Paragraph("mg/L/h", TABLE_BODY)],
    [Paragraph("Accumulation factor", TABLE_BODY), Paragraph("R = 1 / (1 – e^(–K×τ))", TABLE_BODY), Paragraph("Unitless", TABLE_BODY)],
    [Paragraph("Noyes-Whitney (Modified)", TABLE_BODY), Paragraph("dC/dt = D × A × (Cs – Ct) / (V × h)", TABLE_BODY), Paragraph("mg/L/h", TABLE_BODY)],
]
eq_t = Table(eq_data, colWidths=[4.5*cm, 9*cm, 3.5*cm])
eq_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0),  TEAL),
    ("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, BOXBG]),
    ("FONTSIZE",      (0,0), (-1,-1), 8.5),
    ("GRID",          (0,0), (-1,-1), 0.5, colors.HexColor("#b0bec5")),
    ("TOPPADDING",    (0,0), (-1,-1), 5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
    ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
]))
story.append(eq_t)
story.append(sp(2))

# ══════════════════════════════════════════════════════════════════════════════
# IMPORTANT 2-MARK QUESTIONS
# ══════════════════════════════════════════════════════════════════════════════
story.append(unit_banner("IMPORTANT 2-MARK QUESTIONS & MODEL ANSWERS", "★★"))
story.append(sp(1))

qa_items = [
    ("Q1. Write modified Noyes-Whitney equation.",
     "dC/dt = D·A·(Cs – Ct) / (V·h)\n"
     "D=diffusion coefficient, A=surface area, Cs=saturation solubility, Ct=bulk concentration, V=volume, h=diffusion layer thickness"),
    ("Q2. Give two examples of drugs unstable in the GIT.",
     "1. Insulin – degraded by proteolytic enzymes (administered subcutaneously)\n"
     "2. Penicillin G – hydrolyzed by gastric acid; other examples: Erythromycin, Heparin, Oxytocin"),
    ("Q3. List methods to study absorption of drugs.",
     "In Vivo: Plasma level studies, Urinary excretion, Pharmacological response\n"
     "In Vitro: Dissolution testing, Caco-2 cell model, PAMPA\n"
     "In Situ: Intestinal perfusion (Doluisio method)\n"
     "Ex Vivo: Everted gut sac technique"),
    ("Q4. Distribution characteristics of protein-bound drug?",
     "Only FREE drug is active; protein binding reduces Vd; prolongs t½; bound drug not renally filtered; "
     "displacement interactions possible; affected by disease states reducing albumin"),
    ("Q5. What is enterohepatic cycle?",
     "Drug absorbed → liver → conjugated → excreted into bile → intestine → bacteria cleave conjugate → "
     "free drug reabsorbed → cycle repeats. Effect: prolongs t½; multiple plasma peaks. Examples: Ethinyl estradiol, Morphine"),
    ("Q6. Define extraction ratio.",
     "Fraction of drug irreversibly removed by an eliminating organ in a single pass.\n"
     "ER = (Cin – Cout) / Cin.  Range: 0 to 1. High ER (>0.7) = extensive first-pass. Low ER (<0.3) = minimal extraction"),
    ("Q7. Formula to calculate hepatic extraction ratio.",
     "E_H = (C_A – C_V) / C_A  OR  E_H = Cl_H / Q_H  =  (fu × Cl_int) / (Q_H + fu × Cl_int)\n"
     "Q_H = hepatic blood flow (~1500 mL/min), fu = free fraction, Cl_int = intrinsic clearance"),
    ("Q8. Why Phase II reaction is called true detoxication?",
     "Phase II (conjugation) reactions add large polar groups (glucuronide, sulfate, glycine) making drugs highly "
     "water-soluble, pharmacologically INACTIVE, and rapidly excreted. Unlike Phase I, Phase II does NOT generate toxic intermediates."),
    ("Q9. In compartment modelling, why does excretion take place from central compartment?",
     "Excretion organs (kidneys, liver) are highly perfused and belong to the central compartment. Only drug in "
     "plasma can be filtered/secreted by kidneys or extracted by liver. Drug in peripheral compartment must first "
     "redistribute to central compartment before elimination."),
]

for q, a in qa_items:
    qa_data = [
        [Paragraph(q, S("QH", fontName="Helvetica-Bold", fontSize=9.5, textColor=NAVY, leading=13))],
        [Paragraph(a, S("QB", fontName="Helvetica", fontSize=9, textColor=DARKGRAY, leading=13))],
    ]
    qa_t = Table(qa_data, colWidths=[17*cm])
    qa_t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,0), LIGHTBLUE),
        ("BACKGROUND",   (0,1), (-1,1), WHITE),
        ("TOPPADDING",   (0,0), (-1,-1), 6),
        ("BOTTOMPADDING",(0,0), (-1,-1), 6),
        ("LEFTPADDING",  (0,0), (-1,-1), 10),
        ("LINEBELOW",    (0,-1),(-1,-1), 1, colors.HexColor("#cfd8dc")),
    ]))
    story.append(KeepTogether([qa_t, Spacer(1, 3*mm)]))

story.append(sp(2))

# ══════════════════════════════════════════════════════════════════════════════
# BCS FLOWCHART / SUMMARY TABLE
# ══════════════════════════════════════════════════════════════════════════════
story.append(unit_banner("BCS & IVIVC SUMMARY", "★★★"))
story.append(sp(1))
story.append(Paragraph("<b>In Vitro – In Vivo Correlation (IVIVC)</b>", SUBTOPIC))
story.append(Paragraph("IVIVC establishes a predictive relationship between an in vitro dissolution property and an in vivo bioavailability parameter.", BODY_JUSTIFY))
story.append(make_table(
    ["IVIVC Level", "Correlation", "In Vitro Parameter", "In Vivo Parameter", "Regulatory Value"],
    [
        ["Level A (Best)", "Point-to-point correlation", "% Dissolved vs. time", "Fraction absorbed vs. time", "Allows dissolution specification and biowaiver"],
        ["Level B", "Statistical moment comparison", "MDT in vitro", "MDT in vivo or MRT", "Limited regulatory use; not point-to-point"],
        ["Level C", "Single point correlation", "% Dissolved at one time point", "One PK parameter (Cmax or AUC)", "Useful for formulation screening only"],
        ["Multiple Level C", "Level C at multiple time points", "Multiple % dissolved values", "Multiple PK parameters", "Surrogate for Level A in some cases"],
    ],
    [2.5*cm, 3*cm, 3.5*cm, 3.5*cm, 4.5*cm]
))
story.append(sp(2))

story.append(Paragraph(
    f"<i>Study Guide prepared for BPPK 4th Year Pharm.D · Subject 4.5 Biopharmaceutics & Pharmacokinetics · "
    f"PCI Regulations 2008 · Generated {datetime.date.today().strftime('%B %Y')} · For educational use only.</i>",
    S("Footer", fontName="Helvetica-Oblique", fontSize=8, textColor=MIDGRAY, alignment=TA_CENTER)
))

# ── Build document ─────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=2*cm, rightMargin=2*cm,
    topMargin=28*mm, bottomMargin=18*mm,
    title="BPPK 4th Year Biopharmaceutics & Pharmacokinetics Study Guide",
    author="Pharm.D Study Guide",
    subject="Biopharmaceutics & Pharmacokinetics PCI 2008"
)

# First page uses cover callbacks; rest use header_footer
from reportlab.platypus import BaseDocTemplate, Frame, PageTemplate

class MyDoc(SimpleDocTemplate):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

    def handle_pageBegin(self):
        pass

doc.build(story,
          onFirstPage=cover_page,
          onLaterPages=header_footer)

print(f"PDF generated: {OUTPUT}")
import os
size = os.path.getsize(OUTPUT)
print(f"File size: {size/1024:.1f} KB")
Running Command

cd /tmp/workspace/bppk-pharmd-study-guide && python generate_pdf.py 2>&1

Your study guide is ready! Download it here:

BPPK 4thYear Biopharmaceutics StudyGuide

PDF Document · PDF


Here's what's inside the guide (based on the official PCI Pharm.D Regulations 2008 syllabus for Subject 4.5):
8 Full Units covered:
UnitTopics
1Biopharmaceutics - Drug Absorption (GIT), LADME, Noyes-Whitney, Drug Unstable in GIT, Distribution, Protein Binding, Metabolism (Phase I & II), Enterohepatic Cycle, Extraction Ratio, Absorption Study Methods
2Introduction to PK - Parameters (Ke, t½, Vd, Cl, AUC, F, MRT), Drug Levels (Cmax/Cmin/Css/MEC/MTC), Compartment Models Overview
3One-Compartment Open Model - IV Bolus, IV Infusion, Oral Administration, Method of Residuals, Wagner-Nelson
4Multicompartment Models - Two-Compartment (alpha/beta phases), Rate Constants (K12, K21, K10)
5Multiple Dosage Regimens - Repetitive IV, Oral MDR, Loading/Maintenance Dose Design
6Nonlinear PK - Michaelis-Menten Kinetics, Vmax/Km, Phenytoin example
7Noncompartmental PK - SMT, MRT, AUC by Trapezoidal Rule, PBPK Models
8Bioavailability & Bioequivalence - Study Protocol, Methods, BCS Classes, BE Criteria, IVIVC
Bonus sections:
  • Master Equation Sheet (all key formulas in one table)
  • 9 model 2-mark Q&A (from your question paper)
  • BCS & IVIVC correlation summary table
  • Color-coded boxes for equations, key points, and warnings
attachment
attachment

Give me the answer

Here are the 2-mark answers for questions 9–20 from your BPPK 4th Year Biopharmaceutics paper:

9. Why Does Excretion Take Place from the Central Compartment?

In compartment modelling, the central compartment comprises blood plasma and highly perfused organs - liver, kidneys, and lungs. Excretion occurs from here because:
  • The kidneys (glomerular filtration, tubular secretion) and liver (biliary excretion, metabolism) are high-blood-flow organs belonging to the central compartment
  • Drug must be present in plasma to be filtered or secreted
  • Drug in the peripheral compartment must first redistribute back to the central compartment before it can be excreted

10. Example of Monoexponential Equation

The One-Compartment Open Model after IV Bolus follows a monoexponential equation:
$$\boxed{C_p(t) = C_p^0 \cdot e^{-K_e t}}$$
  • Only one exponential term
  • Semi-log plot gives a straight line
  • Slope = −Ke / 2.303
  • Example drug: Gentamicin, Tobramycin

11. Example of Biexponential Equation

The Two-Compartment Open Model after IV Bolus follows a biexponential equation:
$$\boxed{C_p(t) = A \cdot e^{-\alpha t} + B \cdot e^{-\beta t}}$$
  • Two exponential terms: α phase (fast distribution) + β phase (slow elimination)
  • Semi-log plot gives a biphasic curve (curve, not straight line)
  • A, B = intercepts; α = distribution rate constant; β = elimination rate constant
  • Example drugs: Lidocaine, Digoxin, Theophylline

12. Formula for AUC 0–t and AUC 0–∞

AUC 0→t (Linear Trapezoidal Rule):
$$\boxed{AUC_{0 \to t} = \sum_{i=1}^{n} \frac{(C_{p_i} + C_{p_{i+1}})}{2} \times (t_{i+1} - t_i)}$$
AUC 0→∞:
$$\boxed{AUC_{0 \to \infty} = AUC_{0 \to t} + \frac{C_{p_{last}}}{K_e}}$$
  • The second term Cp_last / Ke extrapolates from the last measured concentration to infinity
  • For IV Bolus: AUC₀→∞ = Cp₀ / Ke = Dose / Cl

13. Equation to Calculate Bioavailability from Urine Data

Absolute Bioavailability (Urine method):
$$\boxed{F = \frac{(Xu_{\infty}){oral}}{(Xu{\infty}){IV}} \times \frac{Dose{IV}}{Dose_{oral}}}$$
Where Xu∞ = total amount of drug excreted unchanged in urine (collected to completion)
Relative Bioavailability (Urine):
$$\boxed{F_{rel} = \frac{(Xu_{\infty}){Test}}{(Xu{\infty}){Reference}} \times \frac{Dose{Ref}}{Dose_{Test}} \times 100%}$$
  • Valid only if renal excretion is the same fraction of total elimination for both routes
  • Requires complete urine collection over ≥7 half-lives

14. Formula for AUMC and MRT

AUMC (Area Under the First Moment Curve):
$$\boxed{AUMC_{0 \to \infty} = \int_0^{\infty} t \cdot C_p \cdot dt = \sum \frac{(t_i C_{p_i} + t_{i+1} C_{p_{i+1}})}{2} \times (t_{i+1} - t_i) + \frac{t_{last} \cdot C_{last}}{K_e} + \frac{C_{last}}{K_e^2}}$$
MRT (Mean Residence Time):
$$\boxed{MRT = \frac{AUMC}{AUC}}$$
  • For IV Bolus: MRT = 1/Ke = 1.443 × t½
  • For IV Infusion: MRT = AUMC/AUC − T/2 (T = infusion duration)
  • For Oral: MRT_oral = MRT_IV + MAT (Mean Absorption Time = 1/Ka)

15. Difference Between AUC and AUMC

FeatureAUCAUMC
Full NameArea Under the Plasma Concentration-Time CurveArea Under the First Moment Curve
Mathematical Expression∫₀^∞ Cp · dt∫₀^∞ t · Cp · dt
PlotCp vs. timet × Cp vs. time
MomentZeroth momentFirst moment
Unitsmg·h/L (or µg·h/mL)mg·h²/L
RepresentsTotal drug exposure (extent of absorption)Used to calculate MRT and Vdss
UseCalculates Cl, F, bioequivalenceCalculates MRT = AUMC/AUC, Vdss

16. Schematic Representation of Physiological Pharmacokinetic (PBPK) Model

A PBPK model is built on actual anatomical compartments connected by blood flow (Q):
                    ┌──────────────────────────┐
                    │        LUNG              │
                    │  (Gas exchange/Inhal.)   │
                    └────────────┬─────────────┘
                                 │ Arterial Blood (QT)
          ┌──────────────────────┼──────────────────────┐
          ▼                      ▼                      ▼
    ┌──────────┐          ┌──────────┐          ┌──────────┐
    │  LIVER   │          │  KIDNEY  │          │  MUSCLE  │
    │(Cl_met)  │          │(Cl_renal)│          │  / FAT   │
    └────┬─────┘          └────┬─────┘          └────┬─────┘
         │                     │                     │
         └─────────────────────┴─────────────────────┘
                                 │ Venous Blood
                            ┌────┴─────┐
                            │  HEART   │
                            └──────────┘
Each compartment has: Volume (V), Blood flow (Q), Tissue partition coefficient (Kp)
  • Perfusion-limited: Blood flow is rate-limiting (highly perfused organs)
  • Diffusion-limited: Membrane permeability is rate-limiting (slowly perfused organs)

17. Tests to Determine Non-linearity

To confirm if a drug follows nonlinear (dose-dependent) pharmacokinetics:
  1. Dose-proportionality test - Administer different doses; if AUC increases proportionally → linear. Disproportionate increase → nonlinear
  2. Plot of AUC vs. Dose - Straight line through origin = linear; curved = nonlinear (saturable)
  3. Half-life vs. dose/concentration test - If t½ increases with increasing dose → nonlinear metabolism (Michaelis-Menten)
  4. Clearance vs. concentration - If Cl decreases as dose increases → saturable elimination
  5. Vd vs. dose test - If Vd changes with dose → saturable protein/tissue binding
  6. Urine metabolite ratio test - Change in ratio of metabolites at different doses → saturation of one metabolic pathway
  7. Steady-state Css vs. dose rate plot - If Css increases non-proportionally with infusion rate → Michaelis-Menten kinetics (Phenytoin)

18. Equations for Steady-State Maximum, Minimum & Average Drug Concentrations

For Repetitive IV Bolus (One-Compartment):
Maximum (Peak) Steady-State Concentration: $$\boxed{C_{max}^{ss} = \frac{Dose/V_d}{1 - e^{-K_e \tau}}}$$
Minimum (Trough) Steady-State Concentration: $$\boxed{C_{min}^{ss} = C_{max}^{ss} \cdot e^{-K_e \tau} = \frac{(Dose/V_d) \cdot e^{-K_e \tau}}{1 - e^{-K_e \tau}}}$$
Average Steady-State Concentration: $$\boxed{C_{avg}^{ss} = \frac{Dose}{Cl \cdot \tau} = \frac{Dose}{K_e \cdot V_d \cdot \tau} = \frac{1.44 \cdot t_{1/2} \cdot Dose}{V_d \cdot \tau}}$$
Where τ = dosing interval

19. Plasma Concentration-Time Plot for Multiple Dosing of IV Bolus

The graph shows drug accumulation over successive doses until steady state is reached:
Cp
(mg/L)
  │         Css_max ────────────────────────────
  │      ╭─╮   ╭─╮   ╭─╮   ╭─╮   ╭─╮   ╭─╮
  │     ╱   ╲ ╱   ╲ ╱   ╲ ╱   ╲ ╱   ╲ ╱   ╲
  │    ╱     ╳     ╳     ╳     ╳     ╳     ╲
  │   ╱     ╱ ╲   ╱ ╲   ╱ ╲   ╱ ╲   ╱ ╲   ╱
  │  ╱     ╱   ╲ ╱   ╲ ╱   ╲ ╱   ╲ ╱   ╲ ╱
  │ ╱                         Css_min ─────
  │─────────────────────────────────────────→ Time
     D1    D2    D3    D4    D5    D6  (Doses)
         ←──── ~4-5 t½ to reach steady state ────→
Key features:
  • Each dose adds on to residual drug from previous dose → accumulation
  • Steady state (Css) reached after 4–5 half-lives
  • At steady state: Cmax,ss and Cmin,ss are constant every dosing interval
  • Fluctuation = Cmax,ss − Cmin,ss (depends on τ relative to t½)

20. Define Dosing Frequency

Dosing frequency is the number of times a drug dose is administered per unit time (usually per day). It is the reciprocal of the dosing interval (τ):
$$\boxed{Dosing\ Frequency = \frac{1}{\tau}}$$
  • If τ = 8 hours → Dosing frequency = 3 times/day (TID)
  • If τ = 12 hours → Dosing frequency = 2 times/day (BID)
  • If τ = 24 hours → Dosing frequency = Once daily (OD)
Factors determining dosing frequency:
  • Drug's elimination half-life (t½)
  • Therapeutic window (MEC to MTC range)
  • Required fluctuation between Cmax,ss and Cmin,ss
  • Patient compliance (simpler regimen = better adherence)
Optimal τ ≈ t½ for most drugs to maintain Cp within therapeutic window

All answers are framed for 2 marks each, suitable for BPPK 4th Year Pharm.D Biopharmaceutics & Pharmacokinetics (Subject 4.5, PCI 2008 syllabus).

Give this 2 marks question in to pdf

Running Command

ls /tmp/workspace/bppk-pharmd-study-guide/

Writing File

~/bppk-pharmd-study-guide/generate_2marks_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
import datetime

OUTPUT = "/tmp/workspace/bppk-pharmd-study-guide/BPPK_2Mark_QA.pdf"

# ── Colors ───────────────────────────────────────────────────────────────────
NAVY      = colors.HexColor("#1a2a5e")
TEAL      = colors.HexColor("#0d7377")
GOLD      = colors.HexColor("#f4a900")
LIGHTBLUE = colors.HexColor("#e8f4f8")
LIGHTGOLD = colors.HexColor("#fff8e7")
WHITE     = colors.white
DARKGRAY  = colors.HexColor("#222222")
MIDGRAY   = colors.HexColor("#555555")
GREENBG   = colors.HexColor("#e8f5e9")
PURPLEBG  = colors.HexColor("#f3e5f5")

def S(name, **kw):
    return ParagraphStyle(name, **kw)

BODY   = S("Body",  fontName="Helvetica",      fontSize=9.5, textColor=DARKGRAY, leading=15, spaceAfter=2)
BODYJ  = S("BodyJ", fontName="Helvetica",      fontSize=9.5, textColor=DARKGRAY, leading=15, spaceAfter=2, alignment=TA_JUSTIFY)
BOLD   = S("Bold",  fontName="Helvetica-Bold", fontSize=9.5, textColor=NAVY,    leading=15, spaceAfter=2)
BULL   = S("Bull",  fontName="Helvetica",      fontSize=9.5, textColor=DARKGRAY, leading=14, spaceAfter=2, leftIndent=14)
BULL2  = S("Bull2", fontName="Helvetica",      fontSize=9,   textColor=MIDGRAY,  leading=13, spaceAfter=1, leftIndent=28)
EQS    = S("EqS",   fontName="Helvetica-Bold", fontSize=10,  textColor=NAVY,    leading=15, spaceAfter=3, spaceBefore=3, alignment=TA_CENTER)
SMALL  = S("Small", fontName="Helvetica-Oblique", fontSize=8.5, textColor=MIDGRAY, leading=12)
TC     = S("TC",    fontName="Helvetica",      fontSize=8.5, textColor=DARKGRAY, leading=12)
TH     = S("TH",    fontName="Helvetica-Bold", fontSize=8.5, textColor=WHITE,   alignment=TA_CENTER, leading=12)

def sp(n=1): return Spacer(1, n*3.5*mm)
def hr():    return HRFlowable(width="100%", thickness=0.4, color=colors.HexColor("#cfd8dc"), spaceAfter=3)
def b(t):    return Paragraph(f"• {t}", BULL)
def b2(t):   return Paragraph(f"  ◦ {t}", BULL2)

def eq_box(text):
    t = Table([[Paragraph(text, EQS)]], colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), LIGHTBLUE),
        ("TOPPADDING",    (0,0),(-1,-1), 7),
        ("BOTTOMPADDING", (0,0),(-1,-1), 7),
        ("LEFTPADDING",   (0,0),(-1,-1), 10),
        ("BOX",           (0,0),(-1,-1), 1.5, TEAL),
    ]))
    return t

def make_table(headers, rows, widths=None):
    if widths is None:
        widths = [17*cm/len(headers)]*len(headers)
    data = [[Paragraph(h, TH) for h in headers]]
    for row in rows:
        data.append([Paragraph(str(c), TC) for c in row])
    t = Table(data, colWidths=widths)
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(-1,0),  TEAL),
        ("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, LIGHTBLUE]),
        ("GRID",          (0,0),(-1,-1), 0.4, colors.HexColor("#b0bec5")),
        ("TOPPADDING",    (0,0),(-1,-1), 5),
        ("BOTTOMPADDING", (0,0),(-1,-1), 5),
        ("LEFTPADDING",   (0,0),(-1,-1), 6),
        ("VALIGN",        (0,0),(-1,-1), "TOP"),
    ]))
    return t

# ── Page callbacks ───────────────────────────────────────────────────────────
def header_footer(canvas, doc):
    canvas.saveState()
    w, h = A4
    canvas.setFillColor(NAVY)
    canvas.rect(0, h-20*mm, w, 20*mm, fill=1, stroke=0)
    canvas.setFont("Helvetica-Bold", 10)
    canvas.setFillColor(WHITE)
    canvas.drawString(15*mm, h-12*mm, "BPPK 4th Year Pharm.D  |  Biopharmaceutics & Pharmacokinetics  |  2-Mark Q&A")
    canvas.setFont("Helvetica", 9)
    canvas.setFillColor(GOLD)
    canvas.drawRightString(w-15*mm, h-12*mm, f"Page {doc.page}")
    canvas.setFillColor(NAVY)
    canvas.rect(0, 0, w, 9*mm, fill=1, stroke=0)
    canvas.setFont("Helvetica-Oblique", 7.5)
    canvas.setFillColor(colors.HexColor("#aaaaaa"))
    canvas.drawCentredString(w/2, 3*mm, "PCI Pharm.D 2008  |  Subject 4.5 Biopharmaceutics & Pharmacokinetics  |  For Educational Use Only")
    canvas.restoreState()

def cover_bg(canvas, doc):
    canvas.saveState()
    w, h = A4
    canvas.setFillColor(NAVY)
    canvas.rect(0, h*0.45, w, h*0.55, fill=1, stroke=0)
    canvas.setFillColor(TEAL)
    canvas.rect(0, 0, w, h*0.45, fill=1, stroke=0)
    canvas.setFillColor(GOLD)
    canvas.rect(0, h*0.45-3*mm, w, 3*mm, fill=1, stroke=0)
    canvas.restoreState()

# ── Q&A data  (Q1–9 from previous session + Q10–20 from this session) ────────
# Format: (question_number, question_text, answer_content)
# answer_content = list of items; each item is either:
#   ("text", str)  →  plain paragraph
#   ("bold", str)  →  bold paragraph
#   ("eq",   str)  →  equation box
#   ("b",    str)  →  bullet
#   ("b2",   str)  →  sub-bullet
#   ("table", headers, rows, widths) → table
#   ("sp",)        →  small spacer
#   ("note", str)  →  italic note

QA = [
    (1, "Write modified Noyes-Whitney equation.", [
        ("text", "Noyes-Whitney (modified by Brunner & Tolloczko) describes the rate of dissolution of a solid drug:"),
        ("eq",   "dC/dt  =  D · A · (Cs – Ct) / (V · h)"),
        ("table",
         ["Symbol", "Meaning"],
         [["D", "Diffusion coefficient of drug in dissolution medium"],
          ["A", "Surface area of dissolving solid"],
          ["Cs", "Drug solubility (concentration at diffusion layer)"],
          ["Ct", "Drug concentration in bulk solution at time t"],
          ["V",  "Volume of dissolution medium"],
          ["h",  "Thickness of diffusion layer"]],
         [2*cm, 15*cm]),
        ("note", "To increase dissolution rate: ↓ particle size (↑A), ↑ solubility (↑Cs), use surfactants (↓h)."),
    ]),

    (2, "Give two examples of drugs which are unstable in the GIT.", [
        ("text", "Drugs destroyed before absorption due to acid hydrolysis or enzymatic degradation in the GIT:"),
        ("b", "<b>Insulin</b> – degraded by proteolytic enzymes (trypsin, chymotrypsin) in the intestine → given subcutaneously"),
        ("b", "<b>Penicillin G</b> – hydrolyzed by gastric acid (low pH ~1–3) → penicilloic acid (inactive)"),
        ("text", "Other examples:"),
        ("b2", "Erythromycin base – acid labile; enteric-coated or ester salt used"),
        ("b2", "Nitroglycerin – extensive first-pass gut wall metabolism"),
        ("b2", "Heparin – large polyanion; degraded by gut enzymes → IV/SC only"),
    ]),

    (3, "List out the methods to study absorption of drugs.", [
        ("table",
         ["Method", "Type", "Key Feature"],
         [["Plasma/blood level studies", "In Vivo", "Cmax, Tmax, AUC measured; most reliable"],
          ["Urinary excretion studies", "In Vivo", "Cumulative Xu∞; useful when Cp undetectable"],
          ["Pharmacological response", "In Vivo", "Effect vs. time; less precise"],
          ["Dissolution testing (USP)", "In Vitro", "% drug dissolved vs. time; Apparatus I–IV"],
          ["Caco-2 cell monolayer", "In Vitro", "Human enterocyte model; predicts permeability"],
          ["PAMPA", "In Vitro", "High-throughput passive permeability screening"],
          ["Everted gut sac", "Ex Vivo", "Intestinal segment everted; measures transport"],
          ["Doluisio / Intestinal perfusion", "In Situ", "Gold standard; single-pass rat intestine"],
         ],
         [4*cm, 2*cm, 11*cm]),
    ]),

    (4, "What are distribution characteristics of protein-bound drug?", [
        ("b", "Only the <b>free (unbound) fraction</b> is pharmacologically active, crosses membranes, and is metabolized/excreted"),
        ("b", "Protein binding reduces the <b>apparent Volume of Distribution (Vd)</b> — drug stays in vascular compartment"),
        ("b", "Acts as a drug <b>reservoir</b> → prolongs half-life"),
        ("b", "Bound drug is <b>NOT filtered</b> by the glomerulus → reduced renal excretion"),
        ("b", "<b>Displacement interactions</b>: two drugs compete for same albumin binding site (e.g., warfarin + NSAIDs)"),
        ("b", "Major plasma proteins: <b>Albumin</b> (acidic drugs), <b>α₁-acid glycoprotein</b> (basic drugs)"),
        ("b", "Altered in: hepatic failure, renal failure, malnutrition, pregnancy, neonates (↓albumin → ↑free drug)"),
    ]),

    (5, "What is enterohepatic cycle?", [
        ("text", "The enterohepatic cycle (EHC) is the recycling process of drugs between the liver and intestine:"),
        ("b", "Drug absorbed from intestine → portal vein → liver"),
        ("b", "Liver conjugates drug (glucuronide/sulfate) → secretes conjugate into bile"),
        ("b", "Bile released into duodenum → conjugate travels to large intestine"),
        ("b", "Gut bacteria (β-glucuronidase) hydrolyze conjugate → regenerate FREE drug"),
        ("b", "Free drug reabsorbed from colon → returns to liver (cycle repeats)"),
        ("bold", "Effect: Prolongs drug action; multiple peaks on Cp-time curve; extends t½"),
        ("b", "Examples: Ethinyl estradiol, Morphine, Chloramphenicol, Digoxin"),
        ("note", "Antibiotics (ampicillin) kill gut bacteria → disrupt EHC → reduce OCP efficacy."),
    ]),

    (6, "Define extraction ratio.", [
        ("text", "Extraction Ratio (ER) is the fraction of drug irreversibly removed from blood by an eliminating organ (liver/kidney) in a single pass through that organ."),
        ("eq",  "ER  =  (C_in – C_out) / C_in"),
        ("table",
         ["ER Value", "Classification", "Examples"],
         [["> 0.7", "High (Flow-limited)", "Lidocaine, Propranolol, Morphine, Verapamil"],
          ["0.3–0.7", "Intermediate", "Aspirin, Codeine"],
          ["< 0.3", "Low (Capacity-limited)", "Warfarin, Diazepam, Phenytoin"]],
         [2.5*cm, 4.5*cm, 10*cm]),
        ("text", "Range: 0 to 1. High ER drugs have extensive first-pass effect and low oral bioavailability."),
    ]),

    (7, "Write the formula to calculate hepatic extraction ratio.", [
        ("eq",  "E_H  =  (C_A – C_V) / C_A"),
        ("eq",  "E_H  =  Cl_H / Q_H  =  (f_u · Cl_int) / (Q_H + f_u · Cl_int)"),
        ("table",
         ["Symbol", "Meaning", "Normal Value"],
         [["C_A", "Arterial drug conc. entering liver", "—"],
          ["C_V", "Venous drug conc. leaving liver", "—"],
          ["Q_H", "Hepatic blood flow", "~1500 mL/min"],
          ["f_u", "Free (unbound) fraction in plasma", "Drug-specific"],
          ["Cl_int", "Intrinsic clearance (enzyme capacity)", "Drug-specific"],
          ["Cl_H", "Hepatic clearance = Q_H × E_H", "mL/min"]],
         [2*cm, 9*cm, 6*cm]),
    ]),

    (8, "Why phase II reaction is called true detoxication reactions?", [
        ("text", "Phase II (conjugation) reactions are called TRUE DETOXICATION because:"),
        ("b", "They add large polar groups (<b>glucuronide, sulfate, glycine, glutathione, acetyl</b>) to drugs/Phase I metabolites"),
        ("b", "Products are <b>highly water-soluble</b> → rapidly excreted in urine or bile"),
        ("b", "Conjugates are pharmacologically <b>INACTIVE</b> (non-toxic) in most cases"),
        ("b", "Products are too large/polar to cross cell membranes → cannot re-enter tissues"),
        ("b", "Convert <b>reactive/toxic Phase I intermediates</b> (e.g., NAPQI from paracetamol) into harmless conjugates"),
        ("note", "Phase I reactions may GENERATE toxic intermediates (e.g., reactive epoxides) — hence Phase I alone is NOT true detoxication."),
    ]),

    (9, "In compartment modelling why does excretion takes place from central compartment?", [
        ("text", "The central compartment comprises blood plasma + highly perfused organs (liver, kidneys, lungs, heart)."),
        ("b", "<b>Kidneys</b> perform glomerular filtration and tubular secretion — both require drug to be IN plasma"),
        ("b", "<b>Liver</b> performs hepatic metabolism and biliary excretion — requires drug in hepatic blood"),
        ("b", "Drug in the peripheral compartment (muscle, fat, bone) has <b>NO direct access</b> to excretory organs"),
        ("b", "Peripheral drug must first <b>redistribute back</b> to central compartment before elimination"),
        ("b", "This explains the characteristic <b>biphasic decline</b> on semi-log Cp-time plots"),
        ("note", "In mathematical terms: all elimination rate constants (K10, Ke) originate from compartment 1 (central) only."),
    ]),

    (10, "Give an example for Mono exponential equation.", [
        ("text", "A monoexponential equation has a single exponential term. The One-Compartment Open Model after IV Bolus is the classic example:"),
        ("eq",  "Cp(t)  =  Cp₀ · e^(–Ke·t)"),
        ("bold", "Log form:   log Cp(t)  =  log Cp₀  –  (Ke / 2.303) · t"),
        ("b", "Single exponential term → <b>straight line</b> on semi-log plot"),
        ("b", "Slope = –Ke / 2.303; Y-intercept = log Cp₀"),
        ("b", "Example drugs: Gentamicin, Tobramycin, most aminoglycosides"),
        ("note", "Monoexponential = one-compartment = instantaneous distribution throughout body."),
    ]),

    (11, "Give an example for Bi exponential equation.", [
        ("text", "A biexponential equation has TWO exponential terms. The Two-Compartment Open Model after IV Bolus follows:"),
        ("eq",  "Cp(t)  =  A · e^(–αt)  +  B · e^(–βt)"),
        ("table",
         ["Term", "Phase", "Meaning"],
         [["A · e^(–αt)", "α-phase (distribution)", "Fast decline — drug distributes from central to peripheral compartment"],
          ["B · e^(–βt)", "β-phase (elimination)", "Slow decline — drug eliminated from central compartment; α > β always"]],
         [4*cm, 4*cm, 9*cm]),
        ("b", "A, B = intercepts of respective phases on log Cp-time plot"),
        ("b", "α > β (distribution is faster than elimination)"),
        ("b", "Semi-log plot shows a <b>biphasic curve</b> (not straight line)"),
        ("b", "Example drugs: Lidocaine, Digoxin, Theophylline, Gentamicin (high doses)"),
    ]),

    (12, "Give the formula AUC 0–t & AUC 0–∞.", [
        ("bold", "AUC 0→t  (Linear Trapezoidal Rule):"),
        ("eq",  "AUC(0→t)  =  Σ [(Cp_i + Cp_(i+1)) / 2] × (t_(i+1) – t_i)"),
        ("bold", "AUC 0→∞  (Extrapolated to infinity):"),
        ("eq",  "AUC(0→∞)  =  AUC(0→t)  +  Cp_last / Ke"),
        ("b", "Cp_last = last measurable plasma concentration"),
        ("b", "Ke = terminal elimination rate constant (slope of log-linear terminal phase)"),
        ("b", "For IV Bolus: AUC(0→∞) = Cp₀ / Ke = Dose / Cl"),
        ("b", "Log-trapezoidal method is more accurate for declining concentration intervals"),
        ("note", "AUC is the area under the plasma concentration-time curve and represents total drug exposure."),
    ]),

    (13, "Give the equation to calculate bio-availability from urine data.", [
        ("bold", "Absolute Bioavailability (Urine Method):"),
        ("eq",  "F  =  (Xu∞_oral / Xu∞_IV)  ×  (Dose_IV / Dose_oral)"),
        ("bold", "Relative Bioavailability (Urine Method):"),
        ("eq",  "F_rel  =  (Xu∞_test / Xu∞_reference)  ×  (Dose_ref / Dose_test)  ×  100%"),
        ("b", "Xu∞ = total amount of unchanged drug excreted in urine (collected to completion)"),
        ("b", "Requires complete urine collection for ≥ 7 half-lives"),
        ("b", "Valid ONLY if renal excretion is the same fraction of total elimination for both routes"),
        ("b", "Used when plasma concentrations are too low to measure accurately"),
    ]),

    (14, "Give the formula for AUMC and MRT.", [
        ("bold", "AUMC (Area Under the First Moment Curve):"),
        ("eq",  "AUMC(0→∞)  =  ∫₀^∞ t · Cp · dt  =  Σ[(t_i·Cp_i + t_(i+1)·Cp_(i+1))/2 × Δt]  +  (t_last · Cp_last)/Ke  +  Cp_last/Ke²"),
        ("bold", "MRT (Mean Residence Time):"),
        ("eq",  "MRT  =  AUMC / AUC"),
        ("table",
         ["Route/Condition", "MRT Formula"],
         [["IV Bolus", "MRT = 1/Ke = 1.443 × t½"],
          ["IV Infusion (duration T)", "MRT = AUMC/AUC – T/2"],
          ["Oral", "MRT_oral = MRT_IV + MAT  (MAT = 1/Ka)"],
          ["Vdss from MRT", "Vdss = Cl × MRT = Dose × AUMC / AUC²"]],
         [4*cm, 13*cm]),
    ]),

    (15, "What is the difference between AUC and AUMC?", [
        ("table",
         ["Feature", "AUC", "AUMC"],
         [["Full Name", "Area Under Plasma Concentration-Time Curve", "Area Under First Moment Curve"],
          ["Mathematical form", "∫₀^∞ Cp · dt", "∫₀^∞ t · Cp · dt"],
          ["Plot axes", "Cp vs. time", "t × Cp vs. time"],
          ["Statistical Moment", "Zeroth moment", "First moment"],
          ["Units", "mg·h/L (or µg·h/mL)", "mg·h²/L"],
          ["Represents", "Total drug exposure; extent of absorption", "Time-weighted drug exposure"],
          ["Primary use", "Calculate Cl, F, bioequivalence", "Calculate MRT and Vdss"],
          ["Formula", "Cp₀/Ke (IV bolus)", "Cp₀/Ke² (IV bolus)"]],
         [3*cm, 7*cm, 7*cm]),
    ]),

    (16, "Give schematic representation for Physiological-Pharmacokinetic model.", [
        ("text", "A Physiological Pharmacokinetic (PBPK) model divides the body into anatomical organ compartments connected by blood flow:"),
        ("eq",  "Lung  →  Arterial Blood  →  [Liver | Kidney | Muscle | Fat | Brain | Other organs]  →  Venous Blood  →  Heart  →  Lung"),
        ("b", "Each organ compartment has: Volume (V_T), Blood flow (Q_T), Tissue partition coefficient (K_p = C_tissue / C_blood)"),
        ("b", "<b>Perfusion-limited model</b>: Blood flow is rate-limiting (highly perfused: liver, kidney, lung)"),
        ("b", "<b>Diffusion-limited model</b>: Membrane permeability is rate-limiting (poorly perfused: muscle, fat)"),
        ("b", "Rate equations for each organ: dC_T/dt = Q_T · (C_A – C_V) / V_T"),
        ("table",
         ["Organ", "Blood Flow (Q)", "Volume", "Role"],
         [["Liver", "1300 mL/min", "1.5 L", "Metabolism (Cl_int); first-pass"],
          ["Kidney", "1100 mL/min", "0.3 L", "Renal excretion; filtration + secretion"],
          ["Lung", "5000 mL/min", "0.6 L", "Gas exchange; inhalation route"],
          ["Muscle", "750 mL/min", "35 L", "Large depot; slow distribution"],
          ["Fat", "250 mL/min", "15 L", "Lipophilic drug storage"],
         ],
         [2.5*cm, 3.5*cm, 2.5*cm, 8.5*cm]),
        ("note", "PBPK models allow prediction of tissue concentrations and cross-species extrapolation."),
    ]),

    (17, "Write the tests to determine non-linearity.", [
        ("text", "The following tests are used to detect dose-dependent (nonlinear) pharmacokinetics:"),
        ("b", "<b>Dose-Proportionality Test</b>: Administer multiple dose levels; if AUC ∝ Dose → linear; if AUC increases disproportionately → nonlinear"),
        ("b", "<b>AUC vs. Dose Plot</b>: Linear → straight line through origin; Nonlinear → curved upward (saturable elimination)"),
        ("b", "<b>Half-life vs. Dose Test</b>: If t½ increases with increasing dose → saturable (Michaelis-Menten) metabolism"),
        ("b", "<b>Clearance vs. Concentration</b>: If Cl decreases as dose/Cp increases → saturable elimination"),
        ("b", "<b>Vd vs. Dose</b>: Change in Vd with dose → saturable protein or tissue binding"),
        ("b", "<b>Urine Metabolite Ratio</b>: Change in ratio of metabolites at high vs. low doses → saturation of a metabolic pathway"),
        ("b", "<b>Css vs. Infusion Rate (R₀) Plot</b>: If Css is disproportionately high at higher R₀ → Michaelis-Menten kinetics (classic: Phenytoin)"),
        ("note", "Phenytoin is the classic example: small dose increase near Km causes dramatic rise in Cp."),
    ]),

    (18, "Give the equations to calculate the steady state maximum, minimum and average drug concentrations.", [
        ("text", "For Repetitive IV Bolus — One-Compartment Open Model:"),
        ("bold", "Steady-State Maximum (Peak) Concentration:"),
        ("eq",  "Css_max  =  (Dose/Vd) / (1 – e^(–Ke·τ))"),
        ("bold", "Steady-State Minimum (Trough) Concentration:"),
        ("eq",  "Css_min  =  [(Dose/Vd) · e^(–Ke·τ)] / (1 – e^(–Ke·τ))"),
        ("bold", "Average Steady-State Concentration:"),
        ("eq",  "Css_avg  =  Dose / (Cl · τ)  =  Dose / (Ke · Vd · τ)  =  1.44 · t½ · Dose / (Vd · τ)"),
        ("b", "τ = dosing interval"),
        ("b", "Steady state is reached after ~4–5 half-lives regardless of dose or route"),
        ("b", "Fluctuation = Css_max – Css_min (decreases as τ decreases relative to t½)"),
        ("note", "For oral dosing: multiply by F (bioavailability) in the numerator."),
    ]),

    (19, "Give the plasma concentration time-plot for multiple dosing of an IV bolus.", [
        ("text", "After repeated equal IV bolus doses at fixed interval τ, drug accumulates until steady state:"),
        ("eq",  "Cp after nth dose:  Cp(n,t)  =  (Dose/Vd) × [(1 – e^(–n·Ke·τ)) / (1 – e^(–Ke·τ))] × e^(–Ke·t)"),
        ("table",
         ["Feature", "Description"],
         [["Shape", "Sawtooth pattern — rises sharply at each dose, then falls exponentially"],
          ["Accumulation", "Each successive dose adds to residual drug → progressive rise until SS"],
          ["Steady state", "Reached after 4–5 half-lives; Css_max & Css_min constant each interval"],
          ["Fluctuation", "Css_max – Css_min; depends on τ relative to t½"],
          ["Effect of τ", "Short τ → less fluctuation, higher average Css; long τ → more fluctuation"],
          ["Loading dose", "DL = Css_max × Vd → achieves SS immediately on first dose"]],
         [3.5*cm, 13.5*cm]),
        ("bold", "Key points on the plot:"),
        ("b", "Y-axis: Plasma concentration (mg/L); X-axis: Time (hours/days)"),
        ("b", "Horizontal dashed lines: Css_max (upper) and Css_min (lower) once SS is reached"),
        ("b", "MEC (Minimum Effective Concentration) and MTC (Minimum Toxic Concentration) are reference lines"),
    ]),

    (20, "Define dosing frequency.", [
        ("text", "Dosing frequency is the number of times a drug dose is administered per unit time (usually 24 hours). It is the reciprocal of the dosing interval (τ):"),
        ("eq",  "Dosing Frequency  =  1 / τ"),
        ("table",
         ["Dosing Frequency", "Latin Abbreviation", "Dosing Interval (τ)"],
         [["Once daily", "OD / QD", "24 hours"],
          ["Twice daily", "BID / BD", "12 hours"],
          ["Three times daily", "TID / TDS", "8 hours"],
          ["Four times daily", "QID / QDS", "6 hours"],
          ["Every 4 hours", "Q4H", "4 hours"]],
         [4*cm, 5*cm, 8*cm]),
        ("bold", "Factors Determining Dosing Frequency:"),
        ("b", "<b>Elimination half-life (t½)</b> — primary determinant; τ ≈ t½ for most drugs"),
        ("b", "<b>Therapeutic window</b> — drugs with narrow TI need frequent dosing to maintain Cp in range"),
        ("b", "<b>Required Css fluctuation</b> — smaller τ → less fluctuation between Css_max and Css_min"),
        ("b", "<b>Patient compliance</b> — once/twice daily preferred for better adherence"),
        ("note", "Optimal τ ≈ t½ maintains plasma concentration within the therapeutic range."),
    ]),
]

# ── Build story ───────────────────────────────────────────────────────────────
story = []

# COVER
story.append(Spacer(1, 38*mm))
story.append(Paragraph("BIOPHARMACEUTICS &amp; PHARMACOKINETICS", S("CT", fontName="Helvetica-Bold", fontSize=26, textColor=WHITE, alignment=TA_CENTER, spaceAfter=4)))
story.append(Spacer(1, 3*mm))
story.append(HRFlowable(width="55%", thickness=2.5, color=GOLD, spaceAfter=5))
story.append(Paragraph("2-MARK QUESTIONS &amp; MODEL ANSWERS", S("CS", fontName="Helvetica-Bold", fontSize=16, textColor=GOLD, alignment=TA_CENTER, spaceAfter=4)))
story.append(Spacer(1, 3*mm))
story.append(Paragraph("Pharm.D  4th Year  •  Subject 4.5", S("CD", fontName="Helvetica", fontSize=12, textColor=colors.HexColor("#b3d9e8"), alignment=TA_CENTER)))
story.append(Spacer(1, 2*mm))
story.append(Paragraph("PCI Regulations 2008  •  Questions 1–20", S("CD2", fontName="Helvetica-Oblique", fontSize=11, textColor=colors.HexColor("#7fbfcf"), alignment=TA_CENTER)))
story.append(Spacer(1, 22*mm))

# Cover index table
idx_data = [[Paragraph("<b>Q.No</b>", TH), Paragraph("<b>Question</b>", TH)]]
for num, q, _ in QA:
    idx_data.append([Paragraph(str(num), TC), Paragraph(q, TC)])
idx_t = Table(idx_data, colWidths=[1.5*cm, 15.5*cm])
idx_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0),  GOLD),
    ("BACKGROUND",    (0,1),(-1,-1), colors.HexColor("#142040")),
    ("ROWBACKGROUNDS",(0,1),(-1,-1), [colors.HexColor("#142040"), colors.HexColor("#0d1a30")]),
    ("TEXTCOLOR",     (0,0),(-1,0),  NAVY),
    ("TEXTCOLOR",     (0,1),(-1,-1), WHITE),
    ("FONTNAME",      (0,0),(-1,0),  "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1), 8.5),
    ("GRID",          (0,0),(-1,-1), 0.3, colors.HexColor("#1e3a5c")),
    ("TOPPADDING",    (0,0),(-1,-1), 5),
    ("BOTTOMPADDING", (0,0),(-1,-1), 5),
    ("LEFTPADDING",   (0,0),(-1,-1), 7),
    ("ALIGN",         (0,0),(0,-1),  "CENTER"),
]))
story.append(idx_t)
story.append(PageBreak())

# ── Each Q&A block ─────────────────────────────────────────────────────────────
for num, question, content in QA:
    block = []

    # Question header bar
    q_data = [[Paragraph(f"Q{num}.  {question}", S("QH",
        fontName="Helvetica-Bold", fontSize=10.5, textColor=WHITE, leading=15))]]
    q_t = Table(q_data, colWidths=[17*cm])
    q_t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), NAVY),
        ("TOPPADDING",    (0,0),(-1,-1), 8),
        ("BOTTOMPADDING", (0,0),(-1,-1), 8),
        ("LEFTPADDING",   (0,0),(-1,-1), 12),
    ]))
    block.append(q_t)

    # Answer area
    ans_items = []
    ans_items.append(Spacer(1, 2*mm))

    for item in content:
        if item[0] == "text":
            ans_items.append(Paragraph(item[1], BODYJ))
        elif item[0] == "bold":
            ans_items.append(Paragraph(item[1], BOLD))
        elif item[0] == "eq":
            ans_items.append(eq_box(item[1]))
            ans_items.append(Spacer(1, 1*mm))
        elif item[0] == "b":
            ans_items.append(Paragraph(f"• {item[1]}", BULL))
        elif item[0] == "b2":
            ans_items.append(Paragraph(f"  ◦ {item[1]}", BULL2))
        elif item[0] == "table":
            _, headers, rows, widths = item
            ans_items.append(make_table(headers, rows, widths))
            ans_items.append(Spacer(1, 1*mm))
        elif item[0] == "note":
            note_t = Table([[Paragraph(f"📌 {item[1]}", S("NT",
                fontName="Helvetica-Oblique", fontSize=8.5, textColor=colors.HexColor("#5d4037"), leading=13))]],
                colWidths=[17*cm])
            note_t.setStyle(TableStyle([
                ("BACKGROUND",    (0,0),(-1,-1), colors.HexColor("#fff3e0")),
                ("TOPPADDING",    (0,0),(-1,-1), 5),
                ("BOTTOMPADDING", (0,0),(-1,-1), 5),
                ("LEFTPADDING",   (0,0),(-1,-1), 10),
                ("BOX",           (0,0),(-1,-1), 1, GOLD),
            ]))
            ans_items.append(note_t)
        elif item[0] == "sp":
            ans_items.append(Spacer(1, 2*mm))

    ans_items.append(Spacer(1, 2*mm))

    # Wrap answer in a light box
    ans_t = Table([[ans_items]], colWidths=[17*cm])
    ans_t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), WHITE),
        ("TOPPADDING",    (0,0),(-1,-1), 2),
        ("BOTTOMPADDING", (0,0),(-1,-1), 2),
        ("LEFTPADDING",   (0,0),(-1,-1), 4),
        ("RIGHTPADDING",  (0,0),(-1,-1), 4),
        ("BOX",           (0,0),(-1,-1), 0.8, colors.HexColor("#b0bec5")),
        ("LINEBELOW",     (0,0),(-1,-1), 2, TEAL),
    ]))
    block.append(ans_t)
    block.append(Spacer(1, 4*mm))

    story.append(KeepTogether(block[:2]))  # Keep Q header with first part of answer
    story.extend(block[2:])

# Footer note
story.append(Spacer(1, 5*mm))
story.append(HRFlowable(width="100%", thickness=0.5, color=TEAL))
story.append(Spacer(1, 2*mm))
story.append(Paragraph(
    f"<i>BPPK 4th Year Pharm.D  |  Subject 4.5 Biopharmaceutics &amp; Pharmacokinetics  |  "
    f"Questions 1–20  |  PCI Regulations 2008  |  Generated {datetime.date.today().strftime('%B %Y')}  |  For Educational Use Only</i>",
    S("Ft", fontName="Helvetica-Oblique", fontSize=8, textColor=MIDGRAY, alignment=TA_CENTER)
))

# ── Compile PDF ───────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=2*cm, rightMargin=2*cm,
    topMargin=26*mm, bottomMargin=16*mm,
    title="BPPK 4th Year Biopharmaceutics 2-Mark Q&A",
    author="Pharm.D Study",
    subject="Biopharmaceutics & Pharmacokinetics 2-Mark Answers"
)

doc.build(story, onFirstPage=cover_bg, onLaterPages=header_footer)

import os
size = os.path.getsize(OUTPUT)
print(f"PDF created: {OUTPUT}")
print(f"Size: {size/1024:.1f} KB")
Running Command

cd /tmp/workspace/bppk-pharmd-study-guide && python generate_2marks_pdf.py 2>&1

Your PDF is ready! Download it here:

BPPK 2Mark QA

PDF Document · PDF


What's inside the PDF:
  • Cover page with full question index (Q1–Q20 listed at a glance)
  • All 20 two-mark questions with complete model answers including:
    • Q1–Q9 (from your first paper image)
    • Q10–Q20 (from this second paper image)
  • Each question has its own colored header banner
  • Equation boxes for all formulas (highlighted in blue)
  • Tables for comparisons (e.g., AUC vs AUMC, extraction ratio classes, BCS, etc.)
  • Bullet-point answers formatted for quick revision
  • Note boxes (in amber) for important reminders and exceptions
  • Header & footer on every page with page numbers
This is a shared conversation. Sign in to Orris to start your own chat.