Tab doxycycline 100mg brief explanation for opd
doxycycline 100mg OPD prescription indications dose duration
| Situation | Dose | Duration |
|---|---|---|
| General bacterial infections | 200 mg on Day 1 (100 mg BD), then 100 mg OD | Per clinical response |
| Moderate-severe infections | 100 mg BD throughout | As needed |
| Malaria prophylaxis | 100 mg OD | Start 1-2 days before travel, continue 4 weeks after |
| Indication | Dose | Duration |
|---|---|---|
| Chlamydia (urethritis/cervicitis) | 100 mg BD | 7 days |
| Pelvic Inflammatory Disease | 100 mg BD | 14 days (with metronidazole) |
| Acne (moderate-severe) | 100 mg OD/BD | 3-4 months |
| Community-acquired Pneumonia | 100 mg BD | 5-7 days |
| Lyme disease (early) | 100 mg BD | 14-21 days |
| Rickettsia / RMSF / Scrub typhus | 100 mg BD | Until afebrile 3 days + minimum 5-7 days |
| MRSA skin/soft tissue infection | 100 mg BD | At least 5 days |
| Malaria prophylaxis | 100 mg OD | Day before travel + 4 weeks after |
| Syphilis (pen-allergic, early) | 100 mg BD | 14 days |
| NGU (non-gonococcal urethritis) | 100 mg BD | 7 days |
Create a quick reference PDF for doxycycline dosing & interactions
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "created"
mkdir -p /tmp/workspace/doxycycline-pdf
~/doxycycline-pdf/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_LEFT, TA_CENTER
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether
)
from reportlab.platypus.flowables import HRFlowable
OUTPUT = "/tmp/workspace/doxycycline-pdf/Doxycycline_Quick_Reference.pdf"
# ─── Colour palette ───────────────────────────────────────────────────────────
TEAL = colors.HexColor("#006D77")
TEAL_LIGHT = colors.HexColor("#E8F4F5")
ORANGE = colors.HexColor("#E07B39")
ORANGE_LT = colors.HexColor("#FDF3EC")
RED = colors.HexColor("#C0392B")
RED_LIGHT = colors.HexColor("#FDEDEC")
GREEN = colors.HexColor("#1A7A4A")
GREEN_LT = colors.HexColor("#E9F7EF")
YELLOW_LT = colors.HexColor("#FFF8E1")
GREY = colors.HexColor("#555555")
LGREY = colors.HexColor("#F5F5F5")
WHITE = colors.white
BLACK = colors.black
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=18*mm,
rightMargin=18*mm,
topMargin=16*mm,
bottomMargin=16*mm,
)
W = A4[0] - 36*mm # usable width
styles = getSampleStyleSheet()
def style(name, **kw):
s = ParagraphStyle(name, parent=styles["Normal"], **kw)
return s
H1 = style("H1", fontSize=20, textColor=WHITE, leading=26, alignment=TA_CENTER, fontName="Helvetica-Bold")
H2 = style("H2", fontSize=12, textColor=WHITE, leading=16, fontName="Helvetica-Bold")
H2S = style("H2S", fontSize=11, textColor=TEAL, leading=15, fontName="Helvetica-Bold")
BODY = style("BODY", fontSize=9, textColor=BLACK, leading=13, fontName="Helvetica")
BOLD9= style("BOLD9", fontSize=9, textColor=BLACK, leading=13, fontName="Helvetica-Bold")
SM = style("SM", fontSize=8, textColor=GREY, leading=11, fontName="Helvetica")
SMB = style("SMB", fontSize=8, textColor=GREY, leading=11, fontName="Helvetica-Bold")
WARN = style("WARN", fontSize=8.5, textColor=RED, leading=12, fontName="Helvetica-Bold")
CELLH= style("CELLH", fontSize=8.5, textColor=WHITE, leading=12, fontName="Helvetica-Bold", alignment=TA_CENTER)
CELLN= style("CELLN", fontSize=8.5, textColor=BLACK, leading=12, fontName="Helvetica")
CELLN_C= style("CELLN_C", fontSize=8.5, textColor=BLACK, leading=12, fontName="Helvetica", alignment=TA_CENTER)
CELLB= style("CELLB", fontSize=8.5, textColor=BLACK, leading=12, fontName="Helvetica-Bold")
story = []
# ════════════════════════════════════════════════════════════
# HEADER BANNER
# ════════════════════════════════════════════════════════════
header_data = [[Paragraph("Tab Doxycycline 100 mg — Quick Reference Card", H1)]]
header_tbl = Table(header_data, colWidths=[W])
header_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), TEAL),
("ROUNDEDCORNERS", [6]),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 10),
]))
story.append(header_tbl)
story.append(Spacer(1, 4*mm))
# Sub-header line
sub_data = [[
Paragraph("Class: Tetracycline Antibiotic | Action: Bacteriostatic (30S ribosomal inhibitor) | Route: Oral", SM),
Paragraph("Ref: Goodman & Gilman, Katzung, Harrison's", SM)
]]
sub_tbl = Table(sub_data, colWidths=[W*0.65, W*0.35])
sub_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), TEAL_LIGHT),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 8),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("ALIGN", (1,0), (1,0), "RIGHT"),
]))
story.append(sub_tbl)
story.append(Spacer(1, 5*mm))
# ════════════════════════════════════════════════════════════
# SECTION 1 — DOSING TABLE
# ════════════════════════════════════════════════════════════
story.append(Paragraph("DOSING BY INDICATION", H2S))
story.append(HRFlowable(width=W, thickness=1.5, color=TEAL, spaceAfter=4))
dose_headers = [
Paragraph("Indication", CELLH),
Paragraph("Dose", CELLH),
Paragraph("Frequency", CELLH),
Paragraph("Duration", CELLH),
]
dose_rows = [
["Chlamydia / NGU", "100 mg", "BD", "7 days"],
["Pelvic Inflammatory Disease", "100 mg", "BD", "14 days (+metronidazole)"],
["Community-Acquired Pneumonia", "100 mg", "BD", "5–7 days"],
["Scrub Typhus / Rickettsia / RMSF", "100 mg", "BD", "Min 5–7 days (till afebrile 3d)"],
["Lyme Disease (early)", "100 mg", "BD", "14–21 days"],
["Syphilis (penicillin-allergic, early)", "100 mg", "BD", "14 days"],
["Syphilis (>1 year / latent)", "100 mg", "BD", "28 days"],
["MRSA Skin & Soft Tissue Infection", "100 mg", "BD", "At least 5 days"],
["Acne (moderate–severe)", "100 mg", "OD or BD", "3–4 months"],
["Malaria Prophylaxis", "100 mg", "OD", "Start 1–2d before; +4 wks after"],
["Brucellosis (with rifampicin)", "100 mg", "BD", "6 weeks"],
["Anthrax prophylaxis (post-exposure)", "100 mg", "BD", "60 days"],
]
dose_data = [dose_headers]
for i, row in enumerate(dose_rows):
dose_data.append([
Paragraph(row[0], CELLB if i % 2 == 0 else CELLN),
Paragraph(row[1], CELLN_C),
Paragraph(row[2], CELLN_C),
Paragraph(row[3], CELLN),
])
dose_table = Table(dose_data, colWidths=[W*0.36, W*0.14, W*0.14, W*0.36])
ts = TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGREY]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#CCCCCC")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
])
dose_table.setStyle(ts)
story.append(dose_table)
story.append(Spacer(1, 5*mm))
# ════════════════════════════════════════════════════════════
# SECTION 2 — TWO COLUMNS: Interactions + Counselling
# ════════════════════════════════════════════════════════════
# --- Drug Interactions sub-table ---
int_title = Table([[Paragraph("DRUG INTERACTIONS", H2S)]], colWidths=[W*0.48])
int_title.setStyle(TableStyle([("BOTTOMPADDING",(0,0),(-1,-1),2)]))
int_headers = [Paragraph("Interacting Drug/Food", CELLH), Paragraph("Effect / Action", CELLH)]
int_rows = [
["Antacids (Al, Mg, Ca)", "↓ Absorption — separate by 2 hrs"],
["Iron / Zinc supplements", "↓ Absorption — separate by 2 hrs"],
["Dairy products / milk", "↓ Absorption — separate by 2 hrs"],
["Oral contraceptives", "Possible ↓ efficacy — advise backup"],
["Warfarin / anticoagulants", "↑ INR — monitor closely"],
["Isotretinoin", "Risk of intracranial HTN — AVOID"],
["Penicillins", "Antagonism — avoid co-prescribing"],
["Barbiturates / Phenytoin / Carbamazepine", "↓ Doxycycline levels — monitor"],
["Rifampicin", "↓ Doxycycline levels — monitor"],
["Methoxyflurane (anaesthetic)", "Nephrotoxicity risk — AVOID"],
["Alcohol (heavy use)", "↓ Efficacy — advise moderation"],
]
int_data = [int_headers] + [
[Paragraph(r[0], CELLN), Paragraph(r[1], CELLN)] for r in int_rows
]
int_table = Table(int_data, colWidths=[W*0.22, W*0.26])
int_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), ORANGE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, ORANGE_LT]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#CCCCCC")),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
# --- Patient Counselling sub-table ---
coun_title = Table([[Paragraph("PATIENT COUNSELLING", H2S)]], colWidths=[W*0.48])
coun_title.setStyle(TableStyle([("BOTTOMPADDING",(0,0),(-1,-1),2)]))
coun_rows = [
["Take with food or full glass of water"],
["Do NOT lie down for 30 min after dose"],
["Avoid dairy, antacids, iron within 2 hrs"],
["Use sunscreen — photosensitivity common"],
["Complete full course — do not stop early"],
["Report severe headache / vision changes"],
["Thrush possible — report white patches"],
["Adequate hydration throughout course"],
]
coun_data = [[Paragraph("Key Counselling Point", CELLH)]] + [
[Paragraph("✔ " + r[0], CELLN)] for r in coun_rows
]
coun_table = Table(coun_data, colWidths=[W*0.48])
coun_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), GREEN),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, GREEN_LT]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#CCCCCC")),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
two_col = Table(
[[int_table, Spacer(4*mm, 1), coun_table]],
colWidths=[W*0.48 + 2, 4*mm, W*0.48 + 2]
)
two_col.setStyle(TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 0),
]))
story.append(KeepTogether([
Table([[Paragraph("DRUG INTERACTIONS", H2S)]], colWidths=[W*0.48]),
HRFlowable(width=W, thickness=1.5, color=ORANGE, spaceAfter=4),
two_col,
]))
story.append(Spacer(1, 5*mm))
# ════════════════════════════════════════════════════════════
# SECTION 3 — CONTRAINDICATIONS + SIDE EFFECTS (2 col)
# ════════════════════════════════════════════════════════════
ci_data = [
[Paragraph("CONTRAINDICATIONS / CAUTIONS", style("x",parent=styles["Normal"],
fontSize=11, textColor=RED, fontName="Helvetica-Bold", leading=15))],
]
ci_hdr = Table(ci_data, colWidths=[W])
ci_hdr.setStyle(TableStyle([("BOTTOMPADDING",(0,0),(-1,-1),2)]))
ci_rows = [
["Pregnancy (Category D)", "Tooth/bone development in fetus"],
["Children < 8 years", "Permanent tooth discolouration"],
["Severe hepatic impairment", "Avoid or reduce dose"],
["Known tetracycline hypersensitivity", "Absolute contraindication"],
["Concurrent isotretinoin use", "Intracranial hypertension risk"],
["Myasthenia gravis", "May worsen neuromuscular blockade"],
]
ci_table_data = [
[Paragraph("Contraindication", CELLH), Paragraph("Reason", CELLH)]
] + [
[Paragraph("✘ " + r[0], style("red9", parent=styles["Normal"], fontSize=8.5,
textColor=RED, fontName="Helvetica-Bold", leading=12)),
Paragraph(r[1], CELLN)]
for r in ci_rows
]
ci_table = Table(ci_table_data, colWidths=[W*0.42, W*0.54])
ci_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), RED),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, RED_LIGHT]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#CCCCCC")),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
# Side Effects
se_rows = [
["GI upset, nausea, vomiting", "Common"],
["Photosensitivity", "Common"],
["Oesophageal ulceration", "If taken without water/lying down"],
["Oral/vaginal candidiasis", "Superinfection"],
["Intracranial hypertension", "Rare — stop if headache/visual Δ"],
["Hepatotoxicity", "Rare, high doses"],
["Diarrhoea / C. difficile colitis", "With prolonged use"],
]
se_table_data = [
[Paragraph("Side Effect", CELLH), Paragraph("Notes", CELLH)]
] + [
[Paragraph(r[0], CELLN), Paragraph(r[1], CELLN)] for r in se_rows
]
se_table = Table(se_table_data, colWidths=[W*0.48, W*0.48])
se_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#7B68EE")),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, colors.HexColor("#F4F3FF")]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#CCCCCC")),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
se_title = Table([[Paragraph("COMMON SIDE EFFECTS", style("se_h", parent=styles["Normal"],
fontSize=11, textColor=colors.HexColor("#5B4EBB"), fontName="Helvetica-Bold", leading=15))]],
colWidths=[W])
bot_two = Table(
[[ci_table, Spacer(4*mm, 1), se_table]],
colWidths=[W*0.48, 4*mm, W*0.48]
)
bot_two.setStyle(TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 0),
]))
story.append(KeepTogether([
ci_hdr,
HRFlowable(width=W, thickness=1.5, color=RED, spaceAfter=4),
bot_two,
]))
story.append(Spacer(1, 5*mm))
# ════════════════════════════════════════════════════════════
# SECTION 4 — SPECIAL POPULATIONS + QUICK TIPS
# ════════════════════════════════════════════════════════════
sp_data_rows = [
["Pregnancy", "AVOID (Category D) — tooth/bone effects", "RED"],
["Breastfeeding", "Avoid if possible — excreted in milk", "RED"],
["Children < 8 yrs", "Contraindicated — dental staining", "RED"],
["Children ≥ 8 yrs", "2.2 mg/kg/dose BD; max 100 mg/dose", "GREEN"],
["Renal impairment", "No dose adjustment needed (hepatically cleared)", "GREEN"],
["Hepatic impairment (severe)", "Use with caution; reduce dose/avoid", "ORANGE"],
["Elderly", "Standard dosing; watch GI side effects", "GREEN"],
]
sp_table_data = [
[Paragraph("Population", CELLH), Paragraph("Recommendation", CELLH)]
]
for r in sp_data_rows:
if r[2] == "RED":
c1 = style("sp_r", parent=styles["Normal"], fontSize=8.5, textColor=RED, fontName="Helvetica-Bold", leading=12)
elif r[2] == "ORANGE":
c1 = style("sp_o", parent=styles["Normal"], fontSize=8.5, textColor=ORANGE, fontName="Helvetica-Bold", leading=12)
else:
c1 = style("sp_g", parent=styles["Normal"], fontSize=8.5, textColor=GREEN, fontName="Helvetica-Bold", leading=12)
sp_table_data.append([Paragraph(r[0], c1), Paragraph(r[1], CELLN)])
sp_table = Table(sp_table_data, colWidths=[W*0.28, W*0.68])
sp_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#37474F")),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGREY]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#CCCCCC")),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
sp_title = style("sp_title", parent=styles["Normal"],
fontSize=11, textColor=colors.HexColor("#37474F"), fontName="Helvetica-Bold", leading=15)
# Quick OPD tip box
tip_txt = (
"<b>Quick OPD Tip:</b> For most outpatient infections (RTI, chlamydia, skin infections): "
"Tab Doxycycline 100 mg BD × 7 days with food. "
"For acne: 100 mg OD × 3 months alongside topical therapy. "
"For malaria prophylaxis: 100 mg OD starting 1–2 days before travel, continuing 4 weeks after return."
)
tip_para = Paragraph(tip_txt, style("tip", parent=styles["Normal"],
fontSize=8.5, textColor=colors.HexColor("#333333"), fontName="Helvetica", leading=13))
tip_box = Table([[tip_para]], colWidths=[W])
tip_box.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), YELLOW_LT),
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#F0C040")),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
]))
story.append(KeepTogether([
Table([[Paragraph("SPECIAL POPULATIONS", sp_title)]], colWidths=[W]),
HRFlowable(width=W, thickness=1.5, color=colors.HexColor("#37474F"), spaceAfter=4),
sp_table,
Spacer(1, 4*mm),
tip_box,
]))
# ════════════════════════════════════════════════════════════
# FOOTER
# ════════════════════════════════════════════════════════════
story.append(Spacer(1, 4*mm))
footer_data = [[
Paragraph(
"References: Goodman & Gilman's Pharmacological Basis of Therapeutics 14e | "
"Katzung Basic & Clinical Pharmacology 16e | Harrison's Principles of Internal Medicine 22e | "
"FDA Prescribing Information | StatPearls (NCBI). "
"For educational use only. Always verify with current guidelines before prescribing.",
style("footer", parent=styles["Normal"], fontSize=7, textColor=colors.HexColor("#888888"),
fontName="Helvetica", leading=10, alignment=TA_CENTER)
)
]]
footer_tbl = Table(footer_data, colWidths=[W])
footer_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LGREY),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 8),
]))
story.append(footer_tbl)
# BUILD
doc.build(story)
print(f"PDF saved to: {OUTPUT}")
cd /tmp/workspace/doxycycline-pdf && python generate_pdf.py 2>&1
~/doxycycline-pdf/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/doxycycline-pdf/generate_pdf.py'
grep -n 'style("' /tmp/workspace/doxycycline-pdf/generate_pdf.py | grep 'parent=styles'
cd /tmp/workspace/doxycycline-pdf && python generate_pdf.py 2>&1
Doxycycline Quick Reference
PDF Document · PDF
| Section | Colour | Content |
|---|---|---|
| Header Banner | Teal | Drug name, class, mechanism at a glance |
| Dosing by Indication | Teal | 12 indications with dose, frequency, duration |
| Drug Interactions | Orange | 11 interactions (antacids, warfarin, OCP, isotretinoin, etc.) |
| Patient Counselling | Green | 8 key OPD counselling points |
| Contraindications | Red | 6 absolute/relative contraindications with reasons |
| Side Effects | Purple | 7 common/serious adverse effects |
| Special Populations | Dark grey | Pregnancy, children, renal/hepatic, elderly dosing |
| Quick OPD Tip box | Yellow | Ready-to-use prescription guidance |
| Footer | Grey | References + educational disclaimer |
Tab udiliv 300mg brief explanation for opd for intern
Udiliv 300mg ursodeoxycholic acid indications dose mechanism OPD uses
| # | Mechanism | Clinical Benefit |
|---|---|---|
| 1 | Replaces/displaces toxic hydrophobic bile acids | Protects liver cells (cytoprotection) |
| 2 | Reduces cholesterol secretion into bile | Dissolves/prevents cholesterol gallstones |
| 3 | Stabilises hepatocyte canalicular membranes | Reduces cholestatic liver injury |
| 4 | Anti-inflammatory / immunomodulatory | Slows progression of autoimmune liver disease |
| Indication | Dose | Duration | Notes |
|---|---|---|---|
| Primary Biliary Cholangitis (PBC) | 13–15 mg/kg/day in 2–4 divided doses with food | Long-term (months–years) | First-line agent |
| Cholesterol Gallstone dissolution | 8–10 mg/kg/day in divided doses | 12–24 months | Only for small (<10mm), non-calcified, radiolucent stones |
| Gallstone prevention (obese patients on rapid weight loss) | 300 mg BD | During weight loss period | Prevents sludge and new stones |
| Intrahepatic Cholestasis of Pregnancy (ICP) | 10–15 mg/kg/day | Till delivery | Reduces bile acids, relieves pruritus |
| NAFLD / NASH (off-label) | 300 mg BD or TDS | 6–12 months | Improves liver enzymes; not FDA-approved for this |
| Drug-induced / viral hepatitis (off-label adjunct) | 300 mg BD | As clinically indicated | Hepatoprotective support |
| Chronic active hepatitis (adjunct) | 300 mg BD–TDS | Per clinical response | Enzyme improvement |
Udiliv 300 mg specific: Standard adult dose is usually 300 mg BD or TDS (i.e., 1 tablet 2-3 times a day with food). For PBC or gallstone dissolution in a 60 kg patient: 10 mg/kg = 600 mg/day = Tab Udiliv 300 mg BD. For 15 mg/kg = 900 mg/day = Tab Udiliv 300 mg TDS.
| Side Effect | Frequency |
|---|---|
| Nausea, loose stools, mild diarrhoea | Uncommon |
| Headache | Uncommon |
| Pruritus (itching) | Rare |
| Hepatotoxicity | Not seen (unlike its predecessor, chenodeoxycholic acid) |
Udiliv is practically free of serious adverse effects at therapeutic doses. - Katzung 16th Ed.
| Drug | Interaction | Action |
|---|---|---|
| Cholestyramine / Colestipol | Binds UDCA in gut - reduces absorption | Give UDCA 2 hrs apart |
| Aluminium hydroxide antacids | Reduces absorption | Separate by 2 hours |
| Oestrogens / OCPs / Clofibrate | Increase biliary cholesterol - oppose UDCA's gallstone action | Caution in gallstone patients |
| Cyclosporine | UDCA increases cyclosporine absorption | Monitor cyclosporine levels |
| Ciprofloxacin | May increase UDCA levels | Monitor |
| Feature | Detail |
|---|---|
| Drug class | Hydrophilic bile acid |
| Main use | PBC (first-line), gallstone dissolution/prevention, ICP |
| Dose in adults | 300 mg BD–TDS with food |
| Safety profile | Very safe; no hepatotoxicity |
| Response monitoring | LFTs every 3–6 months; USG abdomen every 6–12 months |
| When NOT to use | Calcified stones, biliary obstruction, non-functioning GB |
| Key patient instruction | Take with food; long-term compliance is key |
Remember for OPD: The most common scenario you'll prescribe Udiliv in is (1) a patient with mildly elevated LFTs/fatty liver sent by gastro as hepatoprotective adjunct, (2) a pregnant patient with itching and elevated bile acids (ICP), and (3) a PBC patient on long-term follow-up. It is a well-tolerated, safe drug - but document the indication clearly.
Create a quick reference PDF for UDCA/Udiliv dosing and interactions
ls -la /tmp/workspace/ && ls /tmp/workspace/doxycycline-pdf/
mkdir -p /tmp/workspace/udiliv-pdf
~/udiliv-pdf/generate_udiliv_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether
)
OUTPUT = "/tmp/workspace/udiliv-pdf/Udiliv_UDCA_Quick_Reference.pdf"
# ─── Colour palette ───────────────────────────────────────────────────────────
TEAL = colors.HexColor("#00695C") # primary header
TEAL_LT = colors.HexColor("#E0F2F1")
AMBER = colors.HexColor("#E65100") # interactions
AMBER_LT = colors.HexColor("#FFF3E0")
RED = colors.HexColor("#B71C1C")
RED_LT = colors.HexColor("#FFEBEE")
GREEN = colors.HexColor("#2E7D32")
GREEN_LT = colors.HexColor("#E8F5E9")
PURPLE = colors.HexColor("#4527A0")
PURPLE_LT = colors.HexColor("#EDE7F6")
BLUE = colors.HexColor("#1565C0")
BLUE_LT = colors.HexColor("#E3F2FD")
SLATE = colors.HexColor("#37474F")
LGREY = colors.HexColor("#F5F5F5")
YELLOW_LT = colors.HexColor("#FFFDE7")
WHITE = colors.white
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=17*mm, rightMargin=17*mm,
topMargin=14*mm, bottomMargin=14*mm,
)
W = A4[0] - 34*mm
styles = getSampleStyleSheet()
def S(name, parent=None, **kw):
base = parent if parent else styles["Normal"]
return ParagraphStyle(name, parent=base, **kw)
# --- reusable paragraph styles ---
BANNER = S("BANNER", fontSize=19, textColor=WHITE, leading=25, alignment=TA_CENTER, fontName="Helvetica-Bold")
SUBBAN = S("SUBBAN", fontSize=8.5, textColor=WHITE, leading=12, alignment=TA_CENTER, fontName="Helvetica")
SECH = S("SECH", fontSize=11, textColor=TEAL, leading=15, fontName="Helvetica-Bold")
SECHA = S("SECHA", fontSize=11, textColor=AMBER, leading=15, fontName="Helvetica-Bold")
SECHR = S("SECHR", fontSize=11, textColor=RED, leading=15, fontName="Helvetica-Bold")
SECHP = S("SECHP", fontSize=11, textColor=PURPLE, leading=15, fontName="Helvetica-Bold")
SECHSL = S("SECHSL", fontSize=11, textColor=SLATE, leading=15, fontName="Helvetica-Bold")
CELLTOP = S("CELLTOP", fontSize=8.5, textColor=WHITE, leading=12, fontName="Helvetica-Bold", alignment=TA_CENTER)
CELLN = S("CELLN", fontSize=8.5, textColor=colors.black, leading=12, fontName="Helvetica")
CELLNC = S("CELLNC", fontSize=8.5, textColor=colors.black, leading=12, fontName="Helvetica", alignment=TA_CENTER)
CELLB = S("CELLB", fontSize=8.5, textColor=colors.black, leading=12, fontName="Helvetica-Bold")
CELLRED = S("CELLRED", fontSize=8.5, textColor=RED, leading=12, fontName="Helvetica-Bold")
CELLGRN = S("CELLGRN", fontSize=8.5, textColor=GREEN, leading=12, fontName="Helvetica-Bold")
CELLAMB = S("CELLAMB", fontSize=8.5, textColor=AMBER, leading=12, fontName="Helvetica-Bold")
CELLPUR = S("CELLPUR", fontSize=8.5, textColor=PURPLE, leading=12, fontName="Helvetica-Bold")
SM = S("SM", fontSize=7.5, textColor=colors.HexColor("#555555"), leading=10, fontName="Helvetica")
TIP = S("TIP", fontSize=8.5, textColor=colors.HexColor("#333333"), leading=13, fontName="Helvetica")
TIPB = S("TIPB", fontSize=8.5, textColor=TEAL, leading=13, fontName="Helvetica-Bold")
FOOT = S("FOOT", fontSize=7, textColor=colors.HexColor("#888888"), leading=10, fontName="Helvetica", alignment=TA_CENTER)
story = []
# ════════════════════════════════════════════
# HEADER
# ════════════════════════════════════════════
hdr = Table([[Paragraph("Tab Udiliv 300 mg (Ursodeoxycholic Acid — UDCA)", BANNER)]],
colWidths=[W])
hdr.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), TEAL),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
]))
story.append(hdr)
sub = Table([[Paragraph(
"Class: Hydrophilic Bile Acid / Hepatoprotective | Mechanism: Displaces toxic bile acids, cytoprotection, immunomodulation | Route: Oral",
SUBBAN)]],
colWidths=[W])
sub.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#00897B")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
]))
story.append(sub)
story.append(Spacer(1, 4*mm))
# ════════════════════════════════════════════
# SECTION 1 — DOSING TABLE
# ════════════════════════════════════════════
story.append(Paragraph("DOSING BY INDICATION", SECH))
story.append(HRFlowable(width=W, thickness=1.5, color=TEAL, spaceAfter=4))
dose_hdr = [
Paragraph("Indication", CELLTOP),
Paragraph("Dose", CELLTOP),
Paragraph("Frequency / Day", CELLTOP),
Paragraph("Duration", CELLTOP),
Paragraph("Notes", CELLTOP),
]
dose_rows = [
["Primary Biliary Cholangitis (PBC)",
"13–15 mg/kg/day", "2–4 divided doses", "Long-term (years)", "First-line agent; with food"],
["Cholesterol Gallstone Dissolution",
"8–10 mg/kg/day", "2–3 divided doses", "12–24 months", "Only radiolucent, <10 mm stones"],
["Gallstone Prevention\n(rapid weight loss / bariatric)",
"300 mg BD", "BD", "During weight loss", "Prevents biliary sludge & stones"],
["Intrahepatic Cholestasis\nof Pregnancy (ICP)",
"10–15 mg/kg/day", "BD–TDS", "Until delivery", "Relieves pruritus; safe in pregnancy"],
["NAFLD / NASH (off-label adjunct)",
"300 mg BD–TDS", "BD or TDS", "6–12 months", "Improves LFTs; not FDA-approved"],
["Drug-induced / Viral Hepatitis\n(hepatoprotective adjunct)",
"300 mg BD", "BD", "Per clinical response","Enzyme improvement; adjunct use"],
["Primary Sclerosing Cholangitis (PSC)",
"13–15 mg/kg/day", "2–4 divided doses", "Long-term", "Evidence limited; use controversial"],
["Cystic Fibrosis-related\nCholestasis",
"20 mg/kg/day", "BD–TDS", "Long-term", "Paediatric use common"],
]
dose_data = [dose_hdr]
for i, r in enumerate(dose_rows):
bg_rows = [WHITE, LGREY]
dose_data.append([
Paragraph(r[0], CELLB if i % 2 == 0 else CELLN),
Paragraph(r[1], CELLNC),
Paragraph(r[2], CELLNC),
Paragraph(r[3], CELLNC),
Paragraph(r[4], CELLN),
])
dose_tbl = Table(dose_data, colWidths=[W*0.25, W*0.16, W*0.14, W*0.15, W*0.30])
dose_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGREY]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#CCCCCC")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(dose_tbl)
story.append(Spacer(1, 4*mm))
# ════════════════════════════════════════════
# DOSE CALCULATOR BOX
# ════════════════════════════════════════════
calc_rows = [
["Patient Weight", "Gallstone / NAFLD\n(10 mg/kg/day)", "PBC\n(13 mg/kg/day)", "PBC max\n(15 mg/kg/day)"],
["50 kg", "500 mg/day\n= 300mg + 200mg*", "650 mg/day\n≈ 300mg TDS*", "750 mg/day\n= 300mg TDS*"],
["60 kg", "600 mg/day\n= 300mg BD", "780 mg/day\n= 300mg TDS*", "900 mg/day\n= 300mg TDS"],
["70 kg", "700 mg/day\n= 300mg TDS*", "910 mg/day\n= 300mg TDS", "1050 mg/day\n= 300mg TDS + extra*"],
["80 kg", "800 mg/day\n= 300mg TDS*", "1040 mg/day\n= 300mg TDS*", "1200 mg/day\n= 300mg QID"],
]
calc_style_hdr = S("calch", fontSize=8, textColor=WHITE, leading=11, fontName="Helvetica-Bold", alignment=TA_CENTER)
calc_style_nrm = S("calcn", fontSize=8, textColor=colors.black, leading=11, fontName="Helvetica", alignment=TA_CENTER)
calc_style_key = S("calck", fontSize=8, textColor=TEAL, leading=11, fontName="Helvetica-Bold")
calc_data = []
for i, row in enumerate(calc_rows):
if i == 0:
calc_data.append([Paragraph(c, calc_style_hdr) for c in row])
else:
calc_data.append([
Paragraph(row[0], calc_style_key),
Paragraph(row[1], calc_style_nrm),
Paragraph(row[2], calc_style_nrm),
Paragraph(row[3], calc_style_nrm),
])
calc_tbl = Table(calc_data, colWidths=[W*0.14, W*0.28, W*0.28, W*0.28])
calc_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#00897B")),
("ROWBACKGROUNDS", (0,1), (-1,-1), [TEAL_LT, WHITE]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#AAAAAA")),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 4),
("RIGHTPADDING", (0,0), (-1,-1), 4),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
calc_note = Paragraph("* Approximate — adjust to nearest available tablet strength. Udiliv 150 mg & 300 mg tablets available. Always prescribe with food.", SM)
calc_box = Table([
[Paragraph("DOSE CALCULATOR (Udiliv 300 mg tablets)", S("cbox", fontSize=10,
textColor=colors.HexColor("#00695C"), fontName="Helvetica-Bold", leading=14))],
[calc_tbl],
[calc_note],
], colWidths=[W])
calc_box.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), TEAL_LT),
("BOX", (0,0), (-1,-1), 1, TEAL),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 7),
("RIGHTPADDING", (0,0), (-1,-1), 7),
]))
story.append(calc_box)
story.append(Spacer(1, 4*mm))
# ════════════════════════════════════════════
# SECTION 2 — TWO COLUMNS: Interactions + Counselling
# ════════════════════════════════════════════
# Left: Drug Interactions
int_hdr_row = [Paragraph("Interacting Drug/Food", CELLTOP), Paragraph("Effect & Action", CELLTOP)]
int_rows = [
["Cholestyramine / Colestipol", "↓ UDCA absorption — give UDCA 2 hrs before"],
["Aluminium hydroxide antacids", "↓ UDCA absorption — separate by 2 hrs"],
["Oestrogens / OCPs", "Oppose gallstone dissolution — caution"],
["Clofibrate / Cholesterol drugs", "Oppose gallstone action — monitor"],
["Cyclosporine", "UDCA ↑ cyclosporine absorption — monitor levels"],
["Ciprofloxacin", "May ↑ UDCA levels — monitor LFTs"],
["Bile acid sequestrants (all)", "Reduce enterohepatic recirculation of UDCA"],
["Antacids (Ca/Mg based)", "May reduce absorption — separate doses"],
["Obeticholic acid", "Synergistic in PBC non-responders — intentional combo"],
]
int_data = [int_hdr_row] + [
[Paragraph(r[0], CELLN), Paragraph(r[1], CELLN)] for r in int_rows
]
int_tbl = Table(int_data, colWidths=[W*0.23, W*0.27])
int_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), AMBER),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, AMBER_LT]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#DDDDDD")),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
# Right: Patient Counselling
coun_hdr_row = [Paragraph("OPD Counselling Point", CELLTOP)]
coun_rows = [
"Always take with food to reduce GI upset",
"Take bedtime dose if on BD — bile concentrates at night (best for gallstone dissolution)",
"This is a long-term medicine — do NOT stop without telling your doctor",
"Regular blood tests (LFTs) every 3–6 months",
"Ultrasound abdomen every 6–12 months to check stone response",
"Drug will NOT dissolve calcified (hard) stones — X-ray needed first",
"Report severe abdominal pain immediately (may indicate stone migration)",
"Safe in pregnancy — tell doctor if pregnant or planning pregnancy",
"Mild loose stools or nausea may occur initially — usually settles",
]
coun_data = [coun_hdr_row] + [
[Paragraph("✔ " + r, CELLN)] for r in coun_rows
]
coun_tbl = Table(coun_data, colWidths=[W*0.46])
coun_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), GREEN),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, GREEN_LT]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#DDDDDD")),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
two_col = Table(
[[int_tbl, Spacer(4*mm, 1), coun_tbl]],
colWidths=[W*0.50 + 2, 4*mm, W*0.46 + 2]
)
two_col.setStyle(TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 0),
("TOPPADDING", (0,0), (-1,-1), 0),
("BOTTOMPADDING", (0,0), (-1,-1), 0),
]))
story.append(KeepTogether([
Paragraph("DRUG INTERACTIONS", SECHA),
HRFlowable(width=W, thickness=1.5, color=AMBER, spaceAfter=4),
two_col,
]))
story.append(Spacer(1, 4*mm))
# ════════════════════════════════════════════
# SECTION 3 — CONTRAINDICATIONS + SIDE EFFECTS (2 col)
# ════════════════════════════════════════════
ci_rows = [
["Calcified / radio-opaque gallstones", "Won't dissolve — surgery needed"],
["Non-functioning gallbladder", "No bile flow — drug ineffective"],
["Acute cholecystitis / cholangitis", "Active inflammation — surgical emergency"],
["Biliary obstruction / fistula", "Structural problem — surgery first"],
["Bile pigment stones (radiolucent but non-cholesterol)", "Wrong stone type"],
["Inflammatory bowel disease", "Impaired enterohepatic recirculation"],
["Severe hepatic impairment", "May not metabolise; may worsen"],
["Known hypersensitivity to bile acids", "Absolute contraindication"],
]
ci_data = [
[Paragraph("Contraindication", CELLTOP), Paragraph("Reason", CELLTOP)]
] + [
[Paragraph("✘ " + r[0], CELLRED), Paragraph(r[1], CELLN)]
for r in ci_rows
]
ci_tbl = Table(ci_data, colWidths=[W*0.30, W*0.18])
ci_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), RED),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, RED_LT]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#DDDDDD")),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
se_rows = [
["Nausea / loose stools", "Uncommon; take with food"],
["Mild diarrhoea", "Bile-salt effect; usually settles"],
["Headache", "Uncommon"],
["Pruritus (itching)", "Rare"],
["Abdominal discomfort", "Usually mild; monitor"],
["Hepatotoxicity", "NOT seen — unlike chenodeoxycholic acid"],
["C. difficile colitis", "Very rare (no antibiotic effect)"],
]
se_data = [
[Paragraph("Side Effect", CELLTOP), Paragraph("Notes", CELLTOP)]
] + [
[Paragraph(r[0], CELLPUR), Paragraph(r[1], CELLN)] for r in se_rows
]
se_tbl = Table(se_data, colWidths=[W*0.22, W*0.24])
se_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), PURPLE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, PURPLE_LT]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#DDDDDD")),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
bot_two = Table(
[[ci_tbl, Spacer(4*mm, 1), se_tbl]],
colWidths=[W*0.48 + 2, 4*mm, W*0.46 + 2]
)
bot_two.setStyle(TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 0),
("TOPPADDING", (0,0), (-1,-1), 0),
("BOTTOMPADDING", (0,0), (-1,-1), 0),
]))
story.append(KeepTogether([
Paragraph("CONTRAINDICATIONS / CAUTIONS", SECHR),
HRFlowable(width=W, thickness=1.5, color=RED, spaceAfter=4),
bot_two,
]))
story.append(Spacer(1, 4*mm))
# ════════════════════════════════════════════
# SECTION 4 — SPECIAL POPULATIONS
# ════════════════════════════════════════════
sp_rows = [
("Pregnancy", "SAFE — Category B; actively used for ICP", "G"),
("Breastfeeding", "Use with caution; limited data; consult specialist", "A"),
("Children", "Dosing same as adults (mg/kg); used for CF-related cholestasis", "G"),
("Renal impairment", "No dose adjustment needed; hepatically metabolised", "G"),
("Hepatic impairment (mild-mod)", "Use cautiously; monitor LFTs closely", "A"),
("Hepatic impairment (severe)", "Avoid — may not metabolise; may worsen", "R"),
("Elderly", "Standard dosing; monitor LFTs; well-tolerated", "G"),
]
sp_data = [
[Paragraph("Population", CELLTOP), Paragraph("Recommendation", CELLTOP), Paragraph("Status", CELLTOP)]
]
for r in sp_rows:
if r[2] == "R":
c1 = CELLRED; status = Paragraph("AVOID", CELLRED)
elif r[2] == "A":
c1 = CELLAMB; status = Paragraph("CAUTION", CELLAMB)
else:
c1 = CELLGRN; status = Paragraph("SAFE", CELLGRN)
sp_data.append([Paragraph(r[0], c1), Paragraph(r[1], CELLN), status])
sp_tbl = Table(sp_data, colWidths=[W*0.22, W*0.63, W*0.12])
sp_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), SLATE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGREY]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#CCCCCC")),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("ALIGN", (2,0), (2,-1), "CENTER"),
]))
# Quick OPD tip
tip_content = (
"<b>Quick OPD Tip for Interns:</b> Three common scenarios — "
"(1) <b>PBC follow-up patient:</b> Tab Udiliv 300 mg TDS with food, check LFTs every 3 months. "
"(2) <b>ICP (itchy pregnant patient with raised bile acids):</b> Tab Udiliv 300 mg BD–TDS till delivery. "
"(3) <b>Fatty liver / elevated LFTs (adjunct):</b> Tab Udiliv 300 mg BD with food, review at 3 months. "
"Always confirm the gallstone is radiolucent before prescribing for dissolution."
)
tip_para = Paragraph(tip_content, TIP)
tip_box = Table([[tip_para]], colWidths=[W])
tip_box.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), YELLOW_LT),
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#F9A825")),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
]))
story.append(KeepTogether([
Paragraph("SPECIAL POPULATIONS", SECHSL),
HRFlowable(width=W, thickness=1.5, color=SLATE, spaceAfter=4),
sp_tbl,
Spacer(1, 4*mm),
tip_box,
]))
# ════════════════════════════════════════════
# MONITORING TABLE
# ════════════════════════════════════════════
story.append(Spacer(1, 4*mm))
mon_rows = [
["Liver Function Tests (LFTs)", "Every 3–6 months", "Primary response marker; expect improvement in ALP, GGT, bilirubin"],
["Ultrasound Abdomen", "Every 6–12 months", "Assess gallstone dissolution / biliary changes"],
["Serum bile acids", "As clinically indicated", "Especially in ICP — target normalisation"],
["Symptoms review", "Each OPD visit", "Pruritus, jaundice, pain — assess disease progression"],
]
mon_data = [
[Paragraph("Parameter", CELLTOP), Paragraph("Frequency", CELLTOP), Paragraph("Why", CELLTOP)]
] + [
[Paragraph(r[0], CELLB), Paragraph(r[1], CELLNC), Paragraph(r[2], CELLN)] for r in mon_rows
]
mon_tbl = Table(mon_data, colWidths=[W*0.24, W*0.20, W*0.54])
mon_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), BLUE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, BLUE_LT]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#CCCCCC")),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(KeepTogether([
Paragraph("MONITORING", S("mh", fontSize=11, textColor=BLUE, fontName="Helvetica-Bold", leading=15)),
HRFlowable(width=W, thickness=1.5, color=BLUE, spaceAfter=4),
mon_tbl,
]))
# ════════════════════════════════════════════
# FOOTER
# ════════════════════════════════════════════
story.append(Spacer(1, 4*mm))
foot_tbl = Table([[Paragraph(
"References: Goodman & Gilman's Pharmacological Basis of Therapeutics 14e | "
"Katzung Basic & Clinical Pharmacology 16e | StatPearls — UDCA (NCBI NBK545303) | "
"Pediatric Oncall Drug Index | FDA Prescribing Information. "
"For educational/OPD reference only. Always verify dose with current guidelines before prescribing.",
FOOT)]], colWidths=[W])
foot_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LGREY),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 8),
]))
story.append(foot_tbl)
doc.build(story)
print(f"PDF saved: {OUTPUT}")
cd /tmp/workspace/udiliv-pdf && python generate_udiliv_pdf.py 2>&1
Udiliv UDCA Quick Reference
PDF Document · PDF
| Section | Colour | Content |
|---|---|---|
| Header | Teal | Drug name, class, mechanism at a glance |
| Dosing by Indication | Teal | 8 indications - PBC, gallstone dissolution/prevention, ICP, NAFLD, PSC, CF |
| Dose Calculator | Teal (box) | Weight-based dose guide for 50–80 kg patients using 300 mg tablets |
| Drug Interactions | Orange | 9 interactions (cholestyramine, antacids, OCPs, cyclosporine, etc.) |
| Patient Counselling | Green | 9 key OPD counselling points |
| Contraindications | Red | 8 absolute/relative contraindications with reasons |
| Side Effects | Purple | 7 adverse effects (notably: no hepatotoxicity) |
| Special Populations | Slate | Pregnancy (SAFE/ICP), renal, hepatic, elderly - colour coded |
| Monitoring | Blue | LFTs, USG, bile acids - when and why |
| Quick OPD Tip box | Yellow | 3 common intern scenarios with ready-to-use prescriptions |