I have exam i need questions and answers
| Term | Definition | Example |
|---|---|---|
| Agonist | Drug that binds receptor and produces maximal response (full efficacy) | Morphine (mu receptor) |
| Partial Agonist | Binds receptor but produces submaximal response even at full occupancy (partial efficacy) | Buprenorphine |
| Inverse Agonist | Binds receptor and produces opposite effect to agonist (negative efficacy) | Beta-carboline (BZD receptor) |
| Feature | First Order | Zero Order |
|---|---|---|
| Rate of elimination | Proportional to drug concentration | Constant, independent of concentration |
| Half-life | Constant | Increases with dose |
| Plasma curve | Exponential | Linear |
| Examples | Most drugs | Alcohol, Phenytoin (at high doses), Aspirin (high dose) |
| Mechanism | Drugs |
|---|---|
| NaβΊ channel blockers | Phenytoin, Carbamazepine, Valproate, Lamotrigine |
| GABA enhancement | Valproate, Benzodiazepines, Phenobarbitone, Vigabatrin |
| CaΒ²βΊ channel (T-type) block | Ethosuximide, Valproate |
| Glutamate antagonism | Lamotrigine, Topiramate |
| SV2A ligand | Levetiracetam |
| Class | Example | MOA |
|---|---|---|
| Biguanides | Metformin | Activates AMPK, reduces hepatic glucose output, improves insulin sensitivity |
| Sulfonylureas | Glibenclamide, Glipizide | Closes KβΊ-ATP channels β insulin release |
| Meglitinides | Repaglinide | Similar to sulfonylureas, faster acting |
| Thiazolidinediones | Pioglitazone | PPAR-Ξ³ agonist, insulin sensitizer |
| DPP-4 inhibitors | Sitagliptin | Increases GLP-1, enhances insulin release |
| GLP-1 agonists | Liraglutide, Semaglutide | Stimulates insulin, inhibits glucagon |
| SGLT-2 inhibitors | Dapagliflozin | Inhibits renal glucose reabsorption |
| Alpha-glucosidase inhibitors | Acarbose | Delays carbohydrate absorption |
| Topic | Key Point to Remember |
|---|---|
| Angina drugs | Nitrates (acute), Beta-blockers, CCBs (prophylaxis) |
| ACE Inhibitor ADR | Dry cough (bradykinin accumulation) |
| Antiepileptics | Valproate is broadest spectrum |
| Status epilepticus | Lorazepam IV first β Phenytoin β Phenobarbitone |
| Anti-Parkinson | Levodopa+Carbidopa = most effective |
| BZD MOA | GABA-A receptor β frequency of Clβ» opening |
| Morphine | MOA = mu receptor agonist; antidote = Naloxone |
| Metformin | First-line T2DM; no hypoglycemia; risk = lactic acidosis |
| PTU | Blocks TPO + blocks T4βT3; preferred in thyroid storm |
| I-131 | Beta rays destroy thyroid; ADR = hypothyroidism |
| CCF drugs | ACE-I + Diuretic + Digoxin + Beta-blocker |
Generate a quick reference flashcard deck on ADR of major drugs
mkdir -p /home/daytona/workspace/pharma-flashcards && ls /home/daytona/workspaceβ¦
~/pharma-flashcards/generate.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Pharmacology ADR Flashcards";
pres.author = "Orris";
// βββ Design tokens βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const FRONT_BG = "1A1A2E"; // deep navy - question side
const BACK_BG = "16213E"; // slightly lighter navy - answer side
const ACCENT = "E94560"; // vivid red - headings / labels
const GOLD = "F5A623"; // gold - drug name highlight
const WHITE = "FFFFFF";
const LIGHT = "C9D1D9"; // soft grey for body text
const BULLET_OK = "4CAF50"; // green for normal ADRs
const BULLET_WRN= "FF6B35"; // orange for serious/dangerous ADRs
const DIVIDER = "E94560";
// βββ Flashcard data ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const cards = [
// ββ COVER ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
type: "cover",
title: "ADR Flashcard Deck",
subtitle: "Adverse Drug Reactions β Pharmacology Quick Reference",
tag: "Paper I & II | Exam Ready"
},
// ββ SECTION DIVIDER ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{ type: "divider", label: "SECTION 1", title: "General Pharmacology & CVS" },
// ββ DRUG CARDS βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
drug: "ACE Inhibitors",
subtitle: "Enalapril | Ramipril | Lisinopril",
category: "CVS β Antihypertensive",
adrs: [
{ text: "Dry persistent cough (most common β bradykinin accumulation)", warn: true },
{ text: "First-dose hypotension", warn: true },
{ text: "Hyperkalemia", warn: true },
{ text: "Angioedema (rare, potentially life-threatening)", warn: true },
{ text: "Teratogenic β contraindicated in pregnancy", warn: true },
{ text: "Renal impairment (bilateral renal artery stenosis)", warn: true },
],
memory: "π§ ACE = Accumulates Cough Enzyme (bradykinin not degraded)"
},
{
drug: "Digoxin",
subtitle: "Cardiac Glycoside",
category: "CVS β CCF / Arrhythmia",
adrs: [
{ text: "Nausea, vomiting, anorexia (early GI toxicity)", warn: false },
{ text: "Visual disturbances β yellow/green halos (xanthopsia)", warn: false },
{ text: "Bradycardia, heart block, arrhythmias", warn: true },
{ text: "Narrow therapeutic index β toxicity risk is HIGH", warn: true },
{ text: "Hypokalemia increases toxicity risk", warn: true },
],
memory: "π§ Digoxin toxicity β Yellow vision + Slow heart"
},
{
drug: "Nitrates",
subtitle: "GTN | Isosorbide Mononitrate",
category: "CVS β Angina",
adrs: [
{ text: "Headache (most common β meningeal vessel dilation)", warn: false },
{ text: "Postural hypotension / dizziness", warn: false },
{ text: "Reflex tachycardia", warn: false },
{ text: "Tolerance with prolonged use (nitrate-free interval needed)", warn: false },
{ text: "Methaemoglobinaemia (at very high doses)", warn: true },
{ text: "Contraindicated with PDE-5 inhibitors (sildenafil) β severe hypotension", warn: true },
],
memory: "π§ Nitrates = Headache + Hypotension; No sildenafil!"
},
{
drug: "Propranolol (Beta Blockers)",
subtitle: "Non-selective Ξ²-blocker",
category: "CVS β HT / Angina / Arrhythmia",
adrs: [
{ text: "Bronchospasm β contraindicated in asthma", warn: true },
{ text: "Bradycardia and heart block", warn: true },
{ text: "Masking of hypoglycaemia symptoms in diabetics", warn: true },
{ text: "Cold extremities, fatigue, depression", warn: false },
{ text: "Rebound angina / hypertension on abrupt withdrawal", warn: true },
{ text: "Impotence", warn: false },
],
memory: "π§ Beta Blockers β Bronchospasm + Bradycardia (BB)"
},
{
drug: "Furosemide (Loop Diuretic)",
subtitle: "Frusemide",
category: "CVS β CCF / HT / Edema",
adrs: [
{ text: "Hypokalemia (most common)", warn: true },
{ text: "Hyponatremia, hypomagnesemia", warn: false },
{ text: "Ototoxicity β tinnitus, deafness (dose-related)", warn: true },
{ text: "Hyperuricemia β gout", warn: false },
{ text: "Dehydration, hypotension", warn: false },
{ text: "Metabolic alkalosis", warn: false },
],
memory: "π§ Furosemide = Flush out KβΊ + Hear less (ototoxic)"
},
// ββ SECTION DIVIDER ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{ type: "divider", label: "SECTION 2", title: "Autonomic Nervous System" },
{
drug: "Atropine",
subtitle: "Anticholinergic / Muscarinic blocker",
category: "ANS β Anticholinergic",
adrs: [
{ text: "Dry mouth (xerostomia)", warn: false },
{ text: "Blurred vision, photophobia, cycloplegia", warn: false },
{ text: "Urinary retention (especially in elderly men β BPH)", warn: true },
{ text: "Constipation", warn: false },
{ text: "Tachycardia, palpitations", warn: false },
{ text: "CNS excitement, confusion (especially in elderly)", warn: false },
],
memory: "π§ 'Hot as a hare, blind as a bat, dry as a bone, red as a beet, mad as a hatter'"
},
{
drug: "Organophosphates",
subtitle: "Irreversible Anticholinesterase",
category: "ANS β Toxicology",
adrs: [
{ text: "SLUDGE: Salivation, Lacrimation, Urination, Diarrhoea, GI cramps, Emesis", warn: true },
{ text: "Miosis (pinpoint pupils)", warn: true },
{ text: "Bradycardia, bronchospasm", warn: true },
{ text: "Muscle fasciculations β paralysis (nicotinic)", warn: true },
{ text: "CNS: anxiety, seizures, coma", warn: true },
{ text: "Treatment: Atropine + Pralidoxime (PAM)", warn: false },
],
memory: "π§ OP toxicity = SLUDGE; Rx = Atropine + PAM"
},
{
drug: "Adrenaline (Epinephrine)",
subtitle: "Alpha + Beta agonist",
category: "ANS β Adrenergic",
adrs: [
{ text: "Palpitations, tachycardia, arrhythmias", warn: true },
{ text: "Hypertension, headache", warn: false },
{ text: "Tremor, anxiety, restlessness", warn: false },
{ text: "Hyperglycemia (beta-2 effect)", warn: false },
{ text: "Tissue necrosis if extravasation occurs (IV)", warn: true },
{ text: "Contraindicated in hyperthyroidism, severe CAD", warn: true },
],
memory: "π§ Adrenaline ADR = Fight-or-Flight overdrive"
},
// ββ SECTION DIVIDER ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{ type: "divider", label: "SECTION 3", title: "CNS Drugs" },
{
drug: "Morphine",
subtitle: "Opioid Analgesic β ΞΌ receptor agonist",
category: "CNS β Opioid",
adrs: [
{ text: "Respiratory depression (most dangerous β can be fatal)", warn: true },
{ text: "Constipation (no tolerance develops)", warn: false },
{ text: "Nausea and vomiting", warn: false },
{ text: "Miosis (pinpoint pupils β diagnostic sign of toxicity)", warn: false },
{ text: "Euphoria, dependence, addiction", warn: true },
{ text: "Urinary retention", warn: false },
{ text: "Histamine release β itching, bronchospasm, hypotension", warn: false },
],
memory: "π§ Morphine: 3 M's β Miosis, nausea (veMitus), constipation"
},
{
drug: "Benzodiazepines (BZD)",
subtitle: "Diazepam | Lorazepam | Alprazolam",
category: "CNS β Sedative Hypnotic",
adrs: [
{ text: "Sedation, drowsiness (most common)", warn: false },
{ text: "Anterograde amnesia", warn: false },
{ text: "Respiratory depression (especially with opioids or alcohol)", warn: true },
{ text: "Physical dependence, tolerance, withdrawal seizures", warn: true },
{ text: "Paradoxical excitement (especially in elderly/children)", warn: false },
{ text: "Ataxia, confusion in elderly β fall risk", warn: false },
],
memory: "π§ BZD reversal = Flumazenil (competitive antagonist)"
},
{
drug: "Phenytoin",
subtitle: "Anti-epileptic β NaβΊ channel blocker",
category: "CNS β Antiepileptic",
adrs: [
{ text: "Gingival hyperplasia (gum overgrowth) β unique to phenytoin", warn: false },
{ text: "Hirsutism (excess hair growth)", warn: false },
{ text: "Coarsening of facial features", warn: false },
{ text: "Nystagmus, ataxia, diplopia (dose-related toxicity)", warn: true },
{ text: "Teratogenic β fetal hydantoin syndrome", warn: true },
{ text: "Drug interactions: enzyme inducer (CYP450)", warn: true },
{ text: "Megaloblastic anaemia (folate deficiency)", warn: false },
],
memory: "π§ Phenytoin = Gum, Hair, Nystagmus + Teratogen"
},
{
drug: "Sodium Valproate",
subtitle: "Broad-spectrum Anti-epileptic",
category: "CNS β Antiepileptic",
adrs: [
{ text: "Hepatotoxicity β most serious, especially in children <2 yrs", warn: true },
{ text: "Teratogenic β neural tube defects (folic acid must be given)", warn: true },
{ text: "Tremor, weight gain", warn: false },
{ text: "Alopecia (reversible hair loss)", warn: false },
{ text: "Thrombocytopenia", warn: false },
{ text: "Pancreatitis (rare)", warn: true },
{ text: "Polycystic ovaries with long-term use in women", warn: false },
],
memory: "π§ Valproate: Hepatotox + Neural tube defect β give folate!"
},
{
drug: "Levodopa",
subtitle: "Anti-Parkinson β Dopamine precursor",
category: "CNS β Parkinsonism",
adrs: [
{ text: "Dyskinesias (involuntary movements) β long-term use", warn: true },
{ text: "On-off fluctuations (wearing-off phenomenon)", warn: true },
{ text: "Nausea, vomiting (peripheral dopamine) β reduced by carbidopa", warn: false },
{ text: "Postural hypotension", warn: false },
{ text: "Psychosis, hallucinations, confusion", warn: true },
{ text: "Arrhythmias (rare)", warn: false },
],
memory: "π§ L-DOPA long-term β Dyskinesia + On-Off swings"
},
// ββ SECTION DIVIDER ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{ type: "divider", label: "SECTION 4", title: "Hormones & Metabolic Drugs" },
{
drug: "Metformin",
subtitle: "Biguanide β OAD (First-line T2DM)",
category: "Hormones β Diabetes",
adrs: [
{ text: "GI side effects: nausea, diarrhea, metallic taste (most common)", warn: false },
{ text: "Lactic acidosis (rare but potentially fatal β esp. renal failure)", warn: true },
{ text: "Vitamin B12 deficiency with long-term use", warn: false },
{ text: "No hypoglycemia (euglycemic drug)", warn: false },
{ text: "Contraindicated: eGFR <30, hepatic failure, IV contrast use, alcoholism", warn: true },
],
memory: "π§ Metformin: GI upset + Lactic acidosis (check kidneys!)"
},
{
drug: "Sulfonylureas",
subtitle: "Glibenclamide | Glipizide | Gliclazide",
category: "Hormones β Diabetes",
adrs: [
{ text: "Hypoglycemia (most important β especially in elderly)", warn: true },
{ text: "Weight gain", warn: false },
{ text: "GI upset: nausea, vomiting", warn: false },
{ text: "Disulfiram-like reaction with alcohol (chlorpropamide)", warn: false },
{ text: "Cholestatic jaundice (rare)", warn: false },
],
memory: "π§ Sulfonylureas: SU = Sugar too low (hypoglycemia)"
},
{
drug: "Propylthiouracil (PTU)",
subtitle: "Antithyroid β Thionamide",
category: "Hormones β Hyperthyroidism",
adrs: [
{ text: "Agranulocytosis (most dangerous β fever + sore throat = STOP drug)", warn: true },
{ text: "Skin rash, urticaria, pruritus", warn: false },
{ text: "Hepatotoxicity (more with PTU than carbimazole)", warn: true },
{ text: "Lupus-like syndrome (rare)", warn: false },
{ text: "Hypothyroidism with overdose", warn: false },
],
memory: "π§ PTU: Agranulocytosis = EMERGENCY. Check CBC if fever!"
},
{
drug: "Radioactive Iodine (I-131)",
subtitle: "Antithyroid β Definitive Therapy",
category: "Hormones β Hyperthyroidism",
adrs: [
{ text: "Hypothyroidism (most common long-term ADR β nearly inevitable)", warn: true },
{ text: "Radiation thyroiditis (acute β painful swelling, transient worsening)", warn: false },
{ text: "Worsening of Graves' ophthalmopathy", warn: false },
{ text: "Sialadenitis (in high-dose thyroid cancer treatment)", warn: false },
{ text: "Absolute contraindication: Pregnancy and lactation", warn: true },
],
memory: "π§ I-131: Burns thyroid β Hypothyroidism in 6β12 months"
},
// ββ SECTION DIVIDER ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{ type: "divider", label: "SECTION 5", title: "Master ADR Comparison Chart" },
// ββ SUMMARY CARD βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
type: "summary",
title: "UNIQUE ADRs β Must Know",
rows: [
["Drug", "Unique / Classic ADR"],
["ACE Inhibitors", "Dry cough (bradykinin β)"],
["Digoxin", "Yellow vision (xanthopsia)"],
["Atropine", "Dry mouth + Urinary retention"],
["Morphine", "Constipation (no tolerance)"],
["Phenytoin", "Gingival hyperplasia"],
["Valproate", "Neural tube defects"],
["Metformin", "Lactic acidosis"],
["PTU", "Agranulocytosis"],
["Furosemide", "Ototoxicity (deafness)"],
["Levodopa", "Dyskinesias (long-term)"],
]
},
{
type: "summary2",
title: "DRUGS CONTRAINDICATED IN PREGNANCY",
rows: [
["Drug / Class", "Reason"],
["ACE Inhibitors / ARBs", "Fetal renal toxicity, oligohydramnios"],
["Phenytoin", "Fetal hydantoin syndrome"],
["Sodium Valproate", "Neural tube defects"],
["Tetracyclines", "Bone/teeth deposition"],
["Warfarin (1st & 3rd trim)", "Warfarin embryopathy, fetal bleeding"],
["Radioactive Iodine", "Fetal thyroid destruction"],
["Methotrexate", "Abortifacient, teratogen"],
]
},
{
type: "summary3",
title: "ANTIDOTES β Quick Reference",
rows: [
["Drug Toxicity", "Antidote"],
["Morphine / Opioids", "Naloxone"],
["Benzodiazepines", "Flumazenil"],
["Organophosphates", "Atropine + Pralidoxime (PAM)"],
["Paracetamol overdose", "N-Acetylcysteine (NAC)"],
["Warfarin overdose", "Vit K + FFP"],
["Heparin overdose", "Protamine sulphate"],
["Digoxin toxicity", "Digoxin-Fab antibodies"],
["Iron overdose", "Deferoxamine"],
]
},
// ββ BACK COVER βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
type: "backcover",
text: "Good Luck with Your Exam! π―",
subtext: "Remember: Know the UNIQUE ADR for each drug β that's what examiners test!"
}
];
// βββ Helper: Draw a rounded rect with colored left border ββββββββββββββββββββ
function addCard(slide, bg) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 10, h: 5.625,
fill: { color: bg },
line: { color: bg }
});
}
function addLeftBorder(slide, color) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 0.12, h: 5.625,
fill: { color: color },
line: { color: color }
});
}
function addTopBar(slide, color, h = 0.06) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 10, h: h,
fill: { color: color },
line: { color: color }
});
}
// βββ Render each card βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
for (const card of cards) {
// ββ COVER ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
if (card.type === "cover") {
const s = pres.addSlide();
// Background
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color: "0D0D1A" }, line:{ color:"0D0D1A" } });
// Top accent bar
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.08, fill:{ color: ACCENT }, line:{ color:ACCENT } });
// Bottom accent bar
s.addShape(pres.ShapeType.rect, { x:0, y:5.545, w:10, h:0.08, fill:{ color: GOLD }, line:{ color:GOLD } });
// Pill tag
s.addShape(pres.ShapeType.roundRect, { x:3.5, y:1.1, w:3, h:0.4, fill:{ color: ACCENT }, line:{ color:ACCENT }, rectRadius:0.2 });
s.addText("ADR QUICK REFERENCE", { x:3.5, y:1.1, w:3, h:0.4, fontSize:10, bold:true, color:WHITE, align:"center", valign:"middle", margin:0 });
// Main title
s.addText("Adverse Drug\nReactions", { x:1, y:1.7, w:8, h:1.5, fontSize:48, bold:true, color:WHITE, align:"center", valign:"middle" });
// Gold underline
s.addShape(pres.ShapeType.rect, { x:3.5, y:3.3, w:3, h:0.04, fill:{ color:GOLD }, line:{ color:GOLD } });
// Subtitle
s.addText(card.subtitle, { x:1, y:3.45, w:8, h:0.5, fontSize:14, color:LIGHT, align:"center", italic:true });
// Tag
s.addText(card.tag, { x:1, y:4.2, w:8, h:0.4, fontSize:11, color:GOLD, align:"center" });
continue;
}
// ββ DIVIDER ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
if (card.type === "divider") {
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:"111122" }, line:{ color:"111122" } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.08, fill:{ color:ACCENT }, line:{ color:ACCENT } });
s.addShape(pres.ShapeType.rect, { x:0, y:5.545, w:10, h:0.08, fill:{ color:ACCENT }, line:{ color:ACCENT } });
s.addShape(pres.ShapeType.rect, { x:4.2, y:2.7, w:1.6, h:0.05, fill:{ color:GOLD }, line:{ color:GOLD } });
s.addText(card.label, { x:1, y:1.5, w:8, h:0.6, fontSize:13, bold:true, color:ACCENT, align:"center", charSpacing:6 });
s.addText(card.title, { x:0.5, y:2.0, w:9, h:1.2, fontSize:36, bold:true, color:WHITE, align:"center" });
continue;
}
// ββ DRUG CARD ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
if (!card.type) {
// FRONT (Question) slide
const front = pres.addSlide();
addCard(front, FRONT_BG);
addTopBar(front, ACCENT, 0.07);
addLeftBorder(front, GOLD);
// Category badge
front.addShape(pres.ShapeType.roundRect, { x:0.3, y:0.2, w:3.6, h:0.35, fill:{ color:"2D2D50" }, line:{ color:ACCENT }, rectRadius:0.15 });
front.addText(card.category, { x:0.3, y:0.2, w:3.6, h:0.35, fontSize:9.5, color:ACCENT, align:"center", valign:"middle", margin:0 });
// Card label (top right)
front.addText("QUESTION", { x:7.5, y:0.2, w:2.2, h:0.35, fontSize:9, bold:true, color:GOLD, align:"right", charSpacing:3 });
// Drug name
front.addText(card.drug, { x:0.3, y:0.75, w:9.4, h:0.85, fontSize:30, bold:true, color:WHITE, align:"left", margin:0 });
// Subtitle
front.addText(card.subtitle, { x:0.3, y:1.55, w:9.4, h:0.4, fontSize:13, color:LIGHT, align:"left", italic:true, margin:0 });
// Divider line
front.addShape(pres.ShapeType.rect, { x:0.3, y:2.05, w:9.4, h:0.03, fill:{ color:"3A3A5C" }, line:{ color:"3A3A5C" } });
// Question text
front.addText("What are the major Adverse Drug Reactions (ADRs)?", {
x:0.3, y:2.2, w:9.2, h:1.0,
fontSize:17, color:LIGHT, align:"left", italic:true, margin:0
});
// Flip instruction
front.addText("β See next slide for answer", { x:0.3, y:5.1, w:9.4, h:0.4, fontSize:10, color:"5A5A8A", align:"left", italic:true, margin:0 });
// BACK (Answer) slide
const back = pres.addSlide();
addCard(back, BACK_BG);
addTopBar(back, GOLD, 0.07);
addLeftBorder(back, ACCENT);
// Drug name (compact header)
back.addText(card.drug, { x:0.3, y:0.12, w:7, h:0.55, fontSize:20, bold:true, color:WHITE, align:"left", margin:0 });
back.addText("ANSWER", { x:7.5, y:0.12, w:2.2, h:0.35, fontSize:9, bold:true, color:ACCENT, align:"right", charSpacing:3 });
// ADRs header
back.addText("β ADRs", { x:0.3, y:0.72, w:3, h:0.3, fontSize:11, bold:true, color:GOLD, margin:0 });
// Build bullet array
const bulletItems = card.adrs.map((a, i) => ({
text: a.text,
options: {
bullet: { code:"2022" },
color: a.warn ? BULLET_WRN : BULLET_OK,
fontSize: 10.5,
breakLine: i < card.adrs.length - 1
}
}));
back.addText(bulletItems, { x:0.3, y:1.05, w:9.4, h:3.2, valign:"top", margin:0 });
// Memory tip
if (card.memory) {
back.addShape(pres.ShapeType.roundRect, { x:0.3, y:4.35, w:9.4, h:0.9, fill:{ color:"25254A" }, line:{ color:GOLD }, rectRadius:0.12 });
back.addText(card.memory, { x:0.4, y:4.38, w:9.2, h:0.84, fontSize:11, color:GOLD, valign:"middle", margin:0, italic:true });
}
continue;
}
// ββ SUMMARY TABLE βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
if (card.type === "summary" || card.type === "summary2" || card.type === "summary3") {
const s = pres.addSlide();
addCard(s, "0E0E22");
addTopBar(s, ACCENT, 0.07);
s.addText(card.title, { x:0.3, y:0.1, w:9.4, h:0.6, fontSize:17, bold:true, color:WHITE, align:"left", charSpacing:2, margin:0 });
s.addShape(pres.ShapeType.rect, { x:0.3, y:0.72, w:9.4, h:0.03, fill:{ color:ACCENT }, line:{ color:ACCENT } });
const rows = card.rows;
const rowH = 4.5 / rows.length;
rows.forEach((row, ri) => {
const isHeader = ri === 0;
const bgColor = isHeader ? "1E1E3A" : (ri % 2 === 0 ? "161628" : "1A1A30");
s.addShape(pres.ShapeType.rect, { x:0.3, y:0.78 + ri * rowH, w:9.4, h:rowH, fill:{ color:bgColor }, line:{ color:"2A2A4A" } });
s.addText(row[0], { x:0.35, y:0.78 + ri * rowH, w:4.5, h:rowH, fontSize:isHeader ? 10.5 : 10, bold:isHeader, color: isHeader ? GOLD : ACCENT, valign:"middle", margin:4 });
s.addText(row[1], { x:4.85, y:0.78 + ri * rowH, w:4.8, h:rowH, fontSize:isHeader ? 10.5 : 10, bold:isHeader, color: isHeader ? GOLD : LIGHT, valign:"middle", margin:4 });
});
continue;
}
// ββ BACK COVER ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
if (card.type === "backcover") {
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:"0D0D1A" }, line:{ color:"0D0D1A" } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.08, fill:{ color:GOLD }, line:{ color:GOLD } });
s.addShape(pres.ShapeType.rect, { x:0, y:5.545, w:10, h:0.08, fill:{ color:ACCENT }, line:{ color:ACCENT } });
s.addText(card.text, { x:1, y:2.0, w:8, h:1.0, fontSize:32, bold:true, color:WHITE, align:"center" });
s.addShape(pres.ShapeType.rect, { x:3.5, y:3.1, w:3, h:0.04, fill:{ color:GOLD }, line:{ color:GOLD } });
s.addText(card.subtext, { x:1, y:3.25, w:8, h:0.8, fontSize:13, color:LIGHT, align:"center", italic:true });
}
}
// βββ Write file βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
pres.writeFile({ fileName: "/home/daytona/workspace/pharma-flashcards/ADR_Flashcards.pptx" })
.then(() => console.log("β
Saved: ADR_Flashcards.pptx"))
.catch(e => { console.error("β Error:", e); process.exit(1); });
cd /home/daytona/workspace/pharma-flashcards && node generate.js 2>&1
ls -lh /home/daytona/workspace/pharma-flashcards/ADR_Flashcards.pptx
ADR Flashcards
Presentation Β· PPTX
| Slide Type | Content |
|---|---|
| Cover slide | Title page with dark navy design |
| Section dividers | 5 sections with bold headers |
| Drug flashcards (x2 each) | Front = Question / Back = Answer with color-coded ADRs |
| 3 Summary tables | Unique ADRs, Drugs in Pregnancy, Antidotes |
| Back cover | Exam good-luck slide |