generate ALL high yield mcqs for batterjee medical exams jeddah and generate hints and one-two page printable cheatsheet and explain all mcqs with labelled diagram from. medical anatomy textbooks or reliable sources mention in which past year mcqs came how important they are
cd /home/daytona/workspace && python3 -c " import pdfplumber path = '/home/daytona/workspace/attachments/3f567bd8-2dc2-46fe-8d68-2c098797b62c/10-11 H & HCO3- handling(1)_240519_104337 (1).pdf' with pdfplumber.open(path) as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): print(f'\\n===PAGE {i+1}===') print(page.extract_text()) "
mkdir -p /home/daytona/workspace/batterjee-mcq && echo "Directory created"
~/batterjee-mcq/generate_mcq.py
#!/usr/bin/env python3
"""
Generate Batterjee Medical College - H+ & HCO3- Renal Handling
High-Yield MCQ Pack + Cheatsheet (PDF)
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
PageBreak, HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import Drawing
from reportlab.graphics.shapes import (
Rect, String, Line, Arrow, Circle, Polygon, Group
)
from reportlab.graphics import renderPDF
import os
W, H = A4
# ── Colour palette ────────────────────────────────────────────────────────────
NAVY = colors.HexColor('#1a3a5c')
TEAL = colors.HexColor('#0d7377')
AMBER = colors.HexColor('#f0a500')
CORAL = colors.HexColor('#e05c5c')
LIME = colors.HexColor('#4caf50')
LGRAY = colors.HexColor('#f4f6f8')
MGRAY = colors.HexColor('#dce3ea')
WHITE = colors.white
BLACK = colors.black
# ── Styles ────────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, **kw)
COVER_TITLE = S('CoverTitle', fontSize=26, textColor=WHITE, alignment=TA_CENTER,
fontName='Helvetica-Bold', spaceAfter=6)
COVER_SUB = S('CoverSub', fontSize=14, textColor=AMBER, alignment=TA_CENTER,
fontName='Helvetica', spaceAfter=4)
COVER_INFO = S('CoverInfo', fontSize=11, textColor=MGRAY, alignment=TA_CENTER,
fontName='Helvetica')
SECTION_HDR = S('SectionHdr', fontSize=13, textColor=WHITE, fontName='Helvetica-Bold',
leftIndent=0, spaceAfter=0, spaceBefore=0, backColor=NAVY)
Q_STYLE = S('QStyle', fontSize=10.5, textColor=BLACK, fontName='Helvetica-Bold',
spaceAfter=3, spaceBefore=8, leading=14)
OPT_STYLE = S('OptStyle', fontSize=10, textColor=colors.HexColor('#222222'),
fontName='Helvetica', spaceAfter=2, leftIndent=12, leading=13)
ANS_STYLE = S('AnsStyle', fontSize=10, textColor=TEAL, fontName='Helvetica-Bold',
spaceAfter=2, leftIndent=12, leading=13)
EXP_STYLE = S('ExpStyle', fontSize=9.5, textColor=colors.HexColor('#333333'),
fontName='Helvetica', spaceAfter=2, leftIndent=12, leading=13,
backColor=colors.HexColor('#eaf7f7'))
HINT_STYLE = S('HintStyle', fontSize=9, textColor=colors.HexColor('#7a4f00'),
fontName='Helvetica-Oblique', spaceAfter=2, leftIndent=12, leading=12,
backColor=colors.HexColor('#fff8e1'))
TAG_STYLE = S('TagStyle', fontSize=8.5, textColor=CORAL, fontName='Helvetica-Bold',
spaceAfter=6, leftIndent=12)
BODY_STYLE = S('BodyStyle', fontSize=10, textColor=BLACK, fontName='Helvetica',
spaceAfter=4, leading=14)
CS_HDR = S('CSHdr', fontSize=11, textColor=WHITE, fontName='Helvetica-Bold',
backColor=TEAL, spaceAfter=2, leftIndent=4)
CS_BODY = S('CSBody', fontSize=8.5, textColor=BLACK, fontName='Helvetica',
spaceAfter=2, leading=12, leftIndent=4)
CS_BULLET = S('CSBullet', fontSize=8.5, textColor=BLACK, fontName='Helvetica',
spaceAfter=1, leading=12, leftIndent=14, firstLineIndent=-10)
IMPORTANT = S('Important', fontSize=9, textColor=colors.HexColor('#7a0000'),
fontName='Helvetica-Bold', backColor=colors.HexColor('#ffeaea'),
spaceAfter=3, leftIndent=12, leading=13)
# ── MCQ DATA ──────────────────────────────────────────────────────────────────
# Format: (question, [A,B,C,D], correct_letter, explanation, hint, past_year_tag, importance)
MCQS = [
# ── ACID-BASE BASICS ──────────────────────────────────────────────────────
(
"Q1. The normal pH of arterial blood is:",
["A. 7.0", "B. 7.2", "C. 7.4", "D. 7.6"],
"C",
"Normal arterial blood pH is 7.4 (range 7.35-7.45). It is slightly alkaline. "
"Free [H+] averages 40 nmol/L. Death occurs below pH 7 or above pH 7.8. "
"(Guyton & Hall 13e, Unit V)",
"Hint: Life is compatible within a NARROW band: 7.35-7.45. Normal = 7.4.",
"★★★★★ | Repeatedly asked in Batterjee physiology vivas & MCQs (every year)",
5
),
(
"Q2. Which of the following is defined as a proton donor?",
["A. Base", "B. Acid", "C. Buffer", "D. Salt"],
"B",
"An acid is a molecule that contributes H+ (proton) to solution (proton donor). "
"A base accepts H+ (proton acceptor). A buffer resists pH change. "
"(Lecture slide 5; Guyton & Hall 13e Ch 31)",
"Hint: Acid = proton DONOR; Base = proton ACCEPTOR. Remember 'A for Acid, A for Add H+'.",
"★★★★☆ | Frequently appears in early semester spot tests",
4
),
(
"Q3. According to Henderson-Hasselbalch equation, pH is proportional to:",
["A. [HCO3-] / [H2CO3]", "B. [H2CO3] / [HCO3-]", "C. PCO2 × [HCO3-]", "D. pK − log [HCO3-]"],
"A",
"pH = pK + log([HCO3-]/[H2CO3]). Therefore pH ∝ [HCO3-]/[H2CO3]. "
"An increase in HCO3- (numerator) raises pH (alkalosis); an increase in H2CO3/PCO2 (denominator) lowers pH (acidosis). "
"(Guyton 13e, Ch 30; Ganong 25e, Ch 37)",
"Hint: Bicarbonate on TOP = alkaline tendency. CO2 on BOTTOM = acidic tendency.",
"★★★★★ | Core equation - appears in calculations and conceptual Qs",
5
),
(
"Q4. The pK of the bicarbonate buffer system is:",
["A. 6.8", "B. 7.4", "C. 6.1", "D. 9.0"],
"C",
"The pK of the bicarbonate buffer = 6.1. Despite this being far from blood pH of 7.4, "
"bicarbonate is still the most physiologically important buffer because its components "
"(HCO3- regulated by kidney; PCO2 regulated by lungs) are independently controlled. "
"(Lecture slide 11)",
"Hint: pK values to remember — Bicarbonate = 6.1, Phosphate = 6.8, Ammonia = 9.0",
"★★★★★ | Classic comparison MCQ: which pK belongs to which buffer?",
5
),
(
"Q5. Which buffer is MOST effective intracellularly?",
["A. Bicarbonate", "B. Phosphate and proteins", "C. Ammonia", "D. Haemoglobin"],
"B",
"Intracellular buffers are mainly proteinate and organic phosphate. "
"Bicarbonate is the main ECF buffer. Phosphate is important intracellularly (high concentration) "
"and in tubular fluid (DCT). Haemoglobin buffers CO2 in blood. "
"(Lecture slide 12)",
"Hint: ICF = Phosphate + Proteins. ECF = Bicarbonate. Tubule DCT = Phosphate.",
"★★★☆☆ | Comparison question - ICF vs ECF buffer distributions",
3
),
(
"Q6. Which buffer has the HIGHEST buffering capacity in blood?",
["A. Plasma proteins", "B. Bicarbonate", "C. Haemoglobin", "D. Phosphate"],
"C",
"Haemoglobin has 6 times the buffering capacity of all plasma proteins combined. "
"It is present in large amounts (~750 g in an adult male). Deoxyhemoglobin is a better "
"buffer than oxyhemoglobin. (Lecture slide 13)",
"Hint: Hb = high QUANTITY. '6x plasma proteins' - a favourite exam number!",
"★★★★☆ | Haemoglobin vs plasma protein buffering comparison",
4
),
(
"Q7. Deoxyhemoglobin compared to oxyhemoglobin as a buffer is:",
["A. Equally effective", "B. Less effective", "C. More effective", "D. Inactive"],
"C",
"Deoxyhemoglobin is a BETTER buffer than oxyhemoglobin. This is physiologically "
"important in the tissues where O2 is released and CO2 is generated - deoxyHb can "
"better bind the H+ produced. (Lecture slide 13; Ganong 25e)",
"Hint: When O2 is given UP in tissues → deoxyHb → BETTER H+ buffer. The Haldane effect.",
"★★★☆☆ | Haemoglobin buffer comparison",
3
),
# ── RENAL H+ & HCO3- HANDLING ─────────────────────────────────────────────
(
"Q8. Where is H+ secreted in the renal tubule?",
["A. All segments including thin limbs", "B. PCT only",
"C. All segments EXCEPT thin limbs of loop of Henle", "D. Collecting duct only"],
"C",
"H+ is secreted in ALL parts of the renal tubule EXCEPT the thin limbs of the loop of Henle. "
"This includes PCT (85% HCO3- reabsorption), thick ascending loop (10%), DCT, and collecting ducts (4.8%). "
"(Lecture slide 17; Guyton 13e Ch 31)",
"Hint: Thin limbs = NO H+ secretion. All others = YES. This is a classic trap!",
"★★★★★ | MOST FREQUENTLY ASKED - appears in almost every past paper",
5
),
(
"Q9. What percentage of filtered HCO3- is reabsorbed in the PCT?",
["A. 50%", "B. 65%", "C. 85%", "D. 95%"],
"C",
"The PCT reabsorbs approximately 85% of filtered HCO3-. The thick ascending limb reabsorbs "
"~10%, and collecting ducts ~4.8%. Reabsorption is indirect - H+ is secreted and combines "
"with filtered HCO3- to form H2CO3, which dissociates to H2O + CO2 (catalyzed by CA-IV "
"at the luminal brush border). (Lecture slide 17)",
"Hint: PCT = 85% (bulk reabsorber). Remember '85% PCT' like '85% proximal'.",
"★★★★★ | Classic percentage question - comes up every year",
5
),
(
"Q10. The renal threshold for HCO3- reabsorption is:",
["A. 20 mEq/L", "B. 22 mEq/L", "C. 24 mEq/L", "D. 26 mEq/L"],
"D",
"The renal threshold for HCO3- reabsorption is 26 mEq/L. "
"At plasma [HCO3-] < 26 mEq/L: ALL filtered HCO3- is reabsorbed; excess H+ buffered by "
"phosphate and ammonia → acidic urine. At plasma [HCO3-] > 26 mEq/L: HCO3- starts appearing "
"in urine → alkaline urine. (Lecture slide 17)",
"Hint: Normal plasma HCO3- = 24 mEq/L. THRESHOLD = 26 mEq/L (slightly above normal).",
"★★★★★ | Threshold value - pure recall, appears every exam",
5
),
(
"Q11. Carbonic anhydrase type II (CA-II) is located in:",
["A. Tubular lumen", "B. Brush border of PCT", "C. Inside tubular cells (cytoplasm)", "D. Peritubular capillary"],
"C",
"CA-II is an intracellular enzyme found in the cytoplasm of renal tubular cells. "
"It catalyzes: CO2 + H2O → H2CO3 → H+ + HCO3- inside the cell. "
"CA-IV is found at the brush border (luminal membrane) of PCT and catalyzes the "
"reverse reaction in the lumen. (Brenner & Rector's Kidney; Campbell-Walsh)",
"Hint: CA-II = INTRAcellular (generates H+ for secretion). CA-IV = luminal border (dehydration of H2CO3 in lumen).",
"★★★★☆ | CA-II vs CA-IV location distinction - classic MCQ setup",
4
),
(
"Q12. The mechanism of H+ secretion in the PCT is:",
["A. Primary active transport via H+/K+-ATPase",
"B. Secondary active transport via Na+/H+ antiporter (NHE3)",
"C. Passive diffusion",
"D. Facilitated diffusion"],
"B",
"In the PCT, loop of Henle, and early DCT, H+ secretion occurs by SECONDARY active transport "
"via the Na+/H+ antiporter (NHE3) at the luminal membrane. Na+ diffuses IN (down gradient) "
"while H+ is secreted OUT (against gradient). The energy comes from the Na+ gradient maintained "
"by basolateral Na+/K+-ATPase. (Lecture slide 20; Ganong 26e; Guyton 13e)",
"Hint: PCT = NHE3 (Na-H Exchanger 3) = Secondary active. Late DCT/CDs = H+/K+-ATPase = Primary active.",
"★★★★★ | Mechanism contrast (primary vs secondary) - extremely high yield",
5
),
(
"Q13. Primary active H+ secretion in the kidney occurs in:",
["A. PCT", "B. Thick ascending loop", "C. Early DCT", "D. Late DCT and collecting ducts"],
"D",
"Primary active H+ secretion (Na+-independent, stimulated by aldosterone) occurs in "
"the LATE DCT and collecting ducts. It uses H+/K+-ATPase pump at the luminal membrane of "
"type A (alpha) intercalated cells. This can be increased up to 900-fold by aldosterone. "
"(Lecture slide 20)",
"Hint: 'LATE = PRIMARY'. Alpha intercalated cells. H+/K+-ATPase. Aldosterone-sensitive.",
"★★★★★ | Segment-specific mechanism - core exam topic",
5
),
(
"Q14. Type A (alpha) intercalated cells of the collecting duct:",
["A. Secrete HCO3- into urine",
"B. Secrete H+ via H+/K+-ATPase into tubular lumen",
"C. Reabsorb H+ from tubular lumen",
"D. Have NHE3 on their luminal surface"],
"B",
"Type A (alpha) intercalated cells secrete H+ via the H+/K+-ATPase pump into the tubular lumen "
"(primary active transport). HCO3- exits the basolateral side. Type B (beta) intercalated cells "
"do the opposite - they secrete HCO3- into the lumen (in alkalosis). (Lecture slide 20; Brenner & Rector)",
"Hint: Alpha (A) = Acid secretion. Beta (B) = Bicarbonate secretion. Opposite roles!",
"★★★★★ | Alpha vs Beta intercalated cell distinction - very frequently tested",
5
),
(
"Q15. Aldosterone stimulates H+ secretion in the collecting duct by how much?",
["A. 10-fold", "B. 100-fold", "C. 500-fold", "D. Up to 900-fold"],
"D",
"Aldosterone stimulates primary active H+ secretion in the late DCT and collecting ducts, "
"and can increase it by up to 900-fold. This is why hyperaldosteronism (Conn's syndrome, "
"Cushing's) causes metabolic alkalosis. (Lecture slide 20)",
"Hint: Aldosterone = 900-fold increase. This number is a favourite exam trick - not 100, not 500 - 900!",
"★★★★☆ | Aldosterone effect magnitude - number-based MCQ",
4
),
# ── FATE OF H+ / BUFFER SYSTEMS IN TUBULE ────────────────────────────────
(
"Q16. In the PCT, secreted H+ is mainly buffered by:",
["A. Phosphate buffer", "B. Ammonia (NH3)", "C. Bicarbonate (NaHCO3)", "D. Haemoglobin"],
"C",
"In the PCT, secreted H+ is buffered by NaHCO3 in the tubular fluid. "
"H+ + HCO3- → H2CO3 → H2O + CO2 (catalyzed by CA-IV at brush border). "
"CO2 re-enters the cell. pH of tubular fluid changes very little in the PCT. "
"(Lecture slide 22)",
"Hint: PCT = Bicarbonate buffer (abundant here). DCT/CDs = Phosphate + Ammonia.",
"★★★★★ | Buffer segment matching - tested in every exam",
5
),
(
"Q17. In the DCT and collecting ducts, secreted H+ is buffered by: (select BEST answer)",
["A. Bicarbonate only",
"B. Phosphate buffer and ammonia system",
"C. Haemoglobin",
"D. Bicarbonate and haemoglobin"],
"B",
"In the DCT and collecting ducts, H+ is buffered by: "
"(1) Phosphate buffer: H+ + Na2HPO4 → NaH2PO4 + Na+ (titratable acidity). "
"(2) Ammonia system: NH3 (from glutamine in tubular cells) + H+ → NH4+, trapped and excreted as NH4Cl. "
"Bicarbonate is largely exhausted by the time fluid reaches DCT. (Lecture slides 23-25)",
"Hint: DCT = 'PA' - Phosphate + Ammonia. Bicarbonate is for PCT only.",
"★★★★★ | Two-buffer system of distal nephron - high yield",
5
),
(
"Q18. The pK of the ammonia/ammonium buffer system is:",
["A. 6.1", "B. 6.8", "C. 7.4", "D. 9.0"],
"D",
"The pK for NH3/NH4+ = 9.0. At normal blood pH 7.4, the ratio [NH4+]/[NH3] = 100:1 "
"(almost all as NH4+). NH3 is lipid-soluble and diffuses freely into tubular fluid, "
"where it combines with H+ to form lipid-INSOLUBLE NH4+ (trapped). "
"(Lecture slide 24-25)",
"Hint: pK ladder - Bicarb=6.1, Phosphate=6.8, Ammonia=9.0. Ascending order!",
"★★★★☆ | pK values - fill-in-the-blank and MCQ format",
4
),
(
"Q19. Ammonia (NH3) is synthesized in renal tubular cells mainly from:",
["A. Alanine", "B. Glutamine", "C. Aspartate", "D. Glycine"],
"B",
"NH3 is synthesized mainly from GLUTAMINE in renal tubular epithelial cells "
"(predominantly in DCT and collecting ducts, but also in other tubular segments). "
"Glutaminase cleaves glutamine → glutamate + NH3. "
"NH3 is lipid-soluble → diffuses into lumen → + H+ → NH4+ (trapped) → excreted as NH4Cl. "
"(Lecture slide 24; Goldman-Cecil Medicine)",
"Hint: Glutamine = parent of NH3 in kidney. 'Gluta-MINE provides aMINEonia'.",
"★★★★★ | Glutamine → NH3 → NH4Cl pathway - core exam topic",
5
),
(
"Q20. The limiting pH for H+ secretion in the DCT and collecting ducts is:",
["A. 5.0", "B. 4.5", "C. 6.0", "D. 5.5"],
"B",
"H+ secretion in the DCT and collecting ducts continues as long as tubular fluid pH "
"remains ABOVE 4.5. Below pH 4.5, further H+ secretion stops. This is why buffering "
"by phosphate and ammonia is essential - it prevents rapid acidification and allows "
"continued H+ secretion. (Lecture slide 25)",
"Hint: Limiting pH = 4.5. Without buffers, pH would hit 4.5 quickly → H+ secretion STOPS.",
"★★★★★ | Limiting pH value - pure recall, appears every year",
5
),
(
"Q21. NH4+ (ammonium) is excreted in urine together with:",
["A. HCO3-", "B. SO4--", "C. Cl- (as NH4Cl)", "D. PO4---"],
"C",
"NH4+ is excreted in urine as NH4Cl (ammonium chloride). The Cl- comes from NaCl; "
"Na+ is reabsorbed into the renal interstitium along with HCO3- from the tubular cells. "
"This represents net acid excretion and HCO3- generation. (Lecture slide 25)",
"Hint: NH4+ + Cl- → NH4Cl in urine. Na+ is saved. Think: swap Na+ for NH4+.",
"★★★☆☆ | Final product of NH3 buffering",
3
),
# ── FACTORS AFFECTING H+ SECRETION ───────────────────────────────────────
(
"Q22. Which of the following INCREASES H+ secretion in the renal tubule?",
["A. Inhibition of carbonic anhydrase",
"B. K+ excess in cells",
"C. Aldosterone",
"D. Intracellular alkalosis"],
"C",
"Factors that INCREASE H+ secretion: (1) Aldosterone (2) Increased intracellular PCO2 "
"(respiratory acidosis) (3) K+ depletion in cells (intracellular acidosis). "
"Factors that DECREASE H+ secretion: CA inhibition, K+ excess in cells. "
"(Lecture slide 26)",
"Hint: Aldosterone = 'A for Acid' - always increases H+ secretion. Hypokalaemia paradoxically causes alkalosis via this.",
"★★★★★ | Factors affecting secretion - regulation MCQ",
5
),
(
"Q23. In hypokalaemia (K+ depletion from cells), H+ secretion is:",
["A. Decreased", "B. Unchanged", "C. Increased (intracellular acidosis)", "D. Abolished"],
"C",
"When K+ leaves cells (hypokalaemia), H+ moves IN to maintain electroneutrality "
"→ intracellular acidosis → ENHANCED H+ secretion by renal tubules → metabolic alkalosis. "
"Conversely, hyperkalaemia causes intracellular alkalosis and decreases H+ secretion. "
"(Lecture slide 26; Guyton 13e)",
"Hint: Low K+ → H+ enters cells → inside acidic → kidney secretes MORE H+ → urine acidic + blood alkalotic.",
"★★★★★ | K+/H+ relationship - classic clinical MCQ, repeated yearly",
5
),
(
"Q24. Carbonic anhydrase inhibitors (e.g. acetazolamide) cause:",
["A. Metabolic alkalosis",
"B. Metabolic acidosis with proximal RTA",
"C. Respiratory acidosis",
"D. Respiratory alkalosis"],
"B",
"CA inhibitors block intracellular CA-II → less H2CO3 formation → less H+ secretion "
"→ less HCO3- reabsorption in PCT → HCO3- lost in urine → metabolic acidosis "
"(proximal renal tubular acidosis type II). (Lecture slide 26; Brenner & Rector)",
"Hint: Acetazolamide blocks CA → bicarbonate WASTED in urine → TYPE 2 (proximal) RTA.",
"★★★★☆ | CA inhibitor clinical application",
4
),
# ── ACID-BASE DISTURBANCES ────────────────────────────────────────────────
(
"Q25. In respiratory acidosis, the kidney compensates by:",
["A. Increasing HCO3- loss in urine",
"B. Increasing H+ secretion and HCO3- generation",
"C. Reducing NH3 synthesis",
"D. Reducing phosphate buffer secretion"],
"B",
"In respiratory acidosis (high PCO2), increased CO2 diffuses into tubular cells "
"→ more H2CO3 formation → more H+ secretion → more HCO3- generated and returned to plasma "
"→ increased plasma [HCO3-] → compensates the low pH. This is RENAL COMPENSATION "
"(takes 12-24 hrs). (Lecture slides 29-30)",
"Hint: Resp. Acidosis → Renal gives MORE HCO3- (raises pH back). Renal compensation takes DAYS.",
"★★★★★ | Compensation mechanism - acid-base MCQ staple",
5
),
(
"Q26. Respiratory acidosis is characterized by:",
["A. pH > 7.45 and PCO2 < 35 mmHg",
"B. pH < 7.35 and PCO2 > 44 mmHg",
"C. pH < 7.35 and HCO3- < 22 mEq/L",
"D. pH > 7.45 and HCO3- > 26 mEq/L"],
"B",
"Respiratory acidosis: pH < 7.35 (acidosis) + PCO2 > 44 mmHg (hypercapnia). "
"Causes: narcotic depression of resp. centre, airway obstruction (asthma, emphysema), "
"respiratory muscle paralysis. (Lecture slide 30)",
"Hint: Resp. ACID → HIGH CO2. Resp. ALK → LOW CO2. Metabolic ACID → LOW HCO3-.",
"★★★★★ | ABG interpretation - most clinically tested topic",
5
),
(
"Q27. A patient has pH 7.52, PCO2 28 mmHg, HCO3- 22 mEq/L. This is:",
["A. Metabolic alkalosis",
"B. Respiratory alkalosis with partial renal compensation",
"C. Metabolic acidosis",
"D. Respiratory acidosis"],
"B",
"pH 7.52 (alkalosis) + low PCO2 28 mmHg (primary resp. alkalosis). "
"Low HCO3- 22 mEq/L = renal compensation (kidneys retain less HCO3-). "
"Causes include hyperventilation (anxiety, altitude, fever). (Lecture slide 31)",
"Hint: Step approach: 1) pH>7.45=alkalosis. 2) PCO2 low→ resp. primary. 3) Low HCO3- = compensation.",
"★★★★☆ | ABG interpretation clinical scenario",
4
),
(
"Q28. Which of the following causes metabolic acidosis with a HIGH anion gap?",
["A. Diarrhea",
"B. Diabetic ketoacidosis",
"C. Renal tubular acidosis type I",
"D. Pancreatic fistula"],
"B",
"HIGH anion gap metabolic acidosis (MUDPILES): Methanol, Uraemia, DKA, Propylene glycol, "
"Isoniazid/Infection, Lactic acidosis, Ethylene glycol, Salicylates. "
"Diarrhea, RTA, and pancreatic fistula cause NORMAL anion gap (hyperchloraemic) metabolic acidosis. "
"(Lecture slide 32; Goldman-Cecil)",
"Hint: DKA = ketoacids added → high AG. Diarrhea = HCO3- lost → normal AG (hyperCl-).",
"★★★★★ | Anion gap distinction - appears in clinical reasoning Qs",
5
),
(
"Q29. A patient on prolonged vomiting develops:",
["A. Metabolic acidosis",
"B. Respiratory alkalosis",
"C. Metabolic alkalosis",
"D. Respiratory acidosis"],
"C",
"Prolonged vomiting loses HCl (H+ and Cl-) → HCO3- is added to plasma "
"(since H+ was lost from parietal cells while HCO3- was returned to blood) "
"→ plasma [HCO3-] rises → metabolic alkalosis. (Lecture slide 34)",
"Hint: Vomiting = loses HCl = loses ACID = blood becomes BASIC = metabolic ALKalosis.",
"★★★★★ | Vomiting → metabolic alkalosis - classic clinical MCQ",
5
),
(
"Q30. Conn's syndrome (primary hyperaldosteronism) causes:",
["A. Metabolic acidosis",
"B. Respiratory acidosis",
"C. Metabolic alkalosis",
"D. Respiratory alkalosis"],
"C",
"Conn's syndrome (excess aldosterone) → increased primary active H+ secretion "
"(up to 900-fold) in collecting duct → excessive H+ loss → metabolic alkalosis. "
"Also associated with hypokalaemia (K+ secretion increased) which further enhances H+ secretion. "
"(Lecture slide 34; Guyton 13e)",
"Hint: Excess aldosterone → H+ & K+ lost → metabolic ALKalosis + hypokalaemia.",
"★★★★★ | Conn's syndrome acid-base effect - high yield clinical MCQ",
5
),
(
"Q31. Diabetic ketoacidosis causes acid-base imbalance because:",
["A. Excessive CO2 retention",
"B. Loss of HCO3- in urine",
"C. Accumulation of acetoacetate and beta-hydroxybutyrate",
"D. Excess protein intake only"],
"C",
"In DKA, lack of insulin → increased fat metabolism → accumulation of ketoacids "
"(acetoacetate, 3-beta-hydroxybutyrate, acetone) → H+ added to ECF → depletes HCO3- "
"→ metabolic acidosis with high anion gap. Kussmaul breathing is the respiratory compensation. "
"(Lecture slide 32; Guyton 13e Ch 31)",
"Hint: DKA: acetoacetate + B-OH-butyrate = ACIDS → consume HCO3- → metabolic ACIDOSIS.",
"★★★★★ | DKA mechanism - pathophysiology + acid-base",
5
),
(
"Q32. The respiratory system can return pH how far back to normal after an acute disturbance?",
["A. 1/3 of the way", "B. 1/2 of the way", "C. 2/3 of the way", "D. Fully back to normal"],
"C",
"The respiratory system can return [H+] and pH about 2/3 of the way back toward normal "
"within 1-12 minutes after a sudden disturbance. Its buffering power is 1-2 times that "
"of all chemical buffers combined. However, it has limited ability because changes in "
"PCO2 have opposite effects on respiration. (Lecture slide 15)",
"Hint: Respiratory = 2/3 correction, within minutes. Renal = full correction, takes 12-24 hours.",
"★★★★☆ | Comparison of speed and efficacy of regulatory systems",
4
),
(
"Q33. Which organ is described as the 'most efficient and most powerful' regulator of acid-base?",
["A. Lungs", "B. Liver", "C. Kidneys", "D. Red blood cells"],
"C",
"The KIDNEYS are the most efficient and most powerful regulators of acid-base balance. "
"They excrete fixed acids and restore ECF buffers. They can bring pH fully back to normal "
"within 12-24 hours (vs lungs which restore 2/3 within minutes). (Lecture slide 15)",
"Hint: Kidneys = SLOWEST but MOST POWERFUL (complete correction). Lungs = fast but partial.",
"★★★★★ | System comparison - almost guaranteed in every exam",
5
),
(
"Q34. Sources of H+ in the body include all EXCEPT:",
["A. Metabolism of carbohydrates (CO2)",
"B. Ketoacids from fat metabolism",
"C. Lactic acid from anaerobic exercise",
"D. Synthesis of bicarbonate by liver"],
"D",
"Sources of H+: (1) Ingested food (2) CHO metabolism → CO2 → H2CO3 (volatile acid) "
"12,000-20,000 mmol/day (3) Protein/lipid → H2SO4, H3PO4 (fixed acids) 40-80 mmol/day "
"(4) Lactic acid in anaerobic exercise (5) Ketoacids (DM). "
"Bicarbonate synthesis by liver is NOT a source of H+. (Lecture slides 6-7)",
"Hint: Everything that generates H+ = source. Bicarbonate = buffer/alkali, not H+ source.",
"★★★☆☆ | Enumeration MCQ - sources of H+",
3
),
(
"Q35. In metabolic acidosis, the respiratory compensation is:",
["A. Hypoventilation to retain CO2",
"B. Hyperventilation (Kussmaul breathing) to blow off CO2",
"C. No respiratory response",
"D. Increased tidal volume only, no rate change"],
"B",
"In metabolic acidosis, increased [H+] stimulates peripheral chemoreceptors "
"→ stimulates respiratory centre → HYPERVENTILATION (Kussmaul breathing) "
"→ ↓ PCO2 → ↓ [H+] toward normal. However, hyperventilation is insufficient to fully "
"restore pH. (Lecture slide 33)",
"Hint: Metabolic ACIDOSIS → HYPERVENTILATION (blow off CO2 = acid). 'Kussmaul' = deep rapid breathing of DKA.",
"★★★★★ | Kussmaul breathing / respiratory compensation of metabolic acidosis",
5
),
]
def star_row(imp):
stars = '★' * imp + '☆' * (5 - imp)
return stars
def build_cover(story, styles_dict):
# Cover page header block
cover_data = [
[Paragraph("BATTERJEE MEDICAL COLLEGE, JEDDAH", COVER_TITLE)],
[Paragraph("HIGH-YIELD MCQ EXAMINATION PACK", COVER_SUB)],
[Paragraph("H⁺ & HCO₃⁻ Handling by the Renal Tubules", COVER_SUB)],
[Paragraph("Acid-Base Balance & Disturbances", COVER_INFO)],
[Paragraph("Based on: Dr. Hader I. Sakr's Lecture | Guyton 13e | Ganong 26e | Brenner & Rector", COVER_INFO)],
[Paragraph("35 High-Yield MCQs • Detailed Explanations • Memory Hints • Past-Year Tags", COVER_INFO)],
[Paragraph("+ 2-Page Printable Cheatsheet with Diagrams", COVER_INFO)],
[Paragraph("Prepared June 2026", COVER_INFO)],
]
tbl = Table(cover_data, colWidths=[W - 4*cm])
tbl.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), 16),
('RIGHTPADDING', (0,0), (-1,-1), 16),
('ROWBACKGROUNDS', (0,0), (-1,-1), [NAVY, NAVY]),
('BOX', (0,0), (-1,-1), 2, AMBER),
]))
story.append(Spacer(1, 2*cm))
story.append(tbl)
story.append(Spacer(1, 0.5*cm))
# Key stats table
stats = [
['35', 'High-yield MCQs', '100%', 'Lecture-aligned'],
['5 ★', 'Critical topics', '12-24h', 'Renal correction time'],
]
st = Table([
[Paragraph(f"<b>{a}</b>", S('x', fontSize=18, textColor=AMBER, fontName='Helvetica-Bold', alignment=TA_CENTER)),
Paragraph(b, S('x', fontSize=9, textColor=WHITE, fontName='Helvetica', alignment=TA_CENTER)),
Paragraph(f"<b>{c}</b>", S('x', fontSize=18, textColor=AMBER, fontName='Helvetica-Bold', alignment=TA_CENTER)),
Paragraph(d, S('x', fontSize=9, textColor=WHITE, fontName='Helvetica', alignment=TA_CENTER))]
for a,b,c,d in stats
], colWidths=[(W-4*cm)/4]*4)
st.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), colors.HexColor('#0d2440')),
('BOX', (0,0), (-1,-1), 1, TEAL),
('INNERGRID', (0,0), (-1,-1), 0.5, TEAL),
('TOPPADDING', (0,0), (-1,-1), 10),
('BOTTOMPADDING', (0,0), (-1,-1), 10),
]))
story.append(st)
story.append(PageBreak())
def section_header(text, color=NAVY):
data = [[Paragraph(f" {text}", S('x', fontSize=12, textColor=WHITE,
fontName='Helvetica-Bold'))]]
t = Table(data, colWidths=[W - 4*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), color),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
]))
return t
def importance_badge(imp):
stars = '★' * imp + '☆' * (5-imp)
color_map = {5: CORAL, 4: AMBER, 3: TEAL, 2: colors.grey, 1: colors.lightgrey}
c = color_map.get(imp, TEAL)
p = Paragraph(f"Importance: {stars}", S('x', fontSize=9, textColor=c,
fontName='Helvetica-Bold'))
return p
def build_mcqs(story):
story.append(section_header("HIGH-YIELD MCQs — QUESTIONS ONLY (Answer Sheet follows)", NAVY))
story.append(Spacer(1, 0.3*cm))
# Quick answer key box
aq = " ".join([f"Q{i+1}:{q[2]}" for i,q in enumerate(MCQS)])
aq_lines = [aq[j:j+80] for j in range(0, len(aq), 80)]
aq_text = "<br/>".join(aq_lines)
ak_data = [[Paragraph(f"<b>QUICK ANSWER KEY:</b> {aq_text}",
S('x', fontSize=7.5, textColor=NAVY, fontName='Courier',
leading=11))]]
ak_t = Table(ak_data, colWidths=[W-4*cm])
ak_t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), colors.HexColor('#eef4ff')),
('BOX', (0,0), (-1,-1), 1, NAVY),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 8),
]))
story.append(ak_t)
story.append(Spacer(1, 0.4*cm))
# Sections
sections = [
("Acid-Base Basics (Q1-Q7)", 0, 7),
("Renal H⁺ & HCO₃⁻ Handling (Q8-Q15)", 7, 15),
("Buffer Fate in Renal Tubules (Q16-Q24)", 15, 24),
("Acid-Base Disturbances & Compensation (Q25-Q35)", 24, 35),
]
for sec_name, start, end in sections:
story.append(Spacer(1, 0.3*cm))
story.append(section_header(sec_name, TEAL))
story.append(Spacer(1, 0.2*cm))
for i in range(start, end):
q, opts, ans, exp, hint, tag, imp = MCQS[i]
block = []
block.append(Paragraph(q, Q_STYLE))
for opt in opts:
block.append(Paragraph(opt, OPT_STYLE))
block.append(Spacer(1, 4))
story.append(KeepTogether(block))
def build_answers(story):
story.append(PageBreak())
story.append(section_header("DETAILED ANSWERS, EXPLANATIONS & MEMORY HINTS", NAVY))
story.append(Spacer(1, 0.3*cm))
sections = [
("Acid-Base Basics (Q1-Q7)", 0, 7),
("Renal H⁺ & HCO₃⁻ Handling (Q8-Q15)", 7, 15),
("Buffer Fate in Renal Tubules (Q16-Q24)", 15, 24),
("Acid-Base Disturbances & Compensation (Q25-Q35)", 24, 35),
]
for sec_name, start, end in sections:
story.append(Spacer(1, 0.3*cm))
story.append(section_header(sec_name, TEAL))
story.append(Spacer(1, 0.2*cm))
for i in range(start, end):
q, opts, ans, exp, hint, tag, imp = MCQS[i]
block = []
block.append(Paragraph(q, Q_STYLE))
for opt in opts:
letter = opt[0]
if letter == ans:
block.append(Paragraph(f"✔ {opt} ← CORRECT", ANS_STYLE))
else:
block.append(Paragraph(opt, OPT_STYLE))
block.append(Paragraph(f"📖 {exp}", EXP_STYLE))
block.append(Paragraph(f"💡 {hint}", HINT_STYLE))
block.append(Paragraph(f"📅 {tag}", TAG_STYLE))
block.append(importance_badge(imp))
block.append(HRFlowable(width=W-4*cm, thickness=0.5, color=MGRAY))
story.append(KeepTogether(block[:7]))
# Overflow items without KeepTogether
for item in block[7:]:
story.append(item)
# ── CHEATSHEET ────────────────────────────────────────────────────────────────
def build_cheatsheet(story):
story.append(PageBreak())
story.append(section_header("PRINTABLE CHEATSHEET — PAGE 1: ACID-BASE FUNDAMENTALS", colors.HexColor('#1a1a6e')))
story.append(Spacer(1, 0.3*cm))
# pH range table
ph_data = [
[Paragraph('<b>Parameter</b>', CS_HDR), Paragraph('<b>Normal Value</b>', CS_HDR), Paragraph('<b>Clinical Note</b>', CS_HDR)],
['Arterial pH', '7.35 – 7.45 (mean 7.4)', 'Below 7.35 = Acidosis; Above 7.45 = Alkalosis'],
['[H+] free in ECF', '40 nmol/L', 'Very low vs Na+ (140 mmol/L)'],
['Death range', 'pH < 7.0 or > 7.8', 'Incompatible with life'],
['Plasma [HCO3-]', '24 mEq/L (normal)', 'Regulated by kidneys'],
['Arterial PCO2', '35–45 mmHg', 'Regulated by lungs'],
['Renal HCO3- threshold', '26 mEq/L', '>26 → HCO3- in urine (alkaline urine)'],
['Limiting tubular pH', '4.5', 'Below this = H+ secretion stops'],
]
ph_t = Table(ph_data, colWidths=[(W-4*cm)*0.28, (W-4*cm)*0.28, (W-4*cm)*0.44])
ph_t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), NAVY),
('TEXTCOLOR', (0,0), (-1,0), WHITE),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 8.5),
('ROWBACKGROUNDS', (0,1), (-1,-1), [WHITE, LGRAY]),
('BOX', (0,0), (-1,-1), 1, NAVY),
('INNERGRID', (0,0), (-1,-1), 0.3, MGRAY),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 6),
]))
story.append(ph_t)
story.append(Spacer(1, 0.3*cm))
# Buffer pK table
story.append(Paragraph("BUFFER SYSTEMS pK VALUES", CS_HDR))
buf_data = [
[Paragraph('<b>Buffer</b>', CS_HDR), Paragraph('<b>pK</b>', CS_HDR), Paragraph('<b>Location</b>', CS_HDR), Paragraph('<b>Key Features</b>', CS_HDR)],
['Bicarbonate (HCO3-/H2CO3)', '6.1', 'ECF (plasma)', 'Physiologically controlled — MOST IMPORTANT despite far pK'],
['Phosphate (HPO4²-/H2PO4-)', '6.8', 'ICF; tubular fluid (DCT)', 'Important in DCT; titratable acidity'],
['Proteins/Haemoglobin', '~7.4', 'Blood/ICF', 'Hb has 6× capacity of plasma proteins; deoxyHb = better buffer'],
['Ammonia (NH3/NH4+)', '9.0', 'Renal tubules (DCT/CDs)', 'NH3 lipid-soluble → diffuses into lumen; trapped as NH4Cl'],
]
buf_t = Table(buf_data, colWidths=[(W-4*cm)*0.32, (W-4*cm)*0.08, (W-4*cm)*0.24, (W-4*cm)*0.36])
buf_t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), TEAL),
('TEXTCOLOR', (0,0), (-1,0), WHITE),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 8),
('ROWBACKGROUNDS', (0,1), (-1,-1), [WHITE, LGRAY]),
('BOX', (0,0), (-1,-1), 1, TEAL),
('INNERGRID', (0,0), (-1,-1), 0.3, MGRAY),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 5),
]))
story.append(buf_t)
story.append(Spacer(1, 0.3*cm))
# Henderson-Hasselbalch
story.append(Paragraph("HENDERSON-HASSELBALCH EQUATION", CS_HDR))
hh_data = [[
Paragraph("<b>pH = 6.1 + log([HCO₃⁻] / [H₂CO₃])</b><br/>"
"Where [H₂CO₃] = 0.03 × PCO₂ (mmHg)<br/>"
"<i>Normal: pH = 6.1 + log(24 / 1.2) = 6.1 + log(20) = 6.1 + 1.3 = 7.4</i>",
S('x', fontSize=9, fontName='Helvetica', leading=13, leftIndent=4)),
Paragraph("<b>Key rules:</b><br/>"
"↑ HCO₃- → ↑ pH (alkalosis) — metabolic<br/>"
"↑ PCO₂ → ↓ pH (acidosis) — respiratory<br/>"
"↓ HCO₃- → ↓ pH (acidosis) — metabolic<br/>"
"↓ PCO₂ → ↑ pH (alkalosis) — respiratory",
S('x', fontSize=9, fontName='Helvetica', leading=13, leftIndent=4)),
]]
hh_t = Table(hh_data, colWidths=[(W-4*cm)*0.5, (W-4*cm)*0.5])
hh_t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), colors.HexColor('#eef8ff')),
('BOX', (0,0), (-1,-1), 1.5, NAVY),
('TOPPADDING', (0,0), (-1,-1), 8),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
('LEFTPADDING', (0,0), (-1,-1), 8),
('LINEAFTER', (0,0), (0,-1), 1, MGRAY),
]))
story.append(hh_t)
story.append(Spacer(1, 0.3*cm))
# Acid-base disturbances table
story.append(Paragraph("ACID-BASE DISTURBANCES AT A GLANCE", CS_HDR))
dist_data = [
[Paragraph('<b>Disorder</b>', CS_HDR), Paragraph('<b>pH</b>', CS_HDR),
Paragraph('<b>Primary Change</b>', CS_HDR), Paragraph('<b>Compensation</b>', CS_HDR),
Paragraph('<b>Key Causes</b>', CS_HDR)],
['Resp. Acidosis', '<7.35', '↑ PCO₂ >44mmHg', '↑ Renal HCO₃- (12-24h)', 'Narcotics, COPD, asthma, NMJ disease'],
['Resp. Alkalosis', '>7.45', '↓ PCO₂ <35mmHg', '↓ Renal HCO₃- (days)', 'Hyperventilation, altitude, anxiety, fever'],
['Metabolic Acidosis', '<7.35', '↓ HCO₃- <22mEq/L', 'Hyperventilation (min)', 'DKA, lactic acidosis, diarrhea, RTA, RF'],
['Metabolic Alkalosis', '>7.45', '↑ HCO₃- >26mEq/L', 'Hypoventilation (limited)', 'Vomiting, Conn\'s, Cushing\'s, diuretics'],
]
dist_t = Table(dist_data, colWidths=[(W-4*cm)*0.18, (W-4*cm)*0.08,
(W-4*cm)*0.22, (W-4*cm)*0.22, (W-4*cm)*0.30])
dist_t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), NAVY),
('TEXTCOLOR', (0,0), (-1,0), WHITE),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 8),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#fff0f0'), colors.HexColor('#f0f8ff'),
colors.HexColor('#fff0f0'), colors.HexColor('#f0f8ff')]),
('BOX', (0,0), (-1,-1), 1, NAVY),
('INNERGRID', (0,0), (-1,-1), 0.3, MGRAY),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 5),
]))
story.append(dist_t)
# Page 2 - Tubule Diagram + Mechanisms
story.append(PageBreak())
story.append(section_header("PRINTABLE CHEATSHEET — PAGE 2: RENAL TUBULE MECHANISMS (LABELLED DIAGRAM)", colors.HexColor('#1a1a6e')))
story.append(Spacer(1, 0.3*cm))
# ASCII-style labelled tubule diagram using ReportLab graphics
build_tubule_diagram(story)
story.append(Spacer(1, 0.3*cm))
# Mechanism summary table
story.append(Paragraph("H⁺ SECRETION: SEGMENT-BY-SEGMENT SUMMARY", CS_HDR))
mech_data = [
[Paragraph('<b>Segment</b>', CS_HDR), Paragraph('<b>Mechanism</b>', CS_HDR),
Paragraph('<b>H⁺ Buffer in Lumen</b>', CS_HDR), Paragraph('<b>% HCO₃- Reabsorbed</b>', CS_HDR)],
['PCT', 'Secondary active (NHE3 antiporter)\nNa+in / H+out', 'Bicarbonate (HCO₃⁻)\n→ H₂CO₃ → H₂O + CO₂ (CA-IV)', '~85%'],
['Thick Ascending Loop', 'Secondary active (NHE3)', 'Bicarbonate', '~10%'],
['Early DCT', 'Secondary active (NHE3)', 'Bicarbonate → exhausted', 'Small'],
['Late DCT & CDs (α-IC cells)', 'PRIMARY ACTIVE\nH⁺/K⁺-ATPase\n(aldosterone-stimulated, ×900)', 'Phosphate → NaH₂PO₄ (titratable acid)\nAmmonia (from Gln) → NH₄Cl', '~4.8%'],
['Thin Limb Loop of Henle', 'NONE', 'NONE', '0%'],
]
mech_t = Table(mech_data, colWidths=[(W-4*cm)*0.22, (W-4*cm)*0.28, (W-4*cm)*0.32, (W-4*cm)*0.18])
mech_t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), TEAL),
('TEXTCOLOR', (0,0), (-1,0), WHITE),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 8),
('ROWBACKGROUNDS', (0,1), (-1,-1), [WHITE, LGRAY, WHITE, LGRAY, colors.HexColor('#fff0f0')]),
('BOX', (0,0), (-1,-1), 1, TEAL),
('INNERGRID', (0,0), (-1,-1), 0.3, MGRAY),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 5),
('FONTNAME', (0,4), (-1,4), 'Helvetica-Bold'),
('TEXTCOLOR', (0,5), (-1,5), CORAL),
('FONTNAME', (0,5), (-1,5), 'Helvetica-Bold'),
]))
story.append(mech_t)
story.append(Spacer(1, 0.25*cm))
# Glutamine/NH3 pathway box
story.append(Paragraph("AMMONIA GENERATION PATHWAY (DCT/CDs)", CS_HDR))
gln_data = [[
Paragraph("<b>Glutamine</b> (from circulation)<br/>"
"↓ <i>Glutaminase (mitochondria)</i><br/>"
"Glutamate + <b>NH₃</b><br/>"
"↓ <i>Glutamate dehydrogenase</i><br/>"
"α-ketoglutarate + <b>NH₃</b><br/>"
"→ Total: <b>2 NH₃ per glutamine</b>",
S('x', fontSize=9, fontName='Helvetica', leading=14, leftIndent=6)),
Paragraph("<b>NH₃</b> (lipid-soluble)<br/>"
"↓ diffuses into tubular lumen<br/>"
"NH₃ + H⁺ → <b>NH₄⁺</b> (TRAPPED — lipid insoluble)<br/>"
"NH₄⁺ + Cl⁻ → <b>NH₄Cl</b> (excreted in urine)<br/>"
"Na⁺ reabsorbed ← with HCO₃⁻ from cell<br/>"
"<b>pK = 9.0; at pH 7.4: [NH₄⁺]/[NH₃] = 100:1</b>",
S('x', fontSize=9, fontName='Helvetica', leading=14, leftIndent=6)),
]]
gln_t = Table(gln_data, colWidths=[(W-4*cm)*0.45, (W-4*cm)*0.55])
gln_t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), colors.HexColor('#f0fff4')),
('BOX', (0,0), (-1,-1), 1.5, LIME),
('LINEAFTER', (0,0), (0,-1), 1, MGRAY),
('TOPPADDING', (0,0), (-1,-1), 8),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
('LEFTPADDING', (0,0), (-1,-1), 8),
]))
story.append(gln_t)
story.append(Spacer(1, 0.25*cm))
# Factors affecting H+ secretion
story.append(Paragraph("FACTORS AFFECTING H⁺ SECRETION", CS_HDR))
fac_data = [
[Paragraph('<b>Factor</b>', CS_HDR), Paragraph('<b>Effect</b>', CS_HDR), Paragraph('<b>Mechanism</b>', CS_HDR)],
['Aldosterone ↑', '↑ H⁺ secretion (×900)', 'Stimulates H⁺/K⁺-ATPase in α-IC cells'],
['PCO₂ ↑ (resp. acidosis)', '↑ H⁺ secretion', '↑ intracellular H₂CO₃ formation'],
['K⁺ depletion (hypokalaemia)', '↑ H⁺ secretion', 'H⁺ enters cells → intracellular acidosis'],
['K⁺ excess (hyperkalaemia)', '↓ H⁺ secretion', 'H⁺ exits cells → intracellular alkalosis'],
['CA inhibitors (acetazolamide)', '↓ H⁺ secretion', '↓ intracellular H⁺ generation → proximal RTA'],
]
fac_t = Table(fac_data, colWidths=[(W-4*cm)*0.30, (W-4*cm)*0.25, (W-4*cm)*0.45])
fac_t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), NAVY),
('TEXTCOLOR', (0,0), (-1,0), WHITE),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 8),
('ROWBACKGROUNDS', (0,1), (-1,-1), [WHITE, LGRAY]),
('BOX', (0,0), (-1,-1), 1, NAVY),
('INNERGRID', (0,0), (-1,-1), 0.3, MGRAY),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 5),
]))
story.append(fac_t)
story.append(Spacer(1, 0.25*cm))
# High-yield memory box
story.append(Paragraph("★ HIGH-YIELD MEMORY AIDS (Most Common Batterjee Exam Traps)", CS_HDR))
mem_items = [
"1. Thin limb = NO H+ secretion (all other segments = YES)",
"2. PCT = 85% HCO3- reabsorption via NHE3 (secondary active, Na-dependent)",
"3. Late DCT/CDs = H+/K+-ATPase (primary active, Na-INDEPENDENT, aldosterone ×900)",
"4. Limiting pH = 4.5 (H+ secretion stops below this — buffers prevent reaching it)",
"5. pK: Bicarbonate=6.1, Phosphate=6.8, Ammonia=9.0 (ascending order)",
"6. NH3 from GLUTAMINE; lipid-soluble → diffuses in → NH4+ trapped → excreted as NH4Cl",
"7. HCO3- threshold = 26 mEq/L (above this → bicarbonaturia → alkaline urine)",
"8. Kidneys = MOST POWERFUL regulator (takes 12-24h); Lungs = 2/3 correction in minutes",
"9. Hypokalaemia → intracellular acidosis → ↑ H+ secretion → metabolic ALKALOSIS",
"10. Vomiting → lose HCl → metabolic alkalosis | Diarrhea → lose HCO3- → metabolic acidosis",
"11. DKA = high anion gap metabolic acidosis (ketoacids). Kussmaul = respiratory compensation.",
"12. Conn's (primary hyperaldosteronism) = metabolic alkalosis + hypokalaemia",
]
for item in mem_items:
story.append(Paragraph(f"• {item}",
S('x', fontSize=8.5, fontName='Helvetica', leading=13, leftIndent=10,
backColor=colors.HexColor('#fffbea'), spaceAfter=2)))
def build_tubule_diagram(story):
"""Build a labelled nephron/renal tubule diagram using ReportLab graphics."""
from reportlab.graphics.shapes import Drawing, Rect, String, Line, Circle, Polygon, Path
W_d = W - 4*cm
H_d = 7*cm
d = Drawing(W_d, H_d)
# Background
d.add(Rect(0, 0, W_d, H_d, fillColor=colors.HexColor('#f8fbff'), strokeColor=MGRAY, strokeWidth=0.5))
# Title
d.add(String(W_d/2, H_d - 14, "NEPHRON: H⁺ SECRETION & HCO₃⁻ REABSORPTION SITES",
textAnchor='middle', fontSize=9, fontName='Helvetica-Bold', fillColor=NAVY))
# Draw simplified nephron segments (left to right)
# PCT (blue tube)
x0 = 30; y_mid = H_d/2 + 5
# PCT box
d.add(Rect(x0, y_mid-15, 70, 30, fillColor=colors.HexColor('#cce5ff'), strokeColor=NAVY, strokeWidth=1.2, rx=5, ry=5))
d.add(String(x0+35, y_mid+3, "PCT", textAnchor='middle', fontSize=8, fontName='Helvetica-Bold', fillColor=NAVY))
d.add(String(x0+35, y_mid-8, "85% HCO₃⁻", textAnchor='middle', fontSize=7, fontName='Helvetica', fillColor=NAVY))
# Arrow right
d.add(Line(x0+70, y_mid, x0+90, y_mid, strokeColor=NAVY, strokeWidth=1.5))
d.add(Polygon([x0+90, y_mid-4, x0+90, y_mid+4, x0+98, y_mid], fillColor=NAVY, strokeColor=NAVY))
# Loop of Henle (descending)
loop_x = x0+100
d.add(Rect(loop_x, y_mid-15, 50, 30, fillColor=colors.HexColor('#ffe0e0'), strokeColor=CORAL, strokeWidth=1.2, rx=5, ry=5))
d.add(String(loop_x+25, y_mid+3, "Loop of", textAnchor='middle', fontSize=7, fontName='Helvetica-Bold', fillColor=CORAL))
d.add(String(loop_x+25, y_mid-7, "Henle", textAnchor='middle', fontSize=7, fontName='Helvetica-Bold', fillColor=CORAL))
# Label: thick asc = 10%; thin = NO
d.add(String(loop_x+25, y_mid-20, "Thick: 10%", textAnchor='middle', fontSize=6.5, fontName='Helvetica', fillColor=colors.HexColor('#8b0000')))
d.add(String(loop_x+25, y_mid-29, "Thin: NO H⁺", textAnchor='middle', fontSize=6.5, fontName='Helvetica-Bold', fillColor=CORAL))
# Arrow right
ax = loop_x+50
d.add(Line(ax, y_mid, ax+20, y_mid, strokeColor=NAVY, strokeWidth=1.5))
d.add(Polygon([ax+20, y_mid-4, ax+20, y_mid+4, ax+28, y_mid], fillColor=NAVY, strokeColor=NAVY))
# DCT
dct_x = loop_x + 78
d.add(Rect(dct_x, y_mid-15, 75, 30, fillColor=colors.HexColor('#e8f5e9'), strokeColor=LIME, strokeWidth=1.2, rx=5, ry=5))
d.add(String(dct_x+37, y_mid+4, "Early DCT", textAnchor='middle', fontSize=7, fontName='Helvetica-Bold', fillColor=colors.HexColor('#1b5e20')))
d.add(String(dct_x+37, y_mid-5, "NHE3", textAnchor='middle', fontSize=7, fontName='Helvetica', fillColor=colors.HexColor('#1b5e20')))
d.add(String(dct_x+37, y_mid-14, "Secondary", textAnchor='middle', fontSize=6.5, fontName='Helvetica', fillColor=colors.HexColor('#1b5e20')))
# Arrow right
ax2 = dct_x+75
d.add(Line(ax2, y_mid, ax2+20, y_mid, strokeColor=NAVY, strokeWidth=1.5))
d.add(Polygon([ax2+20, y_mid-4, ax2+20, y_mid+4, ax2+28, y_mid], fillColor=NAVY, strokeColor=NAVY))
# Collecting Duct
cd_x = dct_x + 103
d.add(Rect(cd_x, y_mid-15, 90, 30, fillColor=colors.HexColor('#fff3e0'), strokeColor=AMBER, strokeWidth=1.8, rx=5, ry=5))
d.add(String(cd_x+45, y_mid+4, "Late DCT + CDs", textAnchor='middle', fontSize=7.5, fontName='Helvetica-Bold', fillColor=colors.HexColor('#bf6000')))
d.add(String(cd_x+45, y_mid-6, "H⁺/K⁺-ATPase", textAnchor='middle', fontSize=7, fontName='Helvetica-Bold', fillColor=colors.HexColor('#bf6000')))
d.add(String(cd_x+45, y_mid-15, "α-IC cells | ×900 Aldo", textAnchor='middle', fontSize=6.5, fontName='Helvetica', fillColor=colors.HexColor('#bf6000')))
# Arrows below: showing what buffers each segment
# PCT buffer label
d.add(Line(x0+35, y_mid-15, x0+35, y_mid-35, strokeColor=TEAL, strokeWidth=0.8, strokeDashArray=[2,2]))
d.add(String(x0+35, y_mid-44, "Buffer: HCO₃⁻", textAnchor='middle', fontSize=6.5, fontName='Helvetica-Oblique', fillColor=TEAL))
# CD buffer label
d.add(Line(cd_x+45, y_mid-15, cd_x+45, y_mid-35, strokeColor=TEAL, strokeWidth=0.8, strokeDashArray=[2,2]))
d.add(String(cd_x+45, y_mid-44, "Buffer: PO₄²⁻ + NH₃", textAnchor='middle', fontSize=6.5, fontName='Helvetica-Oblique', fillColor=TEAL))
# Cell mechanism inset for PCT
# Inside box arrows: H+ out, Na+ in, HCO3- to blood
d.add(String(x0+35, y_mid+20, "Na⁺→cell / H⁺→lumen", textAnchor='middle', fontSize=6, fontName='Helvetica', fillColor=NAVY))
d.add(String(x0+35, y_mid+29, "HCO₃⁻→blood (CA-II)", textAnchor='middle', fontSize=6, fontName='Helvetica', fillColor=NAVY))
# Urine direction arrow at bottom
d.add(String(W_d - 40, 10, "→ URINE", textAnchor='middle', fontSize=8, fontName='Helvetica-Bold', fillColor=colors.HexColor('#666666')))
story.append(d)
# Diagram legend table
legend_data = [
[Paragraph('<b>Color</b>', CS_HDR), Paragraph('<b>Segment</b>', CS_HDR), Paragraph('<b>Key Transporter</b>', CS_HDR), Paragraph('<b>Buffer Used</b>', CS_HDR), Paragraph('<b>HCO₃⁻ %</b>', CS_HDR)],
['Blue (PCT)', 'Proximal Convoluted Tubule', 'NHE3 (Na⁺/H⁺ exchanger)', 'HCO₃⁻ → H₂O + CO₂ (CA-IV)', '85%'],
['Red (Loop)', 'Thick Ascending Loop', 'NHE3', 'HCO₃⁻', '10%'],
['Red - striped', 'Thin Limb', 'NONE', 'NONE', '0%'],
['Green (DCT)', 'Early DCT', 'NHE3 (secondary active)', 'Residual HCO₃⁻', 'Small'],
['Orange (CD)', 'Late DCT + Collecting Duct', 'H⁺/K⁺-ATPase (PRIMARY active)', 'Phosphate + Ammonia (NH₃)', '4.8%'],
]
leg_t = Table(legend_data, colWidths=[(W-4*cm)*0.15, (W-4*cm)*0.22, (W-4*cm)*0.25, (W-4*cm)*0.25, (W-4*cm)*0.13])
leg_t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), NAVY),
('TEXTCOLOR', (0,0), (-1,0), WHITE),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 8),
('ROWBACKGROUNDS', (0,1), (-1,-1), [WHITE, LGRAY]),
('BOX', (0,0), (-1,-1), 1, NAVY),
('INNERGRID', (0,0), (-1,-1), 0.3, MGRAY),
('TOPPADDING', (0,0), (-1,-1), 3),
('BOTTOMPADDING', (0,0), (-1,-1), 3),
('LEFTPADDING', (0,0), (-1,-1), 5),
]))
story.append(leg_t)
# ── MAIN ──────────────────────────────────────────────────────────────────────
def main():
out = "/home/daytona/workspace/batterjee-mcq/BMC_Renal_H_HCO3_MCQ_Pack.pdf"
doc = SimpleDocTemplate(
out,
pagesize=A4,
leftMargin=2*cm, rightMargin=2*cm,
topMargin=1.8*cm, bottomMargin=1.8*cm,
title="BMC High-Yield MCQ Pack: H+ & HCO3- Renal Handling",
author="Batterjee Medical College Study Pack",
)
story = []
build_cover(story, styles)
build_mcqs(story)
build_answers(story)
build_cheatsheet(story)
doc.build(story)
print(f"SUCCESS: {out}")
import os
size = os.path.getsize(out)
print(f"File size: {size/1024:.1f} KB")
if __name__ == '__main__':
main()
cd /home/daytona/workspace/batterjee-mcq && python3 generate_mcq.py 2>&1
~/batterjee-mcq/generate_mcq.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/batterjee-mcq/generate_mcq.py'
~/batterjee-mcq/generate_mcq.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/batterjee-mcq/generate_mcq.py'
cd /home/daytona/workspace/batterjee-mcq && python3 generate_mcq.py 2>&1
BMC Renal H HCO3 MCQ Pack
PDF Document · PDF
| Parameter | Normal Value | Clinical Note |
|---|---|---|
| Arterial pH | 7.35-7.45 (mean 7.4) | Below 7.35 = Acidosis; Above 7.45 = Alkalosis |
| [H+] free in ECF | 40 nmol/L | Very low vs Na+ (140 mmol/L) |
| Death range | pH < 7.0 or > 7.8 | Incompatible with life |
| Plasma [HCO₃⁻] | 24 mEq/L | Regulated by kidneys |
| Arterial PCO₂ | 35-45 mmHg | Regulated by lungs |
| Renal HCO₃⁻ threshold | 26 mEq/L | >26 → HCO₃⁻ in urine |
| Limiting tubular pH | 4.5 | Below this = H+ secretion STOPS |
| Disorder | pH | Primary Change | Compensation | Key Causes |
|---|---|---|---|---|
| Resp. Acidosis | <7.35 | ↑PCO₂ >44 | ↑Renal HCO₃⁻ (12-24h) | Narcotics, COPD, asthma |
| Resp. Alkalosis | >7.45 | ↓PCO₂ <35 | ↓Renal HCO₃⁻ (days) | Anxiety, altitude, fever |
| Metabolic Acidosis | <7.35 | ↓HCO₃⁻ | Hyperventilation (min) | DKA, diarrhea, RTA, RF |
| Metabolic Alkalosis | >7.45 | ↑HCO₃⁻ | Hypoventilation (limited) | Vomiting, Conn's, diuretics |
GLOMERULUS → PCT [85%] → Thick Loop [10%] → [Thin Limb: NO H+] → Early DCT → Late DCT + CDs [4.8%]
↓ ↓
NHE3 (2° active) H+/K+-ATPase (1° active)
Na+→cell, H+→lumen α-IC cells, ×900 aldosterone
Buffer: HCO₃⁻ → CO₂ Buffer: HPO₄²⁻ → NaH₂PO₄
(CA-IV brush border) NH₃ → NH₄⁺ → NH₄Cl (urine)