Make a pdf on hydrocortisone,,, put the sources

Reading File
Reading File
Finding Sources
Searching PubMed

hydrocortisone clinical use

Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Finding Sources
Running Command

mkdir -p /tmp/workspace/hydrocortisone && ls /tmp/workspace/hydrocortisone/

Writing File

~/hydrocortisone/generate_pdf.py

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

OUTPUT_PATH = "/tmp/workspace/hydrocortisone/Hydrocortisone_Drug_Review.pdf"

# -- Document setup --
doc = SimpleDocTemplate(
    OUTPUT_PATH,
    pagesize=A4,
    rightMargin=2.2*cm,
    leftMargin=2.2*cm,
    topMargin=2.5*cm,
    bottomMargin=2.5*cm,
    title="Hydrocortisone – Comprehensive Drug Review",
    author="Orris Medical AI",
)

W = A4[0] - 4.4*cm   # usable width

# -- Colour palette --
NAVY    = colors.HexColor("#1A3A5C")
BLUE    = colors.HexColor("#2B6CB0")
LBLUE   = colors.HexColor("#EBF4FF")
TEAL    = colors.HexColor("#2C7A7B")
LTEAL   = colors.HexColor("#E6FFFA")
AMBER   = colors.HexColor("#C05621")
LGREY   = colors.HexColor("#F7FAFC")
GREY    = colors.HexColor("#718096")
RED     = colors.HexColor("#C53030")
LRED    = colors.HexColor("#FFF5F5")
GREEN   = colors.HexColor("#276749")
LGREEN  = colors.HexColor("#F0FFF4")

base = getSampleStyleSheet()

def S(name, **kw):
    s = ParagraphStyle(name, parent=base["Normal"], **kw)
    return s

# Styles
TITLE_S  = S("title_s",  fontSize=26, leading=32, textColor=NAVY,
             fontName="Helvetica-Bold", alignment=TA_CENTER, spaceAfter=4)
SUB_S    = S("sub_s",    fontSize=13, leading=16, textColor=TEAL,
             fontName="Helvetica-BoldOblique", alignment=TA_CENTER, spaceAfter=2)
DATE_S   = S("date_s",   fontSize=9, leading=12, textColor=GREY,
             alignment=TA_CENTER, spaceAfter=8)
H1       = S("h1",       fontSize=14, leading=18, textColor=NAVY,
             fontName="Helvetica-Bold", spaceBefore=14, spaceAfter=4)
H2       = S("h2",       fontSize=11, leading=14, textColor=BLUE,
             fontName="Helvetica-Bold", spaceBefore=8, spaceAfter=3)
BODY     = S("body",     fontSize=9.5, leading=14, textColor=colors.black,
             alignment=TA_JUSTIFY, spaceAfter=4)
SMALL    = S("small",    fontSize=8.5, leading=12, textColor=GREY,
             alignment=TA_JUSTIFY)
CITE     = S("cite",     fontSize=8, leading=11, textColor=GREY,
             fontName="Helvetica-Oblique", spaceAfter=2)
BOX_H    = S("box_h",    fontSize=9.5, leading=13, textColor=NAVY,
             fontName="Helvetica-Bold")
BOX_B    = S("box_b",    fontSize=9, leading=13, textColor=colors.black)
REF_NUM  = S("ref_num",  fontSize=8.5, leading=12, textColor=NAVY,
             fontName="Helvetica-Bold")
REF_B    = S("ref_b",    fontSize=8.5, leading=12, textColor=colors.black)

def hr(color=BLUE, thickness=0.7):
    return HRFlowable(width="100%", thickness=thickness, color=color, spaceAfter=4, spaceBefore=2)

def section_header(text):
    return [
        Spacer(1, 0.15*cm),
        Paragraph(text, H1),
        hr(),
    ]

def info_box(title, items, bg=LBLUE, title_color=BLUE):
    cell_data = [[Paragraph(title, S("bh", fontSize=9.5, leading=13,
                                     textColor=title_color, fontName="Helvetica-Bold"))]]
    for item in items:
        cell_data.append([Paragraph(item, BOX_B)])
    t = Table(cell_data, colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (0,0), bg),
        ("BACKGROUND", (0,1), (-1,-1), LGREY),
        ("BOX",        (0,0), (-1,-1), 0.5, BLUE),
        ("LINEBELOW",  (0,0), (-1,0),  0.5, BLUE),
        ("TOPPADDING", (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",(0,0),(-1,-1),4),
        ("LEFTPADDING",  (0,0),(-1,-1),7),
        ("RIGHTPADDING", (0,0),(-1,-1),7),
    ]))
    return [t, Spacer(1, 0.3*cm)]

def warning_box(title, items):
    return info_box(title, items, bg=LRED, title_color=RED)

def green_box(title, items):
    return info_box(title, items, bg=LGREEN, title_color=GREEN)

def teal_box(title, items):
    return info_box(title, items, bg=LTEAL, title_color=TEAL)

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

# ---- COVER ----
story.append(Spacer(1, 1.8*cm))
story.append(Paragraph("HYDROCORTISONE", TITLE_S))
story.append(Paragraph("A Comprehensive Drug Reference", SUB_S))
story.append(Spacer(1, 0.3*cm))
story.append(hr(TEAL, 1.5))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
    "Drug class: Glucocorticoid / Corticosteroid  |  INN: Hydrocortisone  |  CAS: 50-23-7",
    DATE_S))
story.append(Paragraph("Compiled from peer-reviewed medical textbooks and recent PubMed evidence  |  August 2026", DATE_S))
story.append(Spacer(1, 0.8*cm))

# Quick reference box
data = [
    [Paragraph("<b>Parameter</b>", BOX_H), Paragraph("<b>Details</b>", BOX_H)],
    [Paragraph("IUPAC Name", BODY),
     Paragraph("(11β)-11,17,21-trihydroxypregn-4-ene-3,20-dione", BODY)],
    [Paragraph("Molecular Formula", BODY), Paragraph("C₂₁H₃₀O₅  |  MW: 362.46 g/mol", BODY)],
    [Paragraph("Drug Class", BODY), Paragraph("Glucocorticoid (endogenous + synthetic)", BODY)],
    [Paragraph("Available Forms", BODY),
     Paragraph("PO (tablet), IV, IM, topical cream/ointment, rectal foam/enema, suppository", BODY)],
    [Paragraph("Brand Names", BODY),
     Paragraph("Solu-Cortef® (IV/IM), Cortef® (PO), Anucort-HC®, Cortenema®, Cortifoam®", BODY)],
    [Paragraph("Pregnancy Category", BODY), Paragraph("C (use with caution; dose increase needed in 3rd trimester)", BODY)],
    [Paragraph("Protein Binding", BODY), Paragraph("~90% (mainly to cortisol-binding globulin and albumin)", BODY)],
    [Paragraph("Half-life (plasma)", BODY), Paragraph("~90 minutes (biological effect lasts 8-12 h)", BODY)],
    [Paragraph("Metabolism", BODY), Paragraph("Hepatic (CYP3A4); renal excretion of metabolites", BODY)],
]
t = Table(data, colWidths=[0.32*W, 0.68*W])
t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0),  NAVY),
    ("TEXTCOLOR",     (0,0),(-1,0),  colors.white),
    ("ROWBACKGROUNDS",(0,1),(-1,-1), [LGREY, colors.white]),
    ("BOX",           (0,0),(-1,-1), 0.5, BLUE),
    ("GRID",          (0,0),(-1,-1), 0.25, colors.HexColor("#CBD5E0")),
    ("TOPPADDING",    (0,0),(-1,-1), 4),
    ("BOTTOMPADDING", (0,0),(-1,-1), 4),
    ("LEFTPADDING",   (0,0),(-1,-1), 7),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
]))
story.append(t)
story.append(Spacer(1, 0.5*cm))

# ---- 1. OVERVIEW ----
story += section_header("1.  Overview and Background")
story.append(Paragraph(
    "Hydrocortisone is the synthetic form of <b>cortisol</b>, the principal glucocorticoid secreted by the adrenal "
    "cortex. It is the prototypical corticosteroid against which the potency of all other glucocorticoids is "
    "benchmarked (relative potency = 1). Discovered in the 1940s, topical hydrocortisone was first introduced "
    "into dermatological practice by Sulzberger and Witten in 1952 for the treatment of eczematous eruptions. "
    "Today it remains an indispensable drug in endocrinology, critical care, dermatology, rheumatology, "
    "gastroenterology, and paediatrics.", BODY))
story.append(Paragraph(
    "The original topical glucocorticosteroid was hydrocortisone, the natural glucocorticosteroid of the "
    "adrenal cortex. The 9α-fluoro derivative was active topically but its salt-retaining properties made "
    "it undesirable even for topical use, leading to the development of newer synthetic congeners.", BODY))
story.append(Paragraph("<i>Sources: Dermatology 2-Volume Set 5e; Katzung's Basic and Clinical Pharmacology, 16th Ed.</i>", CITE))

# ---- 2. MECHANISM OF ACTION ----
story += section_header("2.  Mechanism of Action")
story.append(Paragraph(
    "Hydrocortisone acts primarily through the intracellular <b>glucocorticoid receptor (GR)</b>, a member of "
    "the nuclear receptor superfamily. On binding cortisol, the GR-ligand complex translocates to the nucleus, "
    "where it modulates gene transcription - upregulating anti-inflammatory genes (e.g., lipocortin-1/annexin-A1, "
    "IL-10) and downregulating pro-inflammatory cytokine genes (IL-1, IL-6, TNF-α, COX-2, iNOS) through direct "
    "DNA binding (transactivation) or inhibition of transcription factors such as NF-κB and AP-1 (transrepression).",
    BODY))
story.append(Paragraph(
    "It also binds <b>mineralocorticoid receptors (MR)</b> with approximately equal affinity to aldosterone at "
    "physiological concentrations, explaining its sodium-retaining properties at higher doses. "
    "Anti-mitotic effects on epidermal cells contribute to its activity in psoriasis and other "
    "hyperproliferative skin conditions.", BODY))
story.append(Paragraph(
    "Key downstream effects include:", BODY))

mech_items = [
    "Suppression of arachidonic acid cascade (phospholipase A2 inhibition via lipocortin)",
    "Inhibition of prostaglandin and leukotriene synthesis",
    "Decreased capillary permeability and vasoconstriction (topically)",
    "Inhibition of T-lymphocyte activation and cytokine release",
    "Stimulation of gluconeogenesis; protein catabolism; lipolysis",
    "Modulation of HPA axis via negative feedback on CRH and ACTH",
    "Permissive effects on catecholamine action (restores vascular tone in septic shock)",
]
for item in mech_items:
    story.append(Paragraph(f"• {item}", BODY))
story.append(Paragraph("<i>Sources: The Washington Manual of Medical Therapeutics; Katzung's Basic and Clinical Pharmacology, 16th Ed.</i>", CITE))

# ---- 3. PHARMACOKINETICS ----
story += section_header("3.  Pharmacokinetics")
pk_data = [
    [Paragraph("<b>Parameter</b>", BOX_H), Paragraph("<b>Value / Notes</b>", BOX_H)],
    [Paragraph("Absorption (PO)", BODY), Paragraph("Rapid and complete; peak plasma ~1 h", BODY)],
    [Paragraph("Bioavailability", BODY), Paragraph("~95% oral; 100% IV", BODY)],
    [Paragraph("Volume of Distribution", BODY), Paragraph("~40 L (extensively distributed to tissues)", BODY)],
    [Paragraph("Protein Binding", BODY), Paragraph("~90% (CBG ~75%, albumin ~15%); free fraction increases at high doses", BODY)],
    [Paragraph("Metabolism", BODY), Paragraph("Hepatic reduction and conjugation (inactive glucuronide/sulfate conjugates)", BODY)],
    [Paragraph("Plasma half-life", BODY), Paragraph("~90 min (IV); biological activity 8-12 h", BODY)],
    [Paragraph("Excretion", BODY), Paragraph("Renal (>90% as conjugated metabolites; <1% unchanged)", BODY)],
    [Paragraph("Topical absorption", BODY), Paragraph("Low with intact skin; enhanced by occlusion, thin skin, or inflamed areas", BODY)],
]
t = Table(pk_data, colWidths=[0.35*W, 0.65*W])
t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0),  BLUE),
    ("TEXTCOLOR",     (0,0),(-1,0),  colors.white),
    ("ROWBACKGROUNDS",(0,1),(-1,-1), [LGREY, colors.white]),
    ("BOX",           (0,0),(-1,-1), 0.5, BLUE),
    ("GRID",          (0,0),(-1,-1), 0.25, colors.HexColor("#CBD5E0")),
    ("TOPPADDING",    (0,0),(-1,-1), 4),
    ("BOTTOMPADDING", (0,0),(-1,-1), 4),
    ("LEFTPADDING",   (0,0),(-1,-1), 7),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
]))
story.append(t)
story.append(Spacer(1, 0.3*cm))

# ---- 4. RELATIVE POTENCY ----
story += section_header("4.  Relative Glucocorticoid Potency Comparison")
story.append(Paragraph(
    "Hydrocortisone serves as the reference standard (potency = 1) for comparing glucocorticoid agents. "
    "Mineralocorticoid (salt-retaining) activity is an important factor when choosing agents for replacement "
    "versus anti-inflammatory therapy.", BODY))

pot_data = [
    [Paragraph("<b>Drug</b>", BOX_H),
     Paragraph("<b>Anti-inflammatory potency</b>", BOX_H),
     Paragraph("<b>Mineralocorticoid potency</b>", BOX_H),
     Paragraph("<b>Equivalent dose</b>", BOX_H)],
    [Paragraph("Hydrocortisone", BODY), Paragraph("1", BODY), Paragraph("1", BODY), Paragraph("20 mg", BODY)],
    [Paragraph("Cortisone acetate", BODY), Paragraph("0.8", BODY), Paragraph("0.8", BODY), Paragraph("25 mg", BODY)],
    [Paragraph("Prednisolone", BODY), Paragraph("4-5", BODY), Paragraph("0.25", BODY), Paragraph("4 mg", BODY)],
    [Paragraph("Prednisone", BODY), Paragraph("4", BODY), Paragraph("0.3", BODY), Paragraph("4 mg", BODY)],
    [Paragraph("Methylprednisolone", BODY), Paragraph("5", BODY), Paragraph("0", BODY), Paragraph("4 mg", BODY)],
    [Paragraph("Dexamethasone", BODY), Paragraph("25", BODY), Paragraph("0", BODY), Paragraph("0.75 mg", BODY)],
    [Paragraph("Fludrocortisone", BODY), Paragraph("10", BODY), Paragraph("125-150", BODY), Paragraph("- (mineralocorticoid)", BODY)],
]
t = Table(pot_data, colWidths=[0.28*W, 0.22*W, 0.22*W, 0.28*W])
t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0),  TEAL),
    ("TEXTCOLOR",     (0,0),(-1,0),  colors.white),
    ("ROWBACKGROUNDS",(0,1),(-1,-1), [LGREY, colors.white]),
    ("BOX",           (0,0),(-1,-1), 0.5, TEAL),
    ("GRID",          (0,0),(-1,-1), 0.25, colors.HexColor("#CBD5E0")),
    ("TOPPADDING",    (0,0),(-1,-1), 4),
    ("BOTTOMPADDING", (0,0),(-1,-1), 4),
    ("LEFTPADDING",   (0,0),(-1,-1), 7),
    ("ALIGN",         (1,0),(-1,-1), "CENTER"),
]))
story.append(t)
story.append(Paragraph(
    "<i>Equipotency guide: 1 mg hydrocortisone ≈ 1.6 mg cortisone acetate ≈ 0.2 mg prednisolone ≈ 0.25 mg prednisone "
    "≈ 0.025 mg dexamethasone.</i>", CITE))
story.append(Paragraph(
    "<i>Sources: The Washington Manual of Medical Therapeutics; Harrison's Principles of Internal Medicine 22E (2025).</i>", CITE))

# ---- 5. INDICATIONS ----
story += section_header("5.  Indications and Clinical Uses")

story.append(Paragraph("<b>5.1  Endocrine / Adrenal Disorders</b>", H2))
story.append(Paragraph(
    "<b>Primary adrenal insufficiency (Addison disease)</b> and <b>secondary adrenal insufficiency</b> are the "
    "most evidence-based indications for hydrocortisone replacement. The physiological daily cortisol production "
    "is typically replaced by 15-25 mg hydrocortisone in two to three divided doses, with at least half the dose "
    "given upon awakening.", BODY))
story.append(Paragraph(
    "Congenital adrenal hyperplasia (CAH): modified-release hydrocortisone preparations mimic the endogenous "
    "cortisol circadian rhythm, allowing lower total daily doses while adequately suppressing ACTH and "
    "adrenal androgen excess.", BODY))
story.append(Paragraph("<i>Source: Harrison's Principles of Internal Medicine 22E (2025), p. 3113.</i>", CITE))

story.append(Paragraph("<b>5.2  Critical Care - Septic Shock</b>", H2))
story.append(Paragraph(
    "Low-dose hydrocortisone (200-300 mg/day IV, typically 50 mg q6h or 200 mg continuous infusion) is used "
    "in vasopressor-dependent septic shock. Multiple RCTs and meta-analyses show reduced time to vasopressor "
    "withdrawal and shorter duration of shock, though overall 90-day mortality benefit remains debated. "
    "The combination of <b>hydrocortisone + fludrocortisone</b> (APROCCHSS regimen) showed a mortality benefit "
    "in the APROCCHSS trial, supported by a 2024 network meta-analysis (PMID 38271488).", BODY))
story.append(Paragraph(
    "A 2024 patient-level meta-analysis (PMID 38320130, NEJM Evidence) of low-dose hydrocortisone in septic "
    "shock confirmed reduction in vasopressor duration. The 2025 Zonghua ICU meta-analysis (PMID 40820529) "
    "likewise supports hydrocortisone for severe community-acquired pneumonia.", BODY))
story.append(Paragraph("<i>Sources: Sabiston Textbook of Surgery; Current Surgical Therapy 14e; Mulholland and Greenfield's Surgery 7e; PubMed PMID 38271488, 38320130, 39192056.</i>", CITE))

story.append(Paragraph("<b>5.3  Dermatology</b>", H2))
story.append(Paragraph(
    "Topical hydrocortisone 1% and 2.5% are the lowest-potency glucocorticoid preparations and are widely "
    "used for mild eczema, contact dermatitis, intertrigo, seborrhoeic dermatitis, and nappy rash. "
    "Due to its low potency and short-term safety profile, 1% hydrocortisone is available OTC in many countries. "
    "It is preferred over higher-potency steroids on the face, skin folds, and in infants.", BODY))
story.append(Paragraph("<i>Sources: Dermatology 2-Volume Set 5e; Fitzpatrick's Dermatology; Tintinalli's Emergency Medicine; Katzung's Basic and Clinical Pharmacology 16th Ed.</i>", CITE))

story.append(Paragraph("<b>5.4  Gastroenterology</b>", H2))
story.append(Paragraph(
    "Rectal formulations (hydrocortisone enema 100 mg, foam, suppositories) are used for mild-to-moderate "
    "distal ulcerative colitis and proctitis. These provide high local drug concentrations with reduced "
    "systemic exposure compared to oral steroids.", BODY))
story.append(Paragraph("<i>Source: Lippincott Illustrated Reviews - Pharmacology; Goodman &amp; Gilman's Pharmacological Basis of Therapeutics.</i>", CITE))

story.append(Paragraph("<b>5.5  Perioperative / Stress Dosing</b>", H2))
story.append(Paragraph(
    "Patients on chronic corticosteroids or with known adrenal insufficiency require <b>stress-dose "
    "hydrocortisone</b> during surgery or significant physiological stress. A standard regimen is "
    "100 mg IV bolus on the morning of major surgery, followed by 100 mg IV/IM every 6-8 hours "
    "for 24 hours, tapering to baseline over 1-3 days depending on the type and extent of surgery.", BODY))
story.append(Paragraph("<i>Sources: Barash's Clinical Anesthesia 9e; Mulholland and Greenfield's Surgery 7e; Bailey &amp; Love's Short Practice of Surgery 28th Ed.</i>", CITE))

story.append(Paragraph("<b>5.6  Other Indications</b>", H2))
indications_other = [
    "Acute allergic reactions / anaphylaxis adjunct (IV hydrocortisone 100-200 mg)",
    "Acute severe asthma and COPD exacerbations (IV/oral, short course)",
    "Inflammatory bowel disease (systemic, induction of remission)",
    "Immune thrombocytopenia and autoimmune haemolytic anaemia",
    "Rheumatological conditions (RA, SLE, vasculitis) - short-term bridging",
    "Neonatal adrenal insufficiency and bronchopulmonary dysplasia prevention (BPD) in very preterm neonates (PMID 38237961)",
    "Concomitant use during amphotericin B infusion to reduce infusion-related reactions (fever, chills, rigors)",
    "Ophthalmology: topical hydrocortisone/neomycin combinations for anterior segment inflammation",
]
for item in indications_other:
    story.append(Paragraph(f"• {item}", BODY))
story.append(Spacer(1, 0.2*cm))

# ---- 6. DOSING ----
story += section_header("6.  Dosing Guidelines")

dose_data = [
    [Paragraph("<b>Indication</b>", BOX_H),
     Paragraph("<b>Route</b>", BOX_H),
     Paragraph("<b>Dose</b>", BOX_H),
     Paragraph("<b>Duration / Notes</b>", BOX_H)],
    [Paragraph("Acute adrenal crisis", BODY), Paragraph("IV/IM", BODY),
     Paragraph("100 mg IV bolus, then 200 mg/24 h CI or 50 mg q6h", BODY),
     Paragraph("Until haemodynamically stable; convert to oral when tolerating", BODY)],
    [Paragraph("Chronic adrenal insufficiency", BODY), Paragraph("PO", BODY),
     Paragraph("15-25 mg/day in 2-3 divided doses", BODY),
     Paragraph("Lifelong; double dose with intercurrent illness or fever", BODY)],
    [Paragraph("Septic shock", BODY), Paragraph("IV", BODY),
     Paragraph("200 mg/day CI or 50 mg q6h (± fludrocortisone 50 µg/day)", BODY),
     Paragraph("5-7 days; taper when vasopressors weaned", BODY)],
    [Paragraph("Perioperative stress", BODY), Paragraph("IV/IM", BODY),
     Paragraph("100 mg on day of surgery; 100 mg q6-8h for 24 h", BODY),
     Paragraph("Taper to baseline over 1-3 days", BODY)],
    [Paragraph("Topical (mild eczema)", BODY), Paragraph("Topical", BODY),
     Paragraph("1-2.5% cream/ointment applied 1-2x/day", BODY),
     Paragraph("Limit to 2-4 weeks on face; avoid occlusion", BODY)],
    [Paragraph("Rectal (distal UC)", BODY), Paragraph("Rectal", BODY),
     Paragraph("Enema 100 mg nightly; suppository 25 mg 2-3x/day", BODY),
     Paragraph("4-8 weeks; reassess", BODY)],
    [Paragraph("CAH (paediatric)", BODY), Paragraph("PO", BODY),
     Paragraph("10-15 mg/m² BSA/day in 3 divided doses", BODY),
     Paragraph("Lifelong; monitor 17-OHP and growth velocity", BODY)],
    [Paragraph("Pregnancy (3rd trimester)", BODY), Paragraph("PO", BODY),
     Paragraph("Increase dose by ~50%", BODY),
     Paragraph("Due to increased CBG and placental metabolism", BODY)],
]
t = Table(dose_data, colWidths=[0.21*W, 0.10*W, 0.36*W, 0.33*W])
t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0),  NAVY),
    ("TEXTCOLOR",     (0,0),(-1,0),  colors.white),
    ("ROWBACKGROUNDS",(0,1),(-1,-1), [LGREY, colors.white]),
    ("BOX",           (0,0),(-1,-1), 0.5, BLUE),
    ("GRID",          (0,0),(-1,-1), 0.25, colors.HexColor("#CBD5E0")),
    ("TOPPADDING",    (0,0),(-1,-1), 4),
    ("BOTTOMPADDING", (0,0),(-1,-1), 4),
    ("LEFTPADDING",   (0,0),(-1,-1), 6),
    ("VALIGN",        (0,0),(-1,-1), "TOP"),
]))
story.append(t)
story.append(Paragraph("<i>Sources: Harrison's Principles of Internal Medicine 22E; ROSEN's Emergency Medicine; Bailey &amp; Love's Surgery 28th Ed.; Barash's Clinical Anesthesia 9e.</i>", CITE))

# ---- 7. ADVERSE EFFECTS ----
story += section_header("7.  Adverse Effects")
story.append(Paragraph(
    "Adverse effects are dose- and duration-dependent. They are generally seen with doses equivalent to "
    ">10 mg/day prednisolone (or >50 mg/day hydrocortisone) for extended periods. Short-term use at "
    "physiological replacement doses carries minimal risk.", BODY))

ae_data = [
    [Paragraph("<b>System</b>", BOX_H), Paragraph("<b>Adverse Effect</b>", BOX_H)],
    [Paragraph("Endocrine / Metabolic", BODY),
     Paragraph("Hyperglycaemia, weight gain, Cushing syndrome (moon face, buffalo hump, striae), "
               "adrenal suppression (HPA axis), dyslipidaemia, growth suppression (paediatric)", BODY)],
    [Paragraph("Musculoskeletal", BODY),
     Paragraph("Osteoporosis, proximal myopathy (non-tender; CK normal), avascular necrosis "
               "(femoral head, humeral head, tibial plateau)", BODY)],
    [Paragraph("Cardiovascular", BODY),
     Paragraph("Hypertension (sodium and water retention at higher doses), hypokalaemia, oedema", BODY)],
    [Paragraph("Immunological", BODY),
     Paragraph("Increased susceptibility to infections; reactivation of latent TB, herpes; "
               "opportunistic infections (Pneumocystis jirovecii at doses ≥20 mg/day prednisolone >1 month)", BODY)],
    [Paragraph("Ophthalmological", BODY),
     Paragraph("Posterior subcapsular cataracts, raised intraocular pressure / glaucoma", BODY)],
    [Paragraph("Dermatological", BODY),
     Paragraph("Skin atrophy (thinning, telangiectasia), acne, purpura, striae, hypopigmentation (topical); "
               "delayed wound healing", BODY)],
    [Paragraph("Psychiatric", BODY),
     Paragraph("Euphoria, insomnia, anxiety; severe depression or psychosis (steroid psychosis) at high doses", BODY)],
    [Paragraph("GI", BODY),
     Paragraph("Peptic ulceration (risk increased with concurrent NSAIDs), nausea, pancreatitis (rare)", BODY)],
    [Paragraph("Withdrawal", BODY),
     Paragraph("Adrenal insufficiency on abrupt cessation after prolonged use; fatigue, hypotension, "
               "hypoglycaemia; must taper slowly", BODY)],
]
t = Table(ae_data, colWidths=[0.22*W, 0.78*W])
t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0),  RED),
    ("TEXTCOLOR",     (0,0),(-1,0),  colors.white),
    ("ROWBACKGROUNDS",(0,1),(-1,-1), [LRED, colors.white]),
    ("BOX",           (0,0),(-1,-1), 0.5, RED),
    ("GRID",          (0,0),(-1,-1), 0.25, colors.HexColor("#FEB2B2")),
    ("TOPPADDING",    (0,0),(-1,-1), 4),
    ("BOTTOMPADDING", (0,0),(-1,-1), 4),
    ("LEFTPADDING",   (0,0),(-1,-1), 7),
    ("VALIGN",        (0,0),(-1,-1), "TOP"),
]))
story.append(t)
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
    "<b>Osteoporosis prevention:</b> Start calcium 1-1.5 g/day + vitamin D 1000 IU/day as soon as steroid "
    "therapy begins. Consider bisphosphonates for patients on >7.5 mg/day prednisone-equivalent for >3 months. "
    "Bone mineral density should be assessed in patients on supraphysiologic doses (≥30 mg hydrocortisone equivalent/day).",
    BODY))
story.append(Paragraph("<i>Sources: The Washington Manual of Medical Therapeutics; Harrison's Principles of Internal Medicine 22E.</i>", CITE))

# ---- 8. CONTRAINDICATIONS & PRECAUTIONS ----
story += section_header("8.  Contraindications and Precautions")

story.append(Paragraph("<b>Absolute Contraindications (systemic use):</b>", H2))
ci = [
    "Systemic fungal infections (except adrenal insufficiency with concurrent antifungal coverage)",
    "Known hypersensitivity to hydrocortisone or excipients",
    "Live vaccines in immunosuppressed patients",
]
for item in ci:
    story.append(Paragraph(f"• {item}", BODY))

story.append(Paragraph("<b>Precautions / Use with Care:</b>", H2))
prec = [
    "Diabetes mellitus (monitor blood glucose closely; insulin dose adjustment required)",
    "Hypertension and heart failure (fluid retention, sodium loading)",
    "Active or latent tuberculosis, untreated fungal infections, strongyloidiasis",
    "Osteoporosis (prophylaxis mandatory for prolonged courses)",
    "Peptic ulcer disease (especially if combining with NSAIDs or anticoagulants)",
    "Psychiatric history (risk of steroid psychosis; use lowest effective dose)",
    "Pregnancy (generally safe in physiological doses; high doses cross placenta)",
    "Paediatrics (risk of growth suppression; use lowest effective dose and monitor growth velocity)",
    "Avoid abrupt discontinuation after >3 weeks of therapy - must taper",
]
for item in prec:
    story.append(Paragraph(f"• {item}", BODY))
story.append(Spacer(1, 0.2*cm))

# ---- 9. DRUG INTERACTIONS ----
story += section_header("9.  Drug Interactions")
di_data = [
    [Paragraph("<b>Interacting Drug/Class</b>", BOX_H), Paragraph("<b>Mechanism / Effect</b>", BOX_H), Paragraph("<b>Management</b>", BOX_H)],
    [Paragraph("NSAIDs (e.g., ibuprofen, aspirin)", BODY),
     Paragraph("Additive GI ulceration risk", BODY),
     Paragraph("Avoid combination or use PPI cover", BODY)],
    [Paragraph("CYP3A4 inducers (rifampicin, phenytoin, carbamazepine)", BODY),
     Paragraph("Increased hydrocortisone metabolism → reduced effect", BODY),
     Paragraph("Increase hydrocortisone dose; monitor efficacy", BODY)],
    [Paragraph("CYP3A4 inhibitors (ketoconazole, ritonavir)", BODY),
     Paragraph("Decreased hydrocortisone clearance → Cushingoid features", BODY),
     Paragraph("Reduce dose; monitor for toxicity", BODY)],
    [Paragraph("Antidiabetics (insulin, oral hypoglycaemics)", BODY),
     Paragraph("Glucocorticoids elevate blood glucose", BODY),
     Paragraph("Increase antidiabetic dosing; frequent monitoring", BODY)],
    [Paragraph("Diuretics (loop/thiazide)", BODY),
     Paragraph("Additive hypokalaemia", BODY),
     Paragraph("Monitor electrolytes; K+ supplementation if needed", BODY)],
    [Paragraph("Live vaccines", BODY),
     Paragraph("Immunosuppression → risk of disseminated vaccine-strain infection", BODY),
     Paragraph("Avoid live vaccines during immunosuppressive dosing", BODY)],
    [Paragraph("Anticoagulants (warfarin)", BODY),
     Paragraph("Unpredictable INR changes (typically increases bleed risk)", BODY),
     Paragraph("More frequent INR monitoring", BODY)],
    [Paragraph("Amphotericin B", BODY),
     Paragraph("Hydrocortisone pre-treatment reduces infusion reactions", BODY),
     Paragraph("Often co-administered intentionally", BODY)],
]
t = Table(di_data, colWidths=[0.28*W, 0.38*W, 0.34*W])
t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0),  AMBER),
    ("TEXTCOLOR",     (0,0),(-1,0),  colors.white),
    ("ROWBACKGROUNDS",(0,1),(-1,-1), [colors.HexColor("#FFFAF0"), colors.white]),
    ("BOX",           (0,0),(-1,-1), 0.5, AMBER),
    ("GRID",          (0,0),(-1,-1), 0.25, colors.HexColor("#FEEBC8")),
    ("TOPPADDING",    (0,0),(-1,-1), 4),
    ("BOTTOMPADDING", (0,0),(-1,-1), 4),
    ("LEFTPADDING",   (0,0),(-1,-1), 6),
    ("VALIGN",        (0,0),(-1,-1), "TOP"),
]))
story.append(t)
story.append(Spacer(1, 0.2*cm))

# ---- 10. SPECIAL POPULATIONS ----
story += section_header("10.  Special Populations")

story.append(Paragraph("<b>Pregnancy:</b>", H2))
story.append(Paragraph(
    "Hydrocortisone is the preferred glucocorticoid replacement in pregnancy because it is largely inactivated "
    "by placental 11β-hydroxysteroid dehydrogenase type 2, limiting fetal exposure. Doses should be increased by "
    "approximately 50% in the third trimester due to increased cortisol-binding globulin levels and enhanced "
    "placental metabolism.", BODY))

story.append(Paragraph("<b>Paediatrics:</b>", H2))
story.append(Paragraph(
    "Hydrocortisone is the corticosteroid of choice for adrenal insufficiency and CAH in children, dosed at "
    "10-15 mg/m² BSA/day. Growth velocity must be monitored carefully. Modified-release formulations are "
    "promising for reducing total daily dose while achieving effective adrenal suppression in CAH. "
    "For BPD prevention in very preterm neonates, a 2024 meta-analysis (PMID 38237961) supports early "
    "hydrocortisone use; a 2025 systematic review (PMID 40144277) guides timing of hydrocortisone in neonatal shock.", BODY))

story.append(Paragraph("<b>Hepatic impairment:</b>", H2))
story.append(Paragraph(
    "Conversion of cortisone to active cortisol (and metabolism of hydrocortisone) is partly hepatic. "
    "Severe liver disease may alter pharmacokinetics; monitor for increased or decreased effect.", BODY))

story.append(Paragraph("<b>Renal impairment:</b>", H2))
story.append(Paragraph(
    "Renal excretion of conjugated metabolites; severe renal impairment may increase exposure. "
    "However, hydrocortisone is not renally cleared significantly in active form; dose adjustment is "
    "not routinely required for replacement dosing.", BODY))

# ---- 11. MONITORING ----
story += section_header("11.  Monitoring Parameters")
mon = [
    "Blood glucose (especially in diabetic patients or high doses)",
    "Blood pressure and body weight",
    "Serum electrolytes: sodium, potassium (risk of hypokalaemia and fluid retention)",
    "Bone mineral density (patients on >3 months supraphysiologic doses)",
    "Adrenal function: plasma ACTH, serum cortisol day curves (replacement quality)",
    "Growth velocity and bone age in paediatric patients",
    "Ophthalmological review (IOP, lens) for prolonged systemic use",
    "Screen for adrenal autoantibodies; thyroid function (primary AI)",
    "Signs of infection (be vigilant as fever may be partially masked)",
    "Psychiatric symptoms / mood changes",
    "HbA1c in patients on chronic therapy",
]
for item in mon:
    story.append(Paragraph(f"• {item}", BODY))
story.append(Paragraph("<i>Source: Harrison's Principles of Internal Medicine 22E; Goldman-Cecil Medicine International Ed.</i>", CITE))

# ---- 12. CLINICAL PEARLS ----
story += section_header("12.  Clinical Pearls")
pearls = [
    "Never delay treatment of suspected adrenal crisis to await confirmatory testing - draw cortisol, then give hydrocortisone 100 mg IV immediately.",
    "Sick-day rules: all patients with adrenal insufficiency should double their oral hydrocortisone dose with febrile illness; inject 100 mg IM if vomiting prevents oral intake.",
    "Stress-dose hydrocortisone at high doses (>50 mg/day) provides adequate mineralocorticoid cover - fludrocortisone is not required until hydrocortisone dose falls below ~50 mg/day.",
    "Modified-release hydrocortisone (Plenadren, Chronocort) achieves closer mimicry of physiological cortisol secretion and is associated with improved metabolic profiles compared to standard immediate-release preparations.",
    "Topical hydrocortisone 1% is the safest topical corticosteroid; 2.5% is available by prescription. Unlike higher-potency steroids, it can be used cautiously on the face and in skin folds.",
    "In septic shock, the 2024 APROCCHSS network meta-analysis (PMID 38271488) found combination hydrocortisone + fludrocortisone superior to hydrocortisone alone for reducing 90-day mortality.",
    "Hydrocortisone at physiological doses does NOT meaningfully suppress the immune system - only supraphysiological doses carry infection risk.",
    "Etomidate used for rapid-sequence intubation can cause adrenal suppression; consider hydrocortisone coverage in septic patients intubated with etomidate (CORTICUS substudy evidence).",
]
for i, pearl in enumerate(pearls, 1):
    story.append(Paragraph(f"<b>{i}.</b>  {pearl}", BODY))
story.append(Spacer(1, 0.2*cm))

# ---- 13. RECENT EVIDENCE ----
story += section_header("13.  Recent Evidence Summary (PubMed 2023-2025)")
evidence = [
    ("PMID 38271488 [2024] — Systematic Review / Network Meta-Analysis",
     "Am J Respir Crit Care Med",
     "Teja B et al. Fludrocortisone + hydrocortisone superior to hydrocortisone alone for 90-day mortality "
     "in septic shock (network meta-analysis of RCTs)."),
    ("PMID 38320130 [2023] — Patient-Level Meta-Analysis",
     "NEJM Evidence",
     "Pirracchio R et al. Low-dose hydrocortisone in septic shock associated with reduction in vasopressor "
     "duration; patient-level pooled analysis."),
    ("PMID 39192056 [2025] — Systematic Review & Meta-Analysis",
     "Infection",
     "Wu JY et al. Hydrocortisone-fludrocortisone combination reduces hospital mortality in septic shock "
     "vs hydrocortisone alone."),
    ("PMID 39612454 [2024] — Systematic Review & Meta-Analysis",
     "Medicine",
     "Song B et al. Early use of low-dose hydrocortisone reduces in-hospital mortality in septic shock."),
    ("PMID 38237961 [2024] — Meta-Analysis",
     "Arch Dis Child Fetal Neonatal Ed",
     "De Luca D et al. Hydrocortisone in very preterm neonates for BPD prevention; meta-analysis "
     "with effect size modifiers."),
    ("PMID 40144277 [2025] — Systematic Review",
     "Front Pediatrics",
     "Ramaswamy VV et al. Timing of hydrocortisone therapy in neonates with shock; systematic review, "
     "meta-analysis, and clinical practice guideline."),
    ("PMID 40820529 [2025] — Meta-Analysis",
     "Zhonghua Wei Zhong Bing Ji Jiu Yi Xue",
     "Gu X et al. Hydrocortisone in treatment of severe community-acquired pneumonia; meta-analysis."),
    ("PMID 35465689 [2023] — Systematic Review",
     "J Pharmacy Practice",
     "Wang K et al. HAT protocol (hydrocortisone + ascorbic acid + thiamine) in sepsis and septic shock; "
     "systematic review."),
]
for pmid_str, journal, summary in evidence:
    story.append(Paragraph(f"<b>{pmid_str}</b>", REF_NUM))
    story.append(Paragraph(f"<i>{journal}:</i>  {summary}", BODY))
    story.append(Spacer(1, 0.1*cm))

# ---- 14. REFERENCES ----
story.append(PageBreak())
story += section_header("14.  References and Sources")

story.append(Paragraph("<b>Medical Textbooks</b>", H2))
refs_books = [
    "Harrison's Principles of Internal Medicine, 22nd Edition (2025). McGraw-Hill Medical.",
    "The Washington Manual of Medical Therapeutics. Wolters Kluwer.",
    "Katzung's Basic and Clinical Pharmacology, 16th Edition. McGraw-Hill.",
    "Goodman & Gilman's The Pharmacological Basis of Therapeutics, 14th Edition. McGraw-Hill.",
    "Lippincott Illustrated Reviews: Pharmacology. Wolters Kluwer.",
    "ROSEN's Emergency Medicine: Concepts and Clinical Practice. Elsevier.",
    "Goldman-Cecil Medicine International Edition, 2-Volume Set. Elsevier.",
    "Sabiston Textbook of Surgery: The Biological Basis of Modern Surgical Practice. Elsevier.",
    "Mulholland and Greenfield's Surgery: Scientific Principles and Practice, 7th Edition. Wolters Kluwer.",
    "Current Surgical Therapy, 14th Edition. Elsevier.",
    "Bailey and Love's Short Practice of Surgery, 28th Edition. CRC Press.",
    "Barash, Cullen, and Stoelting's Clinical Anesthesia, 9th Edition. Wolters Kluwer.",
    "Dermatology: 2-Volume Set, 5th Edition. Elsevier.",
    "Fitzpatrick's Dermatology, 9th Edition. McGraw-Hill.",
    "Tintinalli's Emergency Medicine: A Comprehensive Study Guide. McGraw-Hill.",
    "The Harriet Lane Handbook, 23rd Edition. Johns Hopkins Hospital. Elsevier.",
]
for i, ref in enumerate(refs_books, 1):
    story.append(Paragraph(f"{i}.  {ref}", SMALL))
    story.append(Spacer(1, 0.05*cm))

story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("<b>PubMed References</b>", H2))
refs_pubmed = [
    ("38271488", "Teja B, et al. (2024). Effectiveness of Fludrocortisone Plus Hydrocortisone versus Hydrocortisone Alone in Septic Shock: A Systematic Review and Network Meta-Analysis of Randomized Controlled Trials. Am J Respir Crit Care Med. DOI:10.1164/rccm.202310-1785OC"),
    ("38320130", "Pirracchio R, Annane D, et al. (2023). Patient-Level Meta-Analysis of Low-Dose Hydrocortisone in Adults with Septic Shock. NEJM Evidence. DOI:10.1056/EVIDoa2300034"),
    ("39192056", "Wu JY, Liu MY, et al. (2025). Effect of hydrocortisone-fludrocortisone combination on mortality in septic shock: a systematic review and meta-analysis. Infection. DOI:10.1007/s15010-024-02381-z"),
    ("39612454", "Song B, Zheng X, Fu K. (2024). Early use of low-dose hydrocortisone can reduce in-hospital mortality in patients with septic shock: A systematic review and meta-analysis. Medicine. DOI:10.1097/MD.0000000000040635"),
    ("38237961", "De Luca D, Ferraioli S, Watterberg KL. (2024). Hydrocortisone in very preterm neonates for BPD prevention: meta-analysis and effect size modifiers. Arch Dis Child Fetal Neonatal Ed. DOI:10.1136/archdischild-2023-326254"),
    ("40144277", "Ramaswamy VV, Kumar G, Pullattayil SAK. (2025). Timing of hydrocortisone therapy in neonates with shock: a systematic review, meta-analysis, and clinical practice guideline. Front Pediatr. DOI:10.3389/fped.2025.1491976"),
    ("40820529", "Gu X, Yang P, Yu L. (2025). [Meta-analysis of hydrocortisone in the treatment of severe community-acquired pneumonia]. Zhonghua Wei Zhong Bing Ji Jiu Yi Xue. DOI:10.3760/cma.j.cn121430-20230710-00500"),
    ("35465689", "Wang K, Yin L, Song Y. (2023). The Use of Hydrocortisone, Ascorbic Acid and Thiamine in Patients with Sepsis and Septic Shock - A Systematic Review. J Pharm Pract. DOI:10.1177/08971900221097193"),
]
for pmid, citation in refs_pubmed:
    story.append(Paragraph(f"[PMID {pmid}]  {citation}", SMALL))
    story.append(Spacer(1, 0.05*cm))

story.append(Spacer(1, 0.6*cm))
story.append(hr(GREY, 0.5))
story.append(Paragraph(
    "This document was compiled by Orris Medical AI using peer-reviewed medical textbooks and PubMed literature "
    "as primary sources. It is intended for educational purposes only and does not constitute clinical advice. "
    "Always consult current local prescribing guidelines and specialist expertise for patient care decisions.",
    CITE))

# Build
doc.build(story)
print(f"PDF created: {OUTPUT_PATH}")
Running Command

python /tmp/workspace/hydrocortisone/generate_pdf.py

Running Command

ls -lh /tmp/workspace/hydrocortisone/Hydrocortisone_Drug_Review.pdf

Your PDF is ready. Here is the download link:

Hydrocortisone Drug Review

PDF Document · PDF


What's inside the PDF (14 sections):
SectionContent
1. OverviewHistory, background, classification
2. Mechanism of ActionGR/MR receptor binding, NF-κB transrepression, downstream effects
3. PharmacokineticsAbsorption, distribution, metabolism, excretion table
4. Relative PotencyFull comparison table vs. prednisolone, dexamethasone, fludrocortisone
5. IndicationsAdrenal insufficiency, septic shock, dermatology, GI, perioperative, paediatric
6. Dosing GuidelinesDosing table for all major indications (acute crisis, chronic AI, sepsis, CAH, etc.)
7. Adverse EffectsColour-coded table by system (metabolic, MSK, CVS, immune, psychiatric, dermatology)
8. Contraindications & PrecautionsAbsolute and relative
9. Drug InteractionsCYP3A4 interactions, NSAIDs, antidiabetics, vaccines, warfarin
10. Special PopulationsPregnancy, paediatrics, hepatic/renal impairment
11. MonitoringFull monitoring parameter checklist
12. Clinical Pearls8 high-yield practical points
13. Recent Evidence8 PubMed systematic reviews / meta-analyses (2023-2025) with PMIDs
14. References16 textbooks + 8 cited PubMed papers with DOIs
Sources used:
  • Harrison's Principles of Internal Medicine 22E (2025), Katzung's Basic & Clinical Pharmacology 16E, The Washington Manual, ROSEN's Emergency Medicine, Barash's Clinical Anesthesia 9E, Bailey & Love's Surgery 28E, Fitzpatrick's Dermatology, Lippincott Pharmacology, Goldman-Cecil Medicine, and 8 recent PubMed meta-analyses (2023-2025).
This is a shared conversation. Sign in to Orris to start your own chat.