Organ function test and hormones for biochemistry PCT
| Marker | Notes |
|---|---|
| Serum urea | Increases as renal function declines; affected by non-renal factors (diet, catabolism) |
| Serum creatinine | More specific - not significantly affected by non-renal factors; only rises when GFR falls ~50% (poor sensitivity for early disease) |
Clearance (mL/min) = (U × V) / P
| Test | What it Assesses | Clinical Interpretation |
|---|---|---|
| Serum bilirubin | Bilirubin metabolism | Obstructive jaundice: mainly conjugated ↑; Hepatocellular disease: both conjugated + unconjugated ↑ |
| Total protein & albumin | Synthetic function | Low in chronic liver disease (cirrhosis) |
| Prothrombin time (PT) | Coagulation factor synthesis | Prolonged in acute liver disorders (impaired coagulation factor synthesis) |
| ALT (alanine aminotransferase) | Hepatocyte damage | More specific for liver disease; elevated significantly in acute viral hepatitis even before jaundice |
| AST (aspartate aminotransferase) | Hepatocyte damage | Also elevated in cardiac/skeletal muscle injury - less specific |
| Alkaline phosphatase (ALP) | Biliary obstruction / bone | Elevated in obstructive jaundice AND bone disease |
| Test | Purpose |
|---|---|
| Serum TSH (thyrotropin) | Best first-line screening test for thyroid dysfunction |
| Free T4 (fT4) | Confirms hypo- or hyperthyroidism |
| Free T3 (fT3) | Measured when T3 thyrotoxicosis suspected |
| Condition | TSH | fT4 |
|---|---|---|
| Hypothyroidism | ↑ | ↓ |
| Hyperthyroidism | ↓ | ↑ |
| Secondary hypothyroidism | ↓ | ↓ |
| Test | Method | Interpretation |
|---|---|---|
| Diurnal cortisol | Serum at midnight + 8 AM | Loss of variation → Cushing syndrome |
| Dexamethasone suppression test (DST) | 1 mg dexamethasone given at midnight; measure cortisol at 8 AM | Failure to suppress cortisol = Cushing syndrome confirmed |
| Marker | Purpose |
|---|---|
| Total cholesterol | Lipid risk assessment |
| LDL:HDL ratio | Best predictor of atherosclerosis risk |
| Cardiac troponin | Gold standard for MI confirmation |
| CK-MB isoenzyme | Cardiac-specific - confirms MI when ECG is inconclusive |
| Class | Examples | Solubility | Transport | Half-life | Receptor Location |
|---|---|---|---|---|---|
| Polypeptide/Protein | ACTH, Insulin, PTH, GH | Water-soluble | Free in plasma | Short (10-30 min) | Cell surface membrane receptors |
| Amino acid derivatives | Thyroxine (T4, T3), Epinephrine, Norepinephrine | Water-soluble | Bound to transport proteins (T4) or free (catecholamines) | T4: 7-10 days; Catecholamines: <1 min | Nuclear receptors (thyroid); G-protein coupled receptors (catecholamines) |
| Steroids / Lipid-derived | Cortisol, Estrogen, Testosterone, Aldosterone | Hydrophobic, water-insoluble | Bound to specific carrier proteins (CBG, SHBG) | 30-90 min | Intracellular nuclear receptors (cytoplasm/nucleus) |
| Gland | Hormone | Type | Principal Action |
|---|---|---|---|
| Hypothalamus | TRH | Peptide (3aa) | Releases TSH and Prolactin from anterior pituitary |
| GnRH | Peptide (10aa) | Releases LH and FSH | |
| CRH | Peptide (41aa) | Releases ACTH and β-LPH | |
| GHRH | Peptide (40/44aa) | Releases growth hormone | |
| Somatostatin | Peptide | Inhibits GH, TSH, insulin, glucagon release | |
| Anterior pituitary | TSH | Glycoprotein | Stimulates thyroid hormone synthesis/release |
| LH, FSH | Glycoproteins | Gonadal function, reproduction | |
| ACTH | Polypeptide | Stimulates adrenal cortex → cortisol | |
| GH | Protein | Growth, IGF-1 release | |
| Prolactin | Protein | Lactation | |
| Adrenal cortex | Cortisol | Steroid | Gluconeogenesis, anti-inflammatory |
| Aldosterone | Steroid | Na⁺ retention, K⁺ excretion | |
| Androgens (DHEA) | Steroid | Secondary sexual characteristics | |
| Adrenal medulla | Epinephrine, Norepinephrine | Catecholamines (tyrosine derivatives) | Fight-or-flight response |
| Thyroid | T4, T3 | Tyrosine derivatives | Metabolic rate, growth |
| Pancreas | Insulin | Polypeptide | Glucose uptake; lowers blood glucose |
| Glucagon | Polypeptide | Raises blood glucose; promotes glycogenolysis | |
| Gonads | Estradiol, Testosterone | Steroids | Reproduction, secondary sex characteristics |
| Parathyroid | PTH | Polypeptide | Raises serum Ca²⁺; activates vitamin D |
| Receptor Type | Hormone Class | Signal Transduction |
|---|---|---|
| Cell surface G-protein coupled receptors (GPCR) | Catecholamines, Glucagon | cAMP → PKA cascade |
| Cell surface tyrosine kinase receptors | Insulin, IGF-1 | PI3K/Akt, MAPK pathways |
| Intracellular nuclear receptors (NR) | Steroids, Thyroid hormones, Vitamin D | Direct gene transcription regulation |
Create a study guide document on organ function tests for exam prep
mkdir -p /home/daytona/workspace/organ-function-study-guide && ls /home/daytona/workspace/organ-function-study-guide/
~/organ-function-study-guide/generate.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
VerticalAlign, PageNumber, Header, Footer, TableOfContents,
PageBreak, UnderlineType
} = require('docx');
const fs = require('fs');
// ---- COLOR PALETTE ----
const TEAL = "1A7A8A";
const DARK_TEAL = "0D5C6E";
const LIGHT_TEAL = "D6EEF2";
const MED_TEAL = "A0D4DC";
const ORANGE = "E87722";
const LIGHT_ORANGE = "FDF1E6";
const YELLOW_HL = "FFF9C4";
const GRAY_BG = "F5F5F5";
const DARK_GRAY = "333333";
const MED_GRAY = "555555";
const WHITE = "FFFFFF";
const RED_LIGHT = "FDECEA";
const GREEN_LIGHT = "E8F5E9";
// ---- HELPERS ----
function heading1(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_1,
spacing: { before: 360, after: 120 },
border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: TEAL } },
children: [
new TextRun({
text,
bold: true,
color: WHITE,
size: 28,
font: "Calibri",
})
],
shading: { type: ShadingType.SOLID, color: TEAL, fill: TEAL }
});
}
function heading2(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_2,
spacing: { before: 280, after: 80 },
children: [
new TextRun({
text,
bold: true,
color: DARK_TEAL,
size: 24,
font: "Calibri",
})
],
border: { left: { style: BorderStyle.THICK, size: 16, color: ORANGE } },
indent: { left: 180 }
});
}
function heading3(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_3,
spacing: { before: 200, after: 60 },
children: [
new TextRun({
text,
bold: true,
color: ORANGE,
size: 22,
font: "Calibri",
underline: { type: UnderlineType.SINGLE }
})
]
});
}
function body(text, bold = false, italic = false, color = DARK_GRAY) {
return new Paragraph({
spacing: { after: 80 },
children: [
new TextRun({ text, bold, italic, color, size: 20, font: "Calibri" })
]
});
}
function bullet(text, level = 0, highlight = false) {
return new Paragraph({
bullet: { level },
spacing: { after: 60 },
shading: highlight ? { type: ShadingType.SOLID, color: YELLOW_HL, fill: YELLOW_HL } : undefined,
children: [
new TextRun({ text, size: 20, font: "Calibri", color: DARK_GRAY })
]
});
}
function keyPoint(label, value) {
return new Paragraph({
spacing: { after: 80 },
shading: { type: ShadingType.SOLID, color: LIGHT_TEAL, fill: LIGHT_TEAL },
children: [
new TextRun({ text: label + ": ", bold: true, color: DARK_TEAL, size: 20, font: "Calibri" }),
new TextRun({ text: value, size: 20, font: "Calibri", color: DARK_GRAY })
]
});
}
function formulaBox(text) {
return new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 120, after: 120 },
border: {
top: { style: BorderStyle.SINGLE, size: 4, color: TEAL },
bottom: { style: BorderStyle.SINGLE, size: 4, color: TEAL },
left: { style: BorderStyle.SINGLE, size: 4, color: TEAL },
right: { style: BorderStyle.SINGLE, size: 4, color: TEAL }
},
shading: { type: ShadingType.SOLID, color: LIGHT_TEAL, fill: LIGHT_TEAL },
children: [
new TextRun({ text, bold: true, color: DARK_TEAL, size: 22, font: "Courier New" })
]
});
}
function examTip(text) {
return new Paragraph({
spacing: { before: 100, after: 100 },
border: {
top: { style: BorderStyle.SINGLE, size: 4, color: ORANGE },
bottom: { style: BorderStyle.SINGLE, size: 4, color: ORANGE },
left: { style: BorderStyle.THICK, size: 16, color: ORANGE },
right: { style: BorderStyle.SINGLE, size: 4, color: ORANGE }
},
shading: { type: ShadingType.SOLID, color: LIGHT_ORANGE, fill: LIGHT_ORANGE },
children: [
new TextRun({ text: "EXAM TIP: ", bold: true, color: ORANGE, size: 20, font: "Calibri" }),
new TextRun({ text, size: 20, font: "Calibri", color: DARK_GRAY })
]
});
}
function spacer(lines = 1) {
return new Paragraph({ spacing: { after: lines * 100 }, children: [new TextRun("")] });
}
function pageBreakPara() {
return new Paragraph({ children: [new PageBreak()] });
}
// ---- TABLE BUILDER ----
function makeTable(headers, rows, colWidths, headerColor = TEAL) {
const headerCells = headers.map((h, i) =>
new TableCell({
width: { size: colWidths[i], type: WidthType.DXA },
shading: { type: ShadingType.SOLID, color: headerColor, fill: headerColor },
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: h, bold: true, color: WHITE, size: 18, font: "Calibri" })]
})]
})
);
const dataRows = rows.map((row, ri) =>
new TableRow({
children: row.map((cell, ci) =>
new TableCell({
width: { size: colWidths[ci], type: WidthType.DXA },
shading: { type: ShadingType.SOLID, color: ri % 2 === 0 ? WHITE : GRAY_BG, fill: ri % 2 === 0 ? WHITE : GRAY_BG },
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({
spacing: { after: 40, before: 40 },
children: [new TextRun({ text: cell, size: 18, font: "Calibri", color: DARK_GRAY })]
})]
})
)
})
);
return new Table({
width: { size: 9200, type: WidthType.DXA },
rows: [
new TableRow({ children: headerCells, tableHeader: true }),
...dataRows
]
});
}
// ===== DOCUMENT CONTENT =====
const coverSection = [
spacer(2),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { after: 160 },
shading: { type: ShadingType.SOLID, color: TEAL, fill: TEAL },
children: [
new TextRun({ text: "BIOCHEMISTRY PCT", bold: true, color: WHITE, size: 48, font: "Calibri" })
]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { after: 80 },
children: [
new TextRun({ text: "ORGAN FUNCTION TESTS", bold: true, color: DARK_TEAL, size: 40, font: "Calibri" })
]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { after: 80 },
children: [
new TextRun({ text: "COMPREHENSIVE EXAM STUDY GUIDE", bold: false, color: MED_GRAY, size: 26, font: "Calibri", italics: true })
]
}),
spacer(1),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { after: 60 },
border: { top: { style: BorderStyle.THICK, size: 8, color: ORANGE }, bottom: { style: BorderStyle.THICK, size: 8, color: ORANGE } },
shading: { type: ShadingType.SOLID, color: LIGHT_ORANGE, fill: LIGHT_ORANGE },
children: [
new TextRun({ text: "Topics: Kidney | Liver | Thyroid | Adrenal | Cardiac", bold: true, color: ORANGE, size: 22, font: "Calibri" })
]
}),
spacer(1),
new Paragraph({
alignment: AlignmentType.CENTER,
children: [
new TextRun({ text: "Source: Harper's Illustrated Biochemistry, 32nd Ed", italic: true, color: MED_GRAY, size: 18, font: "Calibri" })
]
}),
pageBreakPara()
];
// SECTION 1 - KIDNEY
const kidneySection = [
heading1("1. TESTS OF KIDNEY FUNCTION"),
spacer(),
heading2("Overview"),
body("The kidney is assessed through urinalysis, serum markers (urea, creatinine), protein excretion tests, and clearance studies. These tests detect early and late renal impairment."),
spacer(),
heading2("1.1 Urinalysis (Routine)"),
heading3("A. Physical Characteristics"),
makeTable(
["Parameter", "Normal", "Clinical Significance"],
[
["Volume", "1–2 L / 24 hr", "Polyuria (>3 L) in DM, DI; Oliguria (<400 mL) in AKI"],
["Colour", "Pale to dark yellow", "Dark: dehydration, bilirubinuria; Red: haematuria"],
["Appearance", "Clear", "Turbid: infection, crystals, protein"],
["Specific Gravity", "1.003 – 1.030", "Low: DI, renal tubular disease; High: dehydration, SIADH"],
["pH", "4.5 – 8.0", "Alkaline: UTI (urease-producing bacteria), RTA; Acidic: ketoacidosis"],
],
[2400, 2200, 4600]
),
spacer(),
heading3("B. Chemical Characteristics (Abnormal Constituents)"),
makeTable(
["Constituent", "Condition When Found"],
[
["Protein (Proteinuria)", "Nephrotic syndrome, diabetic nephropathy, glomerulonephritis"],
["Glucose (Glucosuria)", "Diabetes mellitus, renal tubular defects (renal glycosuria)"],
["Blood (Haematuria)", "Kidney stones, UTI, glomerulonephritis, malignancy"],
["Ketone bodies", "DKA, starvation, prolonged fasting"],
["Bile salts", "Obstructive jaundice"],
["Bile pigments (Bilirubin)", "Hepatocellular disease, obstructive jaundice"],
],
[3200, 6000]
),
spacer(),
examTip("These 6 abnormal urine constituents are high-yield MCQ material. Memorise the condition associated with each one."),
spacer(),
heading2("1.2 Serum Urea and Creatinine"),
body("Both increase as renal function declines, but creatinine is the preferred marker."),
makeTable(
["Marker", "Normal Range", "Specificity", "Limitations"],
[
["Serum Urea (BUN)", "2.5 – 7.5 mmol/L", "Low - affected by diet, hydration, catabolism, GI bleed", "Not specific to renal disease"],
["Serum Creatinine", "60 – 110 umol/L", "High - not affected by non-renal factors significantly", "Only rises after ~50% decline in GFR (poor sensitivity for early disease)"],
],
[2200, 1800, 2600, 2600]
),
spacer(),
examTip("Creatinine = more SPECIFIC; only rises after 50% GFR loss = poor SENSITIVITY for early detection. Both facts are commonly tested."),
spacer(),
heading2("1.3 Proteinuria"),
keyPoint("Normal protein excretion", "< 150 mg / 24 hours (below routine test detection limit)"),
keyPoint("Normal albumin excretion", "< 30 mg / 24 hours"),
keyPoint("Proteinuria defined as", "> 150 mg protein / 24 hours"),
keyPoint("Microalbuminuria", "30 – 300 mg albumin / 24 hours"),
spacer(),
body("Most common cause of proteinuria:"),
bullet("Loss of integrity of the glomerular basement membrane (GBM)"),
bullet("Called: Glomerular Proteinuria"),
bullet("Major protein lost: Albumin"),
bullet("Seen in: Nephrotic syndrome, Diabetic nephropathy"),
spacer(),
examTip("Microalbuminuria (30–300 mg/24hr) = EARLY MARKER of renal damage in Diabetes Mellitus. This is a classic exam question."),
spacer(),
heading2("1.4 Creatinine Clearance & GFR"),
body("Clearance = volume of plasma from which a compound is completely cleared by the kidney per unit time."),
spacer(),
formulaBox("Clearance (mL/min) = (U x V) / P"),
body("Where:"),
bullet("U = Urine concentration of analyte (from timed, usually 24-hr, sample)"),
bullet("P = Plasma concentration of analyte"),
bullet("V = Urine volume per minute = (24-hr urine volume) / (24 x 60)"),
spacer(),
makeTable(
["Compound", "GFR Marker?", "Why / Why Not"],
[
["Creatinine", "Yes (practical standard)", "Endogenous, constant levels, freely filtered. BUT slightly secreted by tubules -> slightly OVERESTIMATES GFR"],
["Inulin", "Yes (gold standard)", "Exogenous, meets all ideal criteria: constant blood level, freely filtered, NOT reabsorbed or secreted. Requires IV infusion - impractical for routine use"],
["Urea", "No", "Partially reabsorbed by tubules; variable blood levels depending on diet and catabolism"],
],
[2200, 2200, 4800]
),
spacer(),
examTip("Inulin clearance = GOLD STANDARD for GFR. Creatinine clearance = PRACTICAL standard but overestimates GFR (tubular secretion). Know the difference."),
spacer(),
pageBreakPara()
];
// SECTION 2 - LIVER
const liverSection = [
heading1("2. LIVER FUNCTION TESTS (LFTs)"),
spacer(),
body("LFTs are a panel of tests used for: diagnosis, assessing prognosis, and monitoring therapy of liver disease. Each test assesses a specific aspect of liver function."),
spacer(),
heading2("2.1 LFT Panel Overview"),
makeTable(
["Test", "What It Measures", "Elevated In", "Decreased In"],
[
["Serum Bilirubin (total)", "Bilirubin metabolism", "Jaundice (all types), haemolysis", "-"],
["Conjugated Bilirubin", "Hepatic conjugation + excretion", "Obstructive jaundice (mainly), hepatocellular disease", "-"],
["Unconjugated Bilirubin", "Pre-hepatic bilirubin load", "Haemolytic anaemia, hepatocellular disease", "-"],
["Total Protein", "Hepatic synthesis", "Acute phase (fibrinogen)", "Cirrhosis, chronic liver disease"],
["Albumin", "Hepatic synthesis (specific)", "Not usually elevated", "Chronic liver disease, cirrhosis, nephrotic syndrome"],
["Prothrombin Time (PT)", "Coagulation factor synthesis", "Prolonged in acute liver disorders", "-"],
["ALT (Alanine Aminotransferase)", "Hepatocyte integrity", "Acute viral hepatitis (very high), hepatocellular disease", "-"],
["AST (Aspartate Aminotransferase)", "Hepatocyte / muscle integrity", "Hepatitis, MI, skeletal muscle injury", "-"],
["Alkaline Phosphatase (ALP)", "Biliary canaliculi / bone", "Obstructive jaundice, bone disease", "-"],
],
[2200, 2200, 2800, 2000]
),
spacer(),
heading2("2.2 Bilirubin & Jaundice"),
makeTable(
["Type of Jaundice", "Primary Bilirubin Elevated", "Cause"],
[
["Pre-hepatic (Haemolytic)", "Unconjugated (indirect)", "Excess RBC destruction; liver conjugation overwhelmed"],
["Hepatocellular", "Both conjugated + unconjugated", "Impaired uptake, conjugation AND excretion (e.g. viral hepatitis, cirrhosis)"],
["Post-hepatic (Obstructive)", "Conjugated (direct)", "Bile duct obstruction (gallstones, carcinoma) -> backflow of conjugated bilirubin"],
],
[2600, 2800, 3800]
),
spacer(),
examTip("Obstructive jaundice = conjugated bilirubin. Haemolytic = unconjugated. Hepatocellular = BOTH. This pattern is a guaranteed exam topic."),
spacer(),
heading2("2.3 Aminotransferases - ALT vs AST"),
makeTable(
["Enzyme", "Organ Specificity", "When Elevated", "Exam Point"],
[
["ALT (SGPT)", "Liver-specific", "Acute viral hepatitis (rises before jaundice), hepatocellular disease", "More SPECIFIC for liver disease"],
["AST (SGOT)", "Liver + Heart + Skeletal muscle", "Hepatitis, myocardial infarction, skeletal muscle injury", "Less specific; elevated in cardiac/muscle damage too"],
],
[1800, 2400, 3000, 2000]
),
spacer(),
examTip("ALT is more SPECIFIC for liver disease. AST is elevated in MI and muscle injury too. ALT rises BEFORE jaundice in acute viral hepatitis."),
spacer(),
heading2("2.4 Alkaline Phosphatase (ALP)"),
bullet("Elevated in obstructive jaundice (biliary obstruction)"),
bullet("Also elevated in bone disease (not liver-specific)"),
bullet("To distinguish liver vs bone: measure GGT (elevated in liver disease, not bone) or ALP isoenzymes"),
spacer(),
examTip("ALP is elevated in BOTH obstructive jaundice and bone disease. Always think: is this liver ALP or bone ALP?"),
spacer(),
heading2("2.5 Albumin and Prothrombin Time"),
body("Both are markers of SYNTHETIC function of the liver:"),
bullet("Albumin: low in chronic liver disease (cirrhosis) - reflects prolonged hepatic synthetic failure"),
bullet("PT prolonged: in acute liver disorders - reflects failure to synthesise clotting factors (especially Factor VII, shortest half-life)"),
spacer(),
examTip("Albumin = CHRONIC disease marker. Prothrombin time = ACUTE disease marker. A common compare-and-contrast exam question."),
spacer(),
pageBreakPara()
];
// SECTION 3 - THYROID
const thyroidSection = [
heading1("3. THYROID FUNCTION TESTS"),
spacer(),
heading2("3.1 Thyroid Hormones"),
makeTable(
["Hormone", "Abbreviation", "Also Known As", "Iodine Atoms"],
[
["Thyroxine", "T4", "Tetraiodothyronine", "4"],
["Triiodothyronine", "T3", "Liothyronine", "3 (more potent/active form)"],
["Thyroid Stimulating Hormone", "TSH (Thyrotropin)", "Pituitary hormone (controls thyroid)", "-"],
],
[2500, 1800, 3000, 1900]
),
spacer(),
heading2("3.2 Thyroid Function Tests Panel"),
body("A clinical diagnosis of thyroid disorder is confirmed by:"),
bullet("Serum TSH (thyrotropin) - first-line, most sensitive test"),
bullet("Free T4 (fT4) - confirms hypo/hyperthyroidism"),
bullet("Free T3 (fT3) - when T3 thyrotoxicosis is suspected"),
spacer(),
body("Note: Total serum thyroxine is SELDOM measured now because:"),
bullet("TBG (thyroid-binding globulin) changes can alter total T4 without any true thyroid disease"),
bullet("Free hormone assays (fT4, fT3) are preferred because only free hormone is physiologically active"),
spacer(),
heading2("3.3 Interpretation of Thyroid Tests"),
makeTable(
["Condition", "TSH", "Free T4", "Free T3", "Notes"],
[
["Primary Hypothyroidism", "HIGH (up arrow)", "LOW", "LOW/Normal", "Thyroid gland failure; pituitary compensates by releasing more TSH"],
["Primary Hyperthyroidism", "LOW (down arrow)", "HIGH", "HIGH", "Excess thyroid hormone suppresses TSH"],
["Secondary Hypothyroidism", "LOW", "LOW", "LOW", "Pituitary failure (not enough TSH to drive thyroid)"],
["Secondary Hyperthyroidism", "HIGH", "HIGH", "HIGH", "Pituitary tumour secreting excess TSH"],
["Subclinical Hypothyroidism", "HIGH", "Normal", "Normal", "Early thyroid failure; fT4 still normal"],
],
[2200, 1400, 1400, 1400, 2800]
),
spacer(),
examTip("TSH is the MOST SENSITIVE thyroid function test. It changes before fT4 becomes abnormal. In primary disease, TSH and fT4 move in opposite directions."),
spacer(),
pageBreakPara()
];
// SECTION 4 - ADRENAL
const adrenalSection = [
heading1("4. ADRENAL FUNCTION TESTS"),
spacer(),
heading2("4.1 Overview"),
body("Adrenal function tests confirm:"),
bullet("Adrenal HYPERFUNCTION: Cushing Syndrome (excess cortisol)"),
bullet("Adrenal HYPOFUNCTION: Addison Disease (cortisol deficiency)"),
spacer(),
heading2("4.2 Cortisol Diurnal Variation"),
body("Cortisol secretion shows a characteristic diurnal (daily) rhythm:"),
makeTable(
["Time", "Cortisol Level", "Clinical Relevance"],
[
["Early morning (~8 AM)", "HIGHEST (peak)", "Normal diurnal peak"],
["Midnight", "LOWEST (nadir)", "Should be suppressed in normal individuals"],
],
[2800, 3000, 3400]
),
spacer(),
keyPoint("Key principle", "Loss of diurnal variation = EARLIEST sign of adrenal hyperfunction (Cushing syndrome)"),
spacer(),
examTip("Loss of diurnal cortisol variation (midnight cortisol not suppressed) is the EARLIEST sign of Cushing syndrome. Do not confuse with the dexamethasone test."),
spacer(),
heading2("4.3 Dexamethasone Suppression Test (DST)"),
body("Used to confirm Cushing Syndrome (adrenal hyperfunction):"),
spacer(),
makeTable(
["Step", "Action"],
[
["1. Baseline", "Measure serum cortisol at 8 AM"],
["2. Drug administration", "Give 1 mg dexamethasone (synthetic glucocorticoid) at midnight"],
["3. Post-test measurement", "Measure serum cortisol again at 8 AM next morning"],
["4. Interpretation (Normal)", "Cortisol SUPPRESSED below 50 nmol/L - negative test (no Cushing)"],
["5. Interpretation (Abnormal)", "Cortisol NOT suppressed - POSITIVE test = Cushing syndrome confirmed"],
],
[1800, 7400]
),
spacer(),
body("Mechanism: Dexamethasone acts on the pituitary to suppress ACTH. With less ACTH, the adrenal gland should produce less cortisol. In Cushing syndrome, cortisol secretion is autonomous and does not suppress."),
spacer(),
examTip("In the overnight DST: 1 mg dexamethasone at midnight -> check cortisol at 8 AM. Failure to suppress = Cushing syndrome."),
spacer(),
heading2("4.4 Addison Disease (Adrenal Hypofunction)"),
bullet("Primary adrenal insufficiency: adrenal cortex destruction (autoimmune, TB, haemorrhage)"),
bullet("Cortisol and aldosterone deficient"),
bullet("ACTH is HIGH (pituitary tries to stimulate a failing adrenal gland)"),
bullet("Diagnosis: Short Synacthen (ACTH stimulation) test - cortisol fails to rise after synthetic ACTH injection"),
spacer(),
examTip("Addison = HIGH ACTH + LOW cortisol. Cushing = LOW ACTH (if adrenal adenoma) or HIGH ACTH (if pituitary or ectopic). Know the ACTH levels!"),
spacer(),
pageBreakPara()
];
// SECTION 5 - CARDIAC
const cardiacSection = [
heading1("5. CARDIOVASCULAR RISK AND CARDIAC MARKERS"),
spacer(),
heading2("5.1 Cardiovascular Risk Markers"),
makeTable(
["Marker", "Measured By", "Purpose"],
[
["Total plasma cholesterol", "Direct colorimetric assay", "Overall lipid risk assessment"],
["HDL cholesterol", "After LDL precipitation with divalent cation", "Cardioprotective - higher is better"],
["LDL cholesterol", "Calculated (Friedewald) or direct measurement", "Primary atherogenic particle - lower is better"],
["LDL:HDL ratio", "Calculated from above", "Best index of atherosclerosis risk (see Chapter 25)"],
],
[2200, 3200, 3800]
),
spacer(),
heading2("5.2 Myocardial Infarction (MI) Markers"),
body("An ECG may not always show typical changes following MI. In such cases, serum biomarkers confirm the diagnosis:"),
spacer(),
makeTable(
["Biomarker", "Specificity", "Timing", "Notes"],
[
["Cardiac Troponin T or I", "Highly cardiac-specific", "Rises 3–6 hr; peaks 12–24 hr; stays elevated 10–14 days", "Gold standard for MI diagnosis; preferred over CK-MB"],
["Creatine Kinase-MB (CK-MB)", "Cardiac-specific isoenzyme", "Rises 3–6 hr; peaks 18–24 hr; returns to normal 2–3 days", "Useful when troponin unavailable; re-infarction monitoring"],
["Total CK", "Non-specific", "Rises early; non-specific", "Elevated in skeletal muscle injury too - avoid as sole marker"],
["LDH (Lactate Dehydrogenase)", "Non-specific (historical)", "Rises late (24–48 hr); peaks day 3–5", "No longer recommended for MI diagnosis"],
],
[2400, 2400, 2800, 1600]
),
spacer(),
examTip("Cardiac Troponin = GOLD STANDARD for MI. CK-MB = cardiac-specific but less sensitive than troponin. Total CK and LDH are non-specific and rarely used now."),
spacer(),
pageBreakPara()
];
// SECTION 6 - QUICK REVIEW TABLE
const quickReviewSection = [
heading1("6. QUICK REVIEW: ALL ORGAN FUNCTION TESTS AT A GLANCE"),
spacer(),
makeTable(
["Organ", "Key Tests", "Key Markers", "Must-Know Fact"],
[
["KIDNEY", "Urinalysis, Creatinine clearance", "Serum creatinine, Urea, Albumin", "Microalbuminuria (30–300 mg/24hr) = early DM renal damage"],
["KIDNEY", "GFR estimation", "Inulin (gold std), Creatinine (practical)", "Creatinine overestimates GFR; inulin = ideal but requires IV infusion"],
["LIVER", "LFT panel", "ALT, AST, ALP, Bilirubin, Albumin, PT", "ALT more specific for liver; rises before jaundice in hepatitis"],
["LIVER", "Bilirubin fractionation", "Conjugated vs Unconjugated", "Obstructive = conjugated; Haemolytic = unconjugated; Hepatocellular = both"],
["THYROID", "Thyroid panel", "TSH, Free T4, Free T3", "TSH = most sensitive first-line test"],
["THYROID", "Pattern recognition", "TSH vs fT4 relationship", "Primary disease: TSH and fT4 move in OPPOSITE directions"],
["ADRENAL", "Overnight DST", "Cortisol before/after 1 mg dexamethasone", "No suppression = Cushing syndrome"],
["ADRENAL", "Diurnal cortisol", "8 AM vs midnight cortisol", "Loss of diurnal variation = earliest Cushing sign"],
["CARDIAC", "Lipid profile", "LDL:HDL ratio", "LDL:HDL ratio = best atherosclerosis risk index"],
["CARDIAC", "MI biomarkers", "Troponin, CK-MB", "Troponin = gold standard; stays elevated longest (10–14 days)"],
],
[1600, 2200, 2400, 3000]
),
spacer(),
pageBreakPara()
];
// SECTION 7 - MCQ PRACTICE
const mcqSection = [
heading1("7. PRACTICE MCQ QUESTIONS"),
spacer(),
heading3("Q1. Which of the following is the BEST marker of early renal damage in a patient with Type 2 Diabetes?"),
bullet("A. Serum urea"),
bullet("B. Serum creatinine"),
bullet("C. Microalbuminuria"),
bullet("D. Creatinine clearance"),
new Paragraph({
spacing: { before: 80, after: 80 },
shading: { type: ShadingType.SOLID, color: GREEN_LIGHT, fill: GREEN_LIGHT },
children: [
new TextRun({ text: "Answer: C - Microalbuminuria (30–300 mg/24 hr) is the earliest marker of diabetic nephropathy. Serum creatinine only rises after ~50% GFR loss.", bold: false, color: "2E7D32", size: 20, font: "Calibri" })
]
}),
spacer(),
heading3("Q2. A patient has jaundice with predominantly elevated CONJUGATED bilirubin. What is the most likely cause?"),
bullet("A. Haemolytic anaemia"),
bullet("B. Gilbert syndrome"),
bullet("C. Common bile duct obstruction"),
bullet("D. Neonatal physiological jaundice"),
new Paragraph({
spacing: { before: 80, after: 80 },
shading: { type: ShadingType.SOLID, color: GREEN_LIGHT, fill: GREEN_LIGHT },
children: [
new TextRun({ text: "Answer: C - Obstructive (post-hepatic) jaundice causes backflow of conjugated bilirubin into the bloodstream. Haemolytic causes unconjugated elevation.", bold: false, color: "2E7D32", size: 20, font: "Calibri" })
]
}),
spacer(),
heading3("Q3. Which aminotransferase is MORE SPECIFIC for liver disease and WHY?"),
bullet("A. AST - because it is found only in liver cells"),
bullet("B. ALT - because it is elevated only in cardiac muscle injury"),
bullet("C. ALT - because it is not significantly elevated in cardiac or skeletal muscle injury"),
bullet("D. AST - because it rises before jaundice in hepatitis"),
new Paragraph({
spacing: { before: 80, after: 80 },
shading: { type: ShadingType.SOLID, color: GREEN_LIGHT, fill: GREEN_LIGHT },
children: [
new TextRun({ text: "Answer: C - ALT is more specific for liver disease because AST is also elevated in cardiac muscle (MI) and skeletal muscle injury, while ALT is not.", bold: false, color: "2E7D32", size: 20, font: "Calibri" })
]
}),
spacer(),
heading3("Q4. The overnight dexamethasone suppression test: 1 mg dexamethasone is given at midnight. What result CONFIRMS Cushing syndrome?"),
bullet("A. Cortisol suppressed below 50 nmol/L at 8 AM"),
bullet("B. Cortisol NOT suppressed at 8 AM"),
bullet("C. ACTH levels elevated at midnight"),
bullet("D. Loss of cortisol diurnal variation on repeat testing"),
new Paragraph({
spacing: { before: 80, after: 80 },
shading: { type: ShadingType.SOLID, color: GREEN_LIGHT, fill: GREEN_LIGHT },
children: [
new TextRun({ text: "Answer: B - Failure to suppress cortisol after dexamethasone confirms Cushing syndrome. Normal individuals suppress cortisol because dexamethasone inhibits pituitary ACTH release.", bold: false, color: "2E7D32", size: 20, font: "Calibri" })
]
}),
spacer(),
heading3("Q5. A patient presents with chest pain. ECG is inconclusive. Which blood test is the GOLD STANDARD for confirming myocardial infarction?"),
bullet("A. Serum LDH"),
bullet("B. Total CK"),
bullet("C. CK-MB"),
bullet("D. Cardiac Troponin"),
new Paragraph({
spacing: { before: 80, after: 80 },
shading: { type: ShadingType.SOLID, color: GREEN_LIGHT, fill: GREEN_LIGHT },
children: [
new TextRun({ text: "Answer: D - Cardiac Troponin (T or I) is the gold standard. It is highly specific and remains elevated for 10–14 days. CK-MB is cardiac-specific but less sensitive and used for re-infarction monitoring.", bold: false, color: "2E7D32", size: 20, font: "Calibri" })
]
}),
spacer(),
heading3("Q6. What is the ideal compound for measuring GFR and why is it not routinely used?"),
bullet("A. Creatinine - it is reabsorbed by tubules"),
bullet("B. Inulin - it must be infused intravenously"),
bullet("C. Urea - it is too readily filtered"),
bullet("D. Albumin - it is too large to be filtered"),
new Paragraph({
spacing: { before: 80, after: 80 },
shading: { type: ShadingType.SOLID, color: GREEN_LIGHT, fill: GREEN_LIGHT },
children: [
new TextRun({ text: "Answer: B - Inulin is the gold standard because it is freely filtered and neither reabsorbed nor secreted. However, it is exogenous and requires constant IV infusion, making it impractical for routine use.", bold: false, color: "2E7D32", size: 20, font: "Calibri" })
]
}),
spacer(),
];
// SECTION 8 - KEY FORMULAE
const formulaeSection = [
heading1("8. KEY FORMULAE & REFERENCE VALUES"),
spacer(),
heading2("Creatinine Clearance Formula"),
formulaBox("Clearance (mL/min) = (U x V) / P"),
bullet("U = Urinary analyte concentration (timed urine)"),
bullet("P = Plasma analyte concentration"),
bullet("V = Urine volume per minute = Total urine volume (mL) / 1440"),
spacer(),
heading2("Reference Values Summary"),
makeTable(
["Test", "Normal Value", "Flag"],
[
["Serum creatinine", "60 – 110 umol/L", "Elevated in renal failure"],
["Serum urea", "2.5 – 7.5 mmol/L", "Non-specific elevation"],
["Urine protein (24 hr)", "< 150 mg/24 hr", "Proteinuria if >150 mg"],
["Urine albumin (24 hr)", "< 30 mg/24 hr", "Microalbuminuria: 30–300 mg"],
["Serum albumin", "35 – 50 g/L", "Low in cirrhosis, nephrosis"],
["Serum ALT", "7 – 56 U/L", "Elevated in hepatocellular damage"],
["Serum ALP", "44 – 147 U/L", "Elevated in obstruction + bone disease"],
["Serum bilirubin (total)", "3 – 17 umol/L", "Jaundice > 34 umol/L"],
["TSH", "0.4 – 4.0 mIU/L", "Low in hyperthyroidism; High in hypothyroidism"],
["Morning cortisol (8 AM)", "200 – 700 nmol/L", "Loss of diurnal variation = Cushing"],
["Troponin I", "< 0.04 ng/mL", "Any elevation = suspect MI"],
],
[3000, 2600, 3600]
),
spacer(),
body("Source: Harper's Illustrated Biochemistry, 32nd Edition | Tietz Textbook of Laboratory Medicine, 7th Ed", false, true, MED_GRAY)
];
// ===== ASSEMBLE DOCUMENT =====
const doc = new Document({
creator: "Biochemistry PCT Study Guide Generator",
title: "Organ Function Tests - Biochemistry Study Guide",
description: "Comprehensive exam preparation guide for organ function tests",
styles: {
default: {
document: {
run: { font: "Calibri", size: 20, color: DARK_GRAY }
}
}
},
sections: [{
properties: {
page: {
margin: { top: 720, bottom: 720, left: 900, right: 900 }
}
},
headers: {
default: new Header({
children: [
new Paragraph({
border: { bottom: { style: BorderStyle.SINGLE, size: 4, color: TEAL } },
children: [
new TextRun({ text: "Biochemistry PCT | Organ Function Tests Study Guide", bold: true, color: TEAL, size: 18, font: "Calibri" }),
new TextRun({ text: " Page ", size: 18, font: "Calibri", color: MED_GRAY }),
new PageNumber()
]
})
]
})
},
footers: {
default: new Footer({
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
border: { top: { style: BorderStyle.SINGLE, size: 4, color: LIGHT_TEAL } },
children: [
new TextRun({ text: "Source: Harper's Illustrated Biochemistry 32nd Ed | Tietz Textbook of Laboratory Medicine 7th Ed", italic: true, color: MED_GRAY, size: 16, font: "Calibri" })
]
})
]
})
},
children: [
...coverSection,
...kidneySection,
...liverSection,
...thyroidSection,
...adrenalSection,
...cardiacSection,
...quickReviewSection,
...mcqSection,
...formulaeSection
]
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/organ-function-study-guide/Organ_Function_Tests_Study_Guide.docx', buffer);
console.log("Document created successfully!");
}).catch(err => {
console.error("Error:", err);
process.exit(1);
});
cd /home/daytona/workspace/organ-function-study-guide && node generate.js
node -e "const docx = require('docx'); console.log(Object.keys(docx).filter(k => k.toLowerCase().includes('page')).join('\n'));"
node -e "const { PageNumber } = require('docx'); console.log(typeof PageNumber); const p = new PageNumber(); console.log(p);"
node -e "const { PageNumberElement } = require('docx'); const p = new PageNumberElement(); console.log(p);"
~/organ-function-study-guide/generate.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/organ-function-study-guide/generate.js'
~/organ-function-study-guide/generate.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/organ-function-study-guide/generate.js'
cd /home/daytona/workspace/organ-function-study-guide && node generate.js
python /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/organ-function-study-guide/Organ_Function_Tests_Study_Guide.docx
python3 -c "import zipfile; z = zipfile.ZipFile('/home/daytona/workspace/organ-function-study-guide/Organ_Function_Tests_Study_Guide.docx'); print('Valid ZIP with files:'); print('\n'.join(z.namelist()[:10]))"
ls -lh /home/daytona/workspace/organ-function-study-guide/Organ_Function_Tests_Study_Guide.docx
Organ Function Tests Study Guide
Word Document · DOCX
| Section | Content |
|---|---|
| Cover Page | Title, topic overview, source attribution |
| 1. Kidney Function Tests | Urinalysis (physical + chemical), serum urea vs creatinine, proteinuria + microalbuminuria, clearance formula, inulin vs creatinine |
| 2. Liver Function Tests | Full LFT panel table, bilirubin fractionation by jaundice type, ALT vs AST comparison, ALP, albumin and PT as synthetic markers |
| 3. Thyroid Function Tests | T3/T4/TSH overview, test panel, interpretation table for all thyroid conditions |
| 4. Adrenal Function Tests | Cortisol diurnal variation, overnight dexamethasone suppression test (step-by-step), Addison vs Cushing comparison |
| 5. Cardiac Markers | Lipid risk profile, MI biomarkers (troponin, CK-MB, timing) |
| 6. Quick Review Table | All 5 organs - key tests, markers, and must-know facts in one table |
| 7. MCQ Practice | 6 exam-style questions with colour-coded answers |
| 8. Formulae + Reference Values | Creatinine clearance formula, normal ranges for all key tests |