Yarr mere bhms 1st year ke mpmsu final exam hai

Asking for Preferences

BHMS 1st Year MPMSU exam ke liye kya chahiye tumhe? Β· Kaunsa subject? (ya sab ek saath?)

Asking for Preferences

Physiology (Kriya Sharir) mein kya help chahiye?

Bilkul! BHMS 1st Year MPMSU ke liye Physiology (Kriya Sharir) ke expected questions with answers deta hoon.
Searching sources...
Searching the Web

MPMSU BHMS 1st year Physiology Kriya Sharir important questions exam 2025 2026

Searching the Web

BHMS 1st year Kriya Sharir previous year question paper MPMSU syllabus

Reading Web Page

https://nch.org.in/upload/3-Human-physiology-02-02-2024.pdf

Ab main apni knowledge + NCH syllabus + MPMSU paper pattern ke basis par comprehensive expected Q&A deta hoon.

πŸ“š BHMS 1st Year - Kriya Sharir (Physiology)

MPMSU Final Exam - Expected Questions with Answers


πŸ”΄ LONG ANSWER QUESTIONS (LAQ) - 10 marks


Q1. Cardiac Cycle kya hota hai? Uske events explain karo.

Answer:
Cardiac cycle ek complete heartbeat hai - ek systole (contraction) + ek diastole (relaxation).
Duration: ~0.8 seconds (72 beats/min pe)
Events:
PhaseDurationEvent
Atrial Systole0.1 secAtria contract, blood ventricles mein jaata hai
Ventricular Systole0.3 secVentricles contract, blood aorta/pulmonary artery mein jaata hai
Diastole (Total)0.4 secSabka relaxation, heart blood se bharta hai
Heart Sounds:
  • S1 ("Lub") - Mitral + Tricuspid valve band hone se
  • S2 ("Dub") - Aortic + Pulmonary valve band hone se
Cardiac Output (CO) = Stroke Volume x Heart Rate = 70 ml x 72 = ~5040 ml/min (~5L/min)

Q2. Menstrual Cycle ka varnan karo. (Bahut baar aata hai!)

Answer:
Normal duration: 28 days. Reproductive age mein hoti hai (menarche se menopause tak).
4 Phases:
1. Menstrual Phase (Day 1-5):
  • Endometrium shed hota hai
  • Estrogen + Progesterone low hoti hain
  • Blood loss: ~30-80 mL
2. Proliferative/Follicular Phase (Day 6-13):
  • FSH se follicle develop hota hai
  • Estrogen badh jaati hai
  • Endometrium thick hoti hai
3. Ovulation (Day 14):
  • LH surge se ovum release hota hai
  • Most fertile time
4. Secretory/Luteal Phase (Day 15-28):
  • Corpus luteum progesterone banata hai
  • Endometrium glands active
  • Agar pregnancy nahi - corpus luteum degenerate, hormones gir jaate hain, menstruation fir hoti hai
Hormones: FSH, LH (pituitary se), Estrogen, Progesterone (ovary se)

Q3. Blood Groups (ABO System) samjhao.

Answer:
Landsteiner's Law pe based hai.
Blood GroupAntigen (RBC pe)Antibody (Plasma mein)
AAAnti-B
BBAnti-A
ABA + BNone (Universal Recipient)
ONoneAnti-A + Anti-B (Universal Donor)
Rh Factor:
  • Rh+ = D antigen present (85% Indians)
  • Rh- = D antigen absent
Transfusion Reaction: Incompatible blood dene se agglutination + hemolysis ho jaata hai - patient die kar sakta hai.
Erythroblastosis Fetalis: Rh- maa ka Rh+ baby - maa antibodies banati hai jo baby ke RBCs destroy kar dete hain.

🟑 SHORT ANSWER QUESTIONS (SAQ) - 5 marks


Q4. Juxtaglomerular Apparatus (JGA) kya hai?

Answer:
JGA kidney mein hoti hai - afferent arteriole + distal convoluted tubule ke junction pe.
Components:
  1. Juxtaglomerular (JG) cells - afferent arteriole mein, renin secrete karte hain
  2. Macula Densa - DCT mein, NaCl sense karta hai
  3. Mesangial cells - support dete hain
Function: Blood pressure control - Renin-Angiotensin-Aldosterone System (RAAS) activate karta hai.
  • BP gira β†’ JGA β†’ Renin release β†’ Angiotensin I β†’ Angiotensin II β†’ BP badhata hai + Aldosterone release β†’ Na+ retain β†’ water retain β†’ BP aur badhta hai

Q5. Haemoglobin ki structure aur function batao.

Answer:
  • Normal value: Male: 13-17 g/dL, Female: 12-15 g/dL
  • Structure: 4 globin chains + 4 heme groups (each mein FeΒ²+ hota hai)
  • Types: HbA (adult), HbA2, HbF (fetal)
Functions:
  1. Oβ‚‚ carry karna (lungs se tissues tak) - oxyhemoglobin banata hai
  2. COβ‚‚ carry karna (tissues se lungs tak) - carbaminohemoglobin
  3. Buffer ka kaam karta hai (blood pH maintain)
  4. NO carry karna

Q6. Anemia ke types batao.

Answer:
Anemia = Hemoglobin ya RBC ki count normal se kam.
Classification:
  1. Iron Deficiency Anemia - sabse common, microcytic hypochromic RBCs
  2. Megaloblastic Anemia - B12/Folic acid ki kami, macrocytic RBCs
  3. Pernicious Anemia - Intrinsic factor absent, B12 absorb nahi hota
  4. Hemolytic Anemia - RBCs jaldi toot jaate hain (sickle cell, thalassemia)
  5. Aplastic Anemia - Bone marrow kaam nahi karta

Q7. Synapse kya hai? Uski properties batao.

Answer:
Synapse = 2 neurons ke beech ka junction jahan signal pass hota hai.
Parts: Pre-synaptic terminal β†’ Synaptic cleft β†’ Post-synaptic membrane
Chemical Transmission: Neurotransmitter (Acetylcholine, Dopamine, etc.) release hota hai.
Properties:
  1. One-way conduction - sirf pre β†’ post direction mein
  2. Synaptic delay - ~0.5 milliseconds
  3. Fatigue - repeated stimulation pe response kam ho jaata hai
  4. Summation - temporal + spatial dono types
  5. Convergence & Divergence

Q8. Reflex Arc explain karo.

Answer:
Reflex = voluntary control ke bina automatic response to stimulus.
Reflex Arc ke 5 components:
  1. Receptor - stimulus detect karta hai
  2. Afferent nerve - signal spinal cord tak laata hai
  3. Nerve Centre - spinal cord/brain mein processing
  4. Efferent nerve - response le jaata hai
  5. Effector - muscle/gland - action karta hai
Types:
  • Monosynaptic - 1 synapse, e.g., Knee jerk reflex
  • Polysynaptic - multiple synapses, e.g., Withdrawal reflex

🟒 SHORT NOTES - 3 marks (MCQ/Viva important)

TopicKey Point
Vital CapacityTLC - RV = ~4.8 L (max air exhale karo after max inhale)
GFR~125 mL/min, kidney kitna filter kare per minute
ECG wavesP (atrial), QRS (ventricular depol), T (ventricular repol)
InsulinBeta cells (Pancreas), blood glucose giraata hai, diabetes mein absent
ADH/VasopressinPosterior pituitary, water reabsorption badhata hai
NeurotransmittersACh, Dopamine, Serotonin, GABA, Norepinephrine
ESRNormal: Male <15, Female <20 mm/1st hr (Westergren method)
Platelets1.5-4 lakh/Β΅L, clotting mein help karte hain
PeristalsisGI tract ka wave-like movement, food aage push karta hai
Vital ForceHahnemann ka concept - body ko animate karne wali force

πŸ’‘ Exam Tips:

  • Diagrams zaroor banao - Cardiac Cycle, Menstrual Cycle, Reflex Arc, JGA - diagrams ke marks alag milte hain
  • Normal values yaad karo - Hb, BP (120/80), Pulse (72/min), RBC count
  • Homoeopathic angle - Vital Force ka physiology se connection zaroor likhna (BHMS specific point hai)
  • Paper 1 vs Paper 2 - MPMSU mein Kriya Sharir 2 papers hote hain: Paper 1 (General + Blood + CVS + Respiratory), Paper 2 (Renal + Endocrine + Nervous + Reproductive)
Agar koi specific topic aur detail mein chahiye ya MCQs chahiye, toh batao! All the best exam ke liye! πŸ€

Paper 1 st

Paper 1 ke liye focus areas: General Physiology + Blood + CVS + Respiratory System
Ab main in sabke expected questions with answers deta hoon - ekdum exam-ready format mein.

πŸ“š BHMS 1st Year - Kriya Sharir Paper 1

MPMSU Final Exam - Complete Expected Q&A


πŸ”΄ LONG ANSWER QUESTIONS (LAQ) - 10 Marks


Q1. Cell membrane ki structure aur functions batao.

Answer:
Structure - Fluid Mosaic Model (Singer & Nicolson, 1972):
Bilipid layer hoti hai - do layers of phospholipids jinke hydrophilic heads bahar aur hydrophobic tails andar hote hain.
Components:
  • Phospholipid bilayer - basic framework
  • Proteins - 2 types:
    • Integral proteins - membrane ke andar dhase hue (channels, carriers)
    • Peripheral proteins - bahar surface pe
  • Cholesterol - fluidity maintain karta hai
  • Glycoproteins / Glycolipids - cell recognition mein kaam aate hain
Diagram:
[Extracellular]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ← Glycoproteins
|  O O O O O O O O O O O O O O  |  ← Hydrophilic heads
|  | | | | | | | | | | | | | |  |
|  | | | | | | | | | | | | | |  |  ← Hydrophobic tails
|  O O O O O O O O O O O O O O  |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Intracellular]
Functions:
  1. Selective permeability - sirf zaruri cheezein andar jaane deta hai
  2. Receptor function - hormones, drugs bind hote hain
  3. Transport - active/passive
  4. Cell recognition (ABO blood group antigens)
  5. Enzyme activity

Q2. Blood Coagulation (Haemostasis) ka mechanism samjhao.

Answer:
Haemostasis = blood vessel injury ke baad bleeding rokna.
3 Steps:
Step 1 - Vascular Spasm:
  • Injured vessel turant contract karta hai
  • Blood flow temporarily kam hota hai
Step 2 - Platelet Plug Formation:
  • Platelets injured wall se chipak jaate hain (adhesion)
  • Zyada platelets aate hain (aggregation)
  • Temporary plug banta hai
Step 3 - Coagulation Cascade:
Intrinsic Pathway          Extrinsic Pathway
(blood ke andar)           (tissue damage se)
      ↓                          ↓
   Factor XII                Factor VII
      ↓                          ↓
      ↓←————— Common Path ————————↓
                    ↓
            Factor X activated
                    ↓
      Prothrombin β†’ THROMBIN (Factor II)
                    ↓
      Fibrinogen β†’ FIBRIN (Factor I)
                    ↓
           Stable Clot banta hai
Important Clotting Factors:
FactorName
IFibrinogen
IIProthrombin
IVCalcium (CaΒ²+)
VIIIAntihemophilic factor (Hemophilia A mein absent)
Vitamin K - Factors II, VII, IX, X ke liye zaruri hai.

Q3. Cardiac Cycle explain karo. (Most Important!)

Answer:
Definition: Ek complete heartbeat - ek systole + ek diastole.
Duration: 0.8 seconds (72 beats/min pe)
Phases:
PhaseDurationValvesEvent
Atrial Systole0.1 secAV open, Semilunar closedAtria contract, ventricles bharte hain
Isovolumetric Contraction0.05 secSab bandVentricle pressure badhti hai
Ventricular Ejection0.25 secSemilunar openBlood aorta/PA mein jaata hai
Isovolumetric Relaxation0.08 secSab bandVentricular pressure girti hai
Rapid Filling0.11 secAV openVentricle jaldi bharta hai
Slow Filling0.19 secAV openDheere bharta hai
Heart Sounds:
  • S1 "Lub" - Mitral + Tricuspid (AV valves) band hone se
  • S2 "Dub" - Aortic + Pulmonary (Semilunar) band hone se
Cardiac Output:
CO = Stroke Volume Γ— Heart Rate CO = 70 mL Γ— 72 = ~5 L/min
Regulation of CO:
  • Starling's Law - jitna stretch, utna force se contraction (preload)
  • Heart Rate - SNS badhata, PNS giraata hai

Q4. Respiratory Mechanism - Breathing kaise hoti hai?

Answer:
Inspiration (Active process):
  • Diaphragm contract karta hai β†’ neeche jaata hai
  • External intercostals contract β†’ chest bahar jaata hai
  • Intrathoracic pressure gir jaati hai (atmospheric se kam)
  • Air lungs mein enter karti hai
Expiration (Passive process at rest):
  • Diaphragm relax β†’ upar jaata hai
  • Elastic recoil of lungs
  • Chest andar aata hai
  • Air bahar jaati hai
Lung Volumes (Normal values - yaad karo!):
VolumeValueDefinition
Tidal Volume (TV)500 mLNormal ek breath mein
IRV3000 mLExtra inhale kar sako
ERV1100 mLExtra exhale kar sako
RV1200 mLLungs mein hamesha bachi hui
Vital Capacity4600 mLTV + IRV + ERV
TLC5800 mLSab milake
Transport of Oβ‚‚:
  • 97% - Hemoglobin ke saath (Oxyhemoglobin)
  • 3% - Plasma mein dissolved
Transport of COβ‚‚:
  • 70% - Bicarbonate (HCO₃⁻) form mein
  • 23% - Carbaminohemoglobin
  • 7% - Dissolved in plasma

🟑 SHORT ANSWER QUESTIONS (SAQ) - 5 Marks


Q5. WBC (Leukocytes) ke types batao.

Answer:
Normal Count: 4,000 - 11,000/Β΅L
2 Main Types:
A. Granulocytes (granules hote hain):
Cell%Function
Neutrophil60-70%Bacteria khaata hai (Phagocytosis) - first responder
Eosinophil2-4%Allergy + Parasitic infection
Basophil0-1%Histamine release - allergy
B. Agranulocytes (granules nahi):
Cell%Function
Lymphocyte20-30%Antibody banate (B cells), Cell immunity (T cells)
Monocyte2-8%Tissue mein jaake Macrophage banta hai
Differential Count yaad karna:
"Never Let Monkeys Eat Bananas" Neutrophil - Lymphocyte - Monocyte - Eosinophil - Basophil

Q6. Osmosis aur Osmotic Pressure samjhao.

Answer:
Osmosis: Semi-permeable membrane ke through, water low concentration (hypotonic) se high solute concentration (hypertonic) ki taraf move karta hai.
Osmotic Pressure: Woh pressure jo osmosis rokne ke liye lagana pade.
Blood ka Normal Osmolality: 285-295 mOsm/kg
RBC ke context mein:
  • Isotonic solution (0.9% NaCl) β†’ RBC normal rahega
  • Hypotonic solution β†’ Water andar jayega β†’ RBC swell β†’ Hemolysis
  • Hypertonic solution β†’ Water bahar jayega β†’ RBC shrink β†’ Crenation
Clinical use: IV fluids always isotonic dete hain (Normal Saline, Ringer's Lactate)

Q7. Plasma Proteins ke functions batao.

Answer:
Normal Total Protein: 6-8 g/dL
Protein%Functions
Albumin55%Oncotic pressure maintain, drugs + hormones carry karta hai
Globulin38%Antibodies (immunoglobulins), transport
Fibrinogen7%Clotting mein fibrin banata hai
Oncotic (Colloid Osmotic) Pressure:
  • Mainly albumin se hoti hai (~25 mmHg)
  • Capillary se fluid bahar jaane se rokti hai
  • Albumin kam β†’ edema (swelling) hoti hai

Q8. Conducting System of Heart batao.

Answer:
Heart ka apna electrical system hota hai jo heartbeat generate karta hai.
SA Node β†’ AV Node β†’ Bundle of His β†’ Right + Left Bundle Branches β†’ Purkinje Fibres
StructureLocationRate
SA NodeRight Atrium (Pacemaker)70-80/min
AV NodeInteratrial septum40-60/min
Bundle of HisIV Septum20-40/min
Purkinje FibresVentricular walls15-40/min
SA Node = Primary Pacemaker - highest rate hoti hai, isliye wo pace set karta hai.
ECG Waves:
  • P wave - Atrial depolarization
  • QRS complex - Ventricular depolarization
  • T wave - Ventricular repolarization

Q9. Erythropoiesis kya hai? (RBC kaise banta hai)

Answer:
Erythropoiesis = Red Blood Cell ka formation.
Site:
  • Fetus mein: Liver + Spleen
  • Adult mein: Red Bone Marrow (flat bones - sternum, vertebrae, pelvis)
Stages:
Proerythroblast β†’ Erythroblast β†’ Normoblast β†’ Reticulocyte β†’ Mature RBC
Requirements:
  • Iron (FeΒ²+) - Hb synthesis ke liye
  • Vitamin B12 + Folic Acid - DNA synthesis ke liye
  • Erythropoietin (EPO) - kidney se, hypoxia pe release hota hai
  • Protein, Copper
Life of RBC: 120 days
Destruction: Spleen mein (RBC graveyard)

Q10. Buffer Systems of Blood

Answer:
Blood pH normal: 7.35 - 7.45 (slightly alkaline)
4 Buffer Systems:
  1. Bicarbonate Buffer (Most Important):
    COβ‚‚ + Hβ‚‚O β‡Œ Hβ‚‚CO₃ β‡Œ H⁺ + HCO₃⁻
    • Lungs COβ‚‚ expel karte hain - pH badhata hai
    • Kidneys HCO₃⁻ retain karte hain
  2. Hemoglobin Buffer - RBC ke andar
  3. Protein Buffer - plasma proteins
  4. Phosphate Buffer - renal tubules mein zyada important
Acidosis (pH < 7.35) vs Alkalosis (pH > 7.45)

🟒 SHORT NOTES / MCQ Points - 2-3 Marks

TopicKey Value/Fact
Normal HbMale: 13-17 g/dL, Female: 12-15 g/dL
RBC countMale: 5-5.5 million/Β΅L, Female: 4.5-5 million/Β΅L
Blood Volume5-6 L (body weight ka ~8%)
Platelet count1.5 - 4 lakh/Β΅L
Blood pH7.35 - 7.45
Plasma = 55%Blood ka 55% plasma, 45% cells
Hematocrit (PCV)Male: 45%, Female: 40%
ESRMale: < 15, Female: < 20 mm/1st hour
Normal BP120/80 mmHg
Heart Rate72 beats/min
Tidal Volume500 mL
Vital Capacity4600 mL
RBC life120 days
WBC lifeHours to days
Platelet life8-10 days

🧠 MCQ Traps - Yaad Rakho!

  1. Universal Donor = O negative (O-)
  2. Universal Recipient = AB positive (AB+)
  3. Pacemaker of heart = SA Node
  4. Largest WBC = Monocyte
  5. Most abundant WBC = Neutrophil
  6. Most abundant plasma protein = Albumin
  7. Blood clotting mein CaΒ²+ = Factor IV
  8. Erythropoietin = Kidney se nikalta hai
  9. Normal platelet plug = Primary haemostasis
  10. Fibrin clot = Secondary haemostasis

✍️ Diagrams zaroor banao:

  • Fluid Mosaic Model (Cell Membrane)
  • Coagulation Cascade
  • Cardiac Cycle (Wiggers Diagram simple version)
  • Conducting System of Heart
  • Lung Volumes diagram (Spirogram)

Agar koi specific question aur depth mein chahiye - diagram chahiye - ya MCQ practice karni hai toh bol do! πŸ’ͺ Best of luck exam mein! πŸ€

Create a quick reference PDF for Paper 1 topics

Reading File
Running Command

mkdir -p /tmp/workspace/bhms-physiology && ls /tmp/workspace/

Writing File

~/bhms-physiology/generate_pdf.py

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

OUTPUT = "/tmp/workspace/bhms-physiology/Kriya_Sharir_Paper1_QuickRef.pdf"

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    rightMargin=1.5*cm,
    leftMargin=1.5*cm,
    topMargin=2*cm,
    bottomMargin=2*cm,
)

# ── Colour Palette ──
C_DARK   = colors.HexColor("#1a237e")   # deep indigo
C_MED    = colors.HexColor("#283593")   # medium indigo
C_LIGHT  = colors.HexColor("#e8eaf6")   # very light indigo bg
C_ACCENT = colors.HexColor("#d32f2f")   # red accent
C_GREEN  = colors.HexColor("#1b5e20")   # dark green
C_YELLOW = colors.HexColor("#f9a825")   # amber
C_TEAL   = colors.HexColor("#006064")   # teal
C_WHITE  = colors.white
C_GREY   = colors.HexColor("#f5f5f5")
C_BORDER = colors.HexColor("#9fa8da")

# ── Styles ──
base = getSampleStyleSheet()

def style(name, **kw):
    s = ParagraphStyle(name, **kw)
    return s

TITLE = style("MyTitle",
    fontName="Helvetica-Bold", fontSize=20,
    textColor=C_WHITE, alignment=TA_CENTER,
    spaceAfter=4, leading=26)

SUBTITLE = style("MySubtitle",
    fontName="Helvetica", fontSize=11,
    textColor=C_WHITE, alignment=TA_CENTER,
    spaceAfter=2)

SEC_HEAD = style("SecHead",
    fontName="Helvetica-Bold", fontSize=13,
    textColor=C_WHITE, alignment=TA_LEFT,
    spaceBefore=10, spaceAfter=4, leading=18,
    leftIndent=6)

SUBSEC = style("SubSec",
    fontName="Helvetica-Bold", fontSize=11,
    textColor=C_DARK, alignment=TA_LEFT,
    spaceBefore=8, spaceAfter=3, leading=16)

BODY = style("MyBody",
    fontName="Helvetica", fontSize=9,
    textColor=colors.black, alignment=TA_LEFT,
    spaceAfter=3, leading=14, leftIndent=8)

BODY_SMALL = style("MyBodySm",
    fontName="Helvetica", fontSize=8.5,
    textColor=colors.black, alignment=TA_LEFT,
    spaceAfter=2, leading=13, leftIndent=8)

BULLET = style("MyBullet",
    fontName="Helvetica", fontSize=9,
    textColor=colors.black, alignment=TA_LEFT,
    spaceAfter=2, leading=13, leftIndent=16, firstLineIndent=-8)

IMPBOX = style("ImpBox",
    fontName="Helvetica-Bold", fontSize=8.5,
    textColor=C_ACCENT, alignment=TA_LEFT,
    spaceAfter=2, leading=13, leftIndent=8)

NOTE = style("Note",
    fontName="Helvetica-Oblique", fontSize=8.5,
    textColor=C_TEAL, alignment=TA_LEFT,
    spaceAfter=2, leading=13, leftIndent=8)

FOOTER_S = style("Footer",
    fontName="Helvetica-Oblique", fontSize=7.5,
    textColor=colors.grey, alignment=TA_CENTER)

# ── Helpers ──
def section_header(text, color=C_DARK):
    tbl = Table([[Paragraph(text, SEC_HEAD)]], colWidths=[17.5*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), color),
        ("ROUNDEDCORNERS", [4, 4, 4, 4]),
        ("TOPPADDING", (0,0), (-1,-1), 6),
        ("BOTTOMPADDING", (0,0), (-1,-1), 6),
        ("LEFTPADDING", (0,0), (-1,-1), 8),
    ]))
    return tbl

def colored_table(data, col_widths, header_color=C_MED, stripe=True):
    tbl = Table(data, colWidths=col_widths, repeatRows=1)
    style_cmds = [
        ("BACKGROUND",   (0,0), (-1,0), header_color),
        ("TEXTCOLOR",    (0,0), (-1,0), C_WHITE),
        ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
        ("FONTSIZE",     (0,0), (-1,-1), 8.5),
        ("ALIGN",        (0,0), (-1,-1), "LEFT"),
        ("VALIGN",       (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING",   (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",(0,0), (-1,-1), 4),
        ("LEFTPADDING",  (0,0), (-1,-1), 6),
        ("GRID",         (0,0), (-1,-1), 0.4, C_BORDER),
    ]
    if stripe:
        for i in range(1, len(data)):
            bg = C_GREY if i % 2 == 0 else C_WHITE
            style_cmds.append(("BACKGROUND", (0,i), (-1,i), bg))
    tbl.setStyle(TableStyle(style_cmds))
    return tbl

def tip_box(text, bg=C_LIGHT, tc=C_DARK):
    inner = Paragraph(text, ParagraphStyle("tb", fontName="Helvetica",
        fontSize=8.5, textColor=tc, leading=13))
    t = Table([[inner]], colWidths=[17.5*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), bg),
        ("TOPPADDING",    (0,0), (-1,-1), 6),
        ("BOTTOMPADDING", (0,0), (-1,-1), 6),
        ("LEFTPADDING",   (0,0), (-1,-1), 10),
        ("RIGHTPADDING",  (0,0), (-1,-1), 10),
        ("BOX",           (0,0), (-1,-1), 1, C_DARK),
    ]))
    return t

def bullet(text):
    return Paragraph(f"&#x2022; {text}", BULLET)

def imp(text):
    return Paragraph(f"&#9733; {text}", IMPBOX)

def note(text):
    return Paragraph(text, NOTE)

# ═══════════════════════════════════════════════════════
# CONTENT
# ═══════════════════════════════════════════════════════
story = []

# ── COVER BANNER ──
cover_data = [[
    Paragraph("BHMS 1st Year", SUBTITLE),
],
[
    Paragraph("Kriya Sharir (Physiology)", TITLE),
],
[
    Paragraph("Paper 1 β€” Quick Reference Guide", SUBTITLE),
],
[
    Paragraph("General Physiology β€’ Blood β€’ CVS β€’ Respiratory System", SUBTITLE),
],
[
    Paragraph("MPMSU Final Examination", SUBTITLE),
]]
cover_tbl = Table(cover_data, colWidths=[17.5*cm])
cover_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,-1), C_DARK),
    ("TOPPADDING",    (0,0), (-1,-1), 8),
    ("BOTTOMPADDING", (0,0), (-1,-1), 8),
    ("ALIGN",         (0,0), (-1,-1), "CENTER"),
]))
story.append(cover_tbl)
story.append(Spacer(1, 10))

# ── NORMAL VALUES QUICK BOX ──
story.append(section_header("πŸ“Š  NORMAL VALUES β€” Exam Must Know!", C_ACCENT))
story.append(Spacer(1, 4))

nv_data = [
    ["Parameter", "Normal Value", "Parameter", "Normal Value"],
    ["Haemoglobin (Male)", "13–17 g/dL", "Blood pH", "7.35–7.45"],
    ["Haemoglobin (Female)", "12–15 g/dL", "Normal BP", "120/80 mmHg"],
    ["RBC (Male)", "5–5.5 million/Β΅L", "Heart Rate", "72 beats/min"],
    ["RBC (Female)", "4.5–5 million/Β΅L", "Cardiac Output", "~5 L/min"],
    ["WBC Total", "4,000–11,000/Β΅L", "Stroke Volume", "70 mL"],
    ["Platelets", "1.5–4 lakh/Β΅L", "Tidal Volume", "500 mL"],
    ["Hematocrit (Male)", "45%", "Vital Capacity", "4600 mL"],
    ["Hematocrit (Female)", "40%", "TLC", "5800 mL"],
    ["Plasma Proteins", "6–8 g/dL", "RV", "1200 mL"],
    ["Blood Volume", "5–6 L", "Blood Osmolality", "285–295 mOsm/kg"],
    ["ESR (Male)", "< 15 mm/1st hr", "Fibrinogen", "200–400 mg/dL"],
    ["ESR (Female)", "< 20 mm/1st hr", "PCV (Hematocrit)", "Male 45%, F 40%"],
    ["RBC Life Span", "120 days", "Platelet Life", "8–10 days"],
]
nv_tbl = colored_table(nv_data,
    col_widths=[4.5*cm, 4.0*cm, 4.5*cm, 4.0*cm],
    header_color=C_ACCENT)
story.append(nv_tbl)
story.append(Spacer(1, 8))

# ══════════════════════════════════════════════════════
# SECTION 1 – GENERAL PHYSIOLOGY
# ══════════════════════════════════════════════════════
story.append(section_header("1.  GENERAL PHYSIOLOGY", C_DARK))
story.append(Spacer(1, 4))

story.append(Paragraph("Cell Membrane β€” Fluid Mosaic Model", SUBSEC))
cell_data = [
    ["Component", "Description / Function"],
    ["Phospholipid Bilayer", "Basic framework; hydrophilic heads outside, hydrophobic tails inside"],
    ["Integral Proteins", "Channels & carriers β€” span full membrane; allow selective transport"],
    ["Peripheral Proteins", "On surface only; enzyme/structural roles"],
    ["Cholesterol", "Maintains membrane fluidity (neither too rigid nor too fluid)"],
    ["Glycoproteins / Glycolipids", "Cell recognition, ABO antigens, receptor sites"],
]
story.append(colored_table(cell_data, col_widths=[5*cm, 12.5*cm]))
story.append(Spacer(1, 4))

story.append(Paragraph("Transport Across Membranes", SUBSEC))
trans_data = [
    ["Type", "Energy", "Direction", "Examples"],
    ["Simple Diffusion", "No (passive)", "High β†’ Low conc.", "Oβ‚‚, COβ‚‚, alcohol"],
    ["Facilitated Diffusion", "No (passive)", "High β†’ Low conc.", "Glucose (GLUT), ions"],
    ["Active Transport", "Yes (ATP)", "Low β†’ High conc.", "Na⁺/K⁺ ATPase pump"],
    ["Osmosis", "No (passive)", "Low solute β†’ High solute", "Water across membranes"],
    ["Endocytosis / Exocytosis", "Yes (ATP)", "Bulk transport", "Proteins, large molecules"],
]
story.append(colored_table(trans_data, col_widths=[4*cm, 3.5*cm, 4.5*cm, 5.5*cm]))
story.append(Spacer(1, 4))

story.append(tip_box(
    "β˜… Osmosis MCQ Trap: Isotonic (0.9% NaCl) β†’ RBC normal | "
    "Hypotonic β†’ RBC swells β†’ HEMOLYSIS | Hypertonic β†’ RBC shrinks β†’ CRENATION",
    bg=colors.HexColor("#fff3e0"), tc=C_ACCENT
))
story.append(Spacer(1, 6))

story.append(Paragraph("Homeostasis", SUBSEC))
for b in [
    "Definition: Maintenance of stable internal environment despite external changes.",
    "Mechanism: Negative feedback (most common) β€” corrects deviation from set point.",
    "Positive feedback: Amplifies the change (e.g., childbirth, blood clotting).",
    "Homoeopathic angle: Vital Force (Hahnemann) = the animating principle maintaining homeostasis.",
]:
    story.append(bullet(b))
story.append(Spacer(1, 6))

# ══════════════════════════════════════════════════════
# SECTION 2 – BLOOD
# ══════════════════════════════════════════════════════
story.append(section_header("2.  BLOOD", C_TEAL))
story.append(Spacer(1, 4))

story.append(Paragraph("Composition of Blood", SUBSEC))
blood_comp = [
    ["Component", "% of Blood", "Key Points"],
    ["Plasma", "55%", "Water 91%, Proteins, Glucose, Hormones, Urea"],
    ["RBC (Erythrocytes)", "~44%", "Biconcave, No nucleus, Hb carries Oβ‚‚, Life = 120 days"],
    ["WBC (Leukocytes)", "< 1%", "5 types, Immunity, Life = hrs–days"],
    ["Platelets (Thrombocytes)", "< 1%", "Clotting, No nucleus, Life = 8–10 days"],
]
story.append(colored_table(blood_comp, col_widths=[4*cm, 3.5*cm, 10*cm], header_color=C_TEAL))
story.append(Spacer(1, 5))

story.append(Paragraph("WBC Differential β€” Never Let Monkeys Eat Bananas", SUBSEC))
wbc_data = [
    ["WBC Type", "Normal %", "Key Function", "Special Feature"],
    ["Neutrophil (N)", "60–70%", "Phagocytosis β€” 1st responder to bacteria", "Multilobed nucleus"],
    ["Lymphocyte (L)", "20–30%", "B-cells: antibody; T-cells: cell immunity", "Large round nucleus"],
    ["Monocyte (M)", "2–8%", "Becomes Macrophage in tissues", "Kidney-shaped nucleus"],
    ["Eosinophil (E)", "2–4%", "Allergy & parasitic infections", "Bi-lobed, red granules"],
    ["Basophil (B)", "0–1%", "Releases histamine β€” allergy/inflammation", "Large blue granules"],
]
story.append(colored_table(wbc_data, col_widths=[4*cm, 2.5*cm, 6.5*cm, 4.5*cm], header_color=C_TEAL))
story.append(Spacer(1, 4))

story.append(Paragraph("Plasma Proteins", SUBSEC))
pp_data = [
    ["Protein", "Amount", "Main Functions"],
    ["Albumin", "55% (3.5–5 g/dL)", "Oncotic pressure, drug/hormone transport, buffer"],
    ["Globulin", "38%", "Immunoglobulins (antibodies), transport proteins (transferrin, ceruloplasmin)"],
    ["Fibrinogen", "7% (200–400 mg/dL)", "Converted to fibrin during clotting"],
]
story.append(colored_table(pp_data, col_widths=[3.5*cm, 4*cm, 10*cm], header_color=C_TEAL))
story.append(Spacer(1, 4))
story.append(tip_box(
    "β˜… Albumin low β†’ Oncotic pressure drops β†’ Fluid leaks out of capillaries β†’ OEDEMA (Swelling)",
    bg=colors.HexColor("#e0f7fa"), tc=C_TEAL
))
story.append(Spacer(1, 5))

story.append(Paragraph("Blood Groups β€” ABO + Rh System", SUBSEC))
bg_data = [
    ["Blood Group", "Antigen on RBC", "Antibody in Plasma", "Can Donate To", "Can Receive From"],
    ["A", "A", "Anti-B", "A, AB", "A, O"],
    ["B", "B", "Anti-A", "B, AB", "B, O"],
    ["AB (Universal Recipient)", "A + B", "None", "AB only", "A, B, AB, O"],
    ["O (Universal Donor)", "None", "Anti-A + Anti-B", "A, B, AB, O", "O only"],
]
story.append(colored_table(bg_data, col_widths=[4.5*cm, 3*cm, 3.5*cm, 3*cm, 3.5*cm], header_color=C_TEAL))
story.append(Spacer(1, 4))
for b in [
    "Rh+ = D antigen present (~85% Indians). Rhβˆ’ = D antigen absent.",
    "Erythroblastosis Fetalis: Rhβˆ’ mother + Rh+ baby β†’ mother forms anti-D β†’ destroys baby's RBCs in next pregnancy.",
    "Rh incompatibility prevention: Anti-D immunoglobulin (RhoGAM) given to Rhβˆ’ mother.",
]:
    story.append(bullet(b))
story.append(Spacer(1, 5))

story.append(Paragraph("Erythropoiesis (RBC Formation)", SUBSEC))
ery_data = [
    ["Stage", "Site", "Key Requirement"],
    ["Fetal life", "Liver, Spleen, Yolk sac", "β€”"],
    ["Adult life", "Red Bone Marrow (flat bones)", "Iron, B12, Folic Acid, Erythropoietin (EPO)"],
]
story.append(colored_table(ery_data, col_widths=[4*cm, 7*cm, 6.5*cm], header_color=C_TEAL))
story.append(Spacer(1, 4))
story.append(tip_box(
    "Maturation sequence: Proerythroblast β†’ Erythroblast β†’ Normoblast β†’ Reticulocyte β†’ Mature RBC  |  "
    "EPO released by kidney in response to hypoxia  |  Destroyed in SPLEEN (RBC graveyard)",
    bg=colors.HexColor("#e0f7fa"), tc=C_TEAL
))
story.append(Spacer(1, 5))

story.append(Paragraph("Haemostasis & Blood Coagulation", SUBSEC))
for b in [
    "Step 1 β€” Vascular spasm: immediate vasoconstriction to reduce blood flow.",
    "Step 2 β€” Platelet plug (Primary haemostasis): platelets adhere + aggregate at injury site.",
    "Step 3 β€” Coagulation cascade (Secondary haemostasis): Fibrin clot formation.",
]:
    story.append(bullet(b))
story.append(Spacer(1, 3))

clot_data = [
    ["Key Factor", "Number", "Significance"],
    ["Fibrinogen", "I", "Converted to Fibrin by Thrombin"],
    ["Prothrombin", "II", "Converted to Thrombin (active enzyme)"],
    ["Calcium", "IV", "Required in almost every step"],
    ["Antihemophilic Factor A", "VIII", "Deficient in Haemophilia A (commonest)"],
    ["Antihemophilic Factor B", "IX", "Deficient in Haemophilia B (Christmas disease)"],
    ["Stuart-Prower Factor", "X", "Common pathway β€” where intrinsic + extrinsic meet"],
]
story.append(colored_table(clot_data, col_widths=[5.5*cm, 3*cm, 9*cm], header_color=C_TEAL))
story.append(Spacer(1, 4))
story.append(tip_box(
    "Vitamin K dependent factors: II, VII, IX, X  |  "
    "Heparin: anticoagulant β€” activates antithrombin III  |  "
    "Warfarin: inhibits Vit K β†’ used in DVT/AF patients",
    bg=colors.HexColor("#e0f7fa"), tc=C_TEAL
))
story.append(Spacer(1, 5))

story.append(Paragraph("Buffer Systems of Blood", SUBSEC))
buf_data = [
    ["Buffer System", "Location", "Importance"],
    ["Bicarbonate (HCO₃⁻/Hβ‚‚CO₃)", "Plasma + RBC", "Most important (50–60%) β€” lungs + kidneys regulate"],
    ["Haemoglobin Buffer", "RBC (inside)", "2nd most important; deoxyHb is better buffer"],
    ["Protein Buffer", "Plasma", "Albumin, globulins act as buffers"],
    ["Phosphate Buffer", "Kidney tubules", "Important for urinary pH regulation"],
]
story.append(colored_table(buf_data, col_widths=[5.5*cm, 4*cm, 8*cm], header_color=C_TEAL))
story.append(Spacer(1, 4))
story.append(tip_box(
    "Acidosis: pH < 7.35  |  Alkalosis: pH > 7.45  |  "
    "Respiratory acidosis: COβ‚‚ retention (e.g., COPD)  |  Metabolic acidosis: HCO₃⁻ loss (e.g., diarrhoea)",
    bg=colors.HexColor("#e0f7fa"), tc=C_TEAL
))

# ══════════════════════════════════════════════════════
# SECTION 3 – CARDIOVASCULAR SYSTEM
# ══════════════════════════════════════════════════════
story.append(PageBreak())
story.append(section_header("3.  CARDIOVASCULAR SYSTEM (CVS)", C_GREEN))
story.append(Spacer(1, 4))

story.append(Paragraph("Properties of Cardiac Muscle", SUBSEC))
prop_data = [
    ["Property", "Definition", "Clinical Relevance"],
    ["Automaticity", "Can generate its own impulse without external stimulus", "SA node = pacemaker"],
    ["Rhythmicity", "Impulses generated at regular intervals", "Regular heartbeat 72/min"],
    ["Conductivity", "Impulse conducted through specialised fibres", "Bundle of His, Purkinje fibres"],
    ["Contractility", "Ability to contract on stimulation", "Affected in heart failure"],
    ["Excitability", "Responds to adequate stimulus", "Action potential generation"],
    ["Refractoriness", "Cannot re-excite during contraction (absolute refractory period)", "Prevents tetanus of heart"],
]
story.append(colored_table(prop_data, col_widths=[4*cm, 7*cm, 6*cm], header_color=C_GREEN))
story.append(Spacer(1, 5))

story.append(Paragraph("Conducting System of Heart", SUBSEC))
cs_data = [
    ["Structure", "Location", "Intrinsic Rate", "Function"],
    ["SA Node (Pacemaker)", "Right Atrium", "70–80/min", "Initiates heartbeat β€” sets the pace"],
    ["AV Node", "Interatrial septum", "40–60/min", "Delays impulse 0.1 sec (allows atria to empty)"],
    ["Bundle of His", "IV Septum", "20–40/min", "Connects AV node to ventricles"],
    ["Right + Left Bundle Br.", "IV Septum sides", "20–40/min", "Transmits to respective ventricles"],
    ["Purkinje Fibres", "Ventricular walls", "15–40/min", "Rapid spread β†’ simultaneous ventricular contraction"],
]
story.append(colored_table(cs_data, col_widths=[4.5*cm, 4*cm, 3*cm, 6*cm], header_color=C_GREEN))
story.append(Spacer(1, 4))
story.append(tip_box(
    "β˜… SA Node fires fastest β†’ overrides all others β†’ Primary Pacemaker  |  "
    "If SA node fails β†’ AV node takes over (Junctional rhythm 40–60/min)  |  "
    "Heart Block = AV node conduction blocked",
    bg=colors.HexColor("#e8f5e9"), tc=C_GREEN
))
story.append(Spacer(1, 5))

story.append(Paragraph("Cardiac Cycle", SUBSEC))
cc_data = [
    ["Phase", "Duration", "Valves Open/Closed", "Event"],
    ["Atrial Systole", "0.1 sec", "AV open; Semilunar closed", "Atria contract; remaining blood enters ventricles"],
    ["Isovolumetric Contraction", "0.05 sec", "All valves CLOSED", "Ventricular pressure rises rapidly"],
    ["Rapid Ventricular Ejection", "0.25 sec", "Semilunar open; AV closed", "Blood ejected into aorta & pulmonary artery"],
    ["Isovolumetric Relaxation", "0.08 sec", "All valves CLOSED", "Ventricular pressure falls"],
    ["Rapid Ventricular Filling", "0.11 sec", "AV open; Semilunar closed", "Ventricles fill rapidly from atria"],
    ["Slow Filling (Diastasis)", "0.19 sec", "AV open", "Slow filling; heart at rest"],
]
story.append(colored_table(cc_data, col_widths=[4.5*cm, 2.5*cm, 4.5*cm, 6*cm], header_color=C_GREEN))
story.append(Spacer(1, 4))

hs_data = [
    ["Heart Sound", "Cause", "Heard Best At"],
    ["S1 'Lub'", "Closure of Mitral + Tricuspid (AV) valves", "Apex (Mitral area)"],
    ["S2 'Dub'", "Closure of Aortic + Pulmonary (Semilunar) valves", "Base of heart"],
    ["S3 (Pathological)", "Rapid ventricular filling (ventricular gallop)", "Heart failure"],
    ["S4 (Pathological)", "Atrial systole against stiff ventricle", "Hypertension, MI"],
]
story.append(colored_table(hs_data, col_widths=[3.5*cm, 8*cm, 6*cm], header_color=C_GREEN))
story.append(Spacer(1, 4))

story.append(Paragraph("Cardiac Output (CO)", SUBSEC))
story.append(tip_box(
    "CO = Stroke Volume (SV) Γ— Heart Rate (HR)  =  70 mL Γ— 72 = ~5 L/min  |  "
    "Cardiac Index = CO / Body Surface Area = 3.2 L/min/mΒ²  |  "
    "Ejection Fraction (EF) = SV/EDV Γ— 100 = ~65% (normal > 55%)  |  "
    "Starling's Law: Greater the stretch (preload) β†’ Greater the force of contraction",
    bg=colors.HexColor("#e8f5e9"), tc=C_GREEN
))
story.append(Spacer(1, 5))

story.append(Paragraph("ECG β€” Electrocardiogram", SUBSEC))
ecg_data = [
    ["Wave / Segment", "Represents", "Normal Duration"],
    ["P wave", "Atrial depolarization (SA node β†’ AV node)", "< 0.12 sec"],
    ["PR interval", "Time from atrial to ventricular depolarization", "0.12–0.20 sec"],
    ["QRS complex", "Ventricular depolarization", "< 0.12 sec"],
    ["ST segment", "Ventricular plateau (no net current)", "Isoelectric (flat)"],
    ["T wave", "Ventricular repolarization", "Upright in most leads"],
    ["QT interval", "Total ventricular activity", "0.35–0.44 sec"],
]
story.append(colored_table(ecg_data, col_widths=[4.5*cm, 9*cm, 4*cm], header_color=C_GREEN))
story.append(Spacer(1, 4))
story.append(tip_box(
    "Atrial repolarization is hidden within QRS complex  |  "
    "ST elevation β†’ Acute MI  |  ST depression β†’ Ischaemia  |  "
    "Prolonged QT β†’ Risk of dangerous arrhythmia (Torsades de pointes)",
    bg=colors.HexColor("#e8f5e9"), tc=C_GREEN
))
story.append(Spacer(1, 5))

story.append(Paragraph("Blood Pressure Regulation", SUBSEC))
bp_data = [
    ["Mechanism", "How It Works"],
    ["Baroreceptor Reflex", "Carotid sinus + Aortic arch detect BP changes β†’ rapid reflex via ANS"],
    ["Renin-Angiotensin-Aldosterone (RAAS)", "Kidney JGA β†’ Renin β†’ Angiotensin II β†’ vasoconstriction + Aldosterone β†’ Na+ retention"],
    ["ADH (Vasopressin)", "Posterior pituitary β†’ water reabsorption in kidney β†’ increases blood volume"],
    ["Atrial Natriuretic Peptide (ANP)", "Released from atria when stretched β†’ promotes Na+ & water loss β†’ lowers BP"],
    ["Autonomic Nervous System", "SNS β†’ increases HR + vasoconstriction; PNS β†’ decreases HR (vagus nerve)"],
]
story.append(colored_table(bp_data, col_widths=[6*cm, 11.5*cm], header_color=C_GREEN))

# ══════════════════════════════════════════════════════
# SECTION 4 – RESPIRATORY SYSTEM
# ══════════════════════════════════════════════════════
story.append(PageBreak())
story.append(section_header("4.  RESPIRATORY SYSTEM", C_MED))
story.append(Spacer(1, 4))

story.append(Paragraph("Mechanics of Breathing", SUBSEC))
mech_data = [
    ["Phase", "Type", "Mechanism", "Muscles Used"],
    ["Inspiration", "Active", "Diaphragm + ext. intercostals contract β†’ thoracic volume↑ β†’ pressure↓ β†’ air in", "Diaphragm, External intercostals"],
    ["Expiration (quiet)", "Passive", "Muscles relax β†’ elastic recoil of lungs β†’ volume↓ β†’ pressure↑ β†’ air out", "No active muscles"],
    ["Forced Expiration", "Active", "Internal intercostals + abdominal muscles contract", "Internal intercostals, Abdominals"],
]
story.append(colored_table(mech_data, col_widths=[3*cm, 2.5*cm, 7.5*cm, 4.5*cm]))
story.append(Spacer(1, 5))

story.append(Paragraph("Lung Volumes & Capacities (Spirometry)", SUBSEC))
lv_data = [
    ["Volume / Capacity", "Normal Value", "Definition"],
    ["Tidal Volume (TV)", "500 mL", "Air in one normal breath"],
    ["Inspiratory Reserve Vol. (IRV)", "3000 mL", "Extra air inhaled beyond normal breath"],
    ["Expiratory Reserve Vol. (ERV)", "1100 mL", "Extra air exhaled beyond normal breath"],
    ["Residual Volume (RV)", "1200 mL", "Air always remaining in lungs (cannot be exhaled)"],
    ["Inspiratory Capacity (IC)", "3500 mL", "TV + IRV"],
    ["Functional Residual Cap. (FRC)", "2300 mL", "ERV + RV (at end of quiet expiration)"],
    ["Vital Capacity (VC)", "4600 mL", "TV + IRV + ERV β€” Maximum voluntary breath"],
    ["Total Lung Capacity (TLC)", "5800 mL", "VC + RV β€” All air lungs can hold"],
]
story.append(colored_table(lv_data, col_widths=[5.5*cm, 3*cm, 9*cm]))
story.append(Spacer(1, 4))
story.append(tip_box(
    "β˜… RV cannot be measured by spirometer (cannot be exhaled)  |  "
    "FRC = quiet end-expiratory position  |  "
    "Dead Space = 150 mL (air in conducting airways β€” no gas exchange occurs here)  |  "
    "Alveolar Ventilation = (TV βˆ’ Dead Space) Γ— RR = (500βˆ’150) Γ— 12 = 4200 mL/min",
    bg=C_LIGHT, tc=C_DARK
))
story.append(Spacer(1, 5))

story.append(Paragraph("Transport of Respiratory Gases", SUBSEC))
gas_data = [
    ["Gas", "Form", "% Transported", "Details"],
    ["Oβ‚‚", "Bound to Haemoglobin (Oxyhemoglobin)", "97%", "1 Hb carries 4 Oβ‚‚ molecules; pOβ‚‚ determines binding"],
    ["Oβ‚‚", "Dissolved in plasma", "3%", "Proportional to pOβ‚‚ (Henry's Law)"],
    ["COβ‚‚", "Bicarbonate (HCO₃⁻)", "70%", "COβ‚‚ + Hβ‚‚O β†’ Hβ‚‚CO₃ β†’ H⁺ + HCO₃⁻ (Carbonic anhydrase)"],
    ["COβ‚‚", "Carbaminohaemoglobin", "23%", "COβ‚‚ binds to globin portion of Hb"],
    ["COβ‚‚", "Dissolved in plasma", "7%", "Small but important for pCOβ‚‚"],
]
story.append(colored_table(gas_data, col_widths=[2*cm, 5.5*cm, 3.5*cm, 6.5*cm]))
story.append(Spacer(1, 4))
story.append(tip_box(
    "Chloride Shift (Hamburger Phenomenon): HCO₃⁻ exits RBC β†’ Cl⁻ enters to maintain electrical neutrality  |  "
    "Bohr Effect: ↑COβ‚‚/↑Temp/↑H⁺ β†’ Oβ‚‚ dissociation curve shifts RIGHT β†’ Oβ‚‚ released to tissues  |  "
    "Haldane Effect: Deoxygenated Hb carries more COβ‚‚",
    bg=C_LIGHT, tc=C_DARK
))
story.append(Spacer(1, 5))

story.append(Paragraph("Regulation of Respiration", SUBSEC))
reg_data = [
    ["Centre / Receptor", "Location", "Function"],
    ["Respiratory Centre", "Medulla oblongata", "DRG: inspiration; VRG: expiration (forced)"],
    ["Pneumotaxic Centre", "Pons", "Limits inspiration β€” switches to expiration"],
    ["Apneustic Centre", "Pons (lower)", "Prolongs inspiration (apneusis)"],
    ["Central Chemoreceptors", "Medulla surface", "Respond to ↑COβ‚‚/↑H⁺ in CSF β†’ ↑ventilation"],
    ["Peripheral Chemoreceptors", "Carotid + Aortic bodies", "Respond to ↓Oβ‚‚, ↑COβ‚‚, ↓pH β†’ ↑ventilation"],
    ["Hering-Breuer Reflex", "Lung stretch receptors (vagus)", "Inflation inhibits further inspiration (prevents overinflation)"],
]
story.append(colored_table(reg_data, col_widths=[5*cm, 5*cm, 7.5*cm]))
story.append(Spacer(1, 4))
story.append(tip_box(
    "Primary stimulus for breathing = ↑COβ‚‚ (not ↓Oβ‚‚)  |  "
    "In COPD patients: Oβ‚‚ becomes the drive (Hypoxic drive) β€” giving high Oβ‚‚ can stop breathing!",
    bg=C_LIGHT, tc=C_ACCENT
))
story.append(Spacer(1, 5))

story.append(Paragraph("Haemoglobin & Oxygen Dissociation Curve", SUBSEC))
hb_data = [
    ["Feature", "Detail"],
    ["Structure", "4 globin chains + 4 heme groups; each heme has 1 FeΒ²+ that binds 1 Oβ‚‚"],
    ["Types", "HbA (adult, Ξ±β‚‚Ξ²β‚‚) β€’ HbAβ‚‚ (Ξ±β‚‚Ξ΄β‚‚) β€’ HbF (fetal, Ξ±β‚‚Ξ³β‚‚ β€” higher Oβ‚‚ affinity)"],
    ["CO Poisoning", "CO binds Hb 250Γ— more strongly than Oβ‚‚ β†’ forms carboxyhaemoglobin β†’ cherry-red skin"],
    ["Sickle Cell", "Abnormal HbS (Ξ²-chain mutation) β†’ deoxygenation β†’ sickling β†’ haemolysis"],
    ["Thalassaemia", "Reduced synthesis of Ξ± or Ξ² chains β†’ hypochromic microcytic anaemia"],
    ["Curve shift RIGHT", "↑COβ‚‚, ↑Temp, ↑H⁺, ↑2,3-DPG β†’ Oβ‚‚ released more easily (Bohr effect)"],
    ["Curve shift LEFT", "↓COβ‚‚, ↓Temp, ↓H⁺, Fetal Hb β†’ Oβ‚‚ held more tightly"],
]
story.append(colored_table(hb_data, col_widths=[5*cm, 12.5*cm]))

# ══════════════════════════════════════════════════════
# SECTION 5 – MCQ RAPID FIRE
# ══════════════════════════════════════════════════════
story.append(PageBreak())
story.append(section_header("5.  MCQ RAPID FIRE β€” High Yield Points", C_ACCENT))
story.append(Spacer(1, 4))

mcq_col1 = [
    ["#", "Question", "Answer"],
    ["1", "Universal Blood Donor", "O Negative (Oβˆ’)"],
    ["2", "Universal Blood Recipient", "AB Positive (AB+)"],
    ["3", "Pacemaker of the heart", "SA Node"],
    ["4", "Largest WBC", "Monocyte"],
    ["5", "Most abundant WBC", "Neutrophil"],
    ["6", "Most abundant plasma protein", "Albumin"],
    ["7", "Clotting factor absent in Haemophilia A", "Factor VIII"],
    ["8", "Clotting factor absent in Haemophilia B", "Factor IX"],
    ["9", "Vitamin K dependent factors", "II, VII, IX, X"],
    ["10", "RBC life span", "120 days"],
    ["11", "Site of RBC destruction", "Spleen"],
    ["12", "Erythropoietin secreted by", "Kidney (Juxtaglomerular cells)"],
    ["13", "Blood group with no antigens on RBC", "Group O"],
    ["14", "Blood group with no antibodies in plasma", "Group AB"],
]
story.append(colored_table(mcq_col1, col_widths=[1.2*cm, 9*cm, 7.3*cm], header_color=C_ACCENT))
story.append(Spacer(1, 4))

mcq_col2 = [
    ["#", "Question", "Answer"],
    ["15", "Normal cardiac output", "~5 L/min"],
    ["16", "Normal stroke volume", "70 mL"],
    ["17", "Tidal volume (normal breath)", "500 mL"],
    ["18", "Vital Capacity", "4600 mL"],
    ["19", "Residual Volume (cannot be exhaled)", "1200 mL"],
    ["20", "Primary stimulus for breathing", "↑ COβ‚‚ (not ↓Oβ‚‚)"],
    ["21", "Main transport form of COβ‚‚ in blood", "Bicarbonate (HCO₃⁻) β€” 70%"],
    ["22", "Main transport form of Oβ‚‚ in blood", "Oxyhemoglobin β€” 97%"],
    ["23", "Respiratory centre location", "Medulla Oblongata"],
    ["24", "Hering-Breuer reflex prevents", "Over-inflation of lungs"],
    ["25", "Normal blood pH", "7.35–7.45"],
    ["26", "Most important blood buffer", "Bicarbonate buffer"],
    ["27", "Fluid Mosaic Model β€” proposed by", "Singer & Nicolson (1972)"],
    ["28", "Absolute refractory period prevents", "Tetanus of cardiac muscle"],
]
story.append(colored_table(mcq_col2, col_widths=[1.2*cm, 9*cm, 7.3*cm], header_color=C_ACCENT))
story.append(Spacer(1, 6))

# ── Exam Tips ──
story.append(section_header("6.  EXAM STRATEGY & TIPS", colors.HexColor("#4a148c")))
story.append(Spacer(1, 6))

tips = [
    ("LAQ Strategy (10 marks):", "Definition β†’ Classification β†’ Detailed mechanism/phases (with table if possible) β†’ Diagram β†’ Clinical significance β†’ Homoeopathic connection (1-2 lines)"),
    ("SAQ Strategy (5 marks):", "Definition β†’ 2–3 main points with headings β†’ Small table or list β†’ Normal value if applicable"),
    ("Short Note (2-3 marks):", "3–5 key bullet points. Be concise, include at least one value."),
    ("Diagrams that fetch marks:", "Cardiac Cycle (Wiggers diagram), Spirogram (lung volumes), Coagulation Cascade, Conducting System of Heart, ODC (Oβ‚‚ dissociation curve)"),
    ("BHMS specific β€” always add:", "Vital Force (Hahnemann) concept when writing about homeostasis, health, and body regulation β€” examiners expect this in BHMS papers."),
    ("Common mistakes to avoid:", "Do not mix Kriya Sharir Paper 1 & 2 topics. Paper 1 = General + Blood + CVS + Respiratory ONLY."),
]

for head, content in tips:
    row = [[
        Paragraph(f"<b>{head}</b>", ParagraphStyle("th", fontName="Helvetica-Bold",
            fontSize=9, textColor=colors.HexColor("#4a148c"), leading=13)),
        Paragraph(content, ParagraphStyle("tc", fontName="Helvetica",
            fontSize=8.5, textColor=colors.black, leading=13)),
    ]]
    t = Table(row, colWidths=[5*cm, 12.5*cm])
    t.setStyle(TableStyle([
        ("VALIGN", (0,0), (-1,-1), "TOP"),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING", (0,0), (-1,-1), 6),
        ("LINEBELOW", (0,0), (-1,-1), 0.3, colors.HexColor("#ce93d8")),
        ("BACKGROUND", (0,0), (0,-1), colors.HexColor("#f3e5f5")),
    ]))
    story.append(t)
story.append(Spacer(1, 10))

# ── Footer note ──
story.append(HRFlowable(width="100%", thickness=1, color=C_BORDER))
story.append(Spacer(1, 4))
story.append(Paragraph(
    "BHMS 1st Year β€” Kriya Sharir Paper 1 Quick Reference  |  MPMSU Final Exam  |  "
    "All the best! Study smart. &#128149;",
    FOOTER_S
))

# ── BUILD ──
doc.build(story)
print(f"PDF created: {OUTPUT}")
Running Command

cd /tmp/workspace/bhms-physiology && python generate_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/bhms-physiology/Kriya_Sharir_Paper1_QuickRef.pdf

Tera PDF ready hai! πŸŽ‰ Download kar lo:

Kriya Sharir Paper1 QuickRef

PDF Document Β· PDF


PDF mein kya-kya hai:

SectionContent
Normal Values TableSab important values ek jagah (Hb, RBC, WBC, BP, TV, VC, etc.)
Section 1 - General PhysiologyCell Membrane (Fluid Mosaic), Transport types, Osmosis, Homeostasis
Section 2 - BloodComposition, WBC types (Never Let Monkeys...), Plasma proteins, Blood groups ABO+Rh, Erythropoiesis, Coagulation cascade, Buffer systems
Section 3 - CVSCardiac muscle properties, Conducting system, Cardiac cycle with all phases, Heart sounds, CO formula, ECG waves, BP regulation
Section 4 - RespiratoryMechanics of breathing, Lung volumes spirometry table, Gas transport (Oβ‚‚ + COβ‚‚), Respiratory regulation, Hb & ODC curve
Section 5 - MCQ Rapid Fire28 high-yield MCQs with answers
Section 6 - Exam TipsLAQ/SAQ strategy, diagrams list, BHMS-specific Vital Force point
Print kar ke exam se pehle ek baar scan kar lena - sab kuch ek jagah hai! πŸ’ͺ Best of luck! πŸ€

Unit blood me se kitne no. Ke q.ayenge according to CBDC based mpmsu

Searching sources...
Searching the Web

MPMSU BHMS 1st year Kriya Sharir Paper 1 CBDC marking scheme marks distribution unit wise 2024 2025

Searching the Web

CBDC BHMS Kriya Sharir syllabus unit blood marks weightage question paper pattern

Reading Web Page

https://homoeopathy.ac.in/uploads/1st-BHMS(CBDC)---2024_Summ…

NCH ke official CBDC syllabus document se exact data mil gaya! Ab clearly batata hoon:

🩸 Blood Unit - CBDC Paper 1 Marks Breakdown

CBDC syllabus mein Blood Unit ko "Theme C: Body Fluids & Immune Mechanism" ke naam se list kiya gaya hai.

πŸ“Š Paper 1 - Theme-wise Marks Distribution (Official CBDC)

ThemeTopicTotal MarksMCQSAQLAQ
AGeneral Physiology07βœ…βœ…βŒ
BBiophysics07βœ…βœ…βŒ
CBody Fluids & Blood + Immune Mechanism26βœ…βœ…βœ…
DCardiovascular System16βœ…βœ…βœ…
ERespiratory System16βœ…βœ…βœ…
FExcretory System16βœ…βœ…βœ…
GSkin & Integumentary System06βœ…βœ…βŒ
HNerve Muscle Physiology06βœ…βœ…βŒ
TOTAL100

🩸 Blood Unit (Theme C) = 26 Marks out of 100

Paper 1 ka Format:

  • MCQ = 10 marks (10 questions Γ— 1 mark)
  • SAQ = 40 marks (8 questions Γ— 5 marks)
  • LAQ = 50 marks (5 questions Γ— 10 marks)

Blood Unit se expected split:

Question TypeBlood (Theme C) se kitne
MCQ (1 mark each)~2 questions = 2 marks
SAQ (5 marks each)~2 questions = 10 marks
LAQ (10 marks each)~1 question = 10–14 marks
Total~26 marks

⚠️ Important Note

"Questions can be asked from any paper's syllabus into any question paper. Students cannot claim that the question was not from the syllabus."
  • CBDC official guideline
Matlab exact question distribution fixed nahi hoti β€” ye sirf expected weightage hai. Blood ka 1 LAQ aana almost confirm hai kyunki Theme C ka 26 marks hai aur LAQ bhi allowed hai.

🎯 Blood Unit ke Top Questions (26 marks ke liye prepare karo):

LAQ (10 marks) - Ek zaroor aayega:

  1. Blood Coagulation / Haemostasis (sabse zyada aata hai)
  2. ABO Blood Groups + Rh Factor
  3. Erythropoiesis (RBC formation)

SAQ (5 marks each) - 2 aayenge:

  1. WBC types (Differential count)
  2. Plasma proteins
  3. Anaemia types
  4. Buffer systems of blood
  5. Platelet functions / Primary haemostasis

MCQ (1 mark each) - 2 aayenge:

  • Normal values (Hb, RBC, WBC, platelet count)
  • Universal donor/recipient
  • Vitamin K factors
  • RBC life span
  • Erythropoietin source

Blood = Paper 1 ka sabse bada single unit (26 marks) - isse zyada focus dena bilkul sahi decision hai! πŸ’ͺ

Blood unit ke liye detailed Q&A banao - sabhi expected questions cover karte hue

Bilkul! Pehle medical library check karta hoon phir complete Q&A banata hoon.
Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Finding Sources
Excellent! Textbook content mil gaya. Ab main Medical Physiology + Guyton & Hall ke data ke saath complete Q&A document aur PDF banata hoon.
Writing File

~/bhms-physiology/generate_blood_qa.py

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

OUTPUT = "/tmp/workspace/bhms-physiology/Blood_Unit_DetailedQA.pdf"

doc = SimpleDocTemplate(
    OUTPUT, pagesize=A4,
    rightMargin=1.5*cm, leftMargin=1.5*cm,
    topMargin=2*cm, bottomMargin=2*cm,
)

# ── Colours ──
C_DARK    = colors.HexColor("#880E4F")   # deep maroon (blood theme)
C_MED     = colors.HexColor("#AD1457")
C_LIGHT   = colors.HexColor("#FCE4EC")
C_ACCENT  = colors.HexColor("#B71C1C")
C_BLUE    = colors.HexColor("#1565C0")
C_GREEN   = colors.HexColor("#1B5E20")
C_TEAL    = colors.HexColor("#006064")
C_PURPLE  = colors.HexColor("#4A148C")
C_ORANGE  = colors.HexColor("#E65100")
C_GREY    = colors.HexColor("#F5F5F5")
C_BORDER  = colors.HexColor("#F48FB1")
C_WHITE   = colors.white
C_BLACK   = colors.black
C_AMBER   = colors.HexColor("#FF6F00")

# ── Styles ──
def S(name, **kw):
    return ParagraphStyle(name, **kw)

TITLE   = S("T", fontName="Helvetica-Bold", fontSize=22, textColor=C_WHITE,
            alignment=TA_CENTER, leading=28, spaceAfter=4)
SUB     = S("Sub", fontName="Helvetica", fontSize=11, textColor=C_WHITE,
            alignment=TA_CENTER, leading=15, spaceAfter=3)
QHEAD   = S("QH", fontName="Helvetica-Bold", fontSize=13, textColor=C_WHITE,
            alignment=TA_LEFT, leading=18, leftIndent=6, spaceBefore=2)
AHEAD   = S("AH", fontName="Helvetica-Bold", fontSize=10.5, textColor=C_DARK,
            alignment=TA_LEFT, leading=15, spaceBefore=6, spaceAfter=2)
BODY    = S("B", fontName="Helvetica", fontSize=9.5, textColor=C_BLACK,
            alignment=TA_JUSTIFY, leading=14, leftIndent=8, spaceAfter=3)
BULLET  = S("Bul", fontName="Helvetica", fontSize=9.5, textColor=C_BLACK,
            alignment=TA_LEFT, leading=14, leftIndent=18, firstLineIndent=-10, spaceAfter=2)
IMP     = S("Imp", fontName="Helvetica-Bold", fontSize=9.5, textColor=C_ACCENT,
            alignment=TA_LEFT, leading=14, leftIndent=8, spaceAfter=2)
NOTE    = S("Note", fontName="Helvetica-Oblique", fontSize=9, textColor=C_TEAL,
            alignment=TA_LEFT, leading=13, leftIndent=8, spaceAfter=2)
MCQ_Q   = S("MQ", fontName="Helvetica-Bold", fontSize=9.5, textColor=C_PURPLE,
            alignment=TA_LEFT, leading=14, leftIndent=0, spaceAfter=1)
MCQ_A   = S("MA", fontName="Helvetica", fontSize=9.5, textColor=C_GREEN,
            alignment=TA_LEFT, leading=14, leftIndent=10, spaceAfter=5)
FOOTER  = S("Ft", fontName="Helvetica-Oblique", fontSize=7.5,
            textColor=colors.grey, alignment=TA_CENTER)
PGHEAD  = S("PH", fontName="Helvetica-Bold", fontSize=10, textColor=C_DARK,
            alignment=TA_RIGHT)

# ── Helpers ──
W = 17.5 * cm

def banner(text, sub=None, color=C_DARK):
    rows = [[Paragraph(text, TITLE)]]
    if sub:
        rows.append([Paragraph(sub, SUB)])
    t = Table(rows, colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), color),
        ("TOPPADDING",    (0,0), (-1,-1), 10),
        ("BOTTOMPADDING", (0,0), (-1,-1), 10),
    ]))
    return t

def sec_head(text, color=C_DARK):
    t = Table([[Paragraph(text, QHEAD)]], colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), color),
        ("TOPPADDING",    (0,0), (-1,-1), 6),
        ("BOTTOMPADDING", (0,0), (-1,-1), 6),
        ("LEFTPADDING",   (0,0), (-1,-1), 8),
    ]))
    return t

def q_box(qnum, text, marks, color=C_MED):
    label = f"Q{qnum}.  {text}  [{marks} Marks]"
    t = Table([[Paragraph(label, QHEAD)]], colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), color),
        ("TOPPADDING",    (0,0), (-1,-1), 7),
        ("BOTTOMPADDING", (0,0), (-1,-1), 7),
        ("LEFTPADDING",   (0,0), (-1,-1), 10),
    ]))
    return t

def tip(text, bg=C_LIGHT, tc=C_ACCENT):
    t = Table([[Paragraph(text, S("tip", fontName="Helvetica", fontSize=9,
                textColor=tc, leading=13))]], colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), bg),
        ("TOPPADDING",    (0,0), (-1,-1), 6),
        ("BOTTOMPADDING", (0,0), (-1,-1), 6),
        ("LEFTPADDING",   (0,0), (-1,-1), 10),
        ("RIGHTPADDING",  (0,0), (-1,-1), 10),
        ("BOX",           (0,0), (-1,-1), 1, C_MED),
    ]))
    return t

def ct(data, cws, hc=C_MED):
    tbl = Table(data, colWidths=cws, repeatRows=1)
    cmds = [
        ("BACKGROUND",    (0,0), (-1,0), hc),
        ("TEXTCOLOR",     (0,0), (-1,0), C_WHITE),
        ("FONTNAME",      (0,0), (-1,0), "Helvetica-Bold"),
        ("FONTSIZE",      (0,0), (-1,-1), 8.5),
        ("ALIGN",         (0,0), (-1,-1), "LEFT"),
        ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("GRID",          (0,0), (-1,-1), 0.4, C_BORDER),
    ]
    for i in range(1, len(data)):
        cmds.append(("BACKGROUND", (0,i), (-1,i),
                      C_GREY if i % 2 == 0 else C_WHITE))
    tbl.setStyle(TableStyle(cmds))
    return tbl

def bul(text): return Paragraph(f"&#x2022;  {text}", BULLET)
def imp(text): return Paragraph(f"&#9733;  {text}", IMP)
def note(text): return Paragraph(text, NOTE)
def sp(n=6): return Spacer(1, n)
def hr(): return HRFlowable(width="100%", thickness=0.5, color=C_BORDER)

# ═══════════════════════════════════════════════════
story = []

# ── COVER ──
story.append(banner(
    "BLOOD UNIT β€” Complete Q&A",
    "BHMS 1st Year | Kriya Sharir Paper 1 | CBDC / MPMSU | Theme C: 26 Marks",
    C_DARK
))
story.append(sp(8))
story.append(tip(
    "This document covers ALL expected questions from the Blood Unit (Theme C β€” 26 marks).  "
    "Includes: 3 LAQs (10 marks each) + 5 SAQs (5 marks each) + MCQ points + Diagrams guide.",
    bg=colors.HexColor("#880E4F"), tc=C_WHITE
))
story.append(sp(6))

marks_data = [
    ["Question Type", "Marks Each", "From Blood Unit", "Total from Blood"],
    ["MCQ", "1 mark", "~2 questions", "~2 marks"],
    ["SAQ (Short Answer)", "5 marks", "~2 questions", "~10 marks"],
    ["LAQ (Long Answer)", "10 marks", "1–2 questions", "~14 marks"],
    ["TOTAL (Theme C)", "β€”", "β€”", "26 marks"],
]
story.append(ct(marks_data, [4.5*cm, 3.5*cm, 4.5*cm, 4.5*cm]))
story.append(sp(10))

# ══════════════════════════════════════════════════
# SECTION A: LAQ (10 marks)
# ══════════════════════════════════════════════════
story.append(sec_head("SECTION A β€” LONG ANSWER QUESTIONS (LAQ) | 10 Marks Each", C_ACCENT))
story.append(sp(6))

# ─────────────────────────────────────────────────
# LAQ 1: BLOOD COAGULATION
# ─────────────────────────────────────────────────
story.append(q_box(1, "Describe the mechanism of Blood Coagulation (Haemostasis). Add a labelled diagram of the Coagulation Cascade.", "10", C_ACCENT))
story.append(sp(5))

story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>Definition:</b> Haemostasis is the physiological process by which bleeding is arrested "
    "after injury to a blood vessel. It involves three sequential phases.",
    BODY))
story.append(sp(4))

story.append(Paragraph("<b>PHASE 1 β€” Vascular Spasm</b>", AHEAD))
for b in [
    "Immediate reflex vasoconstriction occurs within seconds of injury.",
    "Local myogenic spasm + nervous reflexes + local humoral factors (thromboxane A2, serotonin) cause the vessel to contract.",
    "Reduces blood flow through the damaged area, buying time for platelet plug formation.",
    "Lasts: Several minutes to hours.",
]:
    story.append(bul(b))
story.append(sp(4))

story.append(Paragraph("<b>PHASE 2 β€” Platelet Plug Formation (Primary Haemostasis)</b>", AHEAD))
for b in [
    "Exposed sub-endothelial collagen activates platelets (platelet activation).",
    "Platelets adhere to collagen via von Willebrand Factor (vWF) β€” this is ADHESION.",
    "Activated platelets release ADP, thromboxane A2, serotonin β†’ recruit more platelets β€” AGGREGATION.",
    "A loose platelet plug forms β€” this is PRIMARY haemostasis.",
    "Sufficient to stop bleeding in small vessel injuries.",
]:
    story.append(bul(b))
story.append(sp(4))

story.append(Paragraph("<b>PHASE 3 β€” Coagulation Cascade (Secondary Haemostasis)</b>", AHEAD))
story.append(Paragraph(
    "The coagulation cascade converts the loose platelet plug into a stable fibrin clot through "
    "two pathways that converge into a common final pathway.",
    BODY))
story.append(sp(3))

cascade_data = [
    ["INTRINSIC PATHWAY", "EXTRINSIC PATHWAY", "COMMON PATHWAY"],
    ["Triggered by blood contact with\ndamaged vessel wall (collagen)",
     "Triggered by tissue damage\n(Tissue Factor / Factor III released)",
     "Both pathways activate Factor X"],
    ["Factor XII (Hageman Factor)\n↓\nFactor XI\n↓\nFactor IX + VIII",
     "Factor VII + Tissue Factor\n↓\nFactor X activated directly",
     "Factor Xa + Factor V\n↓\nProthrombinase complex"],
    ["Slower (takes minutes)",
     "Faster (dominant in vivo)",
     "Prothrombin (II) β†’ Thrombin\nFibrinogen (I) β†’ Fibrin\nFactor XIII: cross-links fibrin"],
]
story.append(ct(cascade_data, [5.5*cm, 5.5*cm, 6.5*cm], hc=C_ACCENT))
story.append(sp(5))

story.append(Paragraph("<b>Important Clotting Factors (Must Memorise)</b>", AHEAD))
cf_data = [
    ["Factor", "Name", "Key Role / Notes"],
    ["I",    "Fibrinogen",            "Converted to Fibrin by Thrombin"],
    ["II",   "Prothrombin",           "Converted to Thrombin (key enzyme of cascade)"],
    ["III",  "Tissue Factor (Thromboplastin)", "Initiates Extrinsic pathway"],
    ["IV",   "Calcium (Ca²⁺)",        "Required at ALMOST EVERY step β€” MCQ favourite"],
    ["V",    "Labile Factor",         "Cofactor; forms prothrombinase with Xa"],
    ["VII",  "Stable Factor",         "Extrinsic pathway; Vitamin K dependent"],
    ["VIII", "Antihemophilic Factor A","Absent in Haemophilia A (most common)"],
    ["IX",   "Antihemophilic Factor B","Absent in Haemophilia B (Christmas Disease)"],
    ["X",    "Stuart-Prower Factor",   "Common pathway entry point"],
    ["XI",   "Plasma Thromboplastin Antecedent", "Intrinsic pathway"],
    ["XII",  "Hageman Factor",         "Contact activation β€” starts intrinsic pathway"],
    ["XIII", "Fibrin Stabilising Factor", "Cross-links fibrin β†’ stable clot"],
]
story.append(ct(cf_data, [1.8*cm, 5.5*cm, 10.2*cm], hc=C_PURPLE))
story.append(sp(5))

story.append(Paragraph("<b>Vitamin K Dependent Factors</b>", AHEAD))
story.append(tip(
    "Vitamin K dependent: Factors II, VII, IX, X  (Mnemonic: '1972' β€” II, VII, IX, X)  |  "
    "Warfarin blocks Vitamin K β†’ inhibits these factors β†’ used as anticoagulant in DVT, AF  |  "
    "Heparin β†’ activates Antithrombin III β†’ inhibits thrombin + Xa",
    bg=colors.HexColor("#FFF3E0"), tc=C_ORANGE
))
story.append(sp(5))

story.append(Paragraph("<b>Fibrinolysis β€” Clot Dissolution</b>", AHEAD))
for b in [
    "After wound healing, the clot must be dissolved β€” this is FIBRINOLYSIS.",
    "Plasminogen β†’ activated to PLASMIN (by tPA β€” tissue Plasminogen Activator).",
    "Plasmin digests fibrin β†’ clot dissolves.",
    "Produces Fibrin Degradation Products (FDPs) / D-dimers β€” used clinically to detect clots.",
]:
    story.append(bul(b))
story.append(sp(4))

story.append(Paragraph("<b>Coagulation Diagram (Draw in Exam)</b>", AHEAD))
diag_data = [
    ["INTRINSIC PATH", " ", "EXTRINSIC PATH"],
    ["Factor XII (contact)", "⬇", "Tissue Factor + Factor VII"],
    ["Factor XI", " ", "⬇"],
    ["Factor IX", " ", "Factor X ←←←←←←←←←←"],
    ["Factor IX + VIII + Ca²⁺ + PL", "β†’β†’β†’β†’β†’", "Factor X (activated)"],
    [" ", " ", "Factor X + V + Ca²⁺ + PL"],
    [" ", " ", "↓  PROTHROMBINASE"],
    [" ", " ", "Prothrombin (II) β†’ THROMBIN"],
    [" ", " ", "↓"],
    [" ", " ", "Fibrinogen (I) β†’ FIBRIN"],
    [" ", " ", "Factor XIII β†’ Stable Fibrin Clot"],
]
diag = Table(diag_data, colWidths=[5.5*cm, 3*cm, 9*cm])
diag.setStyle(TableStyle([
    ("FONTNAME",      (0,0), (-1,-1), "Helvetica"),
    ("FONTSIZE",      (0,0), (-1,-1), 8.5),
    ("BACKGROUND",    (0,0), (-1,0), C_LIGHT),
    ("FONTNAME",      (0,0), (-1,0), "Helvetica-Bold"),
    ("TEXTCOLOR",     (0,0), (-1,0), C_ACCENT),
    ("ALIGN",         (0,0), (-1,-1), "LEFT"),
    ("TOPPADDING",    (0,0), (-1,-1), 3),
    ("BOTTOMPADDING", (0,0), (-1,-1), 3),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
    ("BOX",           (0,0), (-1,-1), 1, C_BORDER),
    ("INNERGRID",     (0,0), (-1,-1), 0.3, C_BORDER),
]))
story.append(diag)
story.append(sp(4))
story.append(tip(
    "β˜… Exam Tip: Write all 3 phases clearly with headings. Draw cascade diagram. "
    "Mention Haemophilia A (Factor VIII) and B (Factor IX). Mention Vitamin K factors. "
    "Add 2 lines on Homoeopathic connection: Vital Force maintains vascular integrity.",
    bg=C_LIGHT, tc=C_DARK
))

# ─────────────────────────────────────────────────
story.append(PageBreak())
# LAQ 2: ERYTHROPOIESIS
# ─────────────────────────────────────────────────
story.append(q_box(2, "Describe Erythropoiesis β€” Formation, Stages, Regulation and Factors.", "10", C_ACCENT))
story.append(sp(5))

story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>Definition:</b> Erythropoiesis is the process of formation and maturation of Red Blood Cells "
    "(Erythrocytes). In a healthy adult, approximately 2–3 million RBCs are produced every second.",
    BODY))
story.append(sp(4))

story.append(Paragraph("<b>Sites of Erythropoiesis (Age-wise)</b>", AHEAD))
site_data = [
    ["Age / Stage", "Site of RBC Production"],
    ["First 2 months of fetal life", "Yolk Sac (extra-embryonic)"],
    ["2nd – 7th month (fetal)", "Liver (primary site) + Spleen"],
    ["Last 2 months of fetal life", "Red Bone Marrow begins"],
    ["Birth onwards (child & adult)", "Red Bone Marrow ONLY β€” flat bones: sternum, vertebrae, ribs, ileum, skull"],
    ["Old age / disease", "Liver and spleen may reactivate (extramedullary erythropoiesis)"],
]
story.append(ct(site_data, [5*cm, 12.5*cm]))
story.append(sp(5))

story.append(Paragraph("<b>Stages of Erythropoiesis (Maturation Sequence)</b>", AHEAD))
stage_data = [
    ["Stage", "Key Features", "Nucleus"],
    ["Proerythroblast\n(Pronormoblast)", "Largest cell; basophilic cytoplasm; Hb synthesis begins", "Large, prominent"],
    ["Basophilic Erythroblast", "Deeply basophilic; active RNA; Hb increasing", "Large"],
    ["Polychromatophilic Erythroblast", "Both acidophilic + basophilic staining; Hb ↑↑", "Smaller"],
    ["Orthochromatic Erythroblast\n(Late Normoblast)", "Mainly acidophilic; nearly full Hb", "Pyknotic (shrinking)"],
    ["Reticulocyte", "No nucleus; residual RNA network; released into blood", "NO nucleus"],
    ["Mature RBC (Erythrocyte)", "Biconcave disc; full Hb content; no nucleus, no mitochondria", "ABSENT"],
]
story.append(ct(stage_data, [5*cm, 7.5*cm, 5*cm]))
story.append(sp(4))
story.append(tip(
    "Mnemonic for stages: 'Pro-BPON-Reti-RBC'  |  "
    "Reticulocyte count = 0.5–2% of RBCs in blood (raised in haemolytic anaemia)  |  "
    "Normal RBC: biconcave, 6–8 Β΅m diameter, no nucleus, life = 120 days",
    bg=colors.HexColor("#E8F5E9"), tc=C_GREEN
))
story.append(sp(5))

story.append(Paragraph("<b>Regulation of Erythropoiesis</b>", AHEAD))
story.append(Paragraph(
    "<b>Erythropoietin (EPO)</b> is the primary hormonal regulator.",
    BODY))
for b in [
    "Produced mainly by: Peritubular cells of KIDNEY (90%) + Liver (10%).",
    "Stimulus for EPO release: Tissue HYPOXIA (low Oβ‚‚) β€” high altitude, anaemia, lung disease.",
    "Action of EPO: Stimulates bone marrow β†’ ↑ RBC production β†’ ↑ Oβ‚‚ carrying capacity.",
    "Negative feedback: When Oβ‚‚ levels normalise, EPO production falls.",
    "Clinical use: Recombinant EPO (rHuEPO) used in anaemia of chronic kidney disease.",
    "Abuse: Misused by athletes (blood doping) to increase Oβ‚‚ delivery to muscles.",
]:
    story.append(bul(b))
story.append(sp(5))

story.append(Paragraph("<b>Factors Required for Normal Erythropoiesis</b>", AHEAD))
fac_data = [
    ["Factor / Nutrient", "Role", "Deficiency Causes"],
    ["Iron (Fe²⁺)", "Essential for Haem synthesis (part of Haemoglobin)", "Iron Deficiency Anaemia β€” microcytic hypochromic"],
    ["Vitamin B12 (Cobalamin)", "DNA synthesis; requires Intrinsic Factor for absorption", "Megaloblastic / Pernicious Anaemia"],
    ["Folic Acid (Vit B9)", "DNA synthesis (purine + pyrimidine)", "Megaloblastic Anaemia (macrocytic)"],
    ["Erythropoietin (EPO)", "Stimulates stem cells to differentiate into RBCs", "Anaemia of CKD"],
    ["Protein (Amino acids)", "Globin chain synthesis", "Nutritional anaemia"],
    ["Copper (Cu)", "Iron absorption + Hb synthesis facilitator", "Mild anaemia"],
    ["Vitamin C", "Enhances iron absorption (reduces Fe³⁺ β†’ Fe²⁺)", "Impaired iron absorption"],
    ["Vitamin B6 (Pyridoxine)", "Haem synthesis", "Sideroblastic anaemia"],
    ["Thyroid hormone, Androgens", "Stimulate EPO + bone marrow directly", "Anaemia of hypothyroidism"],
]
story.append(ct(fac_data, [4.5*cm, 6*cm, 7*cm]))
story.append(sp(5))

story.append(Paragraph("<b>Fate of RBC β€” Destruction</b>", AHEAD))
for b in [
    "After 120 days, old RBCs become rigid and are trapped in the SPLEEN (RBC Graveyard).",
    "Macrophages of spleen + liver phagocytose old RBCs.",
    "Haemoglobin broken down: Globin β†’ amino acids (recycled); Haem β†’ Bilirubin (excreted in bile).",
    "Iron is recycled β€” stored as ferritin/haemosiderin or reused for new Hb synthesis.",
]:
    story.append(bul(b))
story.append(sp(4))
story.append(tip(
    "β˜… Exam Tip: Draw the maturation stages table. Write EPO regulation clearly. "
    "Mention Vitamin B12 needs Intrinsic Factor (from gastric parietal cells) β€” key for Pernicious Anaemia.",
    bg=C_LIGHT, tc=C_DARK
))

# ─────────────────────────────────────────────────
story.append(PageBreak())
# LAQ 3: BLOOD GROUPS
# ─────────────────────────────────────────────────
story.append(q_box(3, "Describe ABO and Rh Blood Group Systems. Explain the clinical significance and transfusion reactions.", "10", C_ACCENT))
story.append(sp(5))

story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>Blood Group Systems</b> classify blood based on the presence or absence of specific "
    "<b>antigens</b> on the surface of Red Blood Cells and corresponding <b>antibodies</b> in plasma. "
    "The most clinically important are ABO and Rh systems.",
    BODY))
story.append(sp(4))

story.append(Paragraph("<b>ABO Blood Group System β€” Landsteiner (1900)</b>", AHEAD))
story.append(Paragraph(
    "Based on <b>Landsteiner's Law</b>: If an antigen is absent from RBCs, "
    "the corresponding antibody WILL be present in plasma.",
    BODY))
story.append(sp(3))

abo_data = [
    ["Blood Group", "Antigen on RBC", "Antibody in Plasma", "Frequency (Indians)", "Special Name"],
    ["A",  "A antigen",      "Anti-B",           "~28%",   "β€”"],
    ["B",  "B antigen",      "Anti-A",           "~38%",   "β€”"],
    ["AB", "A + B antigens", "NONE",             "~9%",    "Universal Recipient"],
    ["O",  "NONE",           "Anti-A + Anti-B",  "~25%",   "Universal Donor"],
]
story.append(ct(abo_data, [2.8*cm, 3.5*cm, 4*cm, 3.7*cm, 3.5*cm]))
story.append(sp(4))

story.append(Paragraph("<b>Transfusion Compatibility Chart</b>", AHEAD))
comp_data = [
    ["Recipient's Blood Group", "Can Safely Receive From"],
    ["A",  "A, O"],
    ["B",  "B, O"],
    ["AB (Universal Recipient)", "A, B, AB, O  β€” can receive from ALL"],
    ["O (Universal Donor)", "O only β€” can receive from O only"],
]
story.append(ct(comp_data, [6*cm, 11.5*cm]))
story.append(sp(5))

story.append(Paragraph("<b>Rh Blood Group System</b>", AHEAD))
for b in [
    "Discovered by Landsteiner and Wiener (1940) β€” named after Rhesus monkey.",
    "Based on the D antigen (most important of ~50 Rh antigens).",
    "Rh Positive (Rh+): D antigen PRESENT on RBCs (~93–95% of Indians).",
    "Rh Negative (Rhβˆ’): D antigen ABSENT on RBCs (~5–7% of Indians).",
    "Unlike ABO β€” Rh antibodies are NOT naturally present; they form only after exposure (sensitisation).",
]:
    story.append(bul(b))
story.append(sp(5))

story.append(Paragraph("<b>Erythroblastosis Fetalis (Haemolytic Disease of Newborn)</b>", AHEAD))
ef_data = [
    ["Step", "Event"],
    ["1st Pregnancy", "Rhβˆ’ mother + Rh+ father β†’ Rh+ baby. At delivery, fetal RBCs enter mother's blood."],
    ["Sensitisation", "Mother's immune system produces Anti-D IgG antibodies (takes weeks β€” 1st baby usually unaffected)."],
    ["2nd Pregnancy", "If 2nd baby is Rh+, mother's Anti-D antibodies cross placenta β†’ destroy fetal RBCs."],
    ["Disease", "Fetal: severe haemolytic anaemia, jaundice, hydrops fetalis, kernicterus (brain damage from bilirubin)."],
    ["Prevention", "Anti-D Immunoglobulin (RhoGAM) given to Rhβˆ’ mother within 72 hrs of delivery/abortion. Prevents sensitisation."],
]
story.append(ct(ef_data, [4*cm, 13.5*cm]))
story.append(sp(5))

story.append(Paragraph("<b>Transfusion Reaction β€” What Happens if Wrong Blood Given?</b>", AHEAD))
for b in [
    "Donor antigen meets recipient antibody β†’ AGGLUTINATION (clumping of RBCs).",
    "Agglutinated RBCs block capillaries β†’ ischaemia in organs.",
    "Complement activation β†’ HAEMOLYSIS (RBC rupture) β†’ release of free Hb β†’ haemoglobinaemia.",
    "Free Hb β†’ kidneys β†’ blocks renal tubules β†’ ACUTE RENAL FAILURE.",
    "Clinical features: fever, chills, back pain, haemoglobinuria (cola-coloured urine), hypotension, shock.",
    "Management: Stop transfusion immediately, IV fluids, mannitol (to protect kidneys), symptomatic treatment.",
]:
    story.append(bul(b))
story.append(sp(4))
story.append(tip(
    "β˜… Exam Tip: Draw the ABO table with antigens + antibodies. Explain Erythroblastosis Fetalis in steps. "
    "Mention RhoGAM. Add 1 line: Homoeopathy treats the individual constitution β€” blood group can reflect "
    "constitutional tendencies (correlation with miasms is a point examiners appreciate).",
    bg=C_LIGHT, tc=C_DARK
))

# ══════════════════════════════════════════════════
# SECTION B: SAQ (5 marks)
# ══════════════════════════════════════════════════
story.append(PageBreak())
story.append(sec_head("SECTION B β€” SHORT ANSWER QUESTIONS (SAQ) | 5 Marks Each", C_BLUE))
story.append(sp(6))

# SAQ 1: WBC
story.append(q_box(4, "Classify WBC (Leukocytes). Describe their functions.", "5", C_BLUE))
story.append(sp(4))
story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>Definition:</b> WBCs (Leukocytes) are nucleated, colourless blood cells that form the "
    "cellular defence system of the body.  Normal count: <b>4,000 – 11,000 cells/Β΅L</b>.",
    BODY))
story.append(sp(3))

wbc_data = [
    ["Type", "Normal %", "Size / Nucleus", "Main Function", "Increased In"],
    ["GRANULOCYTES", "", "", "", ""],
    ["Neutrophil", "60–70%", "10–14 Β΅m; multi-lobed", "Phagocytosis of bacteria; 1st responder to acute infection", "Bacterial infections, Appendicitis"],
    ["Eosinophil", "2–4%", "Bi-lobed; red granules", "Allergy (IgE mediated); anti-parasitic; phagocytosis of Ag-Ab complexes", "Allergy, Asthma, Parasites"],
    ["Basophil", "0–1%", "Bi-lobed; large blue granules", "Releases Histamine + Heparin; role in allergy & inflammation", "Allergy, CML"],
    ["AGRANULOCYTES", "", "", "", ""],
    ["Lymphocyte", "20–30%", "Large round nucleus", "B cells: antibody production; T cells: cell-mediated immunity; NK cells: kill tumours/viruses", "Viral infections, TB, Leukaemia"],
    ["Monocyte", "2–8%", "Kidney-shaped nucleus; largest WBC", "Phagocytosis; becomes Macrophage in tissues; antigen presentation to T cells", "Chronic infections, TB, Typhoid"],
]
story.append(ct(wbc_data, [3*cm, 2*cm, 4*cm, 5.5*cm, 3*cm], hc=C_BLUE))
story.append(sp(4))
story.append(tip(
    "Mnemonic: Never Let Monkeys Eat Bananas = Neutrophil, Lymphocyte, Monocyte, Eosinophil, Basophil  |  "
    "Leukocytosis = WBC > 11,000  |  Leukopaenia = WBC < 4,000  |  Leukaemia = malignant proliferation",
    bg=colors.HexColor("#E3F2FD"), tc=C_BLUE
))
story.append(sp(8))

# SAQ 2: ANAEMIA
story.append(q_box(5, "Define Anaemia. Classify it and describe Iron Deficiency Anaemia in detail.", "5", C_BLUE))
story.append(sp(4))
story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>Definition:</b> Anaemia is a condition in which the haemoglobin concentration (or RBC count) "
    "falls below the normal range for age and sex, resulting in reduced Oβ‚‚ carrying capacity of blood.",
    BODY))
story.append(sp(3))

story.append(Paragraph("<b>Normal Hb values:</b>", AHEAD))
hb_data = [
    ["Category", "Normal Hb", "Anaemia if below"],
    ["Adult Male", "13–17 g/dL", "< 13 g/dL"],
    ["Adult Female", "12–15 g/dL", "< 12 g/dL"],
    ["Pregnant Female", "11–14 g/dL", "< 11 g/dL"],
    ["Children (6–14 yrs)", "12–15 g/dL", "< 12 g/dL"],
]
story.append(ct(hb_data, [5*cm, 4*cm, 5*cm]))
story.append(sp(4))

story.append(Paragraph("<b>Classification of Anaemia</b>", AHEAD))
anem_data = [
    ["Based on RBC Morphology", "Type", "Cause"],
    ["Microcytic Hypochromic", "Small pale RBCs (MCV < 80 fl)", "Iron deficiency, Thalassaemia, Lead poisoning"],
    ["Normocytic Normochromic", "Normal size + colour", "Acute blood loss, Haemolytic anaemia, Aplastic anaemia"],
    ["Macrocytic / Megaloblastic", "Large RBCs (MCV > 100 fl)", "Vit B12 deficiency, Folic acid deficiency"],
]
story.append(ct(anem_data, [5.5*cm, 4*cm, 8*cm], hc=C_BLUE))
story.append(sp(4))

anem2_data = [
    ["Based on Aetiology", "Details"],
    ["Iron Deficiency Anaemia", "Most common worldwide; microcytic hypochromic; Fe↓, ferritin↓, TIBC↑"],
    ["Megaloblastic Anaemia", "B12/Folate deficiency; macrocytic; hypersegmented neutrophils"],
    ["Pernicious Anaemia", "Autoimmune β€” no Intrinsic Factor β†’ B12 not absorbed β†’ megaloblastic"],
    ["Haemolytic Anaemia", "RBCs destroyed prematurely; reticulocytosis; Coombs test +ve"],
    ["Sickle Cell Anaemia", "HbS β€” deoxygenation β†’ sickling β†’ haemolysis + vaso-occlusion"],
    ["Aplastic Anaemia", "Bone marrow failure; pancytopaenia; very serious"],
    ["Thalassaemia", "Genetic β€” reduced globin chain synthesis; common in India"],
]
story.append(ct(anem2_data, [5*cm, 12.5*cm], hc=C_BLUE))
story.append(sp(4))
story.append(tip(
    "Iron Deficiency Anaemia features: Fatigue, pallor, koilonychia (spoon nails), glossitis, "
    "pica (craving chalk/mud), angular stomatitis.  Lab: Hb↓, MCV↓, MCH↓, serum ferritin↓, TIBC↑.",
    bg=colors.HexColor("#E3F2FD"), tc=C_BLUE
))
story.append(sp(8))

# SAQ 3: PLASMA PROTEINS
story.append(q_box(6, "Describe Plasma Proteins β€” types, properties and functions.", "5", C_BLUE))
story.append(sp(4))
story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>Plasma proteins</b> are macromolecules present in blood plasma. "
    "Total plasma protein concentration: <b>6–8 g/dL</b>. "
    "Synthesised mainly by the LIVER (70–80%). "
    "They provide the colloid osmotic (oncotic) pressure of plasma (~25 mmHg).",
    BODY))
story.append(sp(3))

pp_data = [
    ["Protein", "Normal Level", "Synthesised By", "Key Functions"],
    ["Albumin (55%)", "3.5–5.5 g/dL", "Liver", "β‘  Maintains oncotic pressure (most important)\nβ‘‘ Transports drugs, hormones (T4, cortisol), bilirubin, fatty acids\nβ‘’ Buffer function\nβ‘£ Protein reserve of body"],
    ["Globulins (38%)", "2.0–3.5 g/dL", "Liver + Plasma cells", "Ξ±-globulins: transport proteins (ceruloplasmin, haptoglobin)\nΞ²-globulins: transferrin (Fe transport), complement\nΞ³-globulins: IMMUNOGLOBULINS (IgG, IgA, IgM, IgE, IgD) = Antibodies"],
    ["Fibrinogen (7%)", "200–400 mg/dL", "Liver", "Clotting β€” converted to Fibrin by Thrombin\nAcute phase reactant (rises in inflammation)"],
]
story.append(ct(pp_data, [3*cm, 3*cm, 3.5*cm, 8*cm]))
story.append(sp(4))

story.append(Paragraph("<b>Oncotic Pressure and Oedema</b>", AHEAD))
for b in [
    "Oncotic (colloid osmotic) pressure is created mainly by ALBUMIN (due to its high concentration + molecular weight).",
    "It opposes the outward filtration of fluid from capillaries β€” keeps water inside vessels.",
    "Albumin ↓ (hypoalbuminaemia) β†’ oncotic pressure ↓ β†’ fluid leaks into interstitium β†’ OEDEMA.",
    "Causes of hypoalbuminaemia: Liver disease (cirrhosis), Nephrotic syndrome (protein in urine), Malnutrition, Protein-losing enteropathy.",
    "A:G ratio (Albumin:Globulin) = normally >1.0; reversed in liver disease/chronic infections.",
]:
    story.append(bul(b))
story.append(sp(8))

# SAQ 4: BUFFER SYSTEMS
story.append(q_box(7, "Describe the Buffer Systems of Blood. How is blood pH maintained?", "5", C_BLUE))
story.append(sp(4))
story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>Buffer:</b> A substance that resists changes in pH when acid or base is added. "
    "Normal blood pH: <b>7.35 – 7.45</b> (slightly alkaline). "
    "The body uses multiple buffer systems working together to maintain this narrow range.",
    BODY))
story.append(sp(3))

buf_data = [
    ["Buffer System", "Location", "% Contribution", "Mechanism"],
    ["Bicarbonate Buffer\n(Hβ‚‚CO₃ / HCO₃⁻)", "Plasma + RBC", "50–60%\n(Most Important)", "COβ‚‚ + Hβ‚‚O β‡Œ Hβ‚‚CO₃ β‡Œ H⁺ + HCO₃⁻\nLungs control COβ‚‚; Kidneys control HCO₃⁻\nKidney–Lung teamwork = primary pH control"],
    ["Haemoglobin Buffer", "Inside RBC", "~30%\n(2nd Most)", "Deoxyhaemoglobin is a better buffer than oxyhaemoglobin\nBinds H⁺ released when COβ‚‚ enters RBC (Chloride Shift)"],
    ["Protein Buffer\n(Plasma proteins)", "Plasma", "~7%", "Amino acid side chains (–NHβ‚‚ and –COOH) act as weak acids/bases\nAlbumin is main plasma buffer"],
    ["Phosphate Buffer\n(Hβ‚‚PO₄⁻ / HPO₄²⁻)", "RBC + Renal tubules", "~5%", "More important inside cells and in urine\nKidney tubular fluid pH regulation"],
]
story.append(ct(buf_data, [4*cm, 3*cm, 3*cm, 7.5*cm]))
story.append(sp(4))

story.append(Paragraph("<b>Acid-Base Disorders</b>", AHEAD))
ab_data = [
    ["Condition", "pH", "Primary Defect", "Compensation", "Common Cause"],
    ["Respiratory Acidosis", "< 7.35", "↑ pCOβ‚‚", "Kidneys retain HCO₃⁻", "COPD, Hypoventilation"],
    ["Respiratory Alkalosis", "> 7.45", "↓ pCOβ‚‚", "Kidneys excrete HCO₃⁻", "Hyperventilation, Anxiety"],
    ["Metabolic Acidosis", "< 7.35", "↓ HCO₃⁻", "Lungs ↑ ventilation (Kussmaul breathing)", "Diarrhoea, Renal failure, DKA"],
    ["Metabolic Alkalosis", "> 7.45", "↑ HCO₃⁻", "Lungs ↓ ventilation", "Vomiting, Antacid excess"],
]
story.append(ct(ab_data, [4.5*cm, 1.5*cm, 3.5*cm, 4.5*cm, 3.5*cm], hc=C_TEAL))
story.append(sp(8))

# SAQ 5: HAEMOGLOBIN
story.append(q_box(8, "Describe the Structure and Functions of Haemoglobin.", "5", C_BLUE))
story.append(sp(4))
story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>Haemoglobin (Hb)</b> is the oxygen-carrying metalloprotein inside Red Blood Cells. "
    "It is responsible for the red colour of blood. "
    "<b>Normal values:</b> Male: 13–17 g/dL | Female: 12–15 g/dL.",
    BODY))
story.append(sp(3))

story.append(Paragraph("<b>Structure of Haemoglobin</b>", AHEAD))
for b in [
    "Molecular weight: ~68,000 Daltons (68 kDa).",
    "Each Hb molecule = 4 subunits (tetramer): 4 GLOBIN chains + 4 HAEM groups.",
    "Each HAEM group = porphyrin ring + 1 iron atom (Fe²⁺ β€” ferrous form).",
    "Each Fe²⁺ binds 1 molecule of Oβ‚‚ β†’ so 1 Hb carries 4 Oβ‚‚ molecules.",
    "HbA (Adult): Ξ±β‚‚Ξ²β‚‚ (most common in adults, >96%).",
    "HbAβ‚‚: Ξ±β‚‚Ξ΄β‚‚ (~2.5%) β€” elevated in Beta-Thalassaemia trait.",
    "HbF (Foetal): Ξ±β‚‚Ξ³β‚‚ β€” higher Oβ‚‚ affinity (leftward shifted ODC) β€” replaced by HbA after birth.",
]:
    story.append(bul(b))
story.append(sp(4))

story.append(Paragraph("<b>Functions of Haemoglobin</b>", AHEAD))
hb_func = [
    ["Function", "Details"],
    ["Oβ‚‚ Transport", "Carries Oβ‚‚ from lungs to tissues as OXYHEMOGLOBIN (HbOβ‚‚). Each gram of Hb carries 1.34 mL Oβ‚‚."],
    ["COβ‚‚ Transport", "~23% of COβ‚‚ is carried as CARBAMINOHAEMOGLOBIN (COβ‚‚ binds to globin chains)."],
    ["H⁺ Buffer", "Hb is the most important intracellular buffer in blood. Accepts H⁺ released from COβ‚‚+Hβ‚‚O reaction."],
    ["NO Transport", "Carries nitric oxide (NO) β€” regulates vasodilation."],
    ["Bohr Effect", "↑COβ‚‚/↑H⁺/↑Temp β†’ Hb releases Oβ‚‚ more readily at tissues (Oβ‚‚ dissociation curve shifts RIGHT)."],
    ["Haldane Effect", "Deoxygenated Hb binds more COβ‚‚ than oxygenated Hb β€” facilitates COβ‚‚ removal at lungs."],
]
story.append(ct(hb_func, [4.5*cm, 13*cm]))
story.append(sp(4))
story.append(tip(
    "CO Poisoning: CO binds Hb 250Γ— stronger than Oβ‚‚ β†’ Carboxyhaemoglobin β†’ bright cherry-red skin β†’ cellular hypoxia  |  "
    "MetHb: Fe²⁺ oxidised to Fe³⁺ β†’ cannot carry Oβ‚‚ β†’ treat with methylene blue",
    bg=colors.HexColor("#E3F2FD"), tc=C_BLUE
))
story.append(sp(8))

# SAQ 6: PLATELET
story.append(q_box(9, "Describe the formation, properties and functions of Platelets (Thrombocytes).", "5", C_BLUE))
story.append(sp(4))
story.append(Paragraph("ANSWER:", AHEAD))
plat_data = [
    ["Feature", "Detail"],
    ["Normal Count", "1.5–4 lakh / Β΅L  (150,000 – 400,000/Β΅L)"],
    ["Size", "2–4 Β΅m diameter (smallest formed element of blood)"],
    ["Nucleus", "ABSENT (cell fragments, not complete cells)"],
    ["Origin", "Derived from MEGAKARYOCYTES in bone marrow"],
    ["Life Span", "8–10 days; destroyed in spleen"],
    ["Thrombopoietin (TPO)", "Hormone regulating platelet production β€” secreted by liver + kidney"],
]
story.append(ct(plat_data, [5*cm, 12.5*cm]))
story.append(sp(4))

story.append(Paragraph("<b>Functions of Platelets</b>", AHEAD))
for b in [
    "PRIMARY HAEMOSTASIS: Adhere to damaged vessel wall (adhesion via vWF) + aggregate to form platelet plug.",
    "Platelet activation: Release ADP, thromboxane Aβ‚‚, serotonin, platelet factor 4 β†’ attract more platelets.",
    "Provide phospholipid surface (PF3) for coagulation cascade reactions.",
    "Vascular repair: Release growth factors (PDGF, VEGF) β†’ promote vessel healing.",
    "Clot retraction: Platelets pull fibrin strands β†’ compact, firm clot.",
]:
    story.append(bul(b))
story.append(sp(4))

story.append(Paragraph("<b>Platelet Count Disorders</b>", AHEAD))
plt_dis = [
    ["Condition", "Count", "Features"],
    ["Thrombocytopaenia", "< 1.5 lakh/Β΅L", "Bleeding tendency; petechiae, purpura; causes: ITP, dengue, aplastic anaemia"],
    ["Thrombocythaemia", "> 6 lakh/Β΅L", "Clotting tendency; causes: myeloproliferative disorders"],
    ["Normal", "1.5–4 lakh/Β΅L", "No bleeding or clotting issues"],
]
story.append(ct(plt_dis, [5*cm, 4*cm, 8.5*cm]))

# ══════════════════════════════════════════════════
# SECTION C: MCQ POWER POINTS
# ══════════════════════════════════════════════════
story.append(PageBreak())
story.append(sec_head("SECTION C β€” MCQ POWER POINTS | Blood Unit", C_PURPLE))
story.append(sp(6))

mcq_list = [
    ("1",  "Universal Blood Donor", "O Negative (Oβˆ’)", "No A, B antigens + no Rh antigen"),
    ("2",  "Universal Blood Recipient", "AB Positive (AB+)", "Has both antigens β†’ no antibodies in plasma"),
    ("3",  "ABO system discovered by", "Karl Landsteiner (1900)", "Nobel Prize 1930"),
    ("4",  "Most common blood group in Indians", "B positive (B+)", "~38% Indians"),
    ("5",  "Rh antigen is", "D antigen", "Most important of 50 Rh antigens"),
    ("6",  "Rh incompatibility prevented by", "Anti-D immunoglobulin (RhoGAM)", "Given within 72 hrs"),
    ("7",  "RBC life span", "120 days", "Destroyed in spleen"),
    ("8",  "Site of RBC destruction", "Spleen (RBC Graveyard)", "Also liver to some extent"),
    ("9",  "Erythropoietin is secreted by", "Kidney (90%) + Liver (10%)", "Stimulus = tissue hypoxia"),
    ("10", "Clotting factor absent in Haemophilia A", "Factor VIII", "X-linked recessive"),
    ("11", "Clotting factor absent in Haemophilia B", "Factor IX", "Christmas Disease"),
    ("12", "Vitamin K dependent factors", "II, VII, IX, X", "Mnemonic: 1, 7, 9, 10"),
    ("13", "Most common type of anaemia worldwide", "Iron Deficiency Anaemia", "Microcytic hypochromic"),
    ("14", "Intrinsic Factor for B12 absorption produced by", "Gastric parietal cells", "Absent β†’ Pernicious anaemia"),
    ("15", "Largest WBC", "Monocyte", "Becomes macrophage in tissues"),
    ("16", "Most abundant WBC", "Neutrophil (60–70%)", "First responder to bacteria"),
    ("17", "WBC increased in allergy", "Eosinophil", "Also in parasitic infections"),
    ("18", "Antibodies are produced by", "Plasma cells (B lymphocytes)", "IgG most abundant"),
    ("19", "Most abundant plasma protein", "Albumin (55%)", "Main oncotic pressure protein"),
    ("20", "Low albumin causes", "Oedema (pitting)", "Due to ↓oncotic pressure"),
    ("21", "Normal platelet count", "1.5 – 4 lakh/Β΅L", "Thrombocytopaenia if < 1.5 lakh"),
    ("22", "Platelet life span", "8–10 days", "Destroyed in spleen"),
    ("23", "Normal WBC count", "4,000 – 11,000/Β΅L", "Leucocytosis > 11,000"),
    ("24", "Normal blood pH", "7.35 – 7.45", "Acidosis < 7.35; Alkalosis > 7.45"),
    ("25", "Haematocrit (PCV) in adult male", "~45%", "Female ~40%"),
    ("26", "Clotting factor requiring Ca²⁺", "Almost ALL factors", "Ca²⁺ = Factor IV"),
    ("27", "Primary stimulus for haemostasis", "Collagen exposure", "Activates platelets + Factor XII"),
    ("28", "Fibrin clot dissolved by", "Plasmin", "From plasminogen via tPA"),
]

for q in mcq_list:
    row = [[
        Paragraph(f"<b>{q[0]}.</b>  {q[1]}", MCQ_Q),
        Paragraph(f"&#x2714;  {q[2]}  <font color='#006064'><i>({q[3]})</i></font>", MCQ_A),
    ]]
    t = Table(row, colWidths=[7.5*cm, 10*cm])
    t.setStyle(TableStyle([
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("LINEBELOW",     (0,0), (-1,-1), 0.3, colors.HexColor("#CE93D8")),
        ("BACKGROUND",    (0,0), (0,-1), colors.HexColor("#F3E5F5")),
        ("BACKGROUND",    (1,0), (1,-1), colors.HexColor("#E8F5E9")),
    ]))
    story.append(t)

# ══════════════════════════════════════════════════
# SECTION D: DIAGRAM GUIDE
# ══════════════════════════════════════════════════
story.append(PageBreak())
story.append(sec_head("SECTION D β€” DIAGRAMS GUIDE & QUICK REVISION TABLES", C_ORANGE))
story.append(sp(6))

story.append(Paragraph("Which Diagrams to Draw in Exam", AHEAD))
diag_table = [
    ["Diagram", "Used in Which Question", "Key Elements to Label"],
    ["Coagulation Cascade", "LAQ on Haemostasis (Q1)", "Intrinsic/Extrinsic paths, common pathway, Thrombin, Fibrin"],
    ["Blood Cell Types", "SAQ on WBC / Blood composition", "RBC, WBC (5 types), Platelets β€” size comparison"],
    ["Erythropoiesis stages", "LAQ on Erythropoiesis (Q2)", "6 stages from Proerythroblast to mature RBC"],
    ["Oβ‚‚ Dissociation Curve (ODC)", "SAQ on Hb", "S-shaped curve, Bohr effect shift, HbF vs HbA"],
    ["ABO blood group diagram", "LAQ on Blood Groups (Q3)", "Antigens on RBC, antibodies in plasma β€” all 4 groups"],
    ["Haemolytic Transfusion Reaction", "LAQ Q3 clinical significance", "Agglutination β†’ haemolysis β†’ renal failure flowchart"],
]
story.append(ct(diag_table, [4.5*cm, 5*cm, 8*cm], hc=C_ORANGE))
story.append(sp(8))

story.append(Paragraph("CRITICAL NORMAL VALUES β€” Last Minute Revision", AHEAD))
nv_data = [
    ["Parameter", "Value", "Parameter", "Value"],
    ["Hb (Male)", "13–17 g/dL", "Hb (Female)", "12–15 g/dL"],
    ["RBC (Male)", "5–5.5 million/Β΅L", "RBC (Female)", "4.5–5 million/Β΅L"],
    ["WBC (Total)", "4,000–11,000/Β΅L", "Neutrophil %", "60–70%"],
    ["Lymphocyte %", "20–30%", "Monocyte %", "2–8%"],
    ["Eosinophil %", "2–4%", "Basophil %", "0–1%"],
    ["Platelet Count", "1.5–4 lakh/Β΅L", "Platelet Life", "8–10 days"],
    ["Hematocrit (M)", "45%", "Hematocrit (F)", "40%"],
    ["ESR (Male)", "< 15 mm/1st hr", "ESR (Female)", "< 20 mm/1st hr"],
    ["Plasma Proteins", "6–8 g/dL", "Albumin", "3.5–5.5 g/dL"],
    ["Blood pH", "7.35–7.45", "Blood Volume", "5–6 L (70–80 mL/kg)"],
    ["RBC Life Span", "120 days", "WBC Life", "Hours to days"],
    ["Reticulocyte %", "0.5–2%", "Oncotic Pressure", "~25 mmHg (albumin)"],
]
story.append(ct(nv_data, [4.5*cm, 4*cm, 4.5*cm, 4*cm]))
story.append(sp(8))

# ── Final tips ──
story.append(sec_head("EXAM SUCCESS STRATEGY β€” Blood Unit (26 Marks)", C_DARK))
story.append(sp(5))
tips_list = [
    ("LAQ (Most likely):", "Blood Coagulation OR Erythropoiesis OR Blood Groups β€” ANY ONE LAQ (10 marks) is almost certain."),
    ("SAQs (2 expected):", "Most common: WBC differential + Anaemia types OR Plasma Proteins + Haemoglobin structure."),
    ("MCQs (2 expected):", "Normal values, Universal donor/recipient, Vitamin K factors β€” revise the MCQ section above."),
    ("Every LAQ:", "Definition β†’ Classification/Types β†’ Mechanism (detailed) β†’ Diagram β†’ Normal values β†’ Clinical significance β†’ 1 line Homoeopathic/Vital Force connection."),
    ("Time Management:", "Give 20–22 minutes to each LAQ. 8–10 minutes per SAQ. 30 seconds per MCQ."),
    ("Common Mistake:", "Do NOT confuse Factor VIII (Haemophilia A) with Factor IX (Haemophilia B). Examiners check this."),
]
for head, content in tips_list:
    row = [[
        Paragraph(f"<b>{head}</b>", S("th2", fontName="Helvetica-Bold", fontSize=9, textColor=C_DARK, leading=13)),
        Paragraph(content, S("tc2", fontName="Helvetica", fontSize=9, textColor=C_BLACK, leading=13)),
    ]]
    t = Table(row, colWidths=[4.5*cm, 13*cm])
    t.setStyle(TableStyle([
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
        ("TOPPADDING",    (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING",   (0,0), (-1,-1), 8),
        ("LINEBELOW",     (0,0), (-1,-1), 0.4, C_BORDER),
        ("BACKGROUND",    (0,0), (0,-1), C_LIGHT),
    ]))
    story.append(t)

story.append(sp(10))
story.append(hr())
story.append(sp(4))
story.append(Paragraph(
    "BHMS 1st Year β€” Kriya Sharir Paper 1 | Blood Unit Complete Q&A | CBDC / MPMSU  |  "
    "Sources: Medical Physiology (Boulpaep & Boron), Guyton & Hall, Harper's Biochemistry  |  All the best! &#128149;",
    FOOTER
))

doc.build(story)
print(f"PDF saved: {OUTPUT}")
Running Command

cd /tmp/workspace/bhms-physiology && python generate_blood_qa.py 2>&1

Editing File

~/bhms-physiology/generate_blood_qa.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/bhms-physiology/generate_blood_qa.py'
Running Command

cd /tmp/workspace/bhms-physiology && python generate_blood_qa.py 2>&1

Running Command

ls -lh /tmp/workspace/bhms-physiology/

Tera Blood Unit Complete Q&A PDF ready hai! 🩸

Blood Unit DetailedQA

PDF Document Β· PDF


PDF mein kya-kya cover hua β€” (38 KB, Full Detail)

πŸ“‹ Section A β€” LAQ (10 marks each) β€” 3 Complete Answers:

QTopicKya Cover Hua
Q1Blood Coagulation & HaemostasisVascular Spasm β†’ Platelet Plug β†’ Full Cascade (Intrinsic + Extrinsic + Common) + All Factors table + Fibrinolysis + Diagram
Q2ErythropoiesisSite (age-wise) + 6 maturation stages + EPO regulation + All factors required (Iron, B12, Folate, etc.) + Fate of RBC
Q3Blood Groups ABO + RhLandsteiner's Law + Full ABO table + Compatibility chart + Erythroblastosis Fetalis (step-by-step) + Transfusion Reaction

πŸ“ Section B β€” SAQ (5 marks each) β€” 6 Answers:

  • Q4 WBC β€” 5 types, functions, differential count table
  • Q5 Anaemia β€” Classification (morphological + aetiological) + IDA in detail
  • Q6 Plasma Proteins β€” Albumin, Globulin, Fibrinogen + Oedema mechanism
  • Q7 Buffer Systems β€” 4 buffers + Acid-Base disorders table
  • Q8 Haemoglobin β€” Structure + Functions + Bohr/Haldane effects
  • Q9 Platelets β€” Formation, properties, functions, disorders

⚑ Section C β€” 28 MCQ Power Points (Blood unit ke sab tricky MCQs)

πŸ“ Section D β€” Diagrams guide + Critical Normal Values table + Exam Strategy


Dono PDFs milake tera complete Blood Unit revision set ready hai! πŸ’ͺ Best of luck! πŸ€

Excretory system

Asking for Preferences

Excretory System ke liye kya chahiye?

Bilkul! Blood unit wala format β€” detailed Q&A + PDF. Abhi banata hoon.
Searching sources...
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Excellent! Textbook data mil gaya. Ab seedha PDF script likhta hoon.
Writing File

~/bhms-physiology/generate_excretory_qa.py

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

OUTPUT = "/tmp/workspace/bhms-physiology/Excretory_System_DetailedQA.pdf"

doc = SimpleDocTemplate(
    OUTPUT, pagesize=A4,
    rightMargin=1.5*cm, leftMargin=1.5*cm,
    topMargin=2*cm, bottomMargin=2*cm,
)

# ── Colours (kidney theme β€” deep teal/blue) ──
C_DARK   = colors.HexColor("#01579B")   # deep blue
C_MED    = colors.HexColor("#0277BD")
C_LIGHT  = colors.HexColor("#E1F5FE")
C_ACCENT = colors.HexColor("#B71C1C")   # red for imp
C_GREEN  = colors.HexColor("#1B5E20")
C_TEAL   = colors.HexColor("#004D40")
C_PURPLE = colors.HexColor("#4A148C")
C_ORANGE = colors.HexColor("#E65100")
C_GREY   = colors.HexColor("#F5F5F5")
C_BORDER = colors.HexColor("#81D4FA")
C_WHITE  = colors.white
C_BLACK  = colors.black
C_AMBER  = colors.HexColor("#FF6F00")

W = 17.5 * cm

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

TITLE  = S("T",  fontName="Helvetica-Bold", fontSize=22, textColor=C_WHITE, alignment=TA_CENTER, leading=28, spaceAfter=4)
SUB    = S("Su", fontName="Helvetica",      fontSize=11, textColor=C_WHITE, alignment=TA_CENTER, leading=15, spaceAfter=3)
QHEAD  = S("QH", fontName="Helvetica-Bold", fontSize=12, textColor=C_WHITE, alignment=TA_LEFT,   leading=17, leftIndent=6)
AHEAD  = S("AH", fontName="Helvetica-Bold", fontSize=10.5, textColor=C_DARK, alignment=TA_LEFT,  leading=15, spaceBefore=6, spaceAfter=2)
BODY   = S("B",  fontName="Helvetica",      fontSize=9.5, textColor=C_BLACK, alignment=TA_JUSTIFY, leading=14, leftIndent=8, spaceAfter=3)
BULLET = S("Bu", fontName="Helvetica",      fontSize=9.5, textColor=C_BLACK, alignment=TA_LEFT,   leading=14, leftIndent=18, firstLineIndent=-10, spaceAfter=2)
IMP    = S("Im", fontName="Helvetica-Bold", fontSize=9.5, textColor=C_ACCENT, alignment=TA_LEFT,  leading=14, leftIndent=8,  spaceAfter=2)
MCQ_Q  = S("MQ", fontName="Helvetica-Bold", fontSize=9.5, textColor=C_PURPLE, alignment=TA_LEFT,  leading=14, spaceAfter=1)
MCQ_A  = S("MA", fontName="Helvetica",      fontSize=9.5, textColor=C_GREEN,  alignment=TA_LEFT,  leading=14, leftIndent=10, spaceAfter=5)
FOOTER = S("Ft", fontName="Helvetica-Oblique", fontSize=7.5, textColor=colors.grey, alignment=TA_CENTER)

def banner(text, sub=None, color=C_DARK):
    rows = [[Paragraph(text, TITLE)]]
    if sub: rows.append([Paragraph(sub, SUB)])
    t = Table(rows, colWidths=[W])
    t.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),color),("TOPPADDING",(0,0),(-1,-1),10),("BOTTOMPADDING",(0,0),(-1,-1),10)]))
    return t

def sec_head(text, color=C_DARK):
    t = Table([[Paragraph(text, QHEAD)]], colWidths=[W])
    t.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),color),("TOPPADDING",(0,0),(-1,-1),6),("BOTTOMPADDING",(0,0),(-1,-1),6),("LEFTPADDING",(0,0),(-1,-1),8)]))
    return t

def q_box(qnum, text, marks, color=C_MED):
    t = Table([[Paragraph(f"Q{qnum}.  {text}  [{marks} Marks]", QHEAD)]], colWidths=[W])
    t.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),color),("TOPPADDING",(0,0),(-1,-1),7),("BOTTOMPADDING",(0,0),(-1,-1),7),("LEFTPADDING",(0,0),(-1,-1),10)]))
    return t

def tip(text, bg=C_LIGHT, tc=C_DARK):
    t = Table([[Paragraph(text, S("tp", fontName="Helvetica", fontSize=9, textColor=tc, leading=13))]], colWidths=[W])
    t.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),bg),("TOPPADDING",(0,0),(-1,-1),6),("BOTTOMPADDING",(0,0),(-1,-1),6),("LEFTPADDING",(0,0),(-1,-1),10),("RIGHTPADDING",(0,0),(-1,-1),10),("BOX",(0,0),(-1,-1),1,C_DARK)]))
    return t

def ct(data, cws, hc=C_MED):
    tbl = Table(data, colWidths=cws, repeatRows=1)
    cmds = [("BACKGROUND",(0,0),(-1,0),hc),("TEXTCOLOR",(0,0),(-1,0),C_WHITE),("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),("FONTSIZE",(0,0),(-1,-1),8.5),("ALIGN",(0,0),(-1,-1),"LEFT"),("VALIGN",(0,0),(-1,-1),"MIDDLE"),("TOPPADDING",(0,0),(-1,-1),4),("BOTTOMPADDING",(0,0),(-1,-1),4),("LEFTPADDING",(0,0),(-1,-1),6),("GRID",(0,0),(-1,-1),0.4,C_BORDER)]
    for i in range(1, len(data)):
        cmds.append(("BACKGROUND",(0,i),(-1,i), C_GREY if i%2==0 else C_WHITE))
    tbl.setStyle(TableStyle(cmds))
    return tbl

def bul(text): return Paragraph(f"&#x2022;  {text}", BULLET)
def sp(n=6):   return Spacer(1, n)
def hr():      return HRFlowable(width="100%", thickness=0.5, color=C_BORDER)

# ═══════════════════════════════════════════════════════
story = []

# ── COVER ──
story.append(banner(
    "EXCRETORY SYSTEM β€” Complete Q&A",
    "BHMS 1st Year | Kriya Sharir Paper 1 | CBDC / MPMSU | Theme F: 16 Marks",
    C_DARK
))
story.append(sp(8))
story.append(tip(
    "Theme F (Excretory System) = 16 marks in Paper 1.  "
    "Includes: 1 LAQ (10 marks) + 1–2 SAQs (5 marks each) + 2 MCQs.  "
    "Most expected LAQ: Urine Formation / GFR / JGA.  Sources: Guyton & Hall, Medical Physiology (Boron & Boulpaep), Costanzo Physiology.",
    bg=C_DARK, tc=C_WHITE
))
story.append(sp(6))

marks_data = [
    ["Question Type", "Marks Each", "From Excretory Unit", "Total"],
    ["MCQ",            "1 mark",    "~2 questions",        "~2 marks"],
    ["SAQ",            "5 marks",   "~1 question",         "~5 marks"],
    ["LAQ",            "10 marks",  "1 question",          "~10 marks"],
    ["TOTAL (Theme F)","β€”",         "β€”",                   "16 marks"],
]
story.append(ct(marks_data, [4.5*cm, 3.5*cm, 5*cm, 4.5*cm]))
story.append(sp(10))

# ══════════════════════════════════════════════════════
# SECTION A β€” LAQ
# ══════════════════════════════════════════════════════
story.append(sec_head("SECTION A β€” LONG ANSWER QUESTIONS (LAQ) | 10 Marks Each", C_ACCENT))
story.append(sp(6))

# ───────────────────────────
# LAQ 1: URINE FORMATION
# ───────────────────────────
story.append(q_box(1, "Describe the mechanism of Urine Formation. Explain GFR and its regulation.", "10", C_ACCENT))
story.append(sp(5))
story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>Definition:</b> Urine formation is the process by which the kidneys filter blood, "
    "selectively reabsorb useful substances, secrete waste products, and excrete a final "
    "concentrated or dilute urine. It involves three fundamental processes.",
    BODY))
story.append(sp(4))

story.append(Paragraph("<b>Overview: Three Processes of Urine Formation</b>", AHEAD))
over_data = [
    ["Process", "Site in Nephron", "What Happens"],
    ["1. Glomerular Filtration", "Glomerulus / Bowman's Capsule", "Blood plasma filtered under pressure β†’ Glomerular Filtrate formed (like plasma without proteins)"],
    ["2. Tubular Reabsorption", "PCT β†’ Loop of Henle β†’ DCT β†’ Collecting Duct", "Useful substances (glucose, amino acids, Na⁺, water) returned to blood"],
    ["3. Tubular Secretion", "PCT and DCT mainly", "Wastes and excess ions (H⁺, K⁺, drugs, creatinine) actively secreted into tubule"],
]
story.append(ct(over_data, [4.5*cm, 5*cm, 8*cm], hc=C_ACCENT))
story.append(sp(5))

story.append(Paragraph("<b>PROCESS 1 β€” Glomerular Filtration</b>", AHEAD))
story.append(Paragraph(
    "Filtration occurs at the <b>glomerular filtration membrane</b>, which consists of: "
    "(1) Fenestrated capillary endothelium, (2) Basement membrane (main barrier), "
    "(3) Filtration slits of podocytes (visceral epithelium of Bowman's capsule).",
    BODY))
story.append(sp(3))

story.append(Paragraph("<b>Starling Forces at the Glomerulus (NFP β€” Net Filtration Pressure)</b>", AHEAD))
nfp_data = [
    ["Force", "Value", "Direction", "Effect"],
    ["Glomerular capillary blood pressure (PGC)", "~55 mmHg", "Favours filtration β†’", "Pushes fluid OUT of capillary"],
    ["Plasma colloid osmotic pressure (Ο€GC)", "~30 mmHg", "Opposes filtration ←", "Pulls fluid BACK into capillary"],
    ["Bowman's capsule hydrostatic pressure (PBS)", "~15 mmHg", "Opposes filtration ←", "Resists fluid entry into capsule"],
    ["<b>Net Filtration Pressure (NFP)</b>", "<b>~10 mmHg</b>", "<b>β†’ Filtration</b>", "<b>55 βˆ’ 30 βˆ’ 15 = 10 mmHg</b>"],
]
story.append(ct(nfp_data, [5.5*cm, 3*cm, 3.5*cm, 5.5*cm], hc=C_TEAL))
story.append(sp(4))

story.append(Paragraph("<b>Glomerular Filtration Rate (GFR)</b>", AHEAD))
for b in [
    "GFR = volume of filtrate formed per minute by BOTH kidneys combined.",
    "Normal GFR = <b>125 mL/min</b> (180 L/day filtered, but only 1–2 L urine excreted β€” 99% reabsorbed!).",
    "GFR is measured by Inulin Clearance (gold standard) or estimated using Creatinine Clearance (clinical).",
    "Filtration Fraction = GFR / Renal Plasma Flow = 125/625 = <b>~20%</b>.",
]:
    story.append(bul(b))
story.append(sp(4))

story.append(Paragraph("<b>Regulation of GFR</b>", AHEAD))
gfr_reg = [
    ["Mechanism", "How It Works", "Effect on GFR"],
    ["Myogenic Reflex (Autoregulation)", "Afferent arteriole stretches when BP rises β†’ constricts automatically", "Keeps GFR stable (80–180 mmHg range)"],
    ["Tubuloglomerular Feedback (TGF)", "Macula Densa detects ↑NaCl in tubule β†’ signals JGA β†’ afferent constriction", "↓GFR to reduce delivery"],
    ["Sympathetic Nervous System", "SNS β†’ constricts afferent arteriole β†’ ↓GFR (e.g., in shock, exercise)", "↓GFR β€” conserves blood for vital organs"],
    ["Angiotensin II", "Constricts EFFERENT arteriole preferentially β†’ maintains GFR despite ↓BP", "Preserves GFR in low-flow states"],
    ["Prostaglandins (PGEβ‚‚, PGIβ‚‚)", "Vasodilate afferent arteriole β†’ counteract Ang II + SNS", "↑GFR β€” protect GFR"],
    ["ANP (Atrial Natriuretic Peptide)", "Dilates afferent + constricts efferent β†’ ↑GFR", "↑GFR + ↑sodium excretion"],
]
story.append(ct(gfr_reg, [5*cm, 6.5*cm, 6*cm]))
story.append(sp(5))

story.append(Paragraph("<b>PROCESS 2 β€” Tubular Reabsorption</b>", AHEAD))
reab_data = [
    ["Segment", "What is Reabsorbed", "Mechanism / Notes"],
    ["Proximal Convoluted Tubule (PCT)", "67% of Na⁺, Cl⁻, water; 100% glucose; 100% amino acids; HCO₃⁻; urea (50%)", "Active transport (Na⁺/K⁺ ATPase); cotransporters for glucose (SGLT2); Obligatory water reabsorption"],
    ["Thin Descending Limb of Loop", "Water only (highly permeable to water, NOT solutes)", "Passive osmosis β€” hyperosmotic medullary gradient draws water out"],
    ["Thick Ascending Limb of Loop", "Na⁺, K⁺, 2Cl⁻ (NKCC2 cotransporter); NOT water (impermeable!)", "Creates the hyperosmotic medullary gradient β€” key for concentration"],
    ["Distal Convoluted Tubule (DCT)", "Na⁺ (Aldosterone regulated); Ca²⁺ (PTH regulated)", "Fine-tuning of electrolytes"],
    ["Collecting Duct", "Water (if ADH present); Na⁺ (Aldosterone); urea recycling", "Final concentration of urine; ADH inserts aquaporin-2 channels"],
]
story.append(ct(reab_data, [4*cm, 5.5*cm, 8*cm]))
story.append(sp(4))

story.append(Paragraph("<b>PROCESS 3 β€” Tubular Secretion</b>", AHEAD))
for b in [
    "Substances moved FROM peritubular capillary blood INTO tubular lumen for excretion.",
    "PCT secretes: H⁺, organic acids/bases, drugs (penicillin, aspirin), creatinine.",
    "DCT secretes: K⁺ (Aldosterone increases K⁺ secretion), H⁺ (acid-base balance).",
    "Clinical importance: Secretion eliminates drugs and toxins not filtered at glomerulus.",
    "PAH (Para-amino hippuric acid) is 100% secreted β€” used to measure Renal Plasma Flow.",
]:
    story.append(bul(b))
story.append(sp(4))

story.append(Paragraph("<b>Urine Concentration Mechanism (Countercurrent)</b>", AHEAD))
story.append(Paragraph(
    "The kidney can produce urine ranging from <b>50 to 1200 mOsm/kg</b> depending on hydration. "
    "This is achieved by the <b>Countercurrent Multiplier</b> in the loop of Henle and "
    "<b>Countercurrent Exchanger</b> in the vasa recta.",
    BODY))
for b in [
    "Thick ascending limb actively pumps NaCl out (impermeable to water) β†’ creates hyperosmotic medullary interstitium.",
    "Descending limb loses water into hypertonic interstitium β†’ tubular fluid becomes more concentrated.",
    "Collecting duct: if ADH present β†’ aquaporin channels open β†’ water absorbed β†’ concentrated urine (Oliguria).",
    "If ADH absent β†’ collecting duct impermeable to water β†’ dilute urine excreted (Diuresis).",
    "Urea recycling from inner medullary collecting duct also contributes to medullary gradient.",
]:
    story.append(bul(b))
story.append(sp(4))
story.append(tip(
    "β˜… Exam Tip: Draw the Nephron diagram labelling all 6 segments. Write NFP formula (55βˆ’30βˆ’15=10 mmHg). "
    "GFR normal value = 125 mL/min. Add ADH and Aldosterone roles clearly. "
    "Vital Force connection: Kidneys maintain fluid homeostasis β€” integral to the Vital Force's role in sustaining life.",
    bg=C_LIGHT, tc=C_DARK
))

# ───────────────────────────
story.append(PageBreak())
# LAQ 2: JGA + RAAS
# ───────────────────────────
story.append(q_box(2, "Describe the Juxtaglomerular Apparatus (JGA). Explain the Renin-Angiotensin-Aldosterone System (RAAS) and its role in BP regulation.", "10", C_ACCENT))
story.append(sp(5))
story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>Juxtaglomerular Apparatus (JGA)</b> is a specialised structure located at the vascular pole "
    "of the renal corpuscle, where the afferent arteriole comes in contact with the distal "
    "convoluted tubule of the SAME nephron.",
    BODY))
story.append(sp(4))

story.append(Paragraph("<b>Components of JGA</b>", AHEAD))
jga_data = [
    ["Component", "Location", "Structure", "Function"],
    ["Juxtaglomerular (JG) Cells\n(Granular cells)", "Wall of afferent arteriole (and some efferent)", "Modified smooth muscle cells containing renin secretory granules", "SECRETE RENIN in response to: ↓BP, ↓NaCl delivery, SNS activation (Ξ²1 receptors)"],
    ["Macula Densa", "Thick ascending limb / early DCT (wall of tubule adjacent to glomerulus)", "Specialised tall, closely packed epithelial cells β€” 'dense spot'", "Senses NaCl concentration in tubular fluid β†’ sends paracrine signals to JG cells β†’ regulate renin release"],
    ["Extraglomerular Mesangial Cells\n(Lacis cells / Goormaghtigh cells)", "Between afferent + efferent arterioles and macula densa", "Contractile cells with gap junctions connecting all JGA components", "Signal transduction between macula densa and JG cells; structural support; may modulate GFR"],
]
story.append(ct(jga_data, [4*cm, 4*cm, 4*cm, 5.5*cm]))
story.append(sp(5))

story.append(Paragraph("<b>Stimuli for Renin Release from JGA</b>", AHEAD))
for b in [
    "↓ Renal perfusion pressure (↓ stretch of afferent arteriole) β€” detected by JG cells as baroreceptors.",
    "↓ NaCl concentration at Macula Densa (↓GFR/↓tubular flow) β€” macula densa signals JG cells.",
    "Sympathetic stimulation (β₁ adrenergic receptors on JG cells) β€” e.g., haemorrhage, stress, upright posture.",
    "Prostaglandins (PGEβ‚‚, PGIβ‚‚) β€” stimulate renin release.",
    "↓ K⁺ (hypokalaemia) β€” stimulates renin.",
    "Inhibitors of renin: Angiotensin II (negative feedback), high Na⁺ delivery, ANP, high BP.",
]:
    story.append(bul(b))
story.append(sp(5))

story.append(Paragraph("<b>Renin-Angiotensin-Aldosterone System (RAAS)</b>", AHEAD))
story.append(Paragraph(
    "RAAS is the most important long-term regulator of blood pressure and fluid balance.",
    BODY))
story.append(sp(3))

raas_data = [
    ["Step", "Substance", "Site", "Event"],
    ["1", "Angiotensinogen", "Synthesised by Liver", "Precursor protein always circulating in blood"],
    ["2", "RENIN", "Released by JGA (kidney)", "Cleaves angiotensinogen β†’ Angiotensin I (inactive decapeptide)"],
    ["3", "ACE\n(Angiotensin Converting Enzyme)", "Pulmonary endothelium (mainly)\nAlso kidney, vessel walls", "Converts Angiotensin I β†’ Angiotensin II (active octapeptide)\nACE inhibitors (Captopril) block this step"],
    ["4", "Angiotensin II", "Systemic circulation", "Multiple powerful effects (see below)"],
    ["5", "Aldosterone", "Adrenal cortex (zona glomerulosa)", "Released in response to Ang II β†’ acts on collecting duct β†’ Na⁺ retention"],
]
story.append(ct(raas_data, [1*cm, 4*cm, 4.5*cm, 8*cm], hc=C_TEAL))
story.append(sp(5))

story.append(Paragraph("<b>Effects of Angiotensin II</b>", AHEAD))
ang_data = [
    ["Target Organ / System", "Effect", "Result"],
    ["Blood vessels", "Potent VASOCONSTRICTION (arterioles + veins)", "↑ Peripheral resistance β†’ ↑BP"],
    ["Adrenal cortex", "Stimulates Aldosterone release", "Na⁺ + water retention β†’ ↑blood volume β†’ ↑BP"],
    ["Kidney (efferent arteriole)", "Constricts efferent > afferent β†’ maintains GFR", "Preserves filtration despite low BP"],
    ["Hypothalamus", "Stimulates THIRST (dipsogenic)", "↑water intake β†’ ↑blood volume"],
    ["Posterior pituitary", "Stimulates ADH release", "↑water reabsorption in collecting duct"],
    ["Brain (area postrema)", "Activates sympathetic outflow", "↑HR, ↑vasoconstriction"],
    ["JGA (feedback)", "Inhibits further renin release (negative feedback)", "Prevents runaway RAAS activation"],
]
story.append(ct(ang_data, [4.5*cm, 5*cm, 8*cm]))
story.append(sp(5))

story.append(Paragraph("<b>Aldosterone β€” Actions in Kidney</b>", AHEAD))
for b in [
    "Secreted by zona glomerulosa of adrenal cortex.",
    "Acts on Principal cells of Collecting Duct and DCT.",
    "Mechanism: Steroid hormone β†’ enters cell β†’ binds nuclear receptor β†’ stimulates synthesis of Na⁺/K⁺ ATPase + Na⁺ channels (ENaC).",
    "Net effect: Na⁺ reabsorbed ↑ β†’ water follows (osmotic) β†’ Blood volume ↑ β†’ BP ↑.",
    "Simultaneously: K⁺ and H⁺ SECRETED into urine.",
    "Conn's Syndrome (Primary hyperaldosteronism): ↑Aldosterone β†’ Na⁺ retention β†’ Hypertension + Hypokalaemia.",
    "Addison's Disease (Adrenal insufficiency): ↓Aldosterone β†’ Na⁺ loss β†’ Hypotension + Hyperkalaemia.",
]:
    story.append(bul(b))
story.append(sp(4))
story.append(tip(
    "β˜… RAAS Cascade to memorise: Angiotensinogen (liver) β†’ [Renin from JGA] β†’ Angiotensin I β†’ "
    "[ACE from lungs] β†’ Angiotensin II β†’ Vasoconstriction + Aldosterone release + ADH + Thirst  |  "
    "ACE Inhibitors: captopril, enalapril β€” treat hypertension by blocking Ang II formation  |  "
    "ARBs (losartan): block Ang II receptor",
    bg=C_LIGHT, tc=C_DARK
))

# ══════════════════════════════════════════════════════
# SECTION B β€” SAQ
# ══════════════════════════════════════════════════════
story.append(PageBreak())
story.append(sec_head("SECTION B β€” SHORT ANSWER QUESTIONS (SAQ) | 5 Marks Each", colors.HexColor("#1565C0")))
story.append(sp(6))

# ── SAQ 1: Nephron
story.append(q_box(3, "Describe the structure of a Nephron. What are the different types of nephrons?", "5", colors.HexColor("#1565C0")))
story.append(sp(4))
story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>Nephron</b> is the structural and functional unit of the kidney. "
    "Each kidney contains approximately <b>1 million nephrons</b>. "
    "Nephrons cannot regenerate β€” lost nephrons are permanently gone.",
    BODY))
story.append(sp(3))

neph_data = [
    ["Component", "Location", "Function"],
    ["Renal Corpuscle", "Cortex", "Filtration unit = Glomerulus + Bowman's capsule"],
    ["Glomerulus", "Cortex", "Tuft of fenestrated capillaries; high-pressure filtration bed"],
    ["Bowman's Capsule", "Cortex", "Double-walled cup; parietal (outer) + visceral (podocytes) layers"],
    ["Proximal Convoluted Tubule (PCT)", "Cortex", "Reabsorbs 67% filtered load; brush border ↑ surface area; bulk reabsorption"],
    ["Loop of Henle β€” Descending limb", "Medulla", "Permeable to water only; fluid concentrates as it descends"],
    ["Loop of Henle β€” Ascending limb (thin)", "Medulla (inner)", "Permeable to NaCl; NaCl diffuses out passively"],
    ["Loop of Henle β€” Ascending limb (thick)", "Medulla/cortex border", "Actively pumps NaCl out (NKCC2); water-IMPERMEABLE β†’ creates gradient"],
    ["Distal Convoluted Tubule (DCT)", "Cortex", "Na⁺ reabsorption (Aldosterone); Ca²⁺ reabsorption (PTH); H⁺ secretion"],
    ["Collecting Duct", "Cortex β†’ Medulla", "Final water reabsorption (ADH); Na⁺ (Aldosterone); urea recycling"],
]
story.append(ct(neph_data, [4*cm, 3.5*cm, 10*cm]))
story.append(sp(4))

story.append(Paragraph("<b>Types of Nephrons</b>", AHEAD))
neph_type = [
    ["Type", "Location of Glomerulus", "Loop of Henle", "Function"],
    ["Cortical Nephrons\n(85%)", "Outer + mid cortex", "Short loop β€” barely enters medulla", "Mainly filtration and reabsorption; regulation of Na⁺ and volume"],
    ["Juxtamedullary Nephrons\n(15%)", "Deep cortex, near corticomedullary junction", "Long loop β€” extends deep into inner medulla", "Urine CONCENTRATION β€” essential for producing concentrated urine via countercurrent mechanism"],
]
story.append(ct(neph_type, [3.5*cm, 4*cm, 4*cm, 6*cm]))
story.append(sp(4))
story.append(tip(
    "Juxtaglomerular Apparatus is at the vascular pole β€” where afferent arteriole meets DCT of same nephron  |  "
    "Bowman's capsule filtration barrier: Fenestrated endothelium + Basement membrane + Podocyte slits  |  "
    "Podocytes have foot processes (pedicels) β€” effacement of pedicels = Nephrotic Syndrome",
    bg=C_LIGHT, tc=C_DARK
))
story.append(sp(8))

# ── SAQ 2: ADH / Diabetes Insipidus
story.append(q_box(4, "Describe the role of ADH (Antidiuretic Hormone) in urine concentration. What happens in its absence?", "5", colors.HexColor("#1565C0")))
story.append(sp(4))
story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>ADH (Antidiuretic Hormone = Vasopressin)</b> is a nonapeptide hormone essential for "
    "regulating water balance and urine concentration.",
    BODY))
story.append(sp(3))

adh_data = [
    ["Feature", "Detail"],
    ["Synthesised by", "Hypothalamus (paraventricular + supraoptic nuclei)"],
    ["Stored and Released from", "Posterior Pituitary (neurohypophysis)"],
    ["Chemical nature", "9 amino acid peptide (nonapeptide)"],
    ["Normal plasma level", "1–5 pg/mL; rises with hyperosmolality or ↓volume"],
    ["Receptor in kidney", "V2 receptors on principal cells of collecting duct and DCT"],
]
story.append(ct(adh_data, [5.5*cm, 12*cm]))
story.append(sp(4))

story.append(Paragraph("<b>Mechanism of Action of ADH in Kidney</b>", AHEAD))
for b in [
    "ADH binds V2 receptor on collecting duct principal cells β†’ activates adenylyl cyclase β†’ ↑cAMP.",
    "cAMP β†’ activates protein kinase A β†’ phosphorylates AQP2 (aquaporin-2) vesicles.",
    "AQP2 channels inserted into apical membrane of collecting duct cells.",
    "Water moves from tubular lumen β†’ through AQP2 β†’ through AQP3/4 (basolateral) β†’ into peritubular capillary.",
    "Result: concentrated, low-volume urine (oliguria); body retains water.",
    "When ADH withdrawn: AQP2 removed from membrane β†’ collecting duct becomes water-impermeable β†’ dilute urine.",
]:
    story.append(bul(b))
story.append(sp(4))

story.append(Paragraph("<b>Stimuli for ADH Release</b>", AHEAD))
adh_stim = [
    ["Stimulus", "Detected By", "Response"],
    ["↑Plasma osmolality (>295 mOsm/kg)", "Osmoreceptors in hypothalamus (anterior)", "↑ADH β†’ water retention β†’ osmolality normalises"],
    ["↓Blood volume / ↓BP (>10% decrease)", "Volume receptors (atria), Baroreceptors (carotid)", "↑ADH β†’ water retention β†’ volume restored"],
    ["Nausea, Pain, Stress, Exercise", "CNS pathways", "↑ADH β€” non-osmotic stimuli"],
    ["Alcohol, Cold, ANP", "β€”", "INHIBIT ADH β†’ diuresis (polyuria)"],
]
story.append(ct(adh_stim, [5*cm, 4.5*cm, 8*cm], hc=C_TEAL))
story.append(sp(4))

story.append(Paragraph("<b>Diabetes Insipidus (DI) β€” When ADH is Absent/Ineffective</b>", AHEAD))
di_data = [
    ["Type", "Cause", "Features"],
    ["Central DI", "ADH NOT secreted (hypothalamus/posterior pituitary damage β€” trauma, tumour)", "Polyuria (up to 20 L/day), polydipsia, dilute urine (SG<1.005, osmolality<300)\nTreat with desmopressin (synthetic ADH)"],
    ["Nephrogenic DI", "ADH secreted normally but KIDNEY DOES NOT RESPOND (V2 receptor mutation, Li⁺ toxicity)", "Same symptoms; desmopressin does NOT help\nTreat: low-Na⁺ diet, thiazide diuretics (paradoxical effect)"],
    ["Psychogenic (Dipsogenic) DI", "Compulsive water drinking β†’ dilutes plasma β†’ suppresses ADH", "Differentiated by water deprivation test"],
]
story.append(ct(di_data, [3.5*cm, 5.5*cm, 8.5*cm], hc=C_TEAL))
story.append(sp(8))

# ── SAQ 3: Renal Clearance
story.append(q_box(5, "Define Renal Clearance. Explain how GFR is measured. What is the significance of clearance?", "5", colors.HexColor("#1565C0")))
story.append(sp(4))
story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>Renal Clearance (C)</b> of a substance X is defined as the <b>volume of plasma that is "
    "completely cleared of substance X by the kidneys per unit time</b>.",
    BODY))
story.append(sp(3))

story.append(Paragraph("<b>Formula:</b>", AHEAD))
story.append(tip(
    "C(x)  =  U(x) Γ— V  Γ·  P(x)     "
    "[Where: U(x) = urine concentration of X (mg/mL); V = urine flow rate (mL/min); P(x) = plasma concentration of X (mg/mL)]",
    bg=colors.HexColor("#E3F2FD"), tc=C_DARK
))
story.append(sp(4))

clear_data = [
    ["Substance", "Clearance Value", "Interpretation", "Clinical Use"],
    ["Inulin", "125 mL/min", "= GFR (gold standard)\nNeither reabsorbed nor secreted β€” freely filtered only", "Research; gold standard for GFR measurement"],
    ["Creatinine", "~120–130 mL/min", "β‰ˆ GFR (slight overestimate β€” small amount secreted)\nEndogenous; no infusion needed", "Clinical GFR estimation (eGFR); most used in practice"],
    ["PAH (Para-aminohippuric acid)", "625 mL/min", "= Effective Renal Plasma Flow (ERPF)\n100% filtered + 100% secreted β†’ completely cleared in one pass", "Measures renal plasma flow"],
    ["Glucose", "0 mL/min (normally)", "All filtered glucose is reabsorbed in PCT\nAbove Tm (180 mg/dL) β†’ glycosuria (diabetes)", "Threshold concept β€” Tm for glucose"],
    ["Urea", "~70 mL/min", "< GFR β†’ reabsorbed (50% in PCT)", "Marker of renal function (BUN / blood urea nitrogen)"],
    ["Na⁺", "Very small (~1 mL/min)", "99% reabsorbed β†’ nearly zero clearance", "Shows efficient tubular reabsorption"],
]
story.append(ct(clear_data, [3*cm, 3.5*cm, 5.5*cm, 5.5*cm]))
story.append(sp(4))

story.append(Paragraph("<b>Significance of Clearance Concept</b>", AHEAD))
for b in [
    "If C(x) < GFR (125 mL/min) β†’ substance is REABSORBED by tubules.",
    "If C(x) = GFR β†’ substance is freely filtered ONLY (like inulin) β€” no reabsorption or secretion.",
    "If C(x) > GFR β†’ substance is SECRETED by tubules (e.g., PAH, penicillin).",
    "Clinical use of creatinine clearance: CKD staging β€” GFR < 60 mL/min for >3 months = Chronic Kidney Disease.",
]:
    story.append(bul(b))
story.append(sp(8))

# ── SAQ 4: Micturition
story.append(q_box(6, "Describe the mechanism of Micturition (Urination). What are its disorders?", "5", colors.HexColor("#1565C0")))
story.append(sp(4))
story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>Micturition (Urination)</b> is the process by which urine stored in the urinary bladder "
    "is expelled through the urethra. It involves coordinated activity of smooth and skeletal muscle "
    "under both involuntary and voluntary control.",
    BODY))
story.append(sp(3))

story.append(Paragraph("<b>Bladder Anatomy (Relevant)</b>", AHEAD))
for b in [
    "Detrusor muscle: smooth muscle of bladder wall β€” contracts during micturition.",
    "Internal urethral sphincter: smooth muscle β€” involuntary control (SNS keeps it closed).",
    "External urethral sphincter: skeletal muscle β€” VOLUNTARY control (can hold urine).",
    "Normal bladder capacity: 400–600 mL; first urge to void at ~150 mL.",
]:
    story.append(bul(b))
story.append(sp(4))

story.append(Paragraph("<b>Neural Control of Micturition</b>", AHEAD))
neural_data = [
    ["Division", "Nerve", "Effect on Bladder", "Effect on Sphincters"],
    ["Parasympathetic (PNS)\n(Pelvic nerve, S2–S4)", "Pelvic nerve (S2–S4)", "CONTRACTS detrusor β€” empties bladder", "RELAXES internal sphincter β†’ allows voiding"],
    ["Sympathetic (SNS)\n(Hypogastric nerve, T11–L2)", "Hypogastric nerve", "RELAXES detrusor β€” allows filling", "CONTRACTS internal sphincter β†’ retains urine"],
    ["Somatic (Voluntary)\n(Pudendal nerve, S2–S4)", "Pudendal nerve", "β€”", "Controls EXTERNAL sphincter β€” voluntary hold/release"],
]
story.append(ct(neural_data, [4*cm, 3.5*cm, 5*cm, 5*cm], hc=C_TEAL))
story.append(sp(4))

story.append(Paragraph("<b>Micturition Reflex (Steps)</b>", AHEAD))
for b in [
    "Bladder fills β†’ stretch receptors in detrusor muscle activated at ~150 mL (first sensation).",
    "Sensory impulses via pelvic nerve β†’ sacral micturition centre (S2–S4) β†’ up to pontine micturition centre.",
    "Voluntary decision to void: cortex releases inhibition β†’ pontine centre activates PNS.",
    "PNS: detrusor contracts + internal sphincter relaxes + pudendal inhibition β†’ external sphincter relaxes.",
    "Urine flows out. Detrusor continues until bladder empty β†’ reflexes subside.",
]:
    story.append(bul(b))
story.append(sp(4))

story.append(Paragraph("<b>Disorders of Micturition</b>", AHEAD))
mic_dis = [
    ["Disorder", "Cause", "Features"],
    ["Overflow Incontinence", "Bladder too full, outlet obstruction (BPH), detrusor failure", "Dribbling urine; large post-void residual"],
    ["Stress Incontinence", "Weak sphincters (post-partum, post-menopause)", "Urine leak on coughing, sneezing, exercise"],
    ["Urge Incontinence", "Detrusor overactivity (OAB)", "Sudden urge, can't hold β€” run to toilet"],
    ["Neurogenic Bladder", "Spinal cord injury above S2", "Uninhibited bladder contractions; no voluntary control"],
    ["Atonic Bladder", "Lower motor neuron lesion (S2–S4 damage)", "Bladder distends massively; no urge; overflow"],
]
story.append(ct(mic_dis, [4*cm, 5*cm, 8.5*cm], hc=C_TEAL))
story.append(sp(8))

# ── SAQ 5: Characteristics of Normal Urine
story.append(q_box(7, "Describe the physical and chemical characteristics of Normal Urine.", "5", colors.HexColor("#1565C0")))
story.append(sp(4))
story.append(Paragraph("ANSWER:", AHEAD))
story.append(Paragraph(
    "<b>Urinalysis</b> provides important diagnostic information about kidney function and "
    "systemic diseases. Normal urine has distinct physical and chemical properties.",
    BODY))
story.append(sp(3))

story.append(Paragraph("<b>A. Physical Characteristics of Normal Urine</b>", AHEAD))
phys_data = [
    ["Property", "Normal Value / Description", "Abnormal Finding"],
    ["Volume", "1,000–2,000 mL/day (average ~1,500 mL)", "Polyuria >3L; Oliguria <400 mL; Anuria <100 mL"],
    ["Colour", "Pale yellow to amber (due to Urobilinogen/Urochrome)", "Dark: dehydration, bilirubin; Red: blood; Colourless: DI"],
    ["Transparency", "Clear (transparent)", "Cloudy: infection (pus = pyuria), phosphates in alkaline urine"],
    ["Odour", "Faint aromatic odour", "Fruity/sweet: diabetic ketoacidosis; Ammoniacal: bacterial infection; Foul: UTI"],
    ["Specific Gravity (SG)", "1.003 – 1.030", "Fixed at 1.010: chronic renal failure (isosthenuria); >1.030: dehydration"],
    ["Reaction (pH)", "4.5 – 8.0 (average ~6.0, slightly acidic)", "Alkaline: UTI (Proteus), vegetarian diet, RTA; Very acidic: acidosis, protein diet"],
    ["Osmolality", "50 – 1,200 mOsm/kg", "Depends on hydration; max concentration = 1,200 mOsm"],
]
story.append(ct(phys_data, [3.5*cm, 5.5*cm, 8.5*cm]))
story.append(sp(4))

story.append(Paragraph("<b>B. Chemical Characteristics of Normal Urine</b>", AHEAD))
chem_data = [
    ["Constituent", "Normal Urine", "Abnormal (Pathological) Finding"],
    ["Urea (largest solute)", "20–35 g/day", "↓ in liver disease; ↑ in high protein diet"],
    ["Creatinine", "1–2 g/day (constant)", "↓ if renal function impaired; used to validate 24hr collection"],
    ["Uric acid", "0.4–1 g/day", "↑ in gout, leukaemia"],
    ["Na⁺, K⁺, Cl⁻", "Varies with diet", "β€”"],
    ["Glucose", "ABSENT / trace (<0.1 g/day)", "Glycosuria: diabetes mellitus (blood glucose >180 mg/dL = renal threshold), or renal glycosuria"],
    ["Proteins", "ABSENT / trace (<150 mg/day Tamm-Horsfall)", "Proteinuria: nephrotic syndrome, glomerulonephritis, UTI"],
    ["Ketone bodies", "ABSENT", "Ketonuria: diabetic ketoacidosis, starvation, prolonged exercise"],
    ["Bilirubin", "ABSENT", "Bilirubinuria: obstructive jaundice, hepatitis β€” dark 'tea-coloured' urine"],
    ["RBCs (Haematuria)", "0–2 RBCs/HPF", "Haematuria: stones, tumour, glomerulonephritis, TB"],
    ["WBCs (Pyuria)", "0–5 WBCs/HPF", "Pyuria: UTI (cystitis, pyelonephritis)"],
    ["Casts", "ABSENT or occasional hyaline", "RBC casts: glomerulonephritis; WBC casts: pyelonephritis; Granular casts: chronic renal failure"],
]
story.append(ct(chem_data, [4*cm, 4.5*cm, 9*cm]))
story.append(sp(8))

# ══════════════════════════════════════════════════════
# SECTION C β€” MCQ
# ══════════════════════════════════════════════════════
story.append(PageBreak())
story.append(sec_head("SECTION C β€” MCQ POWER POINTS | Excretory System (30 Questions)", C_PURPLE))
story.append(sp(6))

mcq_list = [
    ("1",  "Functional unit of kidney",                              "Nephron",                                   "~1 million per kidney"),
    ("2",  "Normal GFR",                                             "125 mL/min",                                "180 L/day filtered; 99% reabsorbed"),
    ("3",  "Substance used to measure GFR (gold standard)",          "Inulin",                                    "Freely filtered; NOT reabsorbed or secreted"),
    ("4",  "Clinical marker for GFR estimation",                     "Creatinine clearance",                      "eGFR formula; endogenous, no infusion needed"),
    ("5",  "Substance used to measure Renal Plasma Flow",            "PAH (Para-aminohippuric acid)",              "Clearance = 625 mL/min = ERPF"),
    ("6",  "Filtration Fraction (FF)",                               "~20% (GFR/RPF = 125/625)",                  "= Fraction of plasma filtered"),
    ("7",  "Net Filtration Pressure at glomerulus",                  "10 mmHg (55 βˆ’ 30 βˆ’ 15)",                    "PGC βˆ’ Ο€GC βˆ’ PBS"),
    ("8",  "JGA location",                                           "Vascular pole of renal corpuscle",          "Where afferent arteriole meets DCT"),
    ("9",  "Cells that secrete Renin",                               "Juxtaglomerular (granular) cells",          "In wall of afferent arteriole"),
    ("10", "Macula Densa senses",                                    "NaCl concentration in tubular fluid",       "Signals JG cells to adjust renin"),
    ("11", "ACE is mainly found in",                                 "Pulmonary endothelium (lungs)",             "Ang I β†’ Ang II"),
    ("12", "Angiotensin II main action",                             "Vasoconstriction + Aldosterone release",    "↑BP + Na⁺ retention"),
    ("13", "Aldosterone acts on",                                    "Collecting duct principal cells",           "↑Na⁺ reabsorption, ↑K⁺ secretion"),
    ("14", "ADH is synthesised in",                                  "Hypothalamus (supraoptic + PVN)",           "Stored in posterior pituitary"),
    ("15", "ADH receptor in kidney",                                 "V2 receptor",                               "Collecting duct β†’ AQP2 insertion"),
    ("16", "Aquaporin inserted by ADH",                              "AQP2 (apical membrane of collecting duct)", "AQP3/4 on basolateral side"),
    ("17", "Diabetes Insipidus (central) treated with",              "Desmopressin (synthetic ADH)",              "V2 receptor agonist"),
    ("18", "Segment impermeable to water (creates medullary gradient)", "Thick ascending limb of loop of Henle",  "Actively pumps NaCl out; NKCC2 cotransporter"),
    ("19", "100% glucose reabsorption occurs in",                    "PCT (Proximal Convoluted Tubule)",          "Via SGLT2 cotransporter"),
    ("20", "Renal threshold for glucose",                            "180 mg/dL",                                 "Above this β†’ glycosuria in diabetes"),
    ("21", "Most important buffer in tubular fluid",                 "Phosphate buffer",                          "Also NH₄⁺ (ammonium buffer) in acidosis"),
    ("22", "Normal urine output per day",                            "1,000–2,000 mL",                            "Average ~1,500 mL"),
    ("23", "Oliguria defined as urine output",                       "< 400 mL/day (< 0.5 mL/kg/hr)",            "Sign of kidney failure/dehydration"),
    ("24", "Normal specific gravity of urine",                       "1.003–1.030",                               "Fixed 1.010 = CRF (isosthenuria)"),
    ("25", "Normal urine pH",                                        "4.5–8.0 (average ~6.0, acidic)",            "Alkaline in UTI with Proteus (urease splits urea)"),
    ("26", "Colour of urine due to",                                 "Urochrome (degraded urobilinogen)",         "Dark yellow = concentrated; colourless = dilute"),
    ("27", "Glycosuria WITHOUT hyperglycaemia",                      "Renal glycosuria",                          "Defective SGLT2 β€” Fanconi syndrome"),
    ("28", "RBC casts in urine suggest",                             "Glomerulonephritis",                        "Casts take shape of tubule lumen"),
    ("29", "Micturition centre in spinal cord",                      "S2, S3, S4 (sacral)",                       "'S2, 3, 4 keeps the pee off the floor'"),
    ("30", "Countercurrent multiplier involves",                     "Loop of Henle",                             "Juxtamedullary nephrons β€” creates medullary gradient"),
]

for q in mcq_list:
    row = [[
        Paragraph(f"<b>{q[0]}.</b>  {q[1]}", MCQ_Q),
        Paragraph(f"&#x2714;  {q[2]}  <font color='#004D40'><i>({q[3]})</i></font>", MCQ_A),
    ]]
    t = Table(row, colWidths=[7.5*cm, 10*cm])
    t.setStyle(TableStyle([
        ("VALIGN",        (0,0),(-1,-1),"TOP"),
        ("TOPPADDING",    (0,0),(-1,-1),4),
        ("BOTTOMPADDING", (0,0),(-1,-1),4),
        ("LEFTPADDING",   (0,0),(-1,-1),6),
        ("LINEBELOW",     (0,0),(-1,-1),0.3,C_BORDER),
        ("BACKGROUND",    (0,0),(0,-1), colors.HexColor("#E3F2FD")),
        ("BACKGROUND",    (1,0),(1,-1), colors.HexColor("#E8F5E9")),
    ]))
    story.append(t)

# ══════════════════════════════════════════════════════
# SECTION D β€” DIAGRAMS + NORMAL VALUES + TIPS
# ══════════════════════════════════════════════════════
story.append(PageBreak())
story.append(sec_head("SECTION D β€” DIAGRAMS GUIDE + NORMAL VALUES + EXAM TIPS", C_ORANGE))
story.append(sp(6))

story.append(Paragraph("Key Diagrams to Draw in Exam", AHEAD))
diag_data = [
    ["Diagram", "Used In", "Must Label"],
    ["Nephron (full structure)", "LAQ 1 Urine Formation, SAQ Nephron", "Glomerulus, Bowman's, PCT, Loop (desc+asc), DCT, Collecting duct, Afferent/Efferent arterioles, JGA"],
    ["JGA Components", "LAQ 2 JGA/RAAS", "JG cells, Macula densa, Lacis cells, Afferent arteriole, DCT"],
    ["RAAS Cascade (flowchart)", "LAQ 2 RAAS", "Angiotensinogen→Renin→Ang I→ACE→Ang II→Aldosterone/ADH/Vasoconstriction"],
    ["Urine Concentration (countercurrent)", "LAQ 1 / SAQ ADH", "Descending + ascending limb, osmolality gradients 300β†’1200 mOsm, ADH + AQP2 in collecting duct"],
    ["Micturition Reflex Arc", "SAQ Micturition", "Bladder β†’ pelvic nerve β†’ S2-S4 β†’ pontine centre β†’ PNS β†’ detrusor, sphincters"],
]
story.append(ct(diag_data, [4*cm, 4.5*cm, 9*cm], hc=C_ORANGE))
story.append(sp(6))

story.append(Paragraph("CRITICAL NORMAL VALUES β€” Excretory System", AHEAD))
nv_data = [
    ["Parameter", "Normal Value", "Parameter", "Normal Value"],
    ["GFR", "125 mL/min", "Renal Blood Flow (RBF)", "1,100–1,200 mL/min"],
    ["Renal Plasma Flow (RPF)", "~625 mL/min", "Filtration Fraction", "~20%"],
    ["Urine Output / day", "1,000–2,000 mL", "Oliguria", "< 400 mL/day"],
    ["Urine pH", "4.5–8.0 (avg 6.0)", "Urine Specific Gravity", "1.003–1.030"],
    ["Urine Osmolality (max)", "Up to 1,200 mOsm/kg", "Plasma Osmolality", "285–295 mOsm/kg"],
    ["Urea in urine/day", "20–35 g", "Creatinine in urine/day", "1–2 g"],
    ["Renal threshold (glucose)", "180 mg/dL", "Tm for glucose", "375 mg/min"],
    ["No. of nephrons/kidney", "~1 million", "Bladder capacity", "400–600 mL"],
    ["Inulin clearance = GFR", "125 mL/min", "PAH clearance = ERPF", "625 mL/min"],
    ["1st urge to void at", "~150 mL", "Max urine concentration", "1,200 mOsm/kg"],
]
story.append(ct(nv_data, [4.5*cm, 4.0*cm, 4.5*cm, 4.0*cm]))
story.append(sp(6))

story.append(sec_head("EXAM SUCCESS STRATEGY β€” Excretory System (16 Marks)", C_DARK))
story.append(sp(5))
tips_list = [
    ("Most likely LAQ:", "Urine Formation (GFR + reabsorption + secretion) OR JGA + RAAS β€” one of these will come for sure (10 marks)."),
    ("Most likely SAQ:", "Characteristics of Urine OR Nephron structure OR ADH / Diabetes Insipidus (5 marks)."),
    ("MCQs (2 expected):", "GFR value (125 mL/min), Inulin clearance, ADH source/target, Macula densa function, Renal threshold for glucose."),
    ("Every LAQ:", "Definition β†’ Anatomy (labelled diagram) β†’ Mechanism (step-by-step) β†’ Regulation β†’ Clinical significance β†’ 1 line Vital Force/Homoeopathic angle."),
    ("RAAS trick:", "Always write full cascade: Angiotensinogen β†’ Renin (JGA) β†’ Ang I β†’ ACE (lungs) β†’ Ang II β†’ Aldosterone + ADH + Vasoconstriction + Thirst."),
    ("Common Mistake:", "Do NOT confuse Aldosterone (Na⁺ retention/K⁺ loss) with ADH (water retention only). Both act on collecting duct but differently."),
    ("Homoeopathic angle:", "Kidneys regulate the internal milieu (homeostasis). Vital Force maintains this balance β€” renal disease reflects a derangement of the Vital Force."),
]
for head, content in tips_list:
    row = [[
        Paragraph(f"<b>{head}</b>", S("th2", fontName="Helvetica-Bold", fontSize=9, textColor=C_DARK, leading=13)),
        Paragraph(content, S("tc2", fontName="Helvetica", fontSize=9, textColor=C_BLACK, leading=13)),
    ]]
    t = Table(row, colWidths=[4.5*cm, 13*cm])
    t.setStyle(TableStyle([
        ("VALIGN",        (0,0),(-1,-1),"TOP"),
        ("TOPPADDING",    (0,0),(-1,-1),5),
        ("BOTTOMPADDING", (0,0),(-1,-1),5),
        ("LEFTPADDING",   (0,0),(-1,-1),8),
        ("LINEBELOW",     (0,0),(-1,-1),0.4,C_BORDER),
        ("BACKGROUND",    (0,0),(0,-1), C_LIGHT),
    ]))
    story.append(t)

story.append(sp(10))
story.append(hr())
story.append(sp(4))
story.append(Paragraph(
    "BHMS 1st Year β€” Kriya Sharir Paper 1 | Excretory System Complete Q&A | CBDC / MPMSU  |  "
    "Sources: Guyton & Hall Medical Physiology, Costanzo Physiology, Medical Physiology (Boron & Boulpaep)  |  All the best! &#128149;",
    FOOTER
))

doc.build(story)
print(f"PDF saved: {OUTPUT}")
Running Command

cd /tmp/workspace/bhms-physiology && python generate_excretory_qa.py 2>&1

Running Command

ls -lh /tmp/workspace/bhms-physiology/*.pdf

Tera Excretory System PDF ready hai! πŸŽ‰

Excretory System DetailedQA

PDF Document Β· PDF


PDF mein kya-kya cover hua (36 KB β€” 4 sections):

πŸ“‹ Section A β€” LAQ (10 marks each) β€” 2 Complete Answers:

QTopicDetails
Q1Urine Formation + GFR3 processes (filtration, reabsorption, secretion) + NFP formula (55βˆ’30βˆ’15=10 mmHg) + GFR = 125 mL/min + Regulation table + Tubular reabsorption segment-wise table + Countercurrent concentration
Q2JGA + RAASJGA ke 3 components (JG cells, Macula Densa, Lacis cells) + Renin release stimuli + Full RAAS cascade table + Angiotensin II effects table + Aldosterone actions + ACE inhibitors mention

πŸ“ Section B β€” SAQ (5 marks each) β€” 5 Answers:

  • Q3 Nephron structure β€” all 9 segments + Cortical vs Juxtamedullary nephrons
  • Q4 ADH / Vasopressin β€” mechanism (V2 β†’ cAMP β†’ AQP2) + Stimuli table + Diabetes Insipidus (Central vs Nephrogenic vs Psychogenic)
  • Q5 Renal Clearance β€” formula + Inulin/Creatinine/PAH/Glucose clearance comparison table
  • Q6 Micturition β€” neural control (PNS/SNS/Somatic) + Micturition reflex steps + 5 disorders
  • Q7 Normal Urine characteristics β€” Physical properties table + Chemical constituents + Abnormal findings

⚑ Section C β€” 30 MCQ Power Points

πŸ“ Section D β€” Diagrams guide (5 diagrams) + All normal values + Exam Strategy


Ab teri PDF collection complete ho gayi:

PDFTopicSize

Kriya Sharir Paper1 QuickRef

PDF Document Β· PDF

All topics overview27 KB

Blood Unit DetailedQA

PDF Document Β· PDF

Theme C β€” 26 marks38 KB

Excretory System DetailedQA

PDF Document Β· PDF

Theme F β€” 16 marks36 KB
Aur kaunsa unit chahiye? CVS, Respiratory, ya General Physiology? πŸ’ͺ

Previous year papers ΰ€•ΰ₯€ ΰ€€ΰ€°ΰ€Ή solve ΰ€•ΰ€°ΰ€¨ΰ₯‡ ΰ€΅ΰ€Ύΰ€²ΰ₯€ Q&A

Asking for Preferences

Kis topic ka Previous Year Paper style mock paper chahiye? Β· Format kaise chahiye?

Bilkul! Actual MPMSU exam format mein β€” MCQ + SAQ + LAQ β€” with complete model answers. PDF bana ke deta hoon.
Writing File

~/bhms-physiology/generate_pyq_excretory.py

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

OUTPUT = "/tmp/workspace/bhms-physiology/Excretory_PYQ_SolvedPaper.pdf"

doc = SimpleDocTemplate(
    OUTPUT, pagesize=A4,
    rightMargin=1.8*cm, leftMargin=1.8*cm,
    topMargin=2*cm, bottomMargin=2*cm,
)

W = 17.0 * cm

# ── Colours ──
C_PAPER  = colors.HexColor("#1A237E")   # deep exam blue
C_Q      = colors.HexColor("#0D47A1")   # question box
C_ANS    = colors.HexColor("#1B5E20")   # answer heading
C_MCQ    = colors.HexColor("#4A148C")   # MCQ purple
C_MARKS  = colors.HexColor("#B71C1C")   # marks red
C_TIP    = colors.HexColor("#E65100")   # tip orange
C_LIGHT  = colors.HexColor("#E8EAF6")
C_LGREEN = colors.HexColor("#E8F5E9")
C_LYELLOW= colors.HexColor("#FFF8E1")
C_LPURP  = colors.HexColor("#F3E5F5")
C_BORDER = colors.HexColor("#9FA8DA")
C_WHITE  = colors.white
C_BLACK  = colors.black
C_GREY   = colors.HexColor("#F5F5F5")
C_TEAL   = colors.HexColor("#004D40")

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

TITLE    = S("T",  fontName="Helvetica-Bold",   fontSize=14, textColor=C_WHITE,   alignment=TA_CENTER, leading=20, spaceAfter=2)
UNIV     = S("U",  fontName="Helvetica-Bold",   fontSize=11, textColor=C_WHITE,   alignment=TA_CENTER, leading=15, spaceAfter=2)
SUBJ     = S("SJ", fontName="Helvetica",        fontSize=10, textColor=C_WHITE,   alignment=TA_CENTER, leading=14, spaceAfter=2)
INSTRUCT = S("IN", fontName="Helvetica",        fontSize=9,  textColor=C_BLACK,   alignment=TA_LEFT,   leading=13, spaceAfter=2)
SECTION  = S("SE", fontName="Helvetica-Bold",   fontSize=11, textColor=C_WHITE,   alignment=TA_CENTER, leading=16)
QNUM     = S("QN", fontName="Helvetica-Bold",   fontSize=10, textColor=C_Q,       alignment=TA_LEFT,   leading=14, spaceBefore=8, spaceAfter=2)
QTEXT    = S("QT", fontName="Helvetica-Bold",   fontSize=10, textColor=C_BLACK,   alignment=TA_LEFT,   leading=14, leftIndent=16, spaceAfter=2)
MARKS_S  = S("MK", fontName="Helvetica-Bold",   fontSize=9,  textColor=C_MARKS,   alignment=TA_RIGHT,  leading=13)
ANS_HEAD = S("AH", fontName="Helvetica-Bold",   fontSize=10, textColor=C_ANS,     alignment=TA_LEFT,   leading=14, spaceBefore=4, spaceAfter=2)
BODY     = S("B",  fontName="Helvetica",        fontSize=9.5,textColor=C_BLACK,   alignment=TA_JUSTIFY,leading=14, leftIndent=8,  spaceAfter=3)
BULLET   = S("Bu", fontName="Helvetica",        fontSize=9.5,textColor=C_BLACK,   alignment=TA_LEFT,   leading=14, leftIndent=20, firstLineIndent=-12, spaceAfter=2)
OPT      = S("OP", fontName="Helvetica",        fontSize=9.5,textColor=C_BLACK,   alignment=TA_LEFT,   leading=14, leftIndent=16, spaceAfter=2)
CORRECT  = S("CO", fontName="Helvetica-Bold",   fontSize=9.5,textColor=C_ANS,     alignment=TA_LEFT,   leading=14, leftIndent=16, spaceAfter=2)
EXPLAIN  = S("EX", fontName="Helvetica-Oblique",fontSize=9,  textColor=C_TEAL,    alignment=TA_LEFT,   leading=13, leftIndent=24, spaceAfter=4)
FOOTER   = S("FT", fontName="Helvetica-Oblique",fontSize=7.5,textColor=colors.grey,alignment=TA_CENTER)

def sp(n=5): return Spacer(1, n)
def hr(color=C_BORDER): return HRFlowable(width="100%", thickness=0.6, color=color)

def sec_banner(text, color=C_PAPER):
    t = Table([[Paragraph(text, SECTION)]], colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), color),
        ("TOPPADDING",    (0,0),(-1,-1), 7),
        ("BOTTOMPADDING", (0,0),(-1,-1), 7),
    ]))
    return t

def ans_box(text, bg=C_LGREEN):
    t = Table([[Paragraph(text, S("ab", fontName="Helvetica", fontSize=9, textColor=C_BLACK, leading=13))]], colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,-1), bg),
        ("TOPPADDING",   (0,0),(-1,-1), 6),
        ("BOTTOMPADDING",(0,0),(-1,-1), 6),
        ("LEFTPADDING",  (0,0),(-1,-1), 10),
        ("RIGHTPADDING", (0,0),(-1,-1), 10),
        ("BOX",          (0,0),(-1,-1), 1, C_ANS),
    ]))
    return t

def tip_box(text):
    t = Table([[Paragraph(f"&#9998; Examiner Tip: {text}", S("tp", fontName="Helvetica-Oblique", fontSize=8.5, textColor=C_TIP, leading=13))]], colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,-1), C_LYELLOW),
        ("TOPPADDING",   (0,0),(-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("LEFTPADDING",  (0,0),(-1,-1), 10),
        ("BOX",          (0,0),(-1,-1), 0.8, C_TIP),
    ]))
    return t

def ct(data, cws, hc=C_Q):
    tbl = Table(data, colWidths=cws, repeatRows=1)
    cmds = [
        ("BACKGROUND",    (0,0),(-1,0), hc),
        ("TEXTCOLOR",     (0,0),(-1,0), C_WHITE),
        ("FONTNAME",      (0,0),(-1,0), "Helvetica-Bold"),
        ("FONTSIZE",      (0,0),(-1,-1), 8.5),
        ("ALIGN",         (0,0),(-1,-1), "LEFT"),
        ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
        ("TOPPADDING",    (0,0),(-1,-1), 4),
        ("BOTTOMPADDING", (0,0),(-1,-1), 4),
        ("LEFTPADDING",   (0,0),(-1,-1), 6),
        ("GRID",          (0,0),(-1,-1), 0.4, C_BORDER),
    ]
    for i in range(1, len(data)):
        cmds.append(("BACKGROUND",(0,i),(-1,i), C_GREY if i%2==0 else C_WHITE))
    tbl.setStyle(TableStyle(cmds))
    return tbl

def bul(t): return Paragraph(f"&#x2022;  {t}", BULLET)

# ════════════════════════════════════════════════════
story = []

# ── EXAM HEADER ──
header_data = [
    [Paragraph("MADHYA PRADESH MEDICAL SCIENCE UNIVERSITY, JABALPUR", UNIV)],
    [Paragraph("BACHELOR OF HOMOEOPATHIC MEDICINE AND SURGERY (BHMS)", TITLE)],
    [Paragraph("FIRST PROFESSIONAL EXAMINATION β€” CBDC PATTERN", SUBJ)],
    [Paragraph("SUBJECT: KRIYA SHARIR (PHYSIOLOGY) β€” PAPER I", SUBJ)],
    [Paragraph("Topic Focus: EXCRETORY SYSTEM (Theme F)", S("sf", fontName="Helvetica-Bold", fontSize=10, textColor=colors.HexColor("#FFD54F"), alignment=TA_CENTER, leading=14))],
]
h = Table(header_data, colWidths=[W])
h.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,-1), C_PAPER),
    ("TOPPADDING",    (0,0),(-1,-1), 6),
    ("BOTTOMPADDING", (0,0),(-1,-1), 6),
]))
story.append(h)
story.append(sp(4))

# Instructions bar
info_data = [[
    Paragraph("<b>Time: 3 Hours</b>", INSTRUCT),
    Paragraph("<b>Maximum Marks: 100</b>  (This paper: 16 marks)", INSTRUCT),
    Paragraph("<b>Pass Marks: 50%</b>", INSTRUCT),
]]
info_t = Table(info_data, colWidths=[5.5*cm, 7*cm, 4.5*cm])
info_t.setStyle(TableStyle([
    ("BOX",           (0,0),(-1,-1), 1, C_PAPER),
    ("INNERGRID",     (0,0),(-1,-1), 0.5, C_BORDER),
    ("BACKGROUND",    (0,0),(-1,-1), C_LIGHT),
    ("TOPPADDING",    (0,0),(-1,-1), 5),
    ("BOTTOMPADDING", (0,0),(-1,-1), 5),
    ("LEFTPADDING",   (0,0),(-1,-1), 8),
]))
story.append(info_t)
story.append(sp(4))

instructions = [
    "1. All questions are COMPULSORY.",
    "2. Section I β€” MCQs: Attempt all 10 MCQs. Each carries 1 mark. No negative marking.",
    "3. Section II β€” SAQs: Attempt all 8 SAQs. Each carries 5 marks.",
    "4. Section III β€” LAQs: Attempt all 5 LAQs. Each carries 10 marks.",
    "5. Draw NEAT and LABELLED diagrams wherever necessary.",
    "6. Write legibly. Marks are deducted for illegible writing.",
]
inst_box = Table([[Paragraph("<br/>".join(instructions), S("ib", fontName="Helvetica", fontSize=8.5, textColor=C_BLACK, leading=14))]], colWidths=[W])
inst_box.setStyle(TableStyle([
    ("BACKGROUND",   (0,0),(-1,-1), colors.HexColor("#FFFDE7")),
    ("BOX",          (0,0),(-1,-1), 1, C_TIP),
    ("TOPPADDING",   (0,0),(-1,-1), 6),
    ("BOTTOMPADDING",(0,0),(-1,-1), 6),
    ("LEFTPADDING",  (0,0),(-1,-1), 10),
]))
story.append(inst_box)
story.append(sp(10))

# ════════════════════════════════════════════════════
# SECTION I β€” MCQ
# ════════════════════════════════════════════════════
story.append(sec_banner("SECTION I β€” MULTIPLE CHOICE QUESTIONS  |  10 Γ— 1 = 10 Marks", C_MCQ))
story.append(sp(2))
story.append(Paragraph("Attempt all questions. Each question carries 1 mark. Tick the correct option.", S("inst2", fontName="Helvetica-Oblique", fontSize=8.5, textColor=colors.grey, leading=12)))
story.append(sp(6))

mcqs = [
    {
        "q": "The functional unit of the kidney is:",
        "opts": ["A) Glomerulus", "B) Nephron", "C) Loop of Henle", "D) Collecting duct"],
        "ans": "B",
        "exp": "Each kidney has ~1 million nephrons. The nephron includes the renal corpuscle + renal tubule and carries out all three processes of urine formation.",
    },
    {
        "q": "Normal Glomerular Filtration Rate (GFR) in a healthy adult is approximately:",
        "opts": ["A) 80 mL/min", "B) 100 mL/min", "C) 125 mL/min", "D) 180 mL/min"],
        "ans": "C",
        "exp": "GFR = 125 mL/min (180 L/day filtered). ~99% is reabsorbed; only 1–2 L/day excreted as urine.",
    },
    {
        "q": "The gold standard substance used to measure GFR is:",
        "opts": ["A) Creatinine", "B) Urea", "C) Inulin", "D) PAH"],
        "ans": "C",
        "exp": "Inulin is freely filtered at glomerulus and neither reabsorbed nor secreted. Its clearance = GFR exactly (125 mL/min).",
    },
    {
        "q": "Renin is secreted by which cells of the Juxtaglomerular Apparatus?",
        "opts": ["A) Macula densa cells", "B) Mesangial cells", "C) Juxtaglomerular (granular) cells", "D) Podocytes"],
        "ans": "C",
        "exp": "JG (granular) cells in the wall of afferent arteriole contain secretory granules packed with renin. Macula densa senses NaCl and signals JG cells.",
    },
    {
        "q": "Angiotensin Converting Enzyme (ACE) is primarily located in the:",
        "opts": ["A) Kidney", "B) Liver", "C) Pulmonary endothelium", "D) Adrenal cortex"],
        "ans": "C",
        "exp": "ACE is mainly found on the endothelium of pulmonary capillaries. It converts Angiotensin I β†’ Angiotensin II (active form).",
    },
    {
        "q": "ADH (Antidiuretic Hormone) is synthesised in the:",
        "opts": ["A) Anterior pituitary", "B) Posterior pituitary", "C) Hypothalamus", "D) Adrenal medulla"],
        "ans": "C",
        "exp": "ADH is SYNTHESISED in hypothalamus (supraoptic + paraventricular nuclei) but STORED and RELEASED from posterior pituitary. MCQ asks synthesis β€” answer is Hypothalamus.",
    },
    {
        "q": "The segment of nephron which is impermeable to water and actively pumps NaCl to create medullary gradient is:",
        "opts": ["A) Thin descending limb", "B) Thick ascending limb of loop of Henle", "C) Proximal convoluted tubule", "D) Collecting duct"],
        "ans": "B",
        "exp": "Thick ascending limb (TAL) uses NKCC2 cotransporter to pump Na⁺, K⁺, 2Cl⁻ out. It is IMPERMEABLE to water β€” essential for countercurrent multiplication.",
    },
    {
        "q": "The renal threshold for glucose (blood sugar above which glycosuria occurs) is:",
        "opts": ["A) 120 mg/dL", "B) 140 mg/dL", "C) 180 mg/dL", "D) 200 mg/dL"],
        "ans": "C",
        "exp": "At blood glucose > 180 mg/dL, the Tubular Maximum (Tm) for glucose reabsorption in PCT is exceeded β†’ glucose appears in urine (glycosuria). Classic in uncontrolled Diabetes Mellitus.",
    },
    {
        "q": "Normal specific gravity of urine ranges from:",
        "opts": ["A) 1.000–1.005", "B) 1.003–1.030", "C) 1.010–1.040", "D) 1.020–1.050"],
        "ans": "B",
        "exp": "Normal SG: 1.003–1.030. Fixed SG at 1.010 = isosthenuria (chronic renal failure β€” kidney cannot concentrate or dilute). > 1.030 = severe dehydration.",
    },
    {
        "q": "Micturition (voiding) is controlled by which sacral spinal cord segments?",
        "opts": ["A) S1, S2", "B) S2, S3, S4", "C) L1, L2, L3", "D) T11, T12, L1"],
        "ans": "B",
        "exp": "Sacral micturition centre at S2–S4 (mnemonic: 'S2, 3, 4 keeps the pee off the floor'). Pelvic nerve (PNS) from S2–S4 contracts detrusor and relaxes internal sphincter.",
    },
]

for i, mcq in enumerate(mcqs):
    qnum = i + 1
    story.append(Paragraph(f"<b>Q{qnum}.</b>  {mcq['q']}", QTEXT))
    for opt in mcq['opts']:
        if opt.startswith(mcq['ans']):
            story.append(Paragraph(f"<b>{opt}  &#10004;</b>", CORRECT))
        else:
            story.append(Paragraph(opt, OPT))
    story.append(Paragraph(f"&#128273; <i>Explanation: {mcq['exp']}</i>", EXPLAIN))
    story.append(sp(2))

story.append(hr())
story.append(sp(4))

# ════════════════════════════════════════════════════
# SECTION II β€” SAQ
# ════════════════════════════════════════════════════
story.append(PageBreak())
story.append(sec_banner("SECTION II β€” SHORT ANSWER QUESTIONS  |  8 Γ— 5 = 40 Marks", C_Q))
story.append(sp(2))
story.append(Paragraph("Attempt all questions. Each question carries 5 marks. Write concise, accurate answers.", S("inst2", fontName="Helvetica-Oblique", fontSize=8.5, textColor=colors.grey, leading=12)))
story.append(sp(8))

# ── SAQ 1 ──
story.append(KeepTogether([
    Table([[
        Paragraph("<b>Q1. Write a short note on Juxtaglomerular Apparatus (JGA).</b>", QTEXT),
        Paragraph("[5 Marks]", MARKS_S),
    ]], colWidths=[13.5*cm, 3.5*cm]),
]))
story.append(sp(4))
story.append(Paragraph("MODEL ANSWER:", ANS_HEAD))
story.append(Paragraph(
    "<b>Definition:</b> JGA is a specialised sensor unit of the kidney located at the vascular pole "
    "of the renal corpuscle, where the afferent arteriole contacts the distal convoluted tubule "
    "of the same nephron.",
    BODY))
story.append(sp(3))

jga_data = [
    ["Component", "Location", "Function"],
    ["JG Cells (Granular cells)", "Wall of AFFERENT arteriole", "Secrete RENIN β†’ triggers RAAS β†’ ↑BP"],
    ["Macula Densa", "Thick asc. limb / early DCT wall", "Detects ↓NaCl β†’ signals JG cells to release renin"],
    ["Lacis Cells (Extraglomerular mesangial)", "Between afferent + efferent arterioles", "Signal transduction; structural support"],
]
story.append(ct(jga_data, [4.5*cm, 5*cm, 7.5*cm]))
story.append(sp(3))
story.append(Paragraph("<b>Stimuli for Renin Release:</b>", ANS_HEAD))
for b in [
    "↓ Renal perfusion pressure (afferent arteriole stretch ↓).",
    "↓ NaCl delivery to macula densa.",
    "Sympathetic stimulation (β₁ receptors on JG cells) β€” e.g., haemorrhage, stress.",
]:
    story.append(bul(b))
story.append(sp(3))
story.append(Paragraph("<b>Clinical significance:</b> JGA overactivity β†’ ↑Renin β†’ ↑Angiotensin II β†’ Hypertension (Renovascular HTN). ACE inhibitors block this cascade.", BODY))
story.append(tip_box("Draw JGA diagram. Label all 3 components + afferent arteriole + DCT. Write stimuli as bullet points. Mention RAAS in 1–2 lines."))
story.append(sp(10))
story.append(hr(C_BORDER))
story.append(sp(6))

# ── SAQ 2 ──
story.append(KeepTogether([
    Table([[
        Paragraph("<b>Q2. Describe Tubular Reabsorption. Where does it occur and what is reabsorbed?</b>", QTEXT),
        Paragraph("[5 Marks]", MARKS_S),
    ]], colWidths=[13.5*cm, 3.5*cm]),
]))
story.append(sp(4))
story.append(Paragraph("MODEL ANSWER:", ANS_HEAD))
story.append(Paragraph(
    "<b>Tubular Reabsorption</b> is the process of moving filtered substances from the tubular "
    "lumen back into the peritubular capillary blood. It is quantitatively the most important "
    "process of urine formation β€” 99% of the 180 L/day filtered is reabsorbed.",
    BODY))
story.append(sp(3))

reab_data = [
    ["Tubule Segment", "Substances Reabsorbed", "Mechanism"],
    ["PCT (67% of all reabsorption)", "Na⁺, Cl⁻, K⁺, HCO₃⁻, water (67%)\n100% glucose, 100% amino acids, uric acid, urea (50%)", "Active (Na⁺/K⁺ ATPase basolateral)\nCotransporters (SGLT2 for glucose)\nObligatory water follows osmotically"],
    ["Thin descending limb (Loop)", "Water only (highly permeable)", "Passive osmosis β€” drawn by hypertonic medulla"],
    ["Thick ascending limb (Loop)", "Na⁺, K⁺, 2Cl⁻ (25%); NO water", "Active NKCC2 cotransporter; water IMPERMEABLE"],
    ["DCT", "Na⁺ (Aldosterone), Ca²⁺ (PTH)", "Active; hormone regulated"],
    ["Collecting Duct", "Water (ADH), Na⁺ (Aldosterone), urea", "AQP2 channels (ADH); ENaC channels (Aldosterone)"],
]
story.append(ct(reab_data, [4*cm, 6.5*cm, 6.5*cm]))
story.append(sp(3))
story.append(tip_box("Write segment-wise table. Highlight PCT reabsorbs 67% and all glucose/amino acids. Mention Tm concept β€” Tubular Maximum. Aldosterone β†’ Na⁺ in DCT/CD; ADH β†’ Water in CD."))
story.append(sp(10))
story.append(hr(C_BORDER))
story.append(sp(6))

# ── SAQ 3 ──
story.append(KeepTogether([
    Table([[
        Paragraph("<b>Q3. Define GFR. Describe the factors that affect GFR.</b>", QTEXT),
        Paragraph("[5 Marks]", MARKS_S),
    ]], colWidths=[13.5*cm, 3.5*cm]),
]))
story.append(sp(4))
story.append(Paragraph("MODEL ANSWER:", ANS_HEAD))
story.append(Paragraph(
    "<b>GFR (Glomerular Filtration Rate)</b> is the volume of plasma filtered by the glomeruli "
    "of BOTH kidneys per minute. <b>Normal = 125 mL/min</b> (180 L/day). "
    "It is the best index of overall kidney function.",
    BODY))
story.append(sp(3))

story.append(Paragraph("<b>Net Filtration Pressure (NFP) = PGC βˆ’ Ο€GC βˆ’ PBS = 55 βˆ’ 30 βˆ’ 15 = 10 mmHg</b>", ANS_HEAD))
story.append(sp(3))

fac_data = [
    ["Factor", "Effect on GFR", "Mechanism"],
    ["↑ Glomerular capillary pressure (PGC)", "↑ GFR", "↑ systemic BP β†’ more pressure to filter"],
    ["↑ Plasma proteins (↑ oncotic Ο€)", "↓ GFR", "Albumin draws fluid back β†’ opposes filtration"],
    ["Urinary obstruction (↑PBS)", "↓ GFR", "Back-pressure reduces NFP"],
    ["Afferent arteriole DILATION", "↑ GFR", "↑ blood flow to glomerulus"],
    ["Afferent arteriole CONSTRICTION (SNS, shock)", "↓ GFR", "↓ glomerular blood flow and pressure"],
    ["Efferent arteriole CONSTRICTION (Ang II)", "↑ GFR (mild)", "Blood dammed back β†’ ↑PGC"],
    ["Prostaglandins (PGEβ‚‚, PGIβ‚‚)", "↑ GFR", "Dilate afferent arteriole β€” protective"],
    ["ANP (Atrial Natriuretic Peptide)", "↑ GFR", "Dilates afferent + constricts efferent"],
    ["Glomerular surface area ↓ (CKD)", "↓ GFR", "Fewer functioning nephrons"],
]
story.append(ct(fac_data, [5.5*cm, 3*cm, 8.5*cm]))
story.append(sp(3))
story.append(tip_box("Write NFP formula with values. Table of factors is very impressive. Mention autoregulation (myogenic + TGF) keeps GFR stable between BP 80–180 mmHg."))
story.append(sp(10))
story.append(hr(C_BORDER))
story.append(sp(6))

# ── SAQ 4 ──
story.append(PageBreak())
story.append(KeepTogether([
    Table([[
        Paragraph("<b>Q4. Write a short note on Aldosterone. What is its role in the kidney?</b>", QTEXT),
        Paragraph("[5 Marks]", MARKS_S),
    ]], colWidths=[13.5*cm, 3.5*cm]),
]))
story.append(sp(4))
story.append(Paragraph("MODEL ANSWER:", ANS_HEAD))
story.append(Paragraph(
    "<b>Aldosterone</b> is a steroid hormone of the mineralocorticoid class, "
    "secreted by the zona glomerulosa of the ADRENAL CORTEX.",
    BODY))
story.append(sp(3))

ald_data = [
    ["Feature", "Detail"],
    ["Chemical nature", "Steroid hormone (lipid-soluble β†’ enters cell; binds nuclear receptor)"],
    ["Source", "Adrenal cortex β€” zona glomerulosa"],
    ["Stimuli for secretion", "Angiotensin II (main) β€’ ↑K⁺ (hyperkalaemia) β€’ ACTH (minor) β€’ ↓Na⁺"],
    ["Target cell in kidney", "Principal cells of Collecting Duct and DCT"],
    ["Receptor", "Mineralocorticoid Receptor (MR) β€” nuclear receptor"],
    ["Mechanism of action", "Steroid β†’ enters nucleus β†’ ↑ transcription of Na⁺/K⁺ ATPase + ENaC (Na⁺ channel) + ROMK (K⁺ channel)"],
]
story.append(ct(ald_data, [5*cm, 12*cm]))
story.append(sp(3))

story.append(Paragraph("<b>Renal Effects of Aldosterone:</b>", ANS_HEAD))
for b in [
    "↑ Na⁺ reabsorption (from tubule lumen into blood) β†’ water follows β†’ ↑blood volume β†’ ↑BP.",
    "↑ K⁺ SECRETION (into tubule, excreted in urine).",
    "↑ H⁺ secretion (contributes to acid-base balance β€” metabolic alkalosis in excess).",
]:
    story.append(bul(b))
story.append(sp(3))

story.append(Paragraph("<b>Clinical Disorders:</b>", ANS_HEAD))
clin_data = [
    ["Condition", "Aldosterone Level", "Key Features"],
    ["Conn's Syndrome (Primary Hyperaldosteronism)", "↑↑↑", "Hypertension + Hypokalaemia + Metabolic Alkalosis"],
    ["Addison's Disease (Adrenocortical insufficiency)", "↓↓↓", "Hypotension + Hyperkalaemia + Hyponatraemia"],
    ["Secondary Hyperaldosteronism", "↑ (due to ↑Renin)", "Heart failure, Cirrhosis, Nephrotic syndrome"],
]
story.append(ct(clin_data, [5.5*cm, 3.5*cm, 8*cm], hc=C_TEAL))
story.append(sp(3))
story.append(tip_box("Aldosterone = Na⁺ IN, K⁺ OUT, H⁺ OUT. Conn's = ↑Aldo β†’ HTN + ↓K. Addison's = ↓Aldo β†’ ↓BP + ↑K. Loop diuretics (Furosemide) inhibit NKCC2 (not Aldosterone)."))
story.append(sp(10))
story.append(hr(C_BORDER))
story.append(sp(6))

# ── SAQ 5 ──
story.append(KeepTogether([
    Table([[
        Paragraph("<b>Q5. What is Renal Clearance? How is it clinically useful?</b>", QTEXT),
        Paragraph("[5 Marks]", MARKS_S),
    ]], colWidths=[13.5*cm, 3.5*cm]),
]))
story.append(sp(4))
story.append(Paragraph("MODEL ANSWER:", ANS_HEAD))
story.append(Paragraph(
    "<b>Renal Clearance (C)</b> of a substance is the <b>volume of plasma completely cleared "
    "of that substance by the kidneys per unit time</b>.",
    BODY))
story.append(ans_box(
    "Formula:   C(x) = U(x) Γ— V Γ· P(x)     "
    "Where: U(x) = Urine concentration of X; V = Urine flow rate (mL/min); P(x) = Plasma concentration of X",
    bg=colors.HexColor("#E3F2FD")
))
story.append(sp(3))

clear_data = [
    ["Substance", "Clearance", "Interpretation"],
    ["Inulin",      "125 mL/min", "= GFR (Gold standard). Freely filtered only β€” no reabsorption or secretion."],
    ["Creatinine",  "~120–130 mL/min", "β‰ˆ GFR. Used clinically (eGFR). Slight overestimate (some secreted)."],
    ["PAH",         "~625 mL/min", "= Renal Plasma Flow. 100% filtered + 100% secreted in one pass."],
    ["Glucose",     "0 mL/min (normal)", "All reabsorbed in PCT. Clearance > 0 only if blood glucose > 180 mg/dL."],
    ["Urea",        "~70 mL/min", "< GFR β†’ net reabsorption (50% in PCT). Blood urea ↑ in renal failure."],
]
story.append(ct(clear_data, [3*cm, 4*cm, 10*cm]))
story.append(sp(3))

story.append(Paragraph("<b>Clinical Use of Creatinine Clearance (eGFR):</b>", ANS_HEAD))
for b in [
    "Used to diagnose and stage Chronic Kidney Disease (CKD).",
    "CKD Stage 1: eGFR β‰₯ 90 mL/min; Stage 3: 30–59; Stage 5 (Renal failure): < 15 mL/min.",
    "Also used to adjust drug dosing in renal impairment.",
]:
    story.append(bul(b))
story.append(tip_box("If C(x) < GFR β†’ reabsorbed. If C(x) = GFR β†’ filtered only (inulin). If C(x) > GFR β†’ secreted (PAH, penicillin)."))
story.append(sp(10))
story.append(hr(C_BORDER))
story.append(sp(6))

# ── SAQ 6 ──
story.append(KeepTogether([
    Table([[
        Paragraph("<b>Q6. Write a short note on Glycosuria. When does it occur?</b>", QTEXT),
        Paragraph("[5 Marks]", MARKS_S),
    ]], colWidths=[13.5*cm, 3.5*cm]),
]))
story.append(sp(4))
story.append(Paragraph("MODEL ANSWER:", ANS_HEAD))
story.append(Paragraph(
    "<b>Glycosuria</b> is the presence of glucose in urine. Normally, urine contains NO glucose "
    "because all filtered glucose is completely reabsorbed in the PCT via SGLT2 cotransporters.",
    BODY))
story.append(sp(3))

story.append(Paragraph("<b>Concept of Renal Threshold and Tubular Maximum (Tm):</b>", ANS_HEAD))
for b in [
    "Renal Threshold for glucose = 180 mg/dL (blood glucose level above which glycosuria occurs).",
    "Tm for glucose = 375 mg/min (maximum rate of glucose reabsorption).",
    "Below 180 mg/dL β†’ all glucose reabsorbed β†’ no glycosuria.",
    "Above 180 mg/dL β†’ SGLT2 transporters saturated β†’ excess glucose escapes into urine.",
    "In Diabetes Mellitus: blood glucose > 180 mg/dL β†’ glycosuria β†’ osmotic diuresis β†’ polyuria + polydipsia.",
]:
    story.append(bul(b))
story.append(sp(3))

gly_data = [
    ["Type", "Cause", "Blood Glucose", "Urine Glucose"],
    ["Hyperglycaemic Glycosuria\n(Overflow)", "Diabetes Mellitus (Type 1 & 2)", "HIGH (>180 mg/dL)", "Present"],
    ["Normoglycaemic Glycosuria\n(Renal Glycosuria)", "Defective SGLT2 transporter; Fanconi Syndrome", "NORMAL", "Present β€” kidney cannot reabsorb normally"],
    ["Pregnancy Glycosuria", "↑GFR in pregnancy β†’ glucose load exceeds Tm", "Normal or slightly raised", "Present β€” physiological"],
]
story.append(ct(gly_data, [4*cm, 5*cm, 3.5*cm, 4.5*cm], hc=C_TEAL))
story.append(tip_box("Key formula to remember: Renal threshold = 180 mg/dL. Tm = 375 mg/min. Glycosuria does NOT always mean diabetes β€” check blood glucose to differentiate!"))
story.append(sp(10))
story.append(hr(C_BORDER))
story.append(sp(6))

# ── SAQ 7 ──
story.append(KeepTogether([
    Table([[
        Paragraph("<b>Q7. Describe the abnormal constituents of urine and their clinical significance.</b>", QTEXT),
        Paragraph("[5 Marks]", MARKS_S),
    ]], colWidths=[13.5*cm, 3.5*cm]),
]))
story.append(sp(4))
story.append(Paragraph("MODEL ANSWER:", ANS_HEAD))
story.append(Paragraph(
    "Normally urine contains water, urea, creatinine, uric acid, Na⁺, K⁺, Cl⁻ and urochrome. "
    "The following substances are ABSENT in normal urine but appear in disease:",
    BODY))
story.append(sp(3))

abn_data = [
    ["Abnormal Constituent", "Condition (Disease)", "Clinical Notes"],
    ["Glucose (Glycosuria)", "Diabetes mellitus, Renal glycosuria, Pregnancy", "Dipstick positive; osmotic diuresis in DM β†’ polyuria"],
    ["Protein (Proteinuria)", "Nephrotic syndrome, Glomerulonephritis, UTI, Eclampsia", "> 150 mg/day significant; frothy urine; albumin most common"],
    ["Ketone bodies (Ketonuria)", "Diabetic ketoacidosis (DKA), Starvation, Alcoholism", "Fruity/acetone smell to urine; dipstick positive for ketones"],
    ["Bilirubin (Bilirubinuria)", "Obstructive jaundice, Hepatitis", "Dark tea/cola-coloured urine; conjugated bilirubin in urine"],
    ["Haemoglobin (Haemoglobinuria)", "Haemolytic anaemia, Mismatched blood transfusion, Burns", "Red/cola urine without RBCs on microscopy; can cause AKI"],
    ["RBCs (Haematuria)", "Urinary stones, Renal TB, Tumour, Glomerulonephritis", "Visible (macroscopic) or microscopic; >2 RBCs/HPF abnormal"],
    ["WBCs / Pus cells (Pyuria)", "Urinary Tract Infection (UTI), Pyelonephritis, TB kidney", ">5 WBCs/HPF; cloudy urine; positive urine culture"],
    ["Casts", "Glomerulonephritis (RBC casts), Pyelonephritis (WBC casts), CRF (granular casts)", "Form in tubule lumen; shape = cylindrical; type indicates disease"],
    ["Myoglobin (Myoglobinuria)", "Rhabdomyolysis (crush injury, severe burns)", "Red urine without RBCs; can cause acute renal failure"],
]
story.append(ct(abn_data, [4*cm, 5.5*cm, 7.5*cm]))
story.append(tip_box("Key: Protein in urine = always abnormal (>150 mg/day). RBC casts = glomerulonephritis. WBC casts = pyelonephritis. Glucose in urine = check blood glucose for DM."))
story.append(sp(10))
story.append(hr(C_BORDER))
story.append(sp(6))

# ── SAQ 8 ──
story.append(PageBreak())
story.append(KeepTogether([
    Table([[
        Paragraph("<b>Q8. What is Diabetes Insipidus? Differentiate between Central and Nephrogenic types.</b>", QTEXT),
        Paragraph("[5 Marks]", MARKS_S),
    ]], colWidths=[13.5*cm, 3.5*cm]),
]))
story.append(sp(4))
story.append(Paragraph("MODEL ANSWER:", ANS_HEAD))
story.append(Paragraph(
    "<b>Diabetes Insipidus (DI)</b> is a disorder of water regulation characterised by "
    "<b>polyuria</b> (excretion of large volumes of dilute urine) and <b>polydipsia</b> (excessive thirst), "
    "due to deficiency of ADH or resistance to its action.",
    BODY))
story.append(sp(3))

di_data = [
    ["Feature", "Central DI", "Nephrogenic DI"],
    ["Cause", "Deficient ADH secretion from hypothalamus/posterior pituitary (trauma, tumour, infection, idiopathic)", "ADH secreted normally but KIDNEY does not respond (V2 receptor mutation, Lithium toxicity, hypercalcaemia, CKD)"],
    ["ADH level in blood", "LOW ↓↓", "NORMAL or HIGH ↑"],
    ["Urine volume", "5–20 L/day (massive polyuria)", "5–15 L/day"],
    ["Urine osmolality", "Very LOW (< 300 mOsm/kg)", "Very LOW (< 300 mOsm/kg)"],
    ["Urine SG", "< 1.005 (very dilute)", "< 1.005"],
    ["Water deprivation test", "Urine still dilute; ADH given β†’ urine concentrates", "Urine still dilute; ADH given β†’ NO response"],
    ["Treatment", "Desmopressin (DDAVP β€” synthetic ADH analogue) intranasal or oral", "Low Na⁺ diet + Thiazide diuretics (paradoxical effect) + Treat underlying cause"],
]
story.append(ct(di_data, [3.5*cm, 6.5*cm, 7*cm], hc=C_TEAL))
story.append(sp(3))

story.append(Paragraph("<b>Compare with SIADH (Syndrome of Inappropriate ADH):</b>", ANS_HEAD))
story.append(Paragraph(
    "Opposite of DI β€” excess ADH β†’ excessive water retention β†’ dilutional hyponatraemia β†’ "
    "cerebral oedema, confusion. Caused by lung tumours (small cell), CNS disease, drugs.",
    BODY))
story.append(tip_box("Water deprivation test differentiates DI types: Give desmopressin β€” Central DI responds (urine concentrates); Nephrogenic DI does NOT respond."))

# ════════════════════════════════════════════════════
# SECTION III β€” LAQ
# ════════════════════════════════════════════════════
story.append(PageBreak())
story.append(sec_banner("SECTION III β€” LONG ANSWER QUESTIONS  |  5 Γ— 10 = 50 Marks", C_MARKS))
story.append(sp(2))
story.append(Paragraph("Attempt all questions. Each question carries 10 marks. Draw labelled diagrams wherever applicable.", S("inst2", fontName="Helvetica-Oblique", fontSize=8.5, textColor=colors.grey, leading=12)))
story.append(sp(8))

# ── LAQ 1 ──
story.append(Table([[
    Paragraph("<b>Q1. Describe the mechanism of Urine Formation. Explain Glomerular Filtration, Tubular Reabsorption and Tubular Secretion with diagrams.</b>", QTEXT),
    Paragraph("[10 Marks]", MARKS_S),
]], colWidths=[13.5*cm, 3.5*cm]))
story.append(sp(5))
story.append(Paragraph("MODEL ANSWER:", ANS_HEAD))
story.append(Paragraph(
    "<b>Introduction:</b> Urine formation is the mechanism by which the kidneys "
    "regulate body fluid composition, remove metabolic wastes and maintain homeostasis. "
    "It involves three sequential processes in the nephron.",
    BODY))
story.append(sp(3))

story.append(Paragraph("<b>PROCESS 1 β€” GLOMERULAR FILTRATION</b>", ANS_HEAD))
story.append(Paragraph(
    "High-pressure filtration of plasma at the glomerulus into Bowman's capsule. "
    "The filtration membrane has 3 layers: fenestrated endothelium, glomerular basement "
    "membrane (GBM), and podocyte slit diaphragms.",
    BODY))
for b in [
    "Normal GFR = 125 mL/min (180 L filtered/day).",
    "NFP = PGC (55) βˆ’ Ο€GC (30) βˆ’ PBS (15) = <b>10 mmHg</b>.",
    "Filtrate is plasma-like: contains water, ions, glucose, amino acids, urea β€” but NO proteins or cells.",
    "Filtration fraction = GFR/RPF = 125/625 = <b>20%</b>.",
]:
    story.append(bul(b))
story.append(sp(4))

story.append(Paragraph("<b>PROCESS 2 β€” TUBULAR REABSORPTION</b>", ANS_HEAD))
story.append(Paragraph(
    "~99% of filtrate is reabsorbed. Each segment reabsorbs specific substances:",
    BODY))
reabs2_data = [
    ["Segment", "Key Substances Reabsorbed", "% of Filtrate"],
    ["PCT", "Na⁺, Cl⁻, K⁺, HCO₃⁻, water, 100% glucose, 100% amino acids, urea (50%)", "~67%"],
    ["Descending limb (thin)", "Water only (osmotic β€” medullary gradient)", "~15%"],
    ["Ascending limb (thick)", "Na⁺, K⁺, 2Cl⁻ (NKCC2); NO water", "~25% of Na⁺"],
    ["DCT", "Na⁺ (Aldosterone), Ca²⁺ (PTH)", "~5%"],
    ["Collecting Duct", "Water (ADH/AQP2), Na⁺ (Aldosterone)", "Variable β€” fine-tuning"],
]
story.append(ct(reabs2_data, [4*cm, 9*cm, 4*cm]))
story.append(sp(4))

story.append(Paragraph("<b>PROCESS 3 β€” TUBULAR SECRETION</b>", ANS_HEAD))
for b in [
    "Substances move FROM peritubular capillaries INTO tubular lumen β€” active process.",
    "PCT secretes: H⁺, K⁺, organic acids, drugs (penicillin, salicylates), creatinine.",
    "DCT secretes: K⁺ (increased by Aldosterone), H⁺ (acid-base regulation).",
    "Ensures elimination of substances even if not filtered (e.g., protein-bound drugs).",
]:
    story.append(bul(b))
story.append(sp(4))

story.append(Paragraph("<b>NEPHRON DIAGRAM (Draw in exam):</b>", ANS_HEAD))
diag_hint = [
    ["Structure to Label", "Function to Write Beside It"],
    ["Afferent arteriole β†’ Glomerulus β†’ Bowman's capsule", "Filtration (GFR 125 mL/min)"],
    ["PCT", "Bulk reabsorption (67%); glucose, AA, Na⁺"],
    ["Descending loop", "Water reabsorption; fluid concentrates"],
    ["Thick ascending loop", "NaCl pumped out; water IMPERMEABLE"],
    ["DCT", "Aldosterone (Na⁺); PTH (Ca²⁺)"],
    ["Collecting duct", "ADH (water); Aldosterone (Na⁺); final concentration"],
    ["JGA (afferent art + DCT junction)", "Renin secretion; autoregulation"],
]
story.append(ct(diag_hint, [8.5*cm, 8.5*cm], hc=C_TEAL))
story.append(sp(4))

story.append(Paragraph("<b>Regulation of GFR:</b>", ANS_HEAD))
for b in [
    "Autoregulation: Myogenic reflex + Tubuloglomerular feedback (TGF) β€” keeps GFR stable 80–180 mmHg.",
    "Hormonal: Ang II (constricts efferent β†’ preserves GFR); ANP (↑GFR); Prostaglandins (↑GFR).",
    "Neural: SNS β†’ ↓GFR (vasoconstriction of afferent) in shock/exercise.",
]:
    story.append(bul(b))
story.append(sp(4))

story.append(Paragraph("<b>Homoeopathic Connection:</b>", ANS_HEAD))
story.append(Paragraph(
    "The kidneys represent the homeostatic control of the Vital Force β€” maintaining fluid balance, "
    "electrolyte equilibrium and waste elimination. Disruption of renal physiology reflects "
    "a fundamental derangement of the dynamic vital principle.",
    BODY))
story.append(tip_box("LAQ structure: Introduction β†’ 3 processes (each with heading + details) β†’ NFP formula β†’ Segment-wise reabsorption table β†’ Nephron diagram β†’ GFR regulation β†’ Clinical significance + Homoeopathic angle."))
story.append(sp(8))
story.append(hr(C_MARKS))
story.append(sp(6))

# ── LAQ 2 ──
story.append(PageBreak())
story.append(Table([[
    Paragraph("<b>Q2. Describe the Juxtaglomerular Apparatus (JGA) and explain the Renin-Angiotensin-Aldosterone System (RAAS). How does it regulate Blood Pressure?</b>", QTEXT),
    Paragraph("[10 Marks]", MARKS_S),
]], colWidths=[13.5*cm, 3.5*cm]))
story.append(sp(5))
story.append(Paragraph("MODEL ANSWER:", ANS_HEAD))

story.append(Paragraph("<b>Part A β€” JGA (as in SAQ Q1 above β€” expand each point)</b>", ANS_HEAD))
story.append(Paragraph("Include: Definition, 3 components (table), stimuli for renin release β€” write 6 stimuli.", BODY))
story.append(sp(4))

story.append(Paragraph("<b>Part B β€” RAAS Cascade</b>", ANS_HEAD))
raas_data = [
    ["Step", "Substance", "Site of Production", "Event"],
    ["1", "Angiotensinogen", "Liver (always circulating)", "Precursor protein in plasma"],
    ["2", "Renin", "JG cells of kidney (afferent arteriole)", "Cleaves angiotensinogen β†’ Angiotensin I (10 AAs β€” inactive)"],
    ["3", "ACE (Angiotensin Converting Enzyme)", "Pulmonary endothelium (mainly)", "Removes 2 AAs from Ang I β†’ Angiotensin II (8 AAs β€” ACTIVE)"],
    ["4", "Angiotensin II", "Blood (active hormone)", "Multiple systemic effects (vasoconstriction, aldosterone release, ADH, thirst)"],
    ["5", "Aldosterone", "Adrenal cortex (zona glomerulosa)", "Na⁺ + water retention β†’ ↑blood volume"],
    ["6", "Negative Feedback", "Angiotensin II β†’ JGA + liver", "Inhibits further renin release; corrects BP"],
]
story.append(ct(raas_data, [1*cm, 4*cm, 5*cm, 7*cm], hc=C_TEAL))
story.append(sp(4))

story.append(Paragraph("<b>Effects of Angiotensin II β€” The 5 Major Actions:</b>", ANS_HEAD))
ang2_data = [
    ["Action", "Site", "Result"],
    ["1. Vasoconstriction", "Arterioles + veins", "↑ Peripheral vascular resistance β†’ ↑BP"],
    ["2. Aldosterone release", "Adrenal cortex", "Na⁺ + water retention β†’ ↑blood volume β†’ ↑BP"],
    ["3. ADH release", "Posterior pituitary", "↑Water reabsorption in collecting duct β†’ ↑volume"],
    ["4. Thirst stimulation", "Hypothalamus (subfornical organ)", "↑Water intake β†’ ↑blood volume"],
    ["5. Efferent arteriole constriction", "Kidney glomerulus", "Preserves GFR despite low BP"],
]
story.append(ct(ang2_data, [3.5*cm, 4.5*cm, 9*cm]))
story.append(sp(4))

story.append(Paragraph("<b>Pharmacological Blockade of RAAS:</b>", ANS_HEAD))
drug_data = [
    ["Drug Class", "Mechanism", "Example", "Clinical Use"],
    ["ACE Inhibitors", "Block ACE β†’ no Ang II formed", "Captopril, Enalapril, Ramipril", "Hypertension, Heart failure, Diabetic nephropathy"],
    ["ARBs (Ang II Receptor Blockers)", "Block AT1 receptor β†’ Ang II cannot act", "Losartan, Valsartan, Telmisartan", "HTN when ACE inhibitor cough occurs"],
    ["Aldosterone Antagonists", "Block mineralocorticoid receptor", "Spironolactone", "Heart failure, Conn's syndrome"],
    ["Renin Inhibitors", "Block renin directly", "Aliskiren", "Hypertension"],
]
story.append(ct(drug_data, [4*cm, 4.5*cm, 4*cm, 5.5*cm]))
story.append(sp(3))
story.append(tip_box("Draw RAAS flowchart: Ang'gen β†’ Renin β†’ Ang I β†’ ACE β†’ Ang II β†’ 4 arrows going to: (1)Vasoconstriction (2)Aldosterone (3)ADH (4)Thirst. Label each. This diagram gets full marks."))
story.append(sp(8))
story.append(hr(C_MARKS))
story.append(sp(6))

# ── LAQ 3 ──
story.append(Table([[
    Paragraph("<b>Q3. Describe the structure of Nephron in detail. What are the types of nephrons? Add a labelled diagram.</b>", QTEXT),
    Paragraph("[10 Marks]", MARKS_S),
]], colWidths=[13.5*cm, 3.5*cm]))
story.append(sp(5))
story.append(Paragraph("MODEL ANSWER:", ANS_HEAD))
story.append(Paragraph(
    "<b>Nephron</b> is the structural and functional unit of the kidney. "
    "Each kidney has approximately <b>1 million nephrons</b>. "
    "Nephrons cannot be regenerated β€” loss is permanent (hence CKD is progressive).",
    BODY))
story.append(sp(3))

neph_full = [
    ["Component", "Layer / Location", "Histological Feature", "Function"],
    ["RENAL CORPUSCLE", "", "", ""],
    ["Glomerulus", "Cortex", "Tuft of fenestrated capillaries; pores 70–100 nm", "High-pressure filtration bed; produces ultrafiltrate"],
    ["Bowman's Capsule β€” Parietal layer", "Cortex (outer)", "Simple squamous epithelium", "Structural β€” forms outer wall of capsule"],
    ["Bowman's Capsule β€” Visceral layer (Podocytes)", "Cortex (inner)", "Specialised cells with foot processes (pedicels) around capillaries", "Filtration slits β€” size-selective barrier; last layer of filtration membrane"],
    ["RENAL TUBULE", "", "", ""],
    ["PCT", "Cortex", "Cuboidal cells with dense brush border (microvilli)", "Bulk reabsorption (67%): glucose, AAs, Na⁺, HCO₃⁻, water"],
    ["Thin descending limb", "Outer medulla β†’ inner medulla", "Flat simple squamous cells; very thin wall", "Water reabsorption by osmosis β€” tubular fluid concentrates"],
    ["Thin ascending limb", "Inner medulla", "Simple squamous; permeable to NaCl", "NaCl diffuses out passively β€” dilutes tubular fluid"],
    ["Thick ascending limb", "Outer medulla / cortex", "Cuboidal; no apical water channels", "Active NaCl transport (NKCC2); builds medullary gradient"],
    ["DCT", "Cortex", "Cuboidal; fewer microvilli than PCT", "Aldosterone (Na⁺ reabs); PTH (Ca²⁺); H⁺ secretion"],
    ["Collecting duct", "Cortex β†’ medulla β†’ papilla", "Principal cells (water/Na channels) + Intercalated cells (H⁺/HCO₃⁻)", "Final urine concentration (ADH); Na⁺ (Aldosterone); acid-base"],
]
story.append(ct(neph_full, [3*cm, 2.5*cm, 4.5*cm, 7*cm]))
story.append(sp(4))

story.append(Paragraph("<b>Types of Nephrons:</b>", ANS_HEAD))
types_data = [
    ["Feature", "Cortical Nephrons (85%)", "Juxtamedullary Nephrons (15%)"],
    ["Glomerulus location", "Outer + mid cortex", "Deep cortex near corticomedullary junction"],
    ["Loop of Henle", "Short β€” barely enters medulla", "LONG β€” extends deep into inner medulla"],
    ["Efferent arteriole", "Forms peritubular capillaries", "Forms vasa recta (long parallel vessels) β€” exchange with loop"],
    ["Function", "Filtration + bulk reabsorption", "URINE CONCENTRATION β€” creates & preserves medullary gradient"],
    ["Blood supply", "Peritubular capillaries (cortex)", "Vasa recta (runs parallel to loop β€” countercurrent exchange)"],
]
story.append(ct(types_data, [3.5*cm, 6.5*cm, 7*cm], hc=C_TEAL))
story.append(sp(3))
story.append(tip_box("Draw nephron with all 9 labelled parts. Draw separately: Cortical vs Juxtamedullary β€” show loop length difference. Filtration membrane = 3 layers (endothelium + GBM + podocytes)."))
story.append(sp(8))
story.append(hr(C_MARKS))
story.append(sp(6))

# ── LAQ 4 (shorter) ──
story.append(PageBreak())
story.append(Table([[
    Paragraph("<b>Q4. Explain the role of ADH in urine concentration. Describe the Countercurrent Mechanism.</b>", QTEXT),
    Paragraph("[10 Marks]", MARKS_S),
]], colWidths=[13.5*cm, 3.5*cm]))
story.append(sp(5))
story.append(Paragraph("MODEL ANSWER:", ANS_HEAD))

story.append(Paragraph("<b>Part A β€” ADH (Antidiuretic Hormone)</b>", ANS_HEAD))
story.append(Paragraph("Synthesised: Hypothalamus (supraoptic + PVN nuclei). Stored & released: Posterior pituitary.", BODY))
story.append(sp(3))

story.append(Paragraph("<b>Mechanism of ADH action in kidney:</b>", ANS_HEAD))
for b in [
    "ADH binds V2 receptor on principal cells of collecting duct.",
    "V2 β†’ Gs β†’ adenylyl cyclase β†’ ↑cAMP β†’ Protein Kinase A activation.",
    "PKA phosphorylates AQP2 vesicles β†’ AQP2 inserted into apical membrane.",
    "Water flows from lumen β†’ through AQP2 (apical) β†’ through AQP3/4 (basolateral) β†’ into blood.",
    "Result: urine becomes concentrated (oliguria, high osmolality up to 1,200 mOsm/kg).",
    "No ADH β†’ AQP2 removed β†’ collecting duct impermeable to water β†’ dilute urine (up to 20 L/day).",
]:
    story.append(bul(b))
story.append(sp(4))

story.append(Paragraph("<b>Stimuli for ADH Release:</b>", ANS_HEAD))
adh_stim2 = [
    ["Stimulus", "Sensor", "Response"],
    ["↑Plasma osmolality (> 295 mOsm/kg)", "Osmoreceptors (hypothalamus)", "↑ADH β†’ water retention β†’ osmolality falls"],
    ["↓Blood volume / ↓BP (> 10% drop)", "Volume receptors (atria), Baroreceptors", "↑ADH β†’ volume restored"],
    ["Nausea, pain, stress, exercise", "CNS", "↑ADH (non-osmotic)"],
    ["Alcohol, Cold, ANP, hypervolaemia", "β€”", "↓ADH β†’ diuresis"],
]
story.append(ct(adh_stim2, [4.5*cm, 4.5*cm, 8*cm], hc=C_TEAL))
story.append(sp(4))

story.append(Paragraph("<b>Part B β€” Countercurrent Mechanism</b>", ANS_HEAD))
story.append(Paragraph(
    "The kidney can produce urine ranging from 50 to 1,200 mOsm/kg. "
    "This enormous range is achieved by the <b>Countercurrent Multiplier</b> "
    "(Loop of Henle) and <b>Countercurrent Exchanger</b> (Vasa Recta).",
    BODY))
story.append(sp(3))

cc_data = [
    ["Structure", "Permeability", "What Happens", "Effect on Osmolality"],
    ["Descending limb", "Permeable to WATER; impermeable to solutes", "Water drawn out by hypertonic interstitium", "Tubular fluid osmolality ↑ (300β†’1200 mOsm going down)"],
    ["Ascending limb (thin)", "Permeable to NaCl", "NaCl diffuses out passively", "Tubular fluid osmolality ↓"],
    ["Ascending limb (thick)", "Impermeable to water; actively pumps NaCl (NKCC2)", "NaCl pumped into interstitium", "Creates hyperosmotic medullary gradient"],
    ["Collecting duct (+ ADH)", "Permeable to water (AQP2)", "Water reabsorbed into medullary vessels", "Urine concentrated β€” up to 1,200 mOsm"],
    ["Vasa Recta", "Permeable to both water + solutes", "Countercurrent exchange preserves gradient (blood goes in both directions)", "Maintains medullary gradient; removes reabsorbed water"],
]
story.append(ct(cc_data, [3.5*cm, 4*cm, 4.5*cm, 5*cm]))
story.append(sp(3))
story.append(Paragraph("<b>Urea recycling:</b> Inner medullary collecting duct is permeable to urea β†’ urea enters interstitium β†’ contributes up to 50% of medullary osmolality.", BODY))
story.append(sp(3))
story.append(tip_box("Draw osmolality gradient diagram: 300 mOsm in cortex β†’ 1200 mOsm in inner medulla. Draw loop showing water out on descending, NaCl out on ascending. Show ADH action on collecting duct with AQP2."))
story.append(sp(8))
story.append(hr(C_MARKS))
story.append(sp(6))

# ── LAQ 5 ──
story.append(Table([[
    Paragraph("<b>Q5. Describe the normal and abnormal characteristics of urine. Discuss micturition and its neural control.</b>", QTEXT),
    Paragraph("[10 Marks]", MARKS_S),
]], colWidths=[13.5*cm, 3.5*cm]))
story.append(sp(5))
story.append(Paragraph("MODEL ANSWER:", ANS_HEAD))

story.append(Paragraph("<b>Part A β€” Normal Urine (5 marks)</b>", ANS_HEAD))
norm_data = [
    ["Property", "Normal Value", "Clinical Significance of Abnormality"],
    ["Volume", "1,000–2,000 mL/day", "Polyuria > 3L (DI, DM); Oliguria < 400 mL (AKI, dehydration)"],
    ["Colour", "Pale yellow–amber (urochrome)", "Dark: concentrated/bilirubin; Red: blood; Colourless: DI"],
    ["pH", "4.5–8.0 (avg 6.0, acidic)", "Alkaline: UTI (Proteus), RTA; Very acid: acidosis, gout"],
    ["Specific Gravity", "1.003–1.030", "Fixed 1.010 = CRF (isosthenuria); > 1.030 = severe dehydration"],
    ["Osmolality", "50–1,200 mOsm/kg", "Fixed ~300 = CRF; > 1,200 not possible normally"],
    ["Protein", "< 150 mg/day (trace)", "Proteinuria: Nephrotic syndrome, glomerulonephritis"],
    ["Glucose", "Absent / trace", "Glycosuria: DM (blood glucose > 180 mg/dL), renal glycosuria"],
    ["Ketones", "Absent", "Ketonuria: DKA, starvation"],
    ["Cells", "0–2 RBCs; 0–5 WBCs per HPF", "Haematuria: stones/tumour; Pyuria: UTI"],
]
story.append(ct(norm_data, [3.5*cm, 4*cm, 10*cm]))
story.append(sp(4))

story.append(Paragraph("<b>Part B β€” Micturition and Neural Control (5 marks)</b>", ANS_HEAD))
story.append(Paragraph(
    "Micturition is the process of voiding urine from the bladder through the urethra. "
    "Normal bladder capacity = 400–600 mL. First urge to void felt at ~150 mL.",
    BODY))
story.append(sp(3))

neur_data = [
    ["Division", "Nerve/Level", "Action on Detrusor", "Action on Sphincters"],
    ["Parasympathetic (PNS)", "Pelvic nerve S2–S4", "CONTRACTS (micturition)", "Relaxes internal sphincter"],
    ["Sympathetic (SNS)", "Hypogastric nerve T11–L2", "RELAXES (storage)", "CONTRACTS internal sphincter"],
    ["Somatic (Voluntary)", "Pudendal nerve S2–S4", "β€”", "Controls external sphincter (voluntary hold)"],
]
story.append(ct(neur_data, [3.5*cm, 4*cm, 4.5*cm, 5*cm], hc=C_TEAL))
story.append(sp(3))

story.append(Paragraph("<b>Micturition Reflex Steps:</b>", ANS_HEAD))
for b in [
    "Bladder fills β†’ stretch receptors activated at ~150 mL β†’ afferent pelvic nerve β†’ sacral cord (S2–S4).",
    "Signal to pontine micturition centre β†’ voluntary decision to void.",
    "PNS activated: detrusor contracts + internal sphincter relaxes + pudendal nerve inhibited β†’ external sphincter relaxes.",
    "Urine expelled. Detrusor contracts until empty β†’ reflex subsides.",
]:
    story.append(bul(b))
story.append(sp(3))
story.append(tip_box("LAQ 5 tip: Part A (urine) = table with 10 rows (normal + abnormal). Part B (micturition) = neural control table + 4-step reflex. Draw bladder diagram with nerves labelled. Total = full 10 marks."))

# ── ANSWER KEY SUMMARY ──
story.append(PageBreak())
story.append(sec_banner("QUICK ANSWER KEY & MARKS GUIDE", C_PAPER))
story.append(sp(6))

ak_data = [
    ["Q No.", "Type", "Topic", "Key Answer / Marks-fetching Points"],
    ["MCQ 1",  "MCQ", "Nephron", "B β€” Nephron"],
    ["MCQ 2",  "MCQ", "GFR",    "C β€” 125 mL/min"],
    ["MCQ 3",  "MCQ", "GFR measurement", "C β€” Inulin"],
    ["MCQ 4",  "MCQ", "JGA",    "C β€” JG (Granular) cells"],
    ["MCQ 5",  "MCQ", "RAAS",   "C β€” Pulmonary endothelium"],
    ["MCQ 6",  "MCQ", "ADH",    "C β€” Hypothalamus (synthesised there)"],
    ["MCQ 7",  "MCQ", "Loop of Henle", "B β€” Thick ascending limb"],
    ["MCQ 8",  "MCQ", "Renal threshold", "C β€” 180 mg/dL"],
    ["MCQ 9",  "MCQ", "Urine SG", "B β€” 1.003–1.030"],
    ["MCQ 10", "MCQ", "Micturition", "B β€” S2, S3, S4"],
    ["SAQ 1", "SAQ (5)", "JGA", "3 components table + 3 stimuli for renin + clinical signif. + diagram"],
    ["SAQ 2", "SAQ (5)", "Tubular Reabsorption", "Segment-wise table + PCT bulk absorption + Aldosterone + ADH roles"],
    ["SAQ 3", "SAQ (5)", "GFR + factors", "NFP formula + GFR = 125 + factors table (at least 5 factors)"],
    ["SAQ 4", "SAQ (5)", "Aldosterone", "Source + mechanism + Na⁺ in K⁺ out + Conn's vs Addison's table"],
    ["SAQ 5", "SAQ (5)", "Clearance", "Formula + Inulin/Creatinine/PAH comparison table + CKD staging"],
    ["SAQ 6", "SAQ (5)", "Glycosuria", "Renal threshold 180 mg/dL + Tm + 3 types of glycosuria table"],
    ["SAQ 7", "SAQ (5)", "Abnormal urine", "Table with 9 abnormal constituents + disease + note"],
    ["SAQ 8", "SAQ (5)", "Diabetes Insipidus", "Central vs Nephrogenic comparison table + desmopressin vs thiazide"],
    ["LAQ 1", "LAQ (10)", "Urine Formation", "3 processes + NFP formula + reabsorption table + nephron diagram + GFR regulation"],
    ["LAQ 2", "LAQ (10)", "JGA + RAAS", "JGA table + RAAS cascade table + Ang II effects table + drugs table"],
    ["LAQ 3", "LAQ (10)", "Nephron structure", "All 9 segments histology + function + cortical vs juxtamedullary table + diagram"],
    ["LAQ 4", "LAQ (10)", "ADH + Countercurrent", "ADH mechanism (AQP2) + stimuli table + countercurrent table + osmolality gradient diagram"],
    ["LAQ 5", "LAQ (10)", "Urine characteristics + Micturition", "Urine properties table + neural control table + micturition reflex steps"],
]
story.append(ct(ak_data, [2*cm, 2.5*cm, 4.5*cm, 8*cm]))
story.append(sp(10))
story.append(hr())
story.append(sp(4))
story.append(Paragraph(
    "BHMS 1st Year | Kriya Sharir Paper 1 | Excretory System | Previous Year Paper Style β€” Solved  |  "
    "CBDC / MPMSU Pattern  |  Sources: Guyton & Hall, Costanzo, Medical Physiology (Boron & Boulpaep)  |  Best of luck! &#128149;",
    FOOTER
))

doc.build(story)
print(f"PDF saved: {OUTPUT}")
Running Command

cd /tmp/workspace/bhms-physiology && python generate_pyq_excretory.py 2>&1

Running Command

ls -lh /tmp/workspace/bhms-physiology/*.pdf

Tera Previous Year Paper style solved paper ready hai! πŸŽ‰

Excretory PYQ SolvedPaper

PDF Document Β· PDF


Paper ka Structure β€” Bilkul MPMSU Exam jaisa:

πŸ“‹ Header Block

  • University name, Subject, Paper I, Time: 3 Hours, Max Marks: 100
  • Full instructions (sab compulsory, diagram, legibility)

✏️ SECTION I β€” MCQ (10 Γ— 1 = 10 Marks)

Har MCQ ke 4 options, correct answer bold + tick marked, neeche explanation:
#Topic
1Functional unit of kidney
2Normal GFR value
3Gold standard for GFR (Inulin)
4Renin secreting cells in JGA
5ACE location
6ADH synthesis site (tricky!)
7Thick ascending limb (NKCC2)
8Renal threshold for glucose
9Normal specific gravity
10Micturition spinal cord level

πŸ“ SECTION II β€” SAQ (8 Γ— 5 = 40 Marks)

Har question ke saath Model Answer + Examiner Tip box:
QTopic
1JGA short note
2Tubular Reabsorption (segment-wise table)
3GFR + factors affecting it
4Aldosterone mechanism + disorders
5Renal Clearance + formula
6Glycosuria + Renal Threshold
7Abnormal constituents of urine (9 items)
8Diabetes Insipidus (Central vs Nephrogenic table)

πŸ“– SECTION III β€” LAQ (5 Γ— 10 = 50 Marks)

Complete model answers with tables + diagram hints:
QTopic
1Urine Formation (GFR + Reabsorption + Secretion)
2JGA + Full RAAS Cascade + Drugs (ACEi, ARB)
3Nephron structure (histology table) + Types
4ADH mechanism (AQP2) + Countercurrent
5Urine characteristics + Micturition neural control

πŸ—οΈ Last Page: Complete Answer Key table


Ye paper solve karo, check karo kitne marks aate hain β€” aur agar koi LAQ ya SAQ aur expand chahiye toh bol do! πŸ’ͺ

Urine formation hand written note

Handwritten-style notes banata hoon β€” jaise class notes mein likhte hain, diagrams ke saath!
Running Command

python3 -c "from reportlab.pdfbase import pdfmetrics; from reportlab.pdfbase.ttfonts import TTFont; import os; fonts = [f for f in os.listdir('/usr/share/fonts/truetype/') if 'andale' in f.lower() or 'comic' in f.lower() or 'dancing' in f.lower()]; print(fonts[:10])" 2>/dev/null; find /usr/share/fonts -name "*.ttf" 2>/dev/null | grep -i -E "hand|write|cursive|comic|indie|kalam|caveat|pacifico|dance|permanent|satisfy" | head -20

Running Command

find /usr/share/fonts -name "*.ttf" 2>/dev/null | head -30; pip show matplotlib 2>/dev/null | grep -i version

Matplotlib available hai β€” isse handwritten-style notebook pages banaunga with matplotlib canvas drawing (ruled lines, hand-drawn diagrams, ink-style text), phir PDF mein merge karunga.
Writing File

~/bhms-physiology/generate_handwritten_notes.py

"""
Handwritten-style Urine Formation notes β€” mimics actual student notebook pages.
Uses matplotlib to draw each page as an image, then combines into PDF.
"""
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.patches import FancyArrowPatch, FancyBboxPatch
import matplotlib.patheffects as pe
import numpy as np
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
from reportlab.platypus import SimpleDocTemplate, Image as RLImage, Spacer
from reportlab.lib import colors as rlcolors
import os, math

OUT_DIR = "/tmp/workspace/bhms-physiology/"
PAGE_IMGS = []

# ── Notebook colours ──
BG       = "#FFFDF0"      # cream notebook paper
LINE_C   = "#C8D8E8"      # blue ruled lines
MARGIN_C = "#FFB3B3"      # red margin line
INK      = "#1a1a5e"      # dark blue ink
INK2     = "#0a0a0a"      # black ink for diagrams
RED_INK  = "#cc0000"      # red underline / headings
GREEN_INK= "#006400"      # green for important boxes
PENCIL   = "#555555"      # pencil grey
BOX_BG   = "#FFF9C4"      # yellow highlight box

A4W_IN = 8.27
A4H_IN = 11.69
DPI    = 150              # good quality, reasonable file size

def new_page(title=None):
    fig, ax = plt.subplots(figsize=(A4W_IN, A4H_IN), dpi=DPI)
    fig.patch.set_facecolor(BG)
    ax.set_facecolor(BG)
    ax.set_xlim(0, 210)
    ax.set_ylim(0, 297)
    ax.invert_yaxis()
    ax.axis('off')

    # Ruled lines (every 8mm)
    for y in np.arange(25, 290, 8):
        ax.axhline(y, color=LINE_C, linewidth=0.5, zorder=0)

    # Margin line
    ax.axvline(20, color=MARGIN_C, linewidth=1.2, zorder=1)

    # Top border line
    ax.axhline(22, color=LINE_C, linewidth=1.0, zorder=1)

    # Header area
    if title:
        ax.text(105, 8, title,
                fontsize=13, fontweight='bold',
                color=RED_INK, ha='center', va='center',
                fontfamily='DejaVu Serif',
                style='italic')
        ax.axhline(14, color=RED_INK, linewidth=0.8, xmin=0.05, xmax=0.95, zorder=2)

    # Page number placeholder area
    ax.text(200, 293, f"",
            fontsize=8, color=PENCIL, ha='right', va='bottom')

    return fig, ax

def htext(ax, x, y, text, size=9.5, color=INK, bold=False, italic=False,
          align='left', spacing=0, underline=False, family='DejaVu Sans'):
    """Write text in handwriting style"""
    style = 'italic' if italic else 'normal'
    weight = 'bold' if bold else 'normal'
    t = ax.text(x, y, text, fontsize=size, color=color,
                ha=align, va='top',
                fontfamily=family,
                style=style, fontweight=weight,
                linespacing=1.2)
    if underline:
        # draw a squiggly underline manually
        x0 = x
        txt_len = len(text) * size * 0.45
        ux = np.linspace(x0, x0 + txt_len, 60)
        uy = y + size * 0.15 + 0.5 * np.sin(np.linspace(0, 3*np.pi, 60))
        ax.plot(ux, uy, color=color, linewidth=0.8, zorder=5)
    return t

def heading(ax, y, text, color=RED_INK, size=11, underline_color=RED_INK):
    ax.text(25, y, text, fontsize=size, color=color, fontweight='bold',
            fontfamily='DejaVu Serif', style='italic', va='top')
    text_len = len(text) * size * 0.55
    ax.plot([25, 25 + text_len], [y + size * 1.1, y + size * 1.1],
            color=underline_color, linewidth=1.2, solid_capstyle='round')

def subheading(ax, y, text, color=INK):
    ax.text(25, y, text, fontsize=10, color=color, fontweight='bold',
            fontfamily='DejaVu Sans', va='top')
    # double underline
    text_len = len(text) * 10 * 0.52
    ax.plot([25, 25 + text_len], [y + 11, y + 11],
            color=color, linewidth=0.8)
    ax.plot([25, 25 + text_len], [y + 12.5, y + 12.5],
            color=color, linewidth=0.5)

def body(ax, y, text, x=28, size=9.0, color=INK2):
    ax.text(x, y, text, fontsize=size, color=color,
            fontfamily='DejaVu Sans', va='top')

def bullet_line(ax, y, text, x=30, color=INK2, size=9.0, bullet='β†’'):
    ax.text(x, y, bullet, fontsize=size, color=RED_INK, va='top', fontweight='bold')
    ax.text(x + 7, y, text, fontsize=size, color=color,
            fontfamily='DejaVu Sans', va='top')

def highlight_box(ax, x1, y1, x2, y2, text_lines, bg=BOX_BG, border=GREEN_INK):
    rect = FancyBboxPatch((x1, y1), x2-x1, y2-y1,
                          boxstyle="round,pad=1", linewidth=1.5,
                          edgecolor=border, facecolor=bg, zorder=3)
    ax.add_patch(rect)
    for i, line in enumerate(text_lines):
        ax.text((x1+x2)/2, y1 + 4 + i*8, line,
                fontsize=8.5, ha='center', va='top',
                color=INK2, fontfamily='DejaVu Sans',
                fontweight='bold' if i == 0 else 'normal',
                zorder=4)

def imp_box(ax, x1, y1, x2, y2, text_lines, bg="#FFE0E0", border=RED_INK):
    rect = FancyBboxPatch((x1, y1), x2-x1, y2-y1,
                          boxstyle="round,pad=1", linewidth=2,
                          edgecolor=border, facecolor=bg, zorder=3,
                          linestyle='--')
    ax.add_patch(rect)
    for i, line in enumerate(text_lines):
        ax.text((x1+x2)/2, y1 + 4 + i*8, line,
                fontsize=8.5, ha='center', va='top',
                color=RED_INK if i == 0 else INK2,
                fontfamily='DejaVu Sans',
                fontweight='bold' if i == 0 else 'normal',
                zorder=4)

def arrow(ax, x1, y1, x2, y2, color=INK, lw=1.5):
    ax.annotate('', xy=(x2, y2), xytext=(x1, y1),
                arrowprops=dict(arrowstyle='->', color=color,
                                lw=lw, mutation_scale=12))

def save_page(fig, name):
    path = os.path.join(OUT_DIR, name)
    fig.savefig(path, dpi=DPI, bbox_inches='tight',
                facecolor=BG, format='png')
    plt.close(fig)
    PAGE_IMGS.append(path)
    return path

# ════════════════════════════════════════════════
# PAGE 1 β€” Title + Introduction + Overview
# ════════════════════════════════════════════════
fig, ax = new_page("KRIYA SHARIR (PHYSIOLOGY) β€” BHMS 1st Year  |  MPMSU")

# Big heading
ax.text(105, 28, "URINE FORMATION",
        fontsize=18, fontweight='bold', color=RED_INK,
        ha='center', va='top',
        fontfamily='DejaVu Serif', style='italic')
ax.plot([30, 180], [42, 42], color=RED_INK, linewidth=2)
ax.plot([30, 180], [43.5, 43.5], color=RED_INK, linewidth=0.7)

# Subtitle
body(ax, 46, "(Mechanism of Urine Formation)", x=65, size=9.5, color=PENCIL)

# Date / name lines (like actual notebook)
ax.plot([25, 100], [56, 56], color=PENCIL, linewidth=0.5)
ax.text(25, 53, "Date: ___________    Topic: Urine Formation    Unit: Excretory System",
        fontsize=8, color=PENCIL, va='top')

# ── Introduction
heading(ax, 64, "INTRODUCTION", size=10)
body(ax, 76, "The kidneys form urine to:", x=28)
bullet_line(ax, 84, "Remove metabolic wastes (urea, creatinine, uric acid)")
bullet_line(ax, 92, "Regulate blood volume, pressure & osmolarity")
bullet_line(ax, 100, "Maintain acid-base balance (pH 7.35–7.45)")
bullet_line(ax, 108, "Excrete drugs, toxins and excess ions")

# ── Three Processes box
highlight_box(ax, 22, 118, 188, 144,
    ["β˜…  THREE PROCESSES OF URINE FORMATION  β˜…",
     "1. GLOMERULAR FILTRATION    2. TUBULAR REABSORPTION    3. TUBULAR SECRETION",
     "                     (In this order β€” filtrate formed β†’ refined β†’ waste added)"])

# ── Key Numbers
heading(ax, 150, "KEY NUMBERS TO MEMORISE", size=10)
body(ax, 162, "GFR  =  125 mL/min  =  180 L/day  filtered", x=28, size=9.5)
body(ax, 170, "Urine output  =  1–2 L/day  (only 1% of filtrate excreted!)", x=28, size=9.5)
body(ax, 178, "99% of filtrate is REABSORBED back into blood", x=28, size=9.5)
body(ax, 186, "Renal Blood Flow (RBF)  =  1100–1200 mL/min  (~22% of cardiac output!)", x=28, size=9.5)
body(ax, 194, "Renal Plasma Flow (RPF)  =  625 mL/min", x=28, size=9.5)
body(ax, 202, "Filtration Fraction  =  GFR / RPF  =  125 / 625  =  20%", x=28, size=9.5)

# ── Circle diagram for 3 processes
cx, cy, r = 105, 248, 20
circle = plt.Circle((cx, cy), r, fill=False, color=INK, linewidth=1.5)
ax.add_patch(circle)
ax.text(cx, cy, "NEPHRON", fontsize=7.5, ha='center', va='center',
        color=RED_INK, fontweight='bold')

# 3 process labels around circle
ax.text(cx, cy - r - 8, "β‘  Filtration", fontsize=8.5, ha='center', color=INK2, fontweight='bold')
ax.text(cx - r - 30, cy + 8, "β‘‘ Reabsorption", fontsize=8.5, ha='center', color=GREEN_INK, fontweight='bold')
ax.text(cx + r + 30, cy + 8, "β‘’ Secretion", fontsize=8.5, ha='center', color=RED_INK, fontweight='bold')

arrow(ax, cx - 5, cy - r, cx - 25, cy - 18, color=INK)
arrow(ax, cx - r, cy + 5, cx - r - 20, cy + 10, color=GREEN_INK)
arrow(ax, cx + r, cy + 5, cx + r + 12, cy + 10, color=RED_INK)

ax.text(25, 285, "Page 1", fontsize=8, color=PENCIL)

save_page(fig, "page1.png")

# ════════════════════════════════════════════════
# PAGE 2 β€” Process 1: Glomerular Filtration
# ════════════════════════════════════════════════
fig, ax = new_page("Urine Formation β€” Process 1: Glomerular Filtration")

heading(ax, 26, "PROCESS 1 β€” GLOMERULAR FILTRATION", size=11)
body(ax, 40, "Definition: High-pressure filtration of plasma at glomerulus β†’ filtrate formed in Bowman's capsule", x=28)

# Filtration membrane
subheading(ax, 52, "Filtration Membrane (3 layers):")
body(ax, 66, "Layer 1  β†’  Fenestrated capillary endothelium  (pores 70–100 nm)", x=30)
body(ax, 74, "Layer 2  β†’  Glomerular Basement Membrane (GBM)  β˜… Main barrier β˜…", x=30, color=RED_INK)
body(ax, 82, "Layer 3  β†’  Podocyte filtration slits  (pedicels form slits ~25–65 nm)", x=30)
body(ax, 90, "What passes: water, ions, glucose, urea, amino acids  (small molecules)", x=30, color=GREEN_INK)
body(ax, 98, "What CANNOT pass: Proteins, RBCs, WBCs, Platelets  (too large)", x=30, color=RED_INK)

# NFP diagram
subheading(ax, 110, "Net Filtration Pressure (NFP):")

# Draw forces diagram
bx, by = 60, 130
# box
rect = FancyBboxPatch((bx, by), 90, 50,
                      boxstyle="round,pad=2", linewidth=1.5,
                      edgecolor=INK, facecolor="#E3F2FD", zorder=3)
ax.add_patch(rect)
ax.text(bx + 45, by + 8, "GLOMERULAR CAPILLARY", fontsize=8, ha='center',
        color=INK, fontweight='bold', zorder=4)

# Force arrows
# PGC pushing out β†’
ax.annotate('', xy=(bx - 15, by + 25), xytext=(bx + 5, by + 25),
            arrowprops=dict(arrowstyle='->', color=GREEN_INK, lw=2))
ax.text(bx - 17, by + 22, "PGC = 55 mmHg", fontsize=8, color=GREEN_INK,
        ha='right', va='top', fontweight='bold')
ax.text(bx - 17, by + 29, "(favours filtration ↑)", fontsize=7.5, color=GREEN_INK, ha='right', va='top')

# Ο€GC pulling in ←
ax.annotate('', xy=(bx + 5, by + 35), xytext=(bx - 15, by + 35),
            arrowprops=dict(arrowstyle='->', color=RED_INK, lw=2))
ax.text(bx - 17, by + 33, "Ο€GC = 30 mmHg", fontsize=8, color=RED_INK,
        ha='right', va='top', fontweight='bold')
ax.text(bx - 17, by + 40, "(opposes filtration ↓)", fontsize=7.5, color=RED_INK, ha='right', va='top')

# PBS opposing from Bowman's
ax.annotate('', xy=(bx + 95 + 5, by + 30), xytext=(bx + 95 - 5, by + 30),
            arrowprops=dict(arrowstyle='->', color="#8B0000", lw=2))
ax.text(bx + 103, by + 27, "PBS = 15 mmHg", fontsize=8, color="#8B0000",
        ha='left', va='top', fontweight='bold')
ax.text(bx + 103, by + 34, "(opposes filtration ↓)", fontsize=7.5, color="#8B0000", ha='left', va='top')

ax.text(bx + 45, by + 38, "FILTRATION β†’", fontsize=8.5, ha='center',
        color=GREEN_INK, fontweight='bold', zorder=4)

# Formula
imp_box(ax, 22, 188, 188, 216,
    ["β˜…  NFP  =  PGC  βˆ’  Ο€GC  βˆ’  PBS  =  55 βˆ’ 30 βˆ’ 15  =  10 mmHg  β˜…",
     "GFR  =  Kf  Γ—  NFP  =  125 mL/min  (both kidneys combined)",
     "180 L/day filtered  β†’  only 1–2 L/day excreted as urine"])

# Regulation of GFR
subheading(ax, 224, "Regulation of GFR:")
body(ax, 236, "β‘  Autoregulation: Myogenic reflex + Tubuloglomerular Feedback (TGF)", x=30, size=9.0)
body(ax, 244, "β‘‘ Sympathetic NS: constricts afferent art. β†’ ↓GFR (in shock, exercise)", x=30, size=9.0)
body(ax, 252, "β‘’ Ang II: constricts efferent art. β†’ preserves GFR despite ↓BP", x=30, size=9.0)
body(ax, 260, "β‘£ Prostaglandins (PGEβ‚‚): dilate afferent β†’ ↑GFR (protective role)", x=30, size=9.0)
body(ax, 268, "β‘€ ANP: dilates afferent + constricts efferent β†’ ↑GFR + ↑Na excretion", x=30, size=9.0)

ax.text(25, 285, "Page 2", fontsize=8, color=PENCIL)
save_page(fig, "page2.png")

# ════════════════════════════════════════════════
# PAGE 3 β€” Process 2: Tubular Reabsorption
# ════════════════════════════════════════════════
fig, ax = new_page("Urine Formation β€” Process 2: Tubular Reabsorption")

heading(ax, 26, "PROCESS 2 β€” TUBULAR REABSORPTION", size=11)
body(ax, 40, "Definition: Movement of filtered substances from tubular lumen BACK into blood.", x=28)
body(ax, 48, "Quantitatively MOST IMPORTANT process. ~99% of 180 L/day is reabsorbed.", x=28, color=GREEN_INK)

# Draw simplified nephron tubule diagram on left, table on right
# Left side: linear nephron representation
nx = 35  # x of nephron tube
# Glomerulus
glom = plt.Circle((nx + 8, 68), 8, fill=True, color="#BBDEFB", edgecolor=INK, linewidth=1.5)
ax.add_patch(glom)
ax.text(nx + 8, 68, "G", fontsize=8, ha='center', va='center', fontweight='bold', color=INK)

# Bowman's
bow = plt.Circle((nx + 8, 68), 11, fill=False, color=INK, linewidth=1.0, linestyle='--')
ax.add_patch(bow)
ax.text(nx + 22, 65, "BC", fontsize=7, color=INK)

# PCT
ax.plot([nx+8, nx+8, nx+3, nx+3, nx+8], [79, 90, 90, 108, 108],
        color=INK2, linewidth=2.5, solid_capstyle='round')
ax.text(nx + 10, 99, "PCT", fontsize=7.5, color=INK2, fontweight='bold')
ax.text(nx - 8, 92, "67%", fontsize=7, color=GREEN_INK, fontweight='bold')

# Descending loop
ax.plot([nx+8, nx+8, nx+8], [108, 135, 155],
        color=INK2, linewidth=2.5, solid_capstyle='round')
ax.text(nx + 10, 130, "Desc", fontsize=6.5, color=INK2)
ax.text(nx + 10, 138, "limb", fontsize=6.5, color=INK2)

# Loop turn
ax.plot([nx+3, nx+8, nx+13], [155, 162, 155],
        color=INK2, linewidth=2.5, solid_capstyle='round')

# Ascending loop
ax.plot([nx+13, nx+13, nx+13], [155, 135, 115],
        color=INK2, linewidth=2.5, solid_capstyle='round')
ax.text(nx + 15, 130, "Asc", fontsize=6.5, color=INK2)
ax.text(nx + 15, 138, "limb", fontsize=6.5, color=INK2)

# DCT
ax.plot([nx+13, nx+13, nx+18, nx+18, nx+13], [115, 105, 105, 90, 90],
        color=INK2, linewidth=2.5, solid_capstyle='round')
ax.text(nx + 20, 99, "DCT", fontsize=7.5, color=INK2, fontweight='bold')

# Collecting duct
ax.plot([nx+8, nx+8], [90, 82], color=INK2, linewidth=2, linestyle='-')
ax.plot([nx+8, nx+8, nx+8], [82, 72, 68], color="grey", linewidth=1, linestyle=':')
ax.text(nx + 10, 74, "CD", fontsize=7, color=INK2)

# Downward arrow at bottom
arrow(ax, nx+8, 163, nx+8, 172, color=INK)
ax.text(nx + 10, 170, "to urine", fontsize=6.5, color=RED_INK)

# Labels for loop
ax.text(nx - 5, 158, "Loop", fontsize=7, color=INK2, fontweight='bold')
ax.text(nx - 5, 164, "of Henle", fontsize=7, color=INK2, fontweight='bold')

# Right side table
tx = 65
body(ax, 58, "Segment-wise Reabsorption:", x=tx, size=9.5, color=INK)

rows = [
    ("SEGMENT", "REABSORBED", "MECHANISM", True),
    ("PCT", "67% Na⁺,Cl⁻,K⁺,HCO₃⁻,Hβ‚‚O\n100% Glucose, AAs, urea 50%", "Na/K ATPase\nSGLT2 (glucose)\nObligatory Hβ‚‚O", False),
    ("Desc. limb", "Water only (~15%)", "Passive osmosis\n(medullary gradient)", False),
    ("Asc. limb\n(thin)", "NaCl (passive)", "Concentration gradient", False),
    ("Asc. limb\n(thick)", "NaCl, K, 2Cl (25%)\nβ˜… NOT water β˜…", "Active NKCC2\nβ˜… Hβ‚‚O impermeable", False),
    ("DCT", "Na⁺ (Aldosterone)\nCa²⁺ (PTH)", "Active\nHormone-regulated", False),
    ("Coll. Duct", "Water (ADHβ†’AQP2)\nNa⁺ (Aldosterone)", "AQP2 channels\nENaC channels", False),
]

ry = 66
col_widths = [18, 48, 38]
col_xs = [tx, tx + col_widths[0] + 2, tx + col_widths[0] + col_widths[1] + 4]

for i, (seg, reabs, mech, is_hdr) in enumerate(rows):
    bg_c = "#1565C0" if is_hdr else ("#F3F3FF" if i % 2 == 0 else "#FFFFFF")
    fc = "white" if is_hdr else INK2
    rect = FancyBboxPatch((tx - 2, ry - 1), 148, 7.5 if '\n' not in reabs else 14,
                          boxstyle="square,pad=0", linewidth=0.5,
                          edgecolor=PENCIL, facecolor=bg_c, zorder=2)
    ax.add_patch(rect)
    row_h = 14 if '\n' in reabs or '\n' in seg else 7.5
    ax.text(col_xs[0], ry + 1, seg.replace('\n', '/'), fontsize=7, color=fc,
            va='top', fontweight='bold' if is_hdr else 'normal', zorder=3)
    ax.text(col_xs[1], ry + 1, reabs.replace('\n', ' | '), fontsize=6.8, color=fc,
            va='top', zorder=3)
    ax.text(col_xs[2], ry + 1, mech.replace('\n', ' | '), fontsize=6.8,
            color=RED_INK if 'β˜…' in mech else fc, va='top', zorder=3)
    ry += row_h + 1.5

# Mechanisms box
subheading(ax, 176, "Key Transport Mechanisms:")
bullet_line(ax, 188, "Active (Na⁺/K⁺ ATPase) on basolateral side of PCT β€” drives all other transport")
bullet_line(ax, 196, "SGLT2 cotransporter β€” absorbs glucose + Na⁺ together in PCT")
bullet_line(ax, 204, "NKCC2 in thick ascending limb β€” Na⁺, K⁺, 2Cl⁻ (blocked by Furosemide)")
bullet_line(ax, 212, "ENaC (epithelial Na channel) in collecting duct β€” regulated by Aldosterone")
bullet_line(ax, 220, "AQP2 (Aquaporin-2) channels in collecting duct β€” inserted by ADH")

highlight_box(ax, 22, 230, 188, 250,
    ["IMPORTANT: PCT reabsorbs ALL glucose + ALL amino acids normally",
     "Tm (glucose) = 375 mg/min  |  Renal threshold = 180 mg/dL",
     "Above 180 mg/dL β†’ glycosuria (hallmark of uncontrolled Diabetes Mellitus)"])

body(ax, 254, "Obligatory water reabsorption: In PCT, water MUST follow Na⁺ (cannot be stopped)", x=28, color=PENCIL)
body(ax, 262, "Facultative water reabsorption: In collecting duct, water reabsorption depends on ADH", x=28, color=PENCIL)

ax.text(25, 285, "Page 3", fontsize=8, color=PENCIL)
save_page(fig, "page3.png")

# ════════════════════════════════════════════════
# PAGE 4 β€” Process 3 + Countercurrent + ADH + Aldosterone
# ════════════════════════════════════════════════
fig, ax = new_page("Urine Formation β€” Process 3 + Hormonal Regulation")

heading(ax, 26, "PROCESS 3 β€” TUBULAR SECRETION", size=11)
body(ax, 40, "Definition: Substances move FROM blood (peritubular capillaries) INTO tubular lumen.", x=28)
body(ax, 48, "Opposite direction to reabsorption. Ensures elimination of substances not fully filtered.", x=28)

# Table for secretion
sec_data = [
    ("SITE", "SECRETED SUBSTANCES", True),
    ("PCT", "H⁺, K⁺, organic acids, drugs (penicillin, aspirin, diuretics), creatinine", False),
    ("DCT", "K⁺ (↑ by Aldosterone), H⁺ (acid-base regulation), NH₄⁺", False),
    ("Coll. Duct", "H⁺ (via intercalated cells), K⁺", False),
]
sy = 60
for seg, subs, is_hdr in sec_data:
    bg_c = "#880E4F" if is_hdr else ("#FFF0F5" if sec_data.index((seg,subs,is_hdr)) % 2 else "#FFFFFF")
    fc = "white" if is_hdr else INK2
    rect = FancyBboxPatch((22, sy-1), 166, 9,
                          boxstyle="square,pad=0", linewidth=0.5,
                          edgecolor=PENCIL, facecolor=bg_c, zorder=2)
    ax.add_patch(rect)
    ax.text(27, sy+1, seg, fontsize=8, color=fc, fontweight='bold' if is_hdr else 'normal', va='top', zorder=3)
    ax.text(60, sy+1, subs, fontsize=8, color=fc, va='top', zorder=3)
    sy += 10

bullet_line(ax, sy + 4, "Clinical use: PAH (para-amino hippuric acid) = 100% secreted β†’ measures Renal Plasma Flow")
bullet_line(ax, sy + 12, "Creatinine: small amount secreted β†’ clearance slightly overestimates GFR")

# ── ADH
heading(ax, sy + 24, "HORMONAL REGULATION β€” ADH (Vasopressin)", size=10)
y = sy + 38
body(ax, y, "Source: Synthesised in HYPOTHALAMUS (SON + PVN) β†’ stored in POSTERIOR PITUITARY", x=28)
body(ax, y+8, "Target: V2 receptors on PRINCIPAL CELLS of Collecting Duct and DCT", x=28)
body(ax, y+16, "Mechanism: ADH β†’ V2 β†’ Gs β†’ cAMP β†’ PKA β†’ AQP2 vesicles β†’ apical membrane", x=28, color=GREEN_INK)
body(ax, y+24, "Effect: Water reabsorbed β†’ concentrated urine (oliguria, up to 1200 mOsm/kg)", x=28)
body(ax, y+32, "No ADH β†’ collecting duct impermeable to water β†’ dilute urine (DI: 5–20 L/day!)", x=28, color=RED_INK)

# ADH stimuli
imp_box(ax, 22, y+42, 188, y+62,
    ["ADH release stimulated by:",
     "↑ Plasma osmolality (>295) | ↓ Blood volume/BP (>10% drop) | Pain, nausea, stress",
     "ADH INHIBITED by: Alcohol, Cold, ANP, Hypervolaemia"])

# ── Aldosterone
heading(ax, y+70, "HORMONAL REGULATION β€” ALDOSTERONE", size=10)
y2 = y + 84
body(ax, y2, "Source: ADRENAL CORTEX (zona glomerulosa)   |   Class: Steroid hormone", x=28)
body(ax, y2+8, "Stimuli: ↑Angiotensin II, ↑K⁺, ↓Na⁺, ACTH (minor)", x=28)
body(ax, y2+16, "Target: Principal cells of DCT and Collecting Duct", x=28)
body(ax, y2+24, "Action: Na⁺ REABSORPTION ↑  +  K⁺ SECRETION ↑  +  H⁺ SECRETION ↑", x=28, color=GREEN_INK)

# Simple diagram: Aldosterone arrow
ax.text(28, y2+34, "Na⁺", fontsize=10, color=RED_INK, fontweight='bold')
ax.text(48, y2+34, "←  (reabsorbed)", fontsize=9, color=GREEN_INK)
ax.text(110, y2+34, "K⁺", fontsize=10, color=RED_INK, fontweight='bold')
ax.text(122, y2+34, "β†’  (secreted in urine)", fontsize=9, color=RED_INK)

highlight_box(ax, 22, y2+44, 188, y2+62,
    ["Mnemonic: Aldosterone  β†’  'A' for sAlt (Na⁺ IN) + sAcK (K⁺ OUT)",
     "Conn's Syndrome: ↑↑Aldosterone β†’ HTN + ↓K (hypokalaemia) + Metabolic alkalosis",
     "Addison's Disease: ↓↓Aldosterone β†’ ↓BP + ↑K (hyperkalaemia) + Hyponatraemia"])

ax.text(25, 285, "Page 4", fontsize=8, color=PENCIL)
save_page(fig, "page4.png")

# ════════════════════════════════════════════════
# PAGE 5 β€” Nephron Diagram (main visual)
# ════════════════════════════════════════════════
fig, ax = new_page("Urine Formation β€” Nephron Diagram")

heading(ax, 26, "NEPHRON β€” LABELLED DIAGRAM", size=11)
body(ax, 40, "Draw this in EXAM. All labels are marks-fetching.", x=28, color=RED_INK)

# ── Draw detailed nephron ──
# Coordinate system: 0–210 x, 0–297 y (inverted)

def draw_nephron(ax):
    # Glomerulus (circle)
    gx, gy = 80, 65
    glom = plt.Circle((gx, gy), 14, fill=True, color="#BBDEFB",
                       edgecolor=INK, linewidth=2, zorder=4)
    ax.add_patch(glom)
    ax.text(gx, gy, "Glomerulus", fontsize=6.5, ha='center', va='center',
            fontweight='bold', color=INK, zorder=5)

    # Bowman's Capsule
    bow = plt.Circle((gx, gy), 20, fill=False, color=INK, linewidth=1.5,
                      linestyle='-', zorder=3)
    ax.add_patch(bow)
    ax.text(gx + 22, gy - 22, "Bowman's\nCapsule", fontsize=6.5, color=INK,
            ha='left', va='top')
    ax.plot([gx+20, gx+22], [gy-16, gy-18], color=INK, lw=0.7)

    # Afferent arteriole
    ax.annotate('', xy=(gx-13, gy-7), xytext=(gx-32, gy-16),
                arrowprops=dict(arrowstyle='->', color=RED_INK, lw=2))
    ax.text(gx-46, gy-12, "Afferent\nArteriole", fontsize=6.5, color=RED_INK, ha='center')

    # Efferent arteriole
    ax.annotate('', xy=(gx-32, gy+12), xytext=(gx-13, gy+7),
                arrowprops=dict(arrowstyle='->', color="#8B0000", lw=2))
    ax.text(gx-46, gy+14, "Efferent\nArteriole", fontsize=6.5, color="#8B0000", ha='center')

    # Neck + PCT β€” zigzag
    px, py = gx + 20, gy
    # straight from Bowman's
    ax.plot([gx+20, gx+38], [gy, gy], color=INK2, lw=2.5)
    # PCT zigzag
    pct_x = [gx+38, gx+50, gx+42, gx+56, gx+48, gx+62, gx+54, gx+68]
    pct_y = [gy,    gy-8,  gy+2,  gy-8,  gy+2,  gy-8,  gy+2,  gy-4]
    ax.plot(pct_x, pct_y, color=INK2, lw=2.5, solid_capstyle='round', solid_joinstyle='round')
    ax.text(gx+53, gy-18, "PCT", fontsize=8, color=INK2, ha='center', fontweight='bold')
    ax.text(gx+53, gy-26, "(Prox. Conv. Tubule)", fontsize=6.5, color=PENCIL, ha='center')
    ax.text(gx+53, gy+14, "67% reabsorption\n100% glucose/AAs", fontsize=6, color=GREEN_INK, ha='center')

    # PCT β†’ descending limb
    ax.plot([gx+68, gx+80], [gy-4, gy-4], color=INK2, lw=2.5)
    ax.plot([gx+80, gx+80], [gy-4, gy+80], color=INK2, lw=2.5)

    # Loop turn
    loop_x = [gx+80, gx+75, gx+70]
    loop_y = [gy+80, gy+88, gy+80]
    ax.plot(loop_x, loop_y, color=INK2, lw=2.5, solid_capstyle='round')

    # Labels on descending
    ax.text(gx+82, gy+35, "Descending", fontsize=7, color=INK2)
    ax.text(gx+82, gy+42, "Limb", fontsize=7, color=INK2)
    ax.text(gx+82, gy+50, "(Hβ‚‚O out)", fontsize=6.5, color=GREEN_INK)
    ax.text(gx+82, gy+58, "osmolality↑", fontsize=6, color=PENCIL)

    # Ascending limb
    ax.plot([gx+70, gx+58], [gy+80, gy+80], color=INK2, lw=2.5)
    ax.plot([gx+58, gx+58], [gy+80, gy+10], color=INK2, lw=2.5)

    # Labels on ascending
    ax.text(gx+45, gy+50, "Ascending", fontsize=7, color=INK2, ha='right')
    ax.text(gx+45, gy+57, "Limb", fontsize=7, color=INK2, ha='right')
    ax.text(gx+45, gy+64, "(NaCl out)", fontsize=6.5, color=RED_INK, ha='right')
    ax.text(gx+45, gy+72, "β˜… Hβ‚‚O imperm.", fontsize=6, color=RED_INK, ha='right')

    # Loop of Henle label
    ax.text(gx+75, gy+96, "Loop of Henle", fontsize=7.5, color=INK, ha='center', fontweight='bold')

    # Ascending β†’ DCT
    ax.plot([gx+58, gx+58], [gy+10, gy+2], color=INK2, lw=2.5)
    ax.plot([gx+58, gx+44], [gy+2, gy+2], color=INK2, lw=2.5)
    # DCT zigzag
    dct_x = [gx+44, gx+34, gx+40, gx+28, gx+34, gx+22, gx+28, gx+16]
    dct_y = [gy+2,  gy-6,  gy+4,  gy-6,  gy+4,  gy-6,  gy+4,  gy]
    ax.plot(dct_x, dct_y, color=INK2, lw=2.5, solid_capstyle='round')
    ax.text(gx+30, gy-18, "DCT", fontsize=8, color=INK2, ha='center', fontweight='bold')
    ax.text(gx+30, gy-26, "(Dist. Conv. Tubule)", fontsize=6.5, color=PENCIL, ha='center')
    ax.text(gx+16, gy+8, "Na⁺(Aldo)\nCa²⁺(PTH)", fontsize=6, color=GREEN_INK)

    # DCT β†’ Collecting Duct
    ax.plot([gx+16, gx+8], [gy, gy], color=INK2, lw=2.5)
    ax.plot([gx+8, gx+8], [gy, gy+90], color="#888888", lw=3)
    ax.text(gx+1, gy+50, "Collecting\nDuct", fontsize=7, color="#555555", ha='left', fontweight='bold')
    ax.text(gx-6, gy+62, "ADHβ†’Hβ‚‚O\nAldoβ†’Na⁺", fontsize=6, color=GREEN_INK, ha='left')

    # Arrow to urine
    ax.annotate('', xy=(gx+8, gy+102), xytext=(gx+8, gy+92),
                arrowprops=dict(arrowstyle='->', color=RED_INK, lw=2.5))
    ax.text(gx+10, gy+104, "URINE", fontsize=8, color=RED_INK, fontweight='bold')

    # JGA marker
    ax.plot([gx-13, gx-13], [gy+7, gy+12], color=PENCIL, lw=1, linestyle=':')
    ax.plot([gx+16, gx-13], [gy+2, gy+10], color=PENCIL, lw=1, linestyle=':')
    ax.text(gx-40, gy+18, "JGA", fontsize=7.5, color=C_TIP if False else "#E65100",
            ha='center', fontweight='bold')
    ax.text(gx-40, gy+25, "(afferent art +\nDCT junction)", fontsize=6, color=PENCIL, ha='center')

    # Osmolality gradient bar (right side)
    ox = gx + 102
    oy_top = gy - 4
    oy_bot = gy + 92
    # bar
    for i, (o_y, osm, col) in enumerate([(gy+0, "300", "#E3F2FD"),
                                          (gy+25, "600", "#BBDEFB"),
                                          (gy+50, "900", "#90CAF9"),
                                          (gy+80, "1200","#42A5F5")]):
        rect = FancyBboxPatch((ox, o_y), 18, 24,
                              boxstyle="square,pad=0", linewidth=0,
                              edgecolor=None, facecolor=col, zorder=2)
        ax.add_patch(rect)
        ax.text(ox+9, o_y+12, osm, fontsize=7, ha='center', va='center',
                color=INK, fontweight='bold', zorder=3)
    ax.text(ox+9, gy-9, "mOsm", fontsize=6.5, ha='center', color=INK)
    ax.text(ox+9, gy+100, "Gradient", fontsize=6.5, ha='center', color=INK)
    ax.plot([ox, ox+18], [gy, gy], color=C_BORDER, lw=0.5)
    arrow(ax, ox+9, gy+0, ox+9, gy+80, color=INK2)

draw_nephron(ax)

# Legend box
legend_items = [
    ("β€”β€” thick", "Tubule segments"),
    ("β†’ red", "Afferent arteriole"),
    ("β†’ dark red", "Efferent arteriole"),
    ("grey bar", "Collecting duct"),
    ("gradient", "Medullary osmolality"),
]
lx, ly = 22, 250
ax.text(lx, ly, "LEGEND:", fontsize=8, color=INK, fontweight='bold')
for i, (sym, desc) in enumerate(legend_items):
    ax.text(lx + 2, ly + 8 + i*8, f"{sym}  =  {desc}", fontsize=7, color=PENCIL)

ax.text(25, 285, "Page 5", fontsize=8, color=PENCIL)
save_page(fig, "page5.png")

# ════════════════════════════════════════════════
# PAGE 6 β€” Countercurrent + Clearance + Summary
# ════════════════════════════════════════════════
fig, ax = new_page("Urine Formation β€” Countercurrent + Clearance + Summary")

heading(ax, 26, "COUNTERCURRENT MECHANISM (Urine Concentration)", size=10)
body(ax, 40, "Kidney produces urine 50–1200 mOsm/kg. Achieved by Countercurrent Multiplier (Loop of Henle)", x=28)
body(ax, 48, "and Countercurrent Exchanger (Vasa Recta).", x=28)

cc_data = [
    ("STRUCTURE",       "Hβ‚‚O perm?", "SOLUTE perm?", "WHAT HAPPENS",         True),
    ("Desc. limb (thin)","YES",       "NO",           "Hβ‚‚O leaves β†’ fluid concentrates (300β†’1200)", False),
    ("Asc. limb (thin)", "NO",        "YES",          "NaCl diffuses out passively",                 False),
    ("Asc. limb (thick)","β˜… NO β˜…",   "YES (active)","NaCl pumped out by NKCC2 β†’ builds gradient",  False),
    ("Coll. duct + ADH", "YES (AQP2)","NO",           "Hβ‚‚O absorbed β†’ concentrated urine",          False),
    ("Vasa Recta",       "YES",       "YES",          "Countercurrent exchange β†’ preserves gradient",False),
]
cy = 58
for row in cc_data:
    bg_c = "#004D40" if row[4] else ("#E0F2F1" if cc_data.index(row) % 2 == 0 else "#FFFFFF")
    fc = "white" if row[4] else (RED_INK if "β˜…" in row[0] else INK2)
    rect = FancyBboxPatch((22, cy-1), 166, 8.5,
                          boxstyle="square,pad=0", linewidth=0.4,
                          edgecolor=PENCIL, facecolor=bg_c, zorder=2)
    ax.add_patch(rect)
    xs = [27, 63, 82, 102]
    for xi, txt in zip(xs, row[:4]):
        ax.text(xi, cy+1, txt, fontsize=7, color=fc, va='top',
                fontweight='bold' if row[4] else ('bold' if 'β˜…' in txt else 'normal'), zorder=3)
    cy += 10

# Renal Clearance section
heading(ax, cy + 6, "RENAL CLEARANCE", size=10)
body(ax, cy + 20, "C(x)  =  U(x) Γ— V  Γ·  P(x)     [Volume of plasma cleared per minute]", x=28)

clear_data2 = [
    ("SUBSTANCE",  "CLEARANCE",    "INTERPRETATION",        True),
    ("Inulin",     "125 mL/min",   "= GFR (Gold Standard). Freely filtered only",   False),
    ("Creatinine", "~120–130 mL/min", "β‰ˆ GFR. Clinical use for eGFR",               False),
    ("PAH",        "625 mL/min",   "= RPF. 100% filtered + 100% secreted",          False),
    ("Glucose",    "0 mL/min",     "100% reabsorbed. >0 only if BG > 180 mg/dL",    False),
    ("Urea",       "~70 mL/min",   "< GFR β†’ net reabsorption (50%) in PCT",         False),
]
cry = cy + 30
for row in clear_data2:
    bg_c = "#0D47A1" if row[3] else ("#E3F2FD" if clear_data2.index(row) % 2 == 0 else "#FFFFFF")
    fc = "white" if row[3] else INK2
    rect = FancyBboxPatch((22, cry-1), 166, 8,
                          boxstyle="square,pad=0", linewidth=0.4,
                          edgecolor=PENCIL, facecolor=bg_c, zorder=2)
    ax.add_patch(rect)
    xs = [27, 60, 100]
    for xi, txt in zip(xs, row[:3]):
        ax.text(xi, cry+1, txt, fontsize=7.2, color=fc, va='top',
                fontweight='bold' if row[3] else 'normal', zorder=3)
    cry += 9.5

body(ax, cry+4, "If C < GFR β†’ reabsorbed  |  If C = GFR β†’ filtered only  |  If C > GFR β†’ secreted", x=28, color=GREEN_INK)

# ── FINAL SUMMARY BOX ──
sy = cry + 16
heading(ax, sy, "QUICK SUMMARY β€” URINE FORMATION", size=10)
sy += 14

summary_lines = [
    ("β‘ ", "FILTRATION", "Glomerulus + Bowman's. GFR=125 mL/min. NFP=10 mmHg (55βˆ’30βˆ’15)."),
    ("β‘‘", "REABSORPTION", "PCT (67%) + Loop + DCT + CD. 99% returned to blood. ADH + Aldosterone."),
    ("β‘’", "SECRETION", "PCT + DCT. H⁺, K⁺, drugs secreted. Ensures complete waste removal."),
    ("β‘£", "COUNTERCURRENT", "Loop of Henle builds 300β†’1200 mOsm gradient. Vasa recta preserves it."),
    ("β‘€", "FINAL URINE", "1–2 L/day, pH 4.5–8, SG 1.003–1.030, yellow (urochrome), clear."),
]
for num, topic, detail in summary_lines:
    rect = FancyBboxPatch((22, sy-1), 166, 10,
                          boxstyle="round,pad=1", linewidth=1,
                          edgecolor=INK, facecolor=C_LYELLOW if False else "#F8F8FF", zorder=2)
    ax.add_patch(rect)
    ax.text(26, sy+2, num, fontsize=9, color=RED_INK, fontweight='bold', zorder=3)
    ax.text(34, sy+2, topic, fontsize=8.5, color=INK, fontweight='bold', zorder=3)
    ax.text(90, sy+2, detail, fontsize=7.5, color=INK2, zorder=3)
    sy += 11.5

ax.text(25, 285, "Page 6", fontsize=8, color=PENCIL)
save_page(fig, "page6.png")

# ════════════════════════════════════════════════
# Build final PDF from page images
# ════════════════════════════════════════════════
from reportlab.lib.pagesizes import A4
from reportlab.platypus import SimpleDocTemplate, Image as RLImage
from reportlab.lib.units import cm

OUT_PDF = os.path.join(OUT_DIR, "Urine_Formation_HandwrittenNotes.pdf")
doc = SimpleDocTemplate(
    OUT_PDF, pagesize=A4,
    rightMargin=0, leftMargin=0,
    topMargin=0, bottomMargin=0,
)
W_pt = A4[0]
H_pt = A4[1]

story = []
for img_path in PAGE_IMGS:
    img = RLImage(img_path, width=W_pt, height=H_pt)
    story.append(img)

doc.build(story)
print(f"PDF saved: {OUT_PDF}")
print(f"Pages: {len(PAGE_IMGS)}")
Running Command

cd /tmp/workspace/bhms-physiology && python generate_handwritten_notes.py 2>&1

Editing File

~/bhms-physiology/generate_handwritten_notes.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/bhms-physiology/generate_handwritten_notes.py'
Running Command

cd /tmp/workspace/bhms-physiology && python generate_handwritten_notes.py 2>&1

Editing File

~/bhms-physiology/generate_handwritten_notes.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/bhms-physiology/generate_handwritten_notes.py'
Running Command

cd /tmp/workspace/bhms-physiology && python generate_handwritten_notes.py 2>&1

Running Command

ls -lh /tmp/workspace/bhms-physiology/Urine_Formation_HandwrittenNotes.pdf

Tera handwritten-style notes PDF ready hai! πŸ““

Urine Formation HandwrittenNotes

PDF Document Β· PDF


6 Pages mein kya-kya hai:

PageContent
Page 1Title page β€” cream notebook background, ruled lines, red margin, Introduction + 3 processes circle diagram
Page 2Process 1: Glomerular Filtration β€” Filtration membrane layers, NFP force diagram (55βˆ’30βˆ’15=10 mmHg), GFR regulation table
Page 3Process 2: Tubular Reabsorption β€” Left side: hand-drawn nephron sketch with PCT/Loop/DCT/CD, Right side: segment-wise reabsorption table; Tm for glucose, SGLT2, AQP2
Page 4Process 3: Tubular Secretion (table) + ADH mechanism (V2β†’cAMPβ†’AQP2) + Aldosterone (Na⁺ IN, K⁺ OUT)
Page 5Full labelled Nephron Diagram β€” glomerulus, Bowman's, PCT, Loop of Henle, DCT, Collecting duct, JGA, osmolality gradient bar (300β†’1200)
Page 6Countercurrent mechanism table + Renal Clearance table + Final Summary (5-point revision box)

Features:
  • 🟑 Cream notebook paper background
  • πŸ”΅ Blue ruled lines + πŸ”΄ Red margin line
  • ✍️ Blue ink text style
  • πŸ“¦ Yellow highlight boxes for important points
  • πŸ”΄ Red dashed boxes for exam tips
  • πŸ“ Hand-drawn style nephron diagram with labels
Aur kisi topic ke notes chahiye? πŸ’ͺ
This is a shared conversation. Sign in to Orris to start your own chat.