Prepare notes for this topics
| Component | Definition |
|---|---|
| Drug Actions | How a drug interacts with its molecular target (receptor, enzyme, transporter) |
| Mechanisms of Action | The precise molecular/cellular events triggered by the drug |
| Therapeutic Uses | Clinical applications to prevent, diagnose, or treat disease |
| Subdivision | Focus |
|---|---|
| Pharmacokinetics (PK) | What the body does to the drug - Absorption, Distribution, Metabolism, Excretion (ADME) |
| Pharmacodynamics (PD) | What the drug does to the body - mechanisms of action, receptor interactions, dose-response |
| Toxicology | Harmful effects of chemicals on living systems |
| Pharmacogenomics | Relationship between a patient's genetic makeup and their response to specific drugs |
| Clinical Pharmacology | Application of pharmacological principles to patient care |
| Neuropharmacology | Drug effects on the nervous system |
| Chemotherapy | Drug effects on invading organisms or cancer cells |
| Immunopharmacology | Drug effects on the immune system |
Pharmacology sits at the intersection of anatomy, biochemistry, genetics, physiology, pathology, and clinical medicine.
| Parameter | Meaning |
|---|---|
| Half-life (t½) | Time for plasma concentration to fall by 50% |
| Volume of distribution (Vd) | Apparent volume in which drug is distributed |
| Clearance (CL) | Rate of drug elimination per unit plasma concentration |
| Bioavailability (F) | Fraction of administered dose reaching systemic circulation |
TI = TD50 / ED50
Plasma MTC --------
Concentration | Therapeutic Window
MEC --------
___
/ \
/ \
/ \___________
---/----Time (hours)----->
| Type | Description | Example |
|---|---|---|
| Type A (Augmented) | Predictable, dose-dependent, extension of pharmacological effect | Hypoglycemia with insulin overdose |
| Type B (Bizarre) | Unpredictable, not dose-dependent, idiosyncratic or immunological | Anaphylaxis to penicillin |
| Type C (Chronic) | Long-term use effects | Adrenal suppression with corticosteroids |
| Type D (Delayed) | Appear after stopping drug | Tardive dyskinesia after antipsychotics |
| Name Type | Description | Example |
|---|---|---|
| Chemical name | IUPAC systematic chemical structure | N-(4-hydroxyphenyl)acetamide |
| Generic (INN) name | International Nonproprietary Name - official, non-commercial | paracetamol / acetaminophen |
| Brand (proprietary) name | Manufacturer's trade name; capitalized | Tylenol® |
| Stem | Drug Class | Examples |
|---|---|---|
| -olol | Beta-adrenoceptor blockers (beta-blockers) | propranolol, atenolol, bisoprolol, metoprolol |
| -pril | ACE inhibitors (angiotensin-converting enzyme inhibitors) | lisinopril, enalapril, ramipril, captopril |
| -cillin | Penicillin antibiotics (beta-lactams) | ampicillin, amoxicillin, flucloxacillin |
| -statin | HMG-CoA reductase inhibitors (lipid-lowering agents) | atorvastatin, rosvustatin, simvastatin |
| -sartan | Angiotensin II receptor blockers (ARBs) | losartan, valsartan, irbesartan |
| -mab | Monoclonal antibodies | trastuzumab, rituximab, adalimumab |
| -nib | Tyrosine kinase inhibitors | imatinib, gefitinib, erlotinib |
| -vir | Antiviral drugs | aciclovir, oseltamivir |
| -azole | Antifungals / proton-pump inhibitors | omeprazole, fluconazole |
| -dipine | Dihydropyridine calcium channel blockers | amlodipine, nifedipine |
| -mycin / -micin | Antibiotics (aminoglycosides / macrolides) | erythromycin, gentamicin |
| -cycline | Tetracycline antibiotics | doxycycline, tetracycline |
| Prefix | Meaning | Example |
|---|---|---|
| Es- | S-enantiomer of a racemic drug (single optical isomer) | Esomeprazole (S-enantiomer of omeprazole), escitalopram |
| Levo- (or L-) | Levorotatory isomer (rotates polarized light to the left) | Levothyroxine (L-T4), levofloxacin, levocetirizine |
| Dex- / Dextro- | Dextrorotatory isomer | Dextromethorphan, dexamfetamine |
| Nor- | Parent compound without an N-methyl group | Norepinephrine (parent of epinephrine) |
| Iso- | Isomeric form | Isoproterenol |
| Class | Mechanism | Examples |
|---|---|---|
| Beta-blockers | Block β-adrenergic receptors | Propranolol (non-selective), atenolol (β1-selective) |
| ACE inhibitors | Inhibit angiotensin-converting enzyme → ↓ angiotensin II, ↑ bradykinin | Lisinopril, enalapril |
| Statins | Inhibit HMG-CoA reductase → ↓ cholesterol synthesis | Atorvastatin, rosuvastatin |
| Penicillins | Inhibit bacterial cell wall synthesis (cross-link peptidoglycan) | Ampicillin, amoxicillin |
| Proton pump inhibitors | Irreversibly inhibit H+/K+-ATPase in gastric parietal cells | Omeprazole, esomeprazole |
| Factor | Details |
|---|---|
| Potency | Dose needed for a given effect (high potency = less drug needed) |
| Efficacy | Maximum achievable effect regardless of dose |
| Selectivity | Degree to which a drug acts on one receptor/tissue vs others |
| Duration of action | Influenced by half-life, protein binding, formulation |
| Route of administration | Oral, IV, IM, SC, topical, inhaled - affects bioavailability and onset |
| Adverse effect profile | Type A vs B reactions; organ toxicity profile |
| Drug interactions | PK and PD interactions with co-medications |
| Therapeutic index | Safety margin; narrow TI drugs require therapeutic drug monitoring |
| Formulation | Immediate-release vs. modified-release affects PK |
| Concept | Key Point |
|---|---|
| Pharmacology definition | Study of substances interacting with living systems via chemical processes |
| Pharmacokinetics | ADME - what the body does to the drug |
| Pharmacodynamics | Drug-receptor interactions - what the drug does to the body |
| Agonist | Binds + activates receptor |
| Antagonist | Binds but does NOT activate; blocks agonist |
| Partial agonist | Submaximal response even at full receptor occupancy; mixed agonist-antagonist |
| Allosteric modulator | Acts at site different from agonist binding site |
| Therapeutic Index | TD50/ED50; narrow TI = close monitoring needed |
| -olol | Beta-blockers (propranolol, atenolol) |
| -pril | ACE inhibitors (lisinopril, enalapril) |
| -cillin | Penicillins (ampicillin, amoxicillin) |
| -statin | HMG-CoA reductase inhibitors (atorvastatin) |
| Es- prefix | S-enantiomer (esomeprazole) |
| Levo- prefix | Levorotatory isomer (levothyroxine) |
Generate a DOCX study guide with flowcharts for drug classification
ls /home/daytona/workspace/ && node --version && ls /home/daytona/skills/docx/
mkdir -p /home/daytona/workspace/pharmacology-guide && ls /home/daytona/skills/d…
cd /home/daytona/workspace/pharmacology-guide && npm install docx 2>&1 | tail -5
node -e "require('docx'); console.log('docx available')" 2>/dev/null || ls /usr/…
~/pharmacology-guide/generate.js
'use strict';
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
VerticalAlign, PageBreak, TabStopType, TabStopPosition,
Header, Footer, PageNumber, NumberFormat, UnderlineType,
LevelFormat, convertInchesToTwip, TableOfContents
} = require('docx');
const fs = require('fs');
// ── Colour palette ──────────────────────────────────────────
const BLUE_DARK = '1F3864'; // navy headings
const BLUE_MID = '2E75B6'; // section heading fill
const BLUE_LIGHT = 'D6E4F0'; // table header rows
const TEAL = '00B0A0'; // flowchart boxes
const TEAL_LIGHT = 'E0F5F3'; // flowchart light
const AMBER = 'F5A623'; // highlight / callout
const AMBER_LIGHT= 'FEF3DB'; // callout background
const GRAY_LIGHT = 'F2F2F2'; // alternating table rows
const WHITE = 'FFFFFF';
// ── Border helper ────────────────────────────────────────────
const solidBorder = (color = '999999', sz = 6) => ({
style: BorderStyle.SINGLE, size: sz, color
});
const noBorder = { style: BorderStyle.NONE, size: 0, color: 'FFFFFF' };
const allNoBorders = { top: noBorder, bottom: noBorder, left: noBorder, right: noBorder };
// ── Text helpers ─────────────────────────────────────────────
const bold = (t, sz = 22, color = '000000') => new TextRun({ text: t, bold: true, size: sz, color });
const normal = (t, sz = 20, color = '000000') => new TextRun({ text: t, bold: false, size: sz, color });
const italic = (t, sz = 20, color = '555555') => new TextRun({ text: t, italics: true, size: sz, color });
const colorBold = (t, color, sz = 20) => new TextRun({ text: t, bold: true, size: sz, color });
const para = (runs, opts = {}) => new Paragraph({ children: Array.isArray(runs) ? runs : [runs], ...opts });
const spacer = (before = 100, after = 100) =>
new Paragraph({ children: [new TextRun('')], spacing: { before, after } });
// ── Heading helpers ──────────────────────────────────────────
const h1 = text => new Paragraph({
children: [new TextRun({ text, bold: true, size: 36, color: WHITE })],
heading: HeadingLevel.HEADING_1,
shading: { type: ShadingType.CLEAR, color: BLUE_DARK, fill: BLUE_DARK },
spacing: { before: 300, after: 200 },
indent: { left: convertInchesToTwip(0.1) }
});
const h2 = text => new Paragraph({
children: [new TextRun({ text, bold: true, size: 28, color: WHITE })],
heading: HeadingLevel.HEADING_2,
shading: { type: ShadingType.CLEAR, color: BLUE_MID, fill: BLUE_MID },
spacing: { before: 240, after: 120 },
indent: { left: convertInchesToTwip(0.1) }
});
const h3 = text => new Paragraph({
children: [new TextRun({ text, bold: true, size: 24, color: BLUE_DARK })],
heading: HeadingLevel.HEADING_3,
border: { bottom: solidBorder(BLUE_MID, 8) },
spacing: { before: 200, after: 100 }
});
const h4 = text => new Paragraph({
children: [new TextRun({ text, bold: true, size: 22, color: BLUE_MID })],
spacing: { before: 160, after: 80 }
});
// ── Bullet helper ────────────────────────────────────────────
const bullet = (text, level = 0) => new Paragraph({
children: [normal(text, 20)],
bullet: { level },
spacing: { before: 40, after: 40 }
});
const bulletBold = (label, text, level = 0) => new Paragraph({
children: [bold(label + ' ', 20), normal(text, 20)],
bullet: { level },
spacing: { before: 40, after: 40 }
});
// ── Callout box (amber) ──────────────────────────────────────
const callout = lines => [
new Paragraph({
children: lines.map((l, i) => i === 0
? new TextRun({ text: l, bold: true, size: 20, color: '7B4000' })
: new TextRun({ text: '\n' + l, size: 20, color: '7B4000' })
),
shading: { type: ShadingType.CLEAR, color: AMBER_LIGHT, fill: AMBER_LIGHT },
border: {
left: { style: BorderStyle.SINGLE, size: 24, color: AMBER }
},
indent: { left: convertInchesToTwip(0.2), right: convertInchesToTwip(0.2) },
spacing: { before: 100, after: 100 }
})
];
// ── Simple data table ────────────────────────────────────────
function dataTable(headers, rows, colWidths) {
const totalWidth = colWidths.reduce((a, b) => a + b, 0);
const headerRow = new TableRow({
children: headers.map((h, i) => new TableCell({
children: [new Paragraph({
children: [new TextRun({ text: h, bold: true, size: 20, color: WHITE })],
alignment: AlignmentType.CENTER
})],
shading: { type: ShadingType.CLEAR, color: BLUE_DARK, fill: BLUE_DARK },
width: { size: Math.round((colWidths[i] / totalWidth) * 9000), type: WidthType.DXA },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 80, bottom: 80, left: 100, right: 100 }
}))
});
const dataRows = rows.map((row, ri) => new TableRow({
children: row.map((cell, ci) => new TableCell({
children: [new Paragraph({
children: typeof cell === 'string'
? [new TextRun({ text: cell, size: 18 })]
: cell,
alignment: AlignmentType.LEFT
})],
shading: {
type: ShadingType.CLEAR,
color: ri % 2 === 0 ? GRAY_LIGHT : WHITE,
fill: ri % 2 === 0 ? GRAY_LIGHT : WHITE
},
width: { size: Math.round((colWidths[ci] / totalWidth) * 9000), type: WidthType.DXA },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 60, bottom: 60, left: 100, right: 100 }
}))
}));
return new Table({
rows: [headerRow, ...dataRows],
width: { size: 9000, type: WidthType.DXA },
borders: {
top: solidBorder('BBBBBB', 4), bottom: solidBorder('BBBBBB', 4),
left: solidBorder('BBBBBB', 4), right: solidBorder('BBBBBB', 4),
insideH: solidBorder('DDDDDD', 2), insideV: solidBorder('DDDDDD', 2)
}
});
}
// ── Flowchart box builder ─────────────────────────────────────
// We simulate a flowchart as a borderless table with styled cells + arrows
function flowBox(text, fill = TEAL, textColor = WHITE, sz = 20) {
return new TableCell({
children: [new Paragraph({
children: [new TextRun({ text, bold: true, size: sz, color: textColor })],
alignment: AlignmentType.CENTER,
spacing: { before: 80, after: 80 }
})],
shading: { type: ShadingType.CLEAR, color: fill, fill },
borders: {
top: solidBorder(TEAL, 8), bottom: solidBorder(TEAL, 8),
left: solidBorder(TEAL, 8), right: solidBorder(TEAL, 8)
},
verticalAlign: VerticalAlign.CENTER,
margins: { top: 60, bottom: 60, left: 120, right: 120 },
width: { size: 3200, type: WidthType.DXA }
});
}
function arrowCell(symbol = '↓') {
return new TableCell({
children: [new Paragraph({
children: [new TextRun({ text: symbol, bold: true, size: 28, color: BLUE_MID })],
alignment: AlignmentType.CENTER
})],
borders: allNoBorders,
shading: { type: ShadingType.CLEAR, color: WHITE, fill: WHITE },
width: { size: 600, type: WidthType.DXA },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 20, bottom: 20, left: 60, right: 60 }
});
}
function spacerCell(w = 1000) {
return new TableCell({
children: [para('')],
borders: allNoBorders,
shading: { type: ShadingType.CLEAR, color: WHITE, fill: WHITE },
width: { size: w, type: WidthType.DXA }
});
}
function flowRow(cells) {
return new TableRow({ children: cells });
}
// Vertical flowchart (single column, boxes stacked with arrows)
function verticalFlowchart(steps) {
// steps: [{label, fill, textColor}]
const rows = [];
steps.forEach((step, i) => {
rows.push(new TableRow({
children: [
spacerCell(2800),
flowBox(step.label, step.fill || TEAL, step.textColor || WHITE, 20),
spacerCell(2800)
]
}));
if (i < steps.length - 1) {
rows.push(new TableRow({
children: [
spacerCell(2800),
arrowCell('↓'),
spacerCell(2800)
]
}));
}
});
return new Table({
rows,
width: { size: 9000, type: WidthType.DXA },
borders: {
top: noBorder, bottom: noBorder, left: noBorder, right: noBorder,
insideH: noBorder, insideV: noBorder
}
});
}
// Horizontal flowchart
function horizontalFlowchart(steps, arrowSym = '→') {
const cells = [];
steps.forEach((step, i) => {
cells.push(flowBox(step.label, step.fill || TEAL, step.textColor || WHITE, 18));
if (i < steps.length - 1) cells.push(arrowCell(arrowSym));
});
return new Table({
rows: [new TableRow({ children: cells })],
width: { size: 9000, type: WidthType.DXA },
borders: {
top: noBorder, bottom: noBorder, left: noBorder, right: noBorder,
insideH: noBorder, insideV: noBorder
}
});
}
// Branch flowchart: top node → N children
function branchFlowchart(rootLabel, branches) {
// Row 1: root spanning full width
const rootRow = new TableRow({
children: [
spacerCell(800),
new TableCell({
children: [new Paragraph({
children: [new TextRun({ text: rootLabel, bold: true, size: 22, color: WHITE })],
alignment: AlignmentType.CENTER,
spacing: { before: 80, after: 80 }
})],
shading: { type: ShadingType.CLEAR, color: BLUE_DARK, fill: BLUE_DARK },
columnSpan: branches.length * 2 - 1,
borders: {
top: solidBorder(BLUE_DARK, 8), bottom: solidBorder(BLUE_DARK, 8),
left: solidBorder(BLUE_DARK, 8), right: solidBorder(BLUE_DARK, 8)
},
verticalAlign: VerticalAlign.CENTER,
margins: { top: 80, bottom: 80, left: 120, right: 120 },
width: { size: 7800, type: WidthType.DXA }
}),
spacerCell(800)
]
});
// Row 2: arrows
const arrowCells = [spacerCell(800)];
branches.forEach((b, i) => {
arrowCells.push(arrowCell('↓'));
if (i < branches.length - 1) arrowCells.push(spacerCell(200));
});
arrowCells.push(spacerCell(800));
const arrowRow = new TableRow({ children: arrowCells });
// Row 3: branch boxes
const branchCells = [spacerCell(800)];
branches.forEach((b, i) => {
branchCells.push(new TableCell({
children: [
new Paragraph({
children: [new TextRun({ text: b.label, bold: true, size: 18, color: WHITE })],
alignment: AlignmentType.CENTER,
spacing: { before: 60, after: 20 }
}),
new Paragraph({
children: [new TextRun({ text: b.sub || '', size: 16, color: 'EEEEEE', italics: true })],
alignment: AlignmentType.CENTER,
spacing: { before: 0, after: 60 }
})
],
shading: { type: ShadingType.CLEAR, color: b.fill || TEAL, fill: b.fill || TEAL },
borders: {
top: solidBorder(b.fill || TEAL, 8), bottom: solidBorder(b.fill || TEAL, 8),
left: solidBorder(b.fill || TEAL, 8), right: solidBorder(b.fill || TEAL, 8)
},
verticalAlign: VerticalAlign.CENTER,
margins: { top: 60, bottom: 60, left: 80, right: 80 },
width: { size: Math.floor(7800 / branches.length) - 200, type: WidthType.DXA }
}));
if (i < branches.length - 1) branchCells.push(spacerCell(200));
});
branchCells.push(spacerCell(800));
const branchRow = new TableRow({ children: branchCells });
return new Table({
rows: [rootRow, arrowRow, branchRow],
width: { size: 9500, type: WidthType.DXA },
borders: {
top: noBorder, bottom: noBorder, left: noBorder, right: noBorder,
insideH: noBorder, insideV: noBorder
}
});
}
// ════════════════════════════════════════════════════════════════
// DOCUMENT CONTENT
// ════════════════════════════════════════════════════════════════
const children = [];
// ── COVER ────────────────────────────────────────────────────
children.push(
spacer(400, 200),
new Paragraph({
children: [new TextRun({ text: 'PHARMACOLOGY', bold: true, size: 72, color: BLUE_DARK })],
alignment: AlignmentType.CENTER,
spacing: { before: 200, after: 60 }
}),
new Paragraph({
children: [new TextRun({ text: 'Study Guide with Drug Classification Flowcharts', size: 36, color: BLUE_MID, italics: true })],
alignment: AlignmentType.CENTER,
spacing: { before: 0, after: 80 }
}),
new Paragraph({
children: [new TextRun({ text: '─────────────────────────────────────', size: 24, color: BLUE_MID })],
alignment: AlignmentType.CENTER,
spacing: { before: 40, after: 80 }
}),
new Paragraph({
children: [new TextRun({ text: 'Topics Covered:', bold: true, size: 24, color: BLUE_DARK })],
alignment: AlignmentType.CENTER,
spacing: { before: 40, after: 40 }
}),
new Paragraph({
children: [new TextRun({ text: '1. Introduction to Pharmacology', size: 22, color: '333333' })],
alignment: AlignmentType.CENTER, spacing: { before: 20, after: 20 }
}),
new Paragraph({
children: [new TextRun({ text: '2. Definition and Scope of Pharmacology', size: 22, color: '333333' })],
alignment: AlignmentType.CENTER, spacing: { before: 20, after: 20 }
}),
new Paragraph({
children: [new TextRun({ text: '3. Drug Nomenclature and Classification Systems', size: 22, color: '333333' })],
alignment: AlignmentType.CENTER, spacing: { before: 20, after: 20 }
}),
spacer(200, 80),
new Paragraph({
children: [new TextRun({ text: 'Source: Katzung\'s Basic and Clinical Pharmacology, 16th Edition', size: 18, color: '777777', italics: true })],
alignment: AlignmentType.CENTER
}),
new Paragraph({ children: [new PageBreak()], spacing: { before: 0, after: 0 } })
);
// ── SECTION 1: INTRODUCTION ──────────────────────────────────
children.push(
h1('SECTION 1: Introduction to Pharmacology'),
spacer(120, 60),
h2('1.1 What is Pharmacology?'),
spacer(60, 40),
para([normal('Pharmacology is defined as the ', 20), bold('study of substances that interact with living systems', 20, BLUE_DARK), normal(' through chemical processes. These interactions occur by binding of the substance to regulatory molecules, activating or inhibiting normal body processes.', 20)]),
spacer(80, 60),
...callout([
'Key Definition',
'Medical Pharmacology = the science of substances used to PREVENT, DIAGNOSE, and TREAT disease.',
'Toxicology = the branch of pharmacology dealing with UNDESIRABLE effects of chemicals.'
]),
spacer(80, 60),
h3('Historical Milestones'),
bullet('~1500 AD: Rational methods began replacing theoretical speculation in medicine'),
bullet('18th-19th c: Magendie & Bernard developed experimental pharmacology'),
bullet('1940s-50s: Rapid expansion - discovery of drug receptors and molecular mechanisms'),
bullet('Today: Pharmacogenomics, biologics, and targeted therapies dominate research'),
spacer(100, 60),
h2('1.2 Flowchart: Scope of Pharmacology'),
spacer(60, 40)
);
// Flowchart 1: Scope of Pharmacology
children.push(
branchFlowchart('PHARMACOLOGY', [
{ label: 'Pharmacokinetics', sub: 'What body does to drug', fill: '1F3864' },
{ label: 'Pharmacodynamics', sub: 'What drug does to body', fill: '2E75B6' },
{ label: 'Toxicology', sub: 'Harmful effects', fill: 'C0392B' },
{ label: 'Pharmacogenomics', sub: 'Genetics & drug response', fill: '27AE60' }
]),
spacer(120, 80),
h2('1.3 Key Pharmacodynamic Terms'),
spacer(60, 40)
);
// Table: Pharmacodynamic terms
children.push(
dataTable(
['Term', 'Definition', 'Example'],
[
['Agonist', 'Binds to receptor AND activates it; mimics endogenous ligand', 'Salbutamol at β2 receptors'],
['Full Agonist', 'Produces maximum possible response (100% efficacy)', 'Morphine at μ-opioid receptors'],
['Partial Agonist', 'Produces sub-maximal response even at full receptor occupancy; acts as mixed agonist-antagonist', 'Buprenorphine at μ-opioid receptors'],
['Inverse Agonist', 'Binds receptor but reduces activity below baseline', 'Some antihistamines at H1 receptors'],
['Competitive Antagonist', 'Blocks agonist by competing for same binding site; effect reversible by increasing agonist', 'Propranolol blocks adrenaline at β receptors'],
['Non-competitive Antagonist', 'Binds irreversibly or at allosteric site; reduces maximal response', 'Phenoxybenzamine at α receptors'],
['Positive Allosteric Modulator', 'Binds different site; enhances receptor activity', 'Benzodiazepines potentiate GABA-A'],
['Potency', 'Amount of drug needed for a given effect (EC50)', 'High potency = less drug needed'],
['Efficacy', 'Maximum pharmacological effect achievable regardless of dose', 'Ceiling effect of partial agonists']
],
[25, 45, 30]
),
spacer(120, 80)
);
// Flowchart 2: Agonist-Antagonist Spectrum
children.push(
h2('1.4 Flowchart: Agonist-Antagonist Drug Spectrum'),
spacer(60, 40),
horizontalFlowchart([
{ label: 'Full Agonist\n(100% response)', fill: '27AE60' },
{ label: 'Partial Agonist\n(<100% response)', fill: '2E75B6' },
{ label: 'Antagonist\n(0% / blocks)', fill: BLUE_DARK },
{ label: 'Inverse Agonist\n(< Baseline)', fill: 'C0392B' }
], '→'),
spacer(60, 40),
...callout([
'Clinical Pearl: Partial Agonists',
'Buprenorphine (partial agonist) is safer than fentanyl (full agonist) in opioid therapy because it suppresses breathing less strongly. However, it can antagonize other opioids in combined use.'
]),
spacer(120, 80)
);
// Therapeutic Index
children.push(
h2('1.5 Therapeutic Index'),
spacer(60, 40),
para([bold('Therapeutic Index (TI) = TD50 ÷ ED50', 22, BLUE_DARK)], { alignment: AlignmentType.CENTER, spacing: { before: 80, after: 80 } }),
spacer(40, 40),
dataTable(
['Term', 'Meaning'],
[
['ED50', 'Dose effective in 50% of the population'],
['TD50', 'Dose toxic in 50% of the population'],
['LD50', 'Lethal dose in 50% of animals (preclinical)'],
['Narrow TI', 'Small margin; requires therapeutic drug monitoring (e.g., digoxin, warfarin, lithium, aminoglycosides)'],
['Wide TI', 'Large safety margin; less monitoring needed (e.g., penicillins, most statins)']
],
[30, 70]
),
spacer(120, 80)
);
// Pharmacokinetics
children.push(
h2('1.6 Pharmacokinetics (PK) - ADME'),
spacer(60, 40),
para([normal('Pharmacokinetics describes ', 20), bold('what the body does to the drug', 20, BLUE_MID), normal(' - encompassing Absorption, Distribution, Metabolism, and Excretion.', 20)]),
spacer(80, 60)
);
// Flowchart 3: ADME
children.push(
h3('Flowchart: The ADME Process'),
spacer(60, 40),
verticalFlowchart([
{ label: 'ADMINISTRATION\n(Oral / IV / IM / SC / Inhaled)', fill: BLUE_DARK },
{ label: 'A - ABSORPTION\nDrug enters bloodstream from site of administration\nInfluenced by: solubility, formulation, first-pass metabolism', fill: '2980B9' },
{ label: 'D - DISTRIBUTION\nDrug moves from blood into tissues\nInfluenced by: plasma protein binding, lipid solubility, Vd', fill: '2E75B6' },
{ label: 'M - METABOLISM\nPrimarily hepatic (CYP450 enzymes)\nPhase I: oxidation/reduction | Phase II: conjugation', fill: '1A5276' },
{ label: 'E - EXCRETION\nPrimarily renal; also biliary, pulmonary\nDepends on glomerular filtration, tubular secretion', fill: '154360' },
{ label: 'ELIMINATION\nDrug cleared from body\nHalf-life determines dosing frequency', fill: BLUE_DARK }
]),
spacer(80, 60),
dataTable(
['PK Parameter', 'Definition', 'Clinical Relevance'],
[
['Half-life (t½)', 'Time for plasma concentration to fall by 50%', 'Determines dosing interval; ~5 × t½ to reach steady state'],
['Volume of Distribution (Vd)', 'Apparent volume in which drug distributes', 'High Vd = extensive tissue binding; low Vd = stays in plasma'],
['Clearance (CL)', 'Rate of elimination per unit plasma concentration', 'Determines maintenance dose'],
['Bioavailability (F)', 'Fraction of oral dose reaching systemic circulation', 'IV = 100%; oral varies due to first-pass effect'],
['AUC', 'Area under plasma concentration-time curve', 'Reflects total drug exposure; used to determine bioequivalence']
],
[25, 38, 37]
),
spacer(120, 80)
);
// Concentration-time curve (text-based)
children.push(
h2('1.7 Drug Concentration-Time Curve'),
spacer(60, 40),
para([normal('The plasma concentration-time curve shows how drug concentration changes over time after a single dose.', 20)]),
spacer(60, 40),
dataTable(
['Feature', 'Definition'],
[
['Cmax', 'Peak plasma concentration reached'],
['Tmax', 'Time at which Cmax is reached'],
['MEC (Min. Effective Concentration)', 'Minimum plasma level needed for therapeutic effect'],
['MTC (Min. Toxic Concentration)', 'Plasma level above which toxicity occurs'],
['Therapeutic Window', 'Range between MEC and MTC — target for dosing'],
['AUC', 'Total drug exposure (area under the curve)'],
['Rising phase', 'Absorption phase — drug entering blood faster than elimination'],
['Falling phase', 'Elimination phase — slope reflects half-life']
],
[40, 60]
),
spacer(80, 60),
...callout([
'Key Concept: Therapeutic Window',
'Target: maintain plasma concentration ABOVE MEC (effective) and BELOW MTC (toxic).',
'Narrow therapeutic window drugs (digoxin, phenytoin, lithium) require regular plasma level monitoring.'
]),
spacer(120, 80),
new Paragraph({ children: [new PageBreak()], spacing: { before: 0, after: 0 } })
);
// ── SECTION 2: DEFINITION AND SCOPE ──────────────────────────
children.push(
h1('SECTION 2: Definition and Scope of Pharmacology'),
spacer(120, 60),
h2('2.1 Primary Components'),
spacer(60, 40),
dataTable(
['Component', 'Description'],
[
['Drug Actions', 'How a drug interacts with its molecular target (receptor, enzyme, ion channel, transporter)'],
['Mechanisms of Action', 'Precise molecular/cellular events triggered by drug-receptor binding'],
['Therapeutic Uses', 'Clinical application to prevent, diagnose, or treat disease — determined by PK + PD profile']
],
[30, 70]
),
spacer(100, 60),
h2('2.2 Subdivisions of Pharmacology'),
spacer(60, 40)
);
// Flowchart 4: Subdivisions
children.push(
branchFlowchart('SUBDIVISIONS OF PHARMACOLOGY', [
{ label: 'Clinical\nPharmacology', sub: 'Drug use in patients', fill: '2E75B6' },
{ label: 'Neuropharmacology', sub: 'CNS/PNS drugs', fill: '8E44AD' },
{ label: 'Chemotherapy', sub: 'Anti-infective / anticancer', fill: 'C0392B' },
{ label: 'Immunopharmacology', sub: 'Immune system drugs', fill: '27AE60' },
{ label: 'Toxicology', sub: 'Adverse chemical effects', fill: 'E67E22' }
]),
spacer(120, 80),
h2('2.3 Adverse Drug Reactions (ADRs)'),
spacer(60, 40),
dataTable(
['Type', 'Characteristics', 'Example'],
[
['Type A (Augmented)', 'Predictable, dose-dependent; extension of pharmacological action; most common (~80%)', 'Hypoglycemia from excess insulin'],
['Type B (Bizarre)', 'Unpredictable, dose-independent; idiosyncratic or immunological; less common but serious', 'Anaphylaxis to penicillin'],
['Type C (Chronic)', 'Effects of long-term use', 'HPA axis suppression with prolonged corticosteroids'],
['Type D (Delayed)', 'Appear after drug discontinuation', 'Tardive dyskinesia after stopping antipsychotics'],
['Type E (End of use)', 'Withdrawal reactions on stopping drug', 'Beta-blocker rebound hypertension']
],
[20, 50, 30]
),
spacer(100, 60),
h2('2.4 Drug Interactions'),
spacer(60, 40)
);
// Flowchart 5: Drug Interactions
children.push(
branchFlowchart('DRUG INTERACTIONS', [
{ label: 'Pharmacokinetic', sub: 'Affects ADME of other drug', fill: '2E75B6' },
{ label: 'Pharmacodynamic', sub: 'Affects receptor/pathway', fill: TEAL }
]),
spacer(60, 40),
dataTable(
['Interaction Type', 'Mechanism', 'Clinical Example'],
[
['CYP450 Induction (PK)', 'Drug A induces liver enzymes → faster metabolism of Drug B → reduced Drug B levels', 'Rifampicin reduces efficacy of oral contraceptives'],
['CYP450 Inhibition (PK)', 'Drug A inhibits liver enzymes → slower metabolism of Drug B → Drug B toxicity', 'Clarithromycin + statins → statin toxicity'],
['Synergism (PD)', 'Two drugs act on same pathway, producing enhanced combined effect', 'Aspirin + warfarin → increased bleeding risk'],
['Antagonism (PD)', 'One drug reduces the effect of another', 'Naloxone reverses opioid effects'],
['Protein binding displacement (PK)', 'Drug A displaces Drug B from plasma proteins → increased free Drug B', 'Sulfonamides displace warfarin']
],
[28, 42, 30]
),
spacer(120, 80),
new Paragraph({ children: [new PageBreak()], spacing: { before: 0, after: 0 } })
);
// ── SECTION 3: DRUG NOMENCLATURE ─────────────────────────────
children.push(
h1('SECTION 3: Drug Nomenclature and Classification Systems'),
spacer(120, 60),
h2('3.1 Three Names of Every Drug'),
spacer(60, 40),
dataTable(
['Name Type', 'Description', 'Example (Painkiller)'],
[
['Chemical Name', 'Full IUPAC systematic name based on molecular structure; used in chemistry', 'N-(4-hydroxyphenyl)acetamide'],
['Generic Name (INN)', 'International Nonproprietary Name — official, non-commercial, globally recognised', 'Paracetamol / Acetaminophen'],
['Brand (Proprietary) Name', 'Manufacturer\'s trade name; capitalized; may vary by country', 'Tylenol® / Panadol®']
],
[25, 45, 30]
),
spacer(100, 60),
h2('3.2 INN Stem System — How to Read Drug Names'),
spacer(60, 40),
para([normal('The ', 20), bold('International Nonproprietary Name (INN)', 20, BLUE_DARK), normal(' system uses standardised stems embedded in drug names to indicate the pharmacological class. Learning stems lets you identify a drug\'s class at a glance.', 20)]),
spacer(80, 60)
);
// Flowchart 6: INN Stems Map
children.push(
h3('Flowchart: Major INN Suffix Stems'),
spacer(60, 40),
branchFlowchart('INN SUFFIX STEMS → Drug Class Identification', [
{ label: '-olol\nBeta-blockers', sub: 'propranolol, atenolol', fill: '1F3864' },
{ label: '-pril\nACE Inhibitors', sub: 'lisinopril, enalapril', fill: '2E75B6' },
{ label: '-sartan\nARBs', sub: 'losartan, valsartan', fill: '2980B9' },
{ label: '-dipine\nCa²⁺ Blockers', sub: 'amlodipine', fill: '1A5276' }
]),
spacer(60, 40),
branchFlowchart('MORE INN SUFFIX STEMS', [
{ label: '-statin\nHMG-CoA Inhibitors', sub: 'atorvastatin, rosuvastatin', fill: '27AE60' },
{ label: '-cillin\nPenicillins', sub: 'ampicillin, amoxicillin', fill: '1E8449' },
{ label: '-mycin/-micin\nAntibiotics', sub: 'erythromycin, gentamicin', fill: '145A32' },
{ label: '-cycline\nTetracyclines', sub: 'doxycycline', fill: '0E6655' }
]),
spacer(60, 40),
branchFlowchart('SPECIALTY & BIOLOGIC STEMS', [
{ label: '-mab\nMonoclonal Antibodies', sub: 'trastuzumab, rituximab', fill: '8E44AD' },
{ label: '-nib\nKinase Inhibitors', sub: 'imatinib, gefitinib', fill: '7D3C98' },
{ label: '-vir\nAntivirals', sub: 'aciclovir, oseltamivir', fill: 'E67E22' },
{ label: '-azole\nAntifungals/PPIs', sub: 'fluconazole, omeprazole', fill: 'D35400' }
]),
spacer(100, 80)
);
// Full stems table
children.push(
h3('Complete INN Stem Reference Table'),
spacer(60, 40),
dataTable(
['Stem', 'Class', 'Mechanism', 'Key Examples'],
[
['-olol', 'Beta-blockers', 'Block β-adrenergic receptors → ↓ heart rate, BP, cardiac output', 'Propranolol (non-selective), Atenolol (β1-selective), Metoprolol (β1-selective), Bisoprolol'],
['-pril', 'ACE Inhibitors', 'Inhibit ACE → ↓ Angiotensin II, ↑ Bradykinin → vasodilation', 'Lisinopril, Enalapril, Ramipril, Captopril, Perindopril'],
['-sartan', 'ARBs (AT1 blockers)', 'Block angiotensin II AT1 receptor → vasodilation', 'Losartan, Valsartan, Irbesartan, Candesartan, Olmesartan'],
['-dipine', 'Dihydropyridine CCBs', 'Block L-type Ca²⁺ channels in vascular smooth muscle → vasodilation', 'Amlodipine, Nifedipine, Felodipine, Lercanidipine'],
['-statin', 'HMG-CoA reductase inhibitors', 'Inhibit rate-limiting step in cholesterol synthesis in liver', 'Atorvastatin, Rosuvastatin, Simvastatin, Pravastatin'],
['-cillin', 'Penicillin antibiotics', 'Inhibit bacterial cell wall synthesis by blocking PBPs (β-lactam ring)', 'Ampicillin, Amoxicillin, Flucloxacillin, Piperacillin'],
['-mycin/-micin', 'Macrolides / Aminoglycosides', 'Inhibit bacterial protein synthesis (30S or 50S ribosome)', 'Erythromycin, Azithromycin, Gentamicin, Tobramycin'],
['-cycline', 'Tetracycline antibiotics', 'Inhibit bacterial protein synthesis at 30S ribosomal subunit', 'Doxycycline, Tetracycline, Minocycline'],
['-mab', 'Monoclonal antibodies', 'Target-specific protein (receptor, cytokine, cell surface antigen)', 'Trastuzumab (HER2), Rituximab (CD20), Adalimumab (TNF-α)'],
['-nib', 'Tyrosine kinase inhibitors', 'Block intracellular kinase signalling → anti-proliferative', 'Imatinib (BCR-ABL), Gefitinib (EGFR), Erlotinib (EGFR)'],
['-vir', 'Antivirals', 'Various: nucleoside analogues, protease/neuraminidase inhibitors', 'Aciclovir, Oseltamivir, Ritonavir, Tenofovir'],
['-azole', 'Antifungals / PPIs', 'Azole antifungals: inhibit ergosterol synthesis; PPIs: inhibit H⁺/K⁺-ATPase', 'Fluconazole, Itraconazole, Omeprazole, Esomeprazole']
],
[15, 20, 35, 30]
),
spacer(100, 80)
);
// Prefixes
children.push(
h2('3.3 INN Prefix Stems'),
spacer(60, 40),
dataTable(
['Prefix', 'Meaning', 'Clinical Significance', 'Examples'],
[
['Es-', 'S-enantiomer of a racemic parent drug', 'Often has improved efficacy/selectivity vs. the racemate; launched as isomer switch', 'Esomeprazole (S-omeprazole), Escitalopram (S-citalopram)'],
['Levo- / L-', 'Levorotatory isomer (rotates polarized light to left)', 'Biologically active stereoisomer in many cases', 'Levothyroxine (L-T4 - active), Levofloxacin, Levothyroxine, Levodopa'],
['Dex- / Dextro-', 'Dextrorotatory isomer (right-rotating)', 'May be more potent or have different activity vs. L-form', 'Dextromethorphan, Dexamfetamine, Dexamethasone'],
['Nor-', 'Parent compound without N-methyl group (de-methylated)', 'Often less potent but longer-acting; some active metabolites', 'Norepinephrine (from epinephrine), Norfloxacin, Nortriptyline'],
['Iso-', 'Isomeric or isopropylamino form', 'Different receptor selectivity vs. parent', 'Isoproterenol (β1+β2 agonist), Isoflurane']
],
[18, 22, 32, 28]
),
spacer(80, 60),
...callout([
'Isomer Switch Drugs - Exam Tip',
'Es- and Levo- prefix drugs are "isomer switch" products — purified enantiomers of older racemic drugs.',
'Esomeprazole = S-enantiomer of omeprazole → better acid suppression',
'Levothyroxine = L-isomer of thyroxine → biologically active form for thyroid replacement'
]),
spacer(120, 80)
);
// ── SECTION 4: CLASSIFICATION SYSTEMS ────────────────────────
children.push(
h1('SECTION 4: Drug Classification Flowcharts'),
spacer(120, 60),
h2('4.1 Overview Flowchart: How Drugs are Classified'),
spacer(60, 40)
);
children.push(
branchFlowchart('DRUG CLASSIFICATION SYSTEMS', [
{ label: 'By Mechanism\n(Pharmacological)', sub: 'Most important clinically', fill: BLUE_DARK },
{ label: 'By Therapeutic\nUse', sub: 'e.g., antihypertensive', fill: '2E75B6' },
{ label: 'By Chemical\nStructure', sub: 'e.g., beta-lactams', fill: TEAL },
{ label: 'By Receptor\nTarget', sub: 'e.g., adrenergic', fill: '27AE60' },
{ label: 'ATC System\n(WHO)', sub: '5-level hierarchy', fill: '8E44AD' }
]),
spacer(100, 80)
);
// Cardiovascular
children.push(
h2('4.2 Cardiovascular Drug Classification Flowchart'),
spacer(60, 40),
branchFlowchart('CARDIOVASCULAR DRUGS', [
{ label: 'Antihypertensives', sub: 'Lower blood pressure', fill: '1F3864' },
{ label: 'Antiarrhythmics', sub: 'Restore rhythm', fill: '2E75B6' },
{ label: 'Antithrombotics', sub: 'Prevent clots', fill: 'C0392B' },
{ label: 'Heart Failure', sub: 'Inotropes / diuretics', fill: '27AE60' }
]),
spacer(60, 40),
h3('Antihypertensives by Mechanism'),
spacer(40, 40),
dataTable(
['Class (INN Stem)', 'Mechanism', 'Examples', 'Key Notes'],
[
['Beta-blockers (-olol)', 'Block β1 receptors → ↓ HR and cardiac output', 'Atenolol, Metoprolol, Bisoprolol', 'Avoid in asthma; first-line in post-MI, heart failure'],
['ACE Inhibitors (-pril)', 'Block ACE → ↓ Ang II, ↑ bradykinin → vasodilation', 'Lisinopril, Ramipril, Enalapril', 'Cough (bradykinin); contraindicated in pregnancy; protect kidneys in diabetics'],
['ARBs (-sartan)', 'Block AT1 receptor → vasodilation', 'Losartan, Valsartan', 'No cough; preferred if ACEi cough; also renoprotective'],
['Dihydropyridine CCBs (-dipine)', 'Block L-type Ca²⁺ channels in vessels → vasodilation', 'Amlodipine, Nifedipine', 'Ankle oedema; reflex tachycardia with short-acting forms'],
['Thiazide diuretics (-ide)', 'Inhibit Na⁺/Cl⁻ cotransporter in DCT → natriuresis', 'Hydrochlorothiazide, Indapamide', 'First-line in elderly, Afro-Caribbean; watch K⁺'],
['Aldosterone antagonists', 'Block mineralocorticoid receptors → Na⁺ excretion', 'Spironolactone, Eplerenone', 'K⁺-sparing; useful in heart failure, Conn\'s syndrome']
],
[22, 28, 25, 25]
),
spacer(100, 80)
);
// Antibiotics
children.push(
h2('4.3 Antibiotic Classification Flowchart'),
spacer(60, 40),
branchFlowchart('ANTIBIOTICS', [
{ label: 'Cell Wall\nSynthesis Inhibitors', sub: 'β-lactams, glycopeptides', fill: '1E8449' },
{ label: 'Protein Synthesis\nInhibitors', sub: '30S and 50S blockers', fill: '27AE60' },
{ label: 'DNA/RNA\nSynthesis Inhibitors', sub: 'Fluoroquinolones, rifampicin', fill: '145A32' },
{ label: 'Cell Membrane\nDisruptors', sub: 'Polymyxins, daptomycin', fill: '0B5345' }
]),
spacer(60, 40),
dataTable(
['Class (INN Stem)', 'Mechanism', 'Examples', 'Spectrum'],
[
['Penicillins (-cillin)', 'Inhibit PBPs → block peptidoglycan crosslinking → cell lysis', 'Amoxicillin, Ampicillin, Piperacillin, Flucloxacillin', 'Variable; flucloxacillin for Staph; piperacillin for Pseudomonas'],
['Cephalosporins (-cef/-ceph)', 'Same as penicillins (β-lactam ring); broader spectrum across generations', 'Cefalexin (1st), Cefuroxime (2nd), Ceftriaxone (3rd), Cefepime (4th)', 'Progressively broader gram-negative; 3rd-gen cross BBB'],
['Carbapenems', 'Broadest β-lactam; resist most β-lactamases', 'Meropenem, Imipenem, Ertapenem', 'Gram+, Gram−, anaerobes; last resort for ESBL organisms'],
['Macrolides (-mycin)', 'Bind 50S ribosome → inhibit translocation', 'Azithromycin, Erythromycin, Clarithromycin', 'Atypicals (Legionella, Mycoplasma); good tissue penetration'],
['Aminoglycosides (-micin/-mycin)', 'Bind 30S ribosome → misreading of mRNA', 'Gentamicin, Tobramycin, Amikacin', 'Gram-negative bactericidal; nephrotoxic, ototoxic'],
['Tetracyclines (-cycline)', 'Bind 30S ribosome → block aminoacyl-tRNA binding', 'Doxycycline, Minocycline', 'Broad spectrum; atypicals, Chlamydia, Rickettsia'],
['Fluoroquinolones (-floxacin)', 'Inhibit DNA gyrase (topoisomerase II) and topoisomerase IV', 'Ciprofloxacin, Levofloxacin, Moxifloxacin', 'Gram− and Gram+; UTI, RTI, anthrax'],
['Glycopeptides', 'Bind D-Ala-D-Ala on peptidoglycan → block cell wall synthesis', 'Vancomycin, Teicoplanin', 'MRSA, C. difficile (oral vancomycin); IV for serious Gram+']
],
[20, 30, 25, 25]
),
spacer(100, 80)
);
// Lipid-lowering
children.push(
h2('4.4 Lipid-Lowering Drug Classification Flowchart'),
spacer(60, 40),
branchFlowchart('LIPID-LOWERING DRUGS', [
{ label: 'Statins (-statin)', sub: 'HMG-CoA reductase inhibitors', fill: '2C3E50' },
{ label: 'Fibrates (-fibrate)', sub: 'PPAR-α agonists', fill: '2E4057' },
{ label: 'Ezetimibe', sub: 'Cholesterol absorption inhibitor', fill: '27AE60' },
{ label: 'PCSK9 Inhibitors (-mab)', sub: 'Monoclonal antibodies', fill: '8E44AD' }
]),
spacer(60, 40),
dataTable(
['Class', 'Mechanism', 'Primary Effect', 'Examples'],
[
['Statins (-statin)', 'Inhibit HMG-CoA reductase → ↓ hepatic cholesterol synthesis → upregulate LDL receptors → ↓ LDL', '↓ LDL-C (30-50%)', 'Atorvastatin, Rosuvastatin, Simvastatin, Pravastatin'],
['Fibrates (-fibrate)', 'Activate PPAR-α → ↑ lipoprotein lipase → ↑ TG clearance', '↓ Triglycerides (↑ HDL)', 'Fenofibrate, Gemfibrozil'],
['Ezetimibe', 'Blocks NPC1L1 transporter in intestinal brush border → ↓ cholesterol absorption', '↓ LDL-C (15-20%)', 'Ezetimibe (Ezetrol)'],
['PCSK9 Inhibitors (-mab)', 'Bind PCSK9 → prevent LDL receptor degradation → ↑↑ LDL receptor recycling', '↓ LDL-C (50-60%); for familial hypercholesterolemia', 'Evolocumab (Repatha), Alirocumab (Praluent)']
],
[20, 35, 25, 20]
),
spacer(120, 80)
);
// Quick Reference
children.push(
h1('QUICK REFERENCE: INN Stems Cheat Sheet'),
spacer(100, 60),
dataTable(
['Stem', 'Class', 'Prototype Drug'],
[
['-olol', 'Beta-blockers', 'Propranolol'],
['-pril', 'ACE Inhibitors', 'Lisinopril'],
['-sartan', 'ARBs', 'Losartan'],
['-dipine', 'Dihydropyridine CCBs', 'Amlodipine'],
['-statin', 'HMG-CoA reductase inhibitors', 'Atorvastatin'],
['-cillin', 'Penicillin antibiotics', 'Ampicillin'],
['-cycline', 'Tetracycline antibiotics', 'Doxycycline'],
['-mycin / -micin', 'Macrolides / Aminoglycosides', 'Azithromycin / Gentamicin'],
['-floxacin', 'Fluoroquinolones', 'Ciprofloxacin'],
['-mab', 'Monoclonal antibodies', 'Trastuzumab'],
['-nib', 'Tyrosine kinase inhibitors', 'Imatinib'],
['-vir', 'Antivirals', 'Aciclovir'],
['-azole', 'Antifungals / PPIs', 'Omeprazole'],
['Es-', 'S-enantiomer (isomer switch)', 'Esomeprazole'],
['Levo-', 'Levorotatory isomer', 'Levothyroxine'],
['Nor-', 'De-methylated derivative', 'Norepinephrine'],
['Dex-', 'Dextrorotatory isomer', 'Dexamethasone']
],
[25, 45, 30]
),
spacer(100, 80),
...callout([
'Study Tip: Using Stems in Clinical Practice',
'1. See a new drug name → identify the stem → know the class instantly',
'2. Know the class → predict mechanism, side effects, contraindications, and monitoring',
'3. Example: "empagliflozin" → contains "-flozin" stem → SGLT2 inhibitor → glucose excretion in urine'
]),
spacer(120, 80),
new Paragraph({
children: [new TextRun({ text: 'Source: Katzung\'s Basic and Clinical Pharmacology, 16th Edition', size: 18, color: '777777', italics: true })],
alignment: AlignmentType.CENTER,
spacing: { before: 100, after: 100 }
})
);
// ── BUILD DOCUMENT ────────────────────────────────────────────
const doc = new Document({
numbering: {
config: []
},
styles: {
default: {
document: {
run: { font: 'Calibri', size: 20 }
}
}
},
sections: [{
properties: {
page: {
margin: {
top: convertInchesToTwip(0.9),
bottom: convertInchesToTwip(0.9),
left: convertInchesToTwip(1),
right: convertInchesToTwip(1)
}
}
},
headers: {
default: new Header({
children: [new Paragraph({
children: [
new TextRun({ text: 'Pharmacology Study Guide | Drug Classification', size: 18, color: '888888' }),
],
alignment: AlignmentType.RIGHT,
border: { bottom: solidBorder('CCCCCC', 4) }
})]
})
},
footers: {
default: new Footer({
children: [new Paragraph({
children: [
new TextRun({ text: 'Katzung\'s Basic & Clinical Pharmacology, 16th Ed. | Page ', size: 16, color: '888888' }),
new TextRun({ children: [PageNumber.CURRENT], size: 16, color: '888888' })
],
alignment: AlignmentType.CENTER,
border: { top: solidBorder('CCCCCC', 4) }
})]
})
},
children
}]
});
Packer.toBuffer(doc).then(buf => {
fs.writeFileSync('/home/daytona/workspace/pharmacology-guide/Pharmacology_Study_Guide.docx', buf);
console.log('SUCCESS: File written.');
}).catch(err => {
console.error('ERROR:', err.message);
process.exit(1);
});
node /home/daytona/workspace/pharmacology-guide/generate.js 2>&1
python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/works…
ls -lh /home/daytona/workspace/pharmacology-guide/ && python3 -c " import zipfil…
Pharmacology Study Guide
Word Document · DOCX