Please give a diet plan what to eat or what to not eat after radical nephrectomy in a known case of DM and hypertension please give in a printable format pdf
mkdir -p /tmp/workspace/nephrectomy-diet && ls /tmp/workspace/nephrectomy-diet/
~/nephrectomy-diet/generate_diet_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import PageBreak
OUTPUT_PATH = "/tmp/workspace/nephrectomy-diet/Post_Radical_Nephrectomy_Diet_Plan.pdf"
# ── Color palette ──────────────────────────────────────────────────────────────
DARK_TEAL = colors.HexColor("#1B6E8C")
MID_TEAL = colors.HexColor("#2A9D8F")
LIGHT_TEAL = colors.HexColor("#E0F5F3")
AMBER = colors.HexColor("#E76F51")
AMBER_LIGHT = colors.HexColor("#FDEBD7")
OLIVE = colors.HexColor("#547A45")
OLIVE_LIGHT = colors.HexColor("#E8F3E4")
RED_WARN = colors.HexColor("#C0392B")
RED_LIGHT = colors.HexColor("#FDEDEB")
GOLD = colors.HexColor("#F4A261")
GOLD_LIGHT = colors.HexColor("#FEF5E7")
GRAY_DARK = colors.HexColor("#2C3E50")
GRAY_MID = colors.HexColor("#7F8C8D")
GRAY_LIGHT = colors.HexColor("#ECF0F1")
WHITE = colors.white
def build_styles():
base = getSampleStyleSheet()
styles = {}
styles["title"] = ParagraphStyle(
"title", fontName="Helvetica-Bold", fontSize=20,
textColor=WHITE, alignment=TA_CENTER, spaceAfter=4, leading=26
)
styles["subtitle"] = ParagraphStyle(
"subtitle", fontName="Helvetica", fontSize=11,
textColor=WHITE, alignment=TA_CENTER, spaceAfter=2
)
styles["section_header"] = ParagraphStyle(
"section_header", fontName="Helvetica-Bold", fontSize=13,
textColor=WHITE, alignment=TA_LEFT, spaceAfter=4,
leftIndent=6, leading=18
)
styles["sub_header"] = ParagraphStyle(
"sub_header", fontName="Helvetica-Bold", fontSize=11,
textColor=DARK_TEAL, alignment=TA_LEFT, spaceAfter=3, leading=14
)
styles["body"] = ParagraphStyle(
"body", fontName="Helvetica", fontSize=9.5,
textColor=GRAY_DARK, alignment=TA_JUSTIFY,
spaceAfter=4, leading=14
)
styles["bullet"] = ParagraphStyle(
"bullet", fontName="Helvetica", fontSize=9.5,
textColor=GRAY_DARK, alignment=TA_LEFT,
leftIndent=14, firstLineIndent=-10,
spaceAfter=3, leading=13
)
styles["warning"] = ParagraphStyle(
"warning", fontName="Helvetica-Bold", fontSize=9.5,
textColor=RED_WARN, alignment=TA_LEFT,
leftIndent=14, firstLineIndent=-10,
spaceAfter=3, leading=13
)
styles["table_header"] = ParagraphStyle(
"table_header", fontName="Helvetica-Bold", fontSize=9,
textColor=WHITE, alignment=TA_CENTER, leading=12
)
styles["table_cell"] = ParagraphStyle(
"table_cell", fontName="Helvetica", fontSize=8.5,
textColor=GRAY_DARK, alignment=TA_LEFT, leading=12
)
styles["table_cell_c"] = ParagraphStyle(
"table_cell_c", fontName="Helvetica", fontSize=8.5,
textColor=GRAY_DARK, alignment=TA_CENTER, leading=12
)
styles["footer"] = ParagraphStyle(
"footer", fontName="Helvetica-Oblique", fontSize=7.5,
textColor=GRAY_MID, alignment=TA_CENTER
)
styles["note"] = ParagraphStyle(
"note", fontName="Helvetica-Oblique", fontSize=8.5,
textColor=GRAY_MID, alignment=TA_JUSTIFY,
spaceAfter=3, leading=12
)
styles["green_bullet"] = ParagraphStyle(
"green_bullet", fontName="Helvetica", fontSize=9.5,
textColor=OLIVE, alignment=TA_LEFT,
leftIndent=14, firstLineIndent=-10,
spaceAfter=3, leading=13
)
styles["red_bullet"] = ParagraphStyle(
"red_bullet", fontName="Helvetica", fontSize=9.5,
textColor=RED_WARN, alignment=TA_LEFT,
leftIndent=14, firstLineIndent=-10,
spaceAfter=3, leading=13
)
return styles
def section_header_table(text, bg_color, styles):
"""Returns a full-width colored header bar with white text."""
p = Paragraph(text, styles["section_header"])
t = Table([[p]], colWidths=[17.5 * cm])
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, -1), bg_color),
("TOPPADDING", (0, 0), (-1, -1), 5),
("BOTTOMPADDING", (0, 0), (-1, -1), 5),
("LEFTPADDING", (0, 0), (-1, -1), 8),
("RIGHTPADDING", (0, 0), (-1, -1), 8),
("ROUNDEDCORNERS", [4, 4, 4, 4]),
]))
return t
def colored_box(content_rows, bg_color, styles, border_color=None):
"""Wraps paragraphs in a light-colored box."""
t = Table([[row] for row in content_rows], colWidths=[17.2 * cm])
ts = [
("BACKGROUND", (0, 0), (-1, -1), bg_color),
("TOPPADDING", (0, 0), (-1, -1), 4),
("BOTTOMPADDING", (0, 0), (-1, -1), 4),
("LEFTPADDING", (0, 0), (-1, -1), 10),
("RIGHTPADDING", (0, 0), (-1, -1), 8),
]
if border_color:
ts += [
("BOX", (0, 0), (-1, -1), 1, border_color),
]
t.setStyle(TableStyle(ts))
return t
def build_pdf():
doc = SimpleDocTemplate(
OUTPUT_PATH,
pagesize=A4,
leftMargin=2.0 * cm,
rightMargin=2.0 * cm,
topMargin=2.0 * cm,
bottomMargin=2.2 * cm,
title="Post Radical Nephrectomy Diet Plan",
author="Medical Nutrition Therapy",
)
styles = build_styles()
story = []
# ── HEADER BANNER ─────────────────────────────────────────────────────────
header_data = [
[Paragraph("POST RADICAL NEPHRECTOMY", styles["title"])],
[Paragraph("Diet & Nutrition Plan", styles["subtitle"])],
[Paragraph("For Patients with Diabetes Mellitus & Hypertension", styles["subtitle"])],
]
header_table = Table(header_data, colWidths=[17.5 * cm])
header_table.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, -1), DARK_TEAL),
("TOPPADDING", (0, 0), (-1, -1), 10),
("BOTTOMPADDING", (0, 0), (-1, -1), 10),
("LEFTPADDING", (0, 0), (-1, -1), 12),
("RIGHTPADDING", (0, 0), (-1, -1), 12),
]))
story.append(header_table)
story.append(Spacer(1, 8))
# ── DISCLAIMER ────────────────────────────────────────────────────────────
disc_box = colored_box([
Paragraph(
"<b>Important:</b> This plan is a general clinical guide based on evidence-based nephrology "
"and nutrition guidelines. All recommendations must be individualized by your nephrologist, "
"diabetologist, and registered renal dietitian. Do not change your diet without medical supervision.",
styles["note"]
)
], GOLD_LIGHT, styles, border_color=GOLD)
story.append(disc_box)
story.append(Spacer(1, 10))
# ── GOALS OVERVIEW ────────────────────────────────────────────────────────
story.append(section_header_table(" GOALS OF NUTRITIONAL THERAPY", MID_TEAL, styles))
story.append(Spacer(1, 5))
goals = [
("Protect remaining kidney", "Reduce workload on the solitary remaining kidney, slow any functional decline"),
("Control blood glucose", "Prevent hyperfiltration and further renal injury in diabetes"),
("Control blood pressure", "Target BP < 130/80 mmHg with dietary sodium restriction and DASH-style eating"),
("Prevent malnutrition", "Maintain adequate protein-energy balance; avoid protein-energy wasting (PEW)"),
("Maintain electrolyte balance", "Monitor and adjust potassium, phosphorus, sodium, and fluid intake"),
("Healthy body weight", "Achieve/maintain BMI 18.5-24.9; excess weight worsens hypertension and diabetes"),
]
goal_data = [[
Paragraph(f"<b>{g[0]}</b>", styles["table_cell"]),
Paragraph(g[1], styles["table_cell"])
] for g in goals]
goal_table = Table(
[[Paragraph("Goal", styles["table_header"]), Paragraph("Rationale", styles["table_header"])]] + goal_data,
colWidths=[5.5 * cm, 12 * cm]
)
goal_table.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), DARK_TEAL),
("ROWBACKGROUNDS", (0, 1), (-1, -1), [WHITE, LIGHT_TEAL]),
("GRID", (0, 0), (-1, -1), 0.4, colors.HexColor("#AAAAAA")),
("TOPPADDING", (0, 0), (-1, -1), 5),
("BOTTOMPADDING", (0, 0), (-1, -1), 5),
("LEFTPADDING", (0, 0), (-1, -1), 6),
("RIGHTPADDING", (0, 0), (-1, -1), 6),
("VALIGN", (0, 0), (-1, -1), "TOP"),
]))
story.append(goal_table)
story.append(Spacer(1, 10))
# ── MACRONUTRIENT TARGETS ─────────────────────────────────────────────────
story.append(section_header_table(" DAILY MACRONUTRIENT TARGETS", MID_TEAL, styles))
story.append(Spacer(1, 5))
macro_data = [
["Nutrient", "Target", "Reason"],
["Protein", "0.8–1.0 g/kg body weight/day", "ISRNM guideline for solitary kidney; avoid >1.0 g/kg/day"],
["Total Calories", "25–35 kcal/kg body weight/day", "Adequate energy to prevent muscle breakdown"],
["Carbohydrate", "45–55% of total calories\n(Low GI preferred)", "Glycemic control in DM; choose whole grains, legumes"],
["Fat", "25–35% of total calories\n(Unsaturated preferred)", "Reduce saturated & trans fats; protects cardiovascular health"],
["Sodium", "< 100 mmol/day (~2.3 g/day)", "Blood pressure control; WHO recommendation for CKD/HTN"],
["Potassium", "Monitor; restrict if serum K+ > 5.0 mEq/L", "Solitary kidney may reduce K+ excretion capacity"],
["Phosphorus", "Adjust to maintain normal serum levels", "Restrict dairy, processed food if phosphorus elevated"],
["Fluid", "~1.5–2 L/day (unless advised otherwise)", "Maintains GFR; avoid dehydration in solitary kidney"],
["Fiber", "25–30 g/day", "Improves glycemic control and cardiovascular risk"],
]
col_w = [4.0 * cm, 7.5 * cm, 6.0 * cm]
macro_table = Table(
[[Paragraph(c, styles["table_header"] if r == 0 else (styles["table_cell_c"] if i == 0 else styles["table_cell"])) for i, c in enumerate(row)] for r, row in enumerate(macro_data)],
colWidths=col_w
)
macro_table.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), DARK_TEAL),
("ROWBACKGROUNDS", (0, 1), (-1, -1), [WHITE, LIGHT_TEAL]),
("GRID", (0, 0), (-1, -1), 0.4, colors.HexColor("#AAAAAA")),
("TOPPADDING", (0, 0), (-1, -1), 5),
("BOTTOMPADDING", (0, 0), (-1, -1), 5),
("LEFTPADDING", (0, 0), (-1, -1), 6),
("RIGHTPADDING", (0, 0), (-1, -1), 6),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("FONTNAME", (0, 1), (0, -1), "Helvetica-Bold"),
("FONTSIZE", (0, 1), (0, -1), 8.5),
]))
story.append(macro_table)
story.append(Spacer(1, 10))
# ── SAMPLE DAILY MEAL PLAN ────────────────────────────────────────────────
story.append(section_header_table(" SAMPLE DAILY MEAL PLAN", OLIVE, styles))
story.append(Spacer(1, 5))
meal_data = [
["Meal", "Sample Foods", "Portions / Notes"],
["Early Morning\n(6–7 AM)", "Warm water + lemon\nFenugreek seeds soaked overnight",
"1 glass (250 mL)\n1 tsp seeds in water"],
["Breakfast\n(7:30–8:30 AM)",
"Oatmeal (plain rolled oats) with cinnamon\nor Vegetable daliya (broken wheat)\nOR 2 egg whites scrambled\nLow-fat milk / unsweetened soy milk",
"1 cup cooked oats\nor 1 cup daliya\n2 egg whites\n150 mL milk"],
["Mid-Morning\n(10–10:30 AM)",
"1 small apple / pear / guava\nor 10–12 almonds (unsalted)",
"1 medium fruit\nor small handful"],
["Lunch\n(12:30–1:30 PM)",
"2 small whole-wheat chapati (no salt added)\nSteamed rice (small portion) optional\n1 cup dal (moong/masoor) or chicken breast\nSabzi (any low-K+ vegetable)\nSalad (cucumber, carrot)",
"No added salt in cooking\nProtein from 1 source\nOil: 1 tsp max per meal"],
["Afternoon Snack\n(3:30–4 PM)",
"Unsalted roasted chana (Bengal gram)\nor Cucumber / carrot sticks\nor Buttermilk (low-fat, no salt)",
"30 g chana\nor 1 cup buttermilk\nor raw vegetables freely"],
["Dinner\n(7–8 PM)",
"2 small whole-wheat chapati\n1 cup mixed vegetable sabzi (low potassium)\n1 cup dal OR 75–100 g fish (grilled)\nCurd/yogurt (low-fat, unsalted) optional",
"Avoid red meat\nSmall portions\nFinish by 8 PM"],
["Bedtime Snack\n(10 PM, optional)",
"1 glass warm low-fat milk (unsweetened)\nor 4–5 unsalted whole grain crackers",
"Only if on insulin or glucose-lowering medication requiring late snack"],
]
meal_table = Table(
[[Paragraph(c, styles["table_header"] if r == 0 else styles["table_cell"]) for c in row] for r, row in enumerate(meal_data)],
colWidths=[3.5 * cm, 8.5 * cm, 5.5 * cm]
)
meal_table.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), OLIVE),
("ROWBACKGROUNDS", (0, 1), (-1, -1), [WHITE, OLIVE_LIGHT]),
("GRID", (0, 0), (-1, -1), 0.4, colors.HexColor("#AAAAAA")),
("TOPPADDING", (0, 0), (-1, -1), 5),
("BOTTOMPADDING", (0, 0), (-1, -1), 5),
("LEFTPADDING", (0, 0), (-1, -1), 6),
("RIGHTPADDING", (0, 0), (-1, -1), 6),
("VALIGN", (0, 0), (-1, -1), "TOP"),
]))
story.append(meal_table)
story.append(Spacer(1, 10))
# ── PAGE BREAK ────────────────────────────────────────────────────────────
story.append(PageBreak())
# ── FOODS TO EAT ──────────────────────────────────────────────────────────
story.append(section_header_table(" FOODS TO EAT (RECOMMENDED)", OLIVE, styles))
story.append(Spacer(1, 5))
eat_categories = [
("Grains & Starches",
["Whole wheat chapati / roti (no/low salt)",
"Oats (rolled, plain, unsweetened)",
"Brown rice or steamed white rice (moderate portion)",
"Broken wheat (daliya / bulgur)",
"Quinoa (moderate portion)",
"Whole grain bread (low sodium)"]),
("Protein Sources",
["Egg whites (2–4/day)",
"Fish: rohu, catla, salmon (grilled/steamed, not fried)",
"Skinless chicken breast (boiled/grilled, not fried)",
"Moong dal, masoor dal, chana dal (moderate)",
"Tofu (unsalted, moderate)",
"Low-fat paneer (50–75 g, infrequently)"]),
("Vegetables (Low Potassium Preferred)",
["Cucumber, bottle gourd (lauki), ridge gourd, tinda",
"Cauliflower, cabbage, green beans, peas",
"Carrot, radish, beetroot (small amounts)",
"Onion, garlic (good for BP control)",
"Methi (fenugreek leaves), palak (spinach) in moderation",
"Leach/boil high-K+ vegetables, discard water to reduce potassium"]),
("Fruits (Low to Moderate Potassium)",
["Apple, pear, guava, pineapple, papaya",
"Berries: strawberry, blueberry (antioxidant-rich)",
"Watermelon (1 small slice, low K+)",
"Grapes (small bunch)"]),
("Fats & Oils",
["Olive oil, mustard oil (1–2 tsp per meal)",
"Flaxseeds (omega-3; ground, 1 tsp/day)",
"Walnuts: 2–3 halves/day (unsalted)",
"Almonds: 8–10/day (unsalted)"]),
("Dairy",
["Low-fat milk (150–200 mL/day)",
"Low-fat unsalted curd / yogurt (1 small cup/day)",
"Avoid full-fat dairy and processed cheese"]),
("Beverages",
["Plain water (1.5–2 L/day)",
"Herbal teas (chamomile, cinnamon, ginger, no added sugar)",
"Coconut water: 1 small serving occasionally (check K+ levels first)",
"Diluted lemon water (no salt)"]),
]
for cat, items in eat_categories:
story.append(Paragraph(f"<b>{cat}</b>", styles["sub_header"]))
for item in items:
story.append(Paragraph(f"• {item}", styles["green_bullet"]))
story.append(Spacer(1, 4))
story.append(Spacer(1, 6))
# ── FOODS TO AVOID ────────────────────────────────────────────────────────
story.append(section_header_table(" FOODS TO AVOID (RESTRICTED)", AMBER, styles))
story.append(Spacer(1, 5))
avoid_categories = [
("High-Sodium Foods (Target < 2,300 mg sodium/day)",
["Table salt and cooking salt (minimize; use herbs/spices instead)",
"Pickles, papad, chutneys, sauces, ketchup, soya sauce",
"Namkeen, salted snacks, chips, biscuits",
"Processed/packaged foods, instant noodles, ready meals",
"Salted butter, salted cheese, processed meats",
"Canned vegetables, canned soups (high hidden sodium)"]),
("High-Potassium Foods (if serum K+ elevated)",
["Bananas, oranges, kiwi, avocado, jackfruit (high K+)",
"Potatoes (unless double-boiled & water discarded)",
"Tomatoes, tomato puree/sauce, tomato soup",
"Coconut water (if K+ levels are already elevated)",
"Dried fruits: raisins, dates, apricots, prunes",
"Nuts in large quantities (cashews, peanuts)"]),
("High-Phosphorus Foods",
["Dairy products in excess (full-fat milk, cream, ice cream)",
"Processed foods with phosphate additives (check labels for 'phosphate')",
"Cola / dark sodas (high phosphoric acid content)",
"Organ meats: liver, kidney, brain",
"Whole grains in very large amounts (moderate is fine)"]),
("High-Protein / Red Meat",
["Red meat: mutton, beef, pork (high protein load on solitary kidney)",
"Processed meats: sausage, salami, bacon",
"Protein powder / supplements (unless prescribed by nephrologist)",
"Very high protein diets (> 1.0 g/kg/day) - increases hyperfiltration"]),
("Sugary / High-Glycemic Foods (for Diabetes Control)",
["White sugar, jaggery, honey in excess",
"Sweets, mithai, halwa, gulab jamun, barfi",
"Fruit juices (even fresh; raise glucose rapidly)",
"Soft drinks, energy drinks, sweetened chai/coffee",
"White bread, maida products, bakery items",
"Polished white rice in large quantities"]),
("Harmful Beverages & Supplements",
["Alcohol (increases BP, glucose, dehydration; harmful for kidney)",
"Caffeinated drinks > 1–2 cups/day",
"Herbal supplements / Ayurvedic kadhas without nephrologist approval",
"NSAIDs (ibuprofen, diclofenac) - reduce kidney perfusion",
"High-dose Vitamin C supplements (> 500 mg/day; risk of oxalate deposition)"]),
]
for cat, items in avoid_categories:
story.append(Paragraph(f"<b>{cat}</b>", styles["sub_header"]))
for item in items:
story.append(Paragraph(f"✗ {item}", styles["red_bullet"]))
story.append(Spacer(1, 4))
story.append(Spacer(1, 6))
# ── PAGE BREAK ────────────────────────────────────────────────────────────
story.append(PageBreak())
# ── COOKING TIPS ─────────────────────────────────────────────────────────
story.append(section_header_table(" COOKING & FOOD PREPARATION TIPS", MID_TEAL, styles))
story.append(Spacer(1, 5))
tips = [
("Cook without added salt", "Use lime juice, coriander, cumin, turmeric, ginger, and garlic for flavor instead of salt."),
("Double-boil high-K+ vegetables", "Cut vegetables small, boil twice in large volume water, discard water. This leaches out 30-50% of potassium."),
("Limit oil to 3–4 tsp/day total", "Use measured amounts; prefer steaming, grilling, stir-frying with minimal oil."),
("Choose whole grain over refined", "Whole wheat flour over maida; brown rice over polished white rice (keep portions moderate)."),
("Read food labels", "Check sodium content; avoid foods with > 200 mg sodium per serving."),
("Avoid frying", "Replace frying with steaming, baking, grilling, or boiling wherever possible."),
("Small, frequent meals", "5–6 small meals are better than 2–3 large meals for blood sugar control."),
("Hydration tracking", "Monitor urine color; pale yellow is ideal. Dark urine = increase fluid. Report decreased urine output immediately."),
]
tip_data = [[
Paragraph(f"<b>{t[0]}</b>", styles["table_cell"]),
Paragraph(t[1], styles["table_cell"])
] for t in tips]
tip_table = Table(
[[Paragraph("Tip", styles["table_header"]), Paragraph("Details", styles["table_header"])]] + tip_data,
colWidths=[5 * cm, 12.5 * cm]
)
tip_table.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), MID_TEAL),
("ROWBACKGROUNDS", (0, 1), (-1, -1), [WHITE, LIGHT_TEAL]),
("GRID", (0, 0), (-1, -1), 0.4, colors.HexColor("#AAAAAA")),
("TOPPADDING", (0, 0), (-1, -1), 5),
("BOTTOMPADDING", (0, 0), (-1, -1), 5),
("LEFTPADDING", (0, 0), (-1, -1), 6),
("RIGHTPADDING", (0, 0), (-1, -1), 6),
("VALIGN", (0, 0), (-1, -1), "TOP"),
]))
story.append(tip_table)
story.append(Spacer(1, 10))
# ── SPECIAL CONSIDERATIONS ────────────────────────────────────────────────
story.append(section_header_table(" SPECIAL CONSIDERATIONS", AMBER, styles))
story.append(Spacer(1, 5))
special = [
("<b>Post-Surgery (First 4–6 weeks):</b> Begin with soft, easily digestible foods. "
"Ensure adequate calorie intake to support wound healing. Protein requirements may be slightly higher "
"in the immediate post-operative period (1.0–1.2 g/kg/day) under specialist guidance."),
("<b>Diabetes Management:</b> Monitor blood glucose closely as post-surgical stress can cause "
"glucose swings. Maintain a consistent carbohydrate intake at each meal. Low glycemic index (GI) "
"foods like oats, lentils, and vegetables should form the base. Avoid skipping meals."),
("<b>Hypertension (BP Control):</b> Follow a modified DASH diet: rich in fruits, vegetables, "
"whole grains, low-fat dairy, and limited sodium. Every 1 g reduction in daily sodium intake "
"reduces systolic BP by approximately 2–3 mmHg."),
("<b>Solitary Kidney Protection:</b> Avoid high-protein intake > 1.0 g/kg/day. "
"Avoid dehydration. Avoid NSAIDs (ibuprofen, diclofenac, naproxen) as they reduce renal blood flow. "
"Stay well-hydrated to prevent kidney stones."),
("<b>Potassium & Phosphorus Monitoring:</b> Get serum electrolytes checked every 3–6 months. "
"Restrictions are only needed if levels are elevated. Do not restrict potassium unnecessarily "
"as it is beneficial for blood pressure."),
("<b>Weight Management:</b> Even 5–10% weight loss if overweight significantly improves "
"BP, blood glucose, and reduces hyperfiltration burden on the remaining kidney."),
("<b>Alcohol:</b> Completely avoid. Alcohol raises blood pressure, interferes with "
"antihypertensives, worsens glucose control, and is nephrotoxic."),
("<b>Nutritional Supplements:</b> Water-soluble vitamins (B complex, vitamin C up to 60 mg/day) "
"are generally safe. Avoid fat-soluble vitamin A supplementation (accumulates in CKD). "
"Omega-3 fatty acids from fish/flaxseeds are beneficial. All supplements must be approved by your nephrologist."),
]
spec_box = colored_box([Paragraph(s, styles["body"]) for s in special], AMBER_LIGHT, styles, border_color=AMBER)
story.append(spec_box)
story.append(Spacer(1, 10))
# ── MONITORING SCHEDULE ───────────────────────────────────────────────────
story.append(section_header_table(" MONITORING & FOLLOW-UP SCHEDULE", DARK_TEAL, styles))
story.append(Spacer(1, 5))
monitor_data = [
["Parameter", "Frequency", "Target"],
["Serum creatinine & eGFR", "Every 3 months", "Stable or improving GFR trend"],
["Blood glucose (FPG, PPG, HbA1c)", "Every 3 months", "HbA1c < 7%; FPG 80-130; PPG < 180 mg/dL"],
["Blood pressure", "Weekly at home / monthly clinic", "< 130/80 mmHg"],
["Serum electrolytes (K+, Na+, HCO3-)", "Every 3–6 months", "K+: 3.5–5.0, Na+: 135–145 mEq/L"],
["Serum phosphorus & calcium", "Every 6 months", "Phosphorus 2.5–4.5 mg/dL"],
["Serum albumin & weight", "Every 6 months", "Albumin > 3.5 g/dL; BMI 18.5–24.9"],
["Urine (routine, microalbuminuria)", "Every 6 months", "No proteinuria; no hematuria"],
["Lipid profile", "Every 6–12 months", "LDL < 100 mg/dL"],
["Dietitian review", "Every 6 months", "Individualized dietary adjustments"],
]
mon_table = Table(
[[Paragraph(c, styles["table_header"] if r == 0 else styles["table_cell"]) for c in row] for r, row in enumerate(monitor_data)],
colWidths=[5.5 * cm, 5.5 * cm, 6.5 * cm]
)
mon_table.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), DARK_TEAL),
("ROWBACKGROUNDS", (0, 1), (-1, -1), [WHITE, LIGHT_TEAL]),
("GRID", (0, 0), (-1, -1), 0.4, colors.HexColor("#AAAAAA")),
("TOPPADDING", (0, 0), (-1, -1), 5),
("BOTTOMPADDING", (0, 0), (-1, -1), 5),
("LEFTPADDING", (0, 0), (-1, -1), 6),
("RIGHTPADDING", (0, 0), (-1, -1), 6),
("VALIGN", (0, 0), (-1, -1), "TOP"),
]))
story.append(mon_table)
story.append(Spacer(1, 10))
# ── RED FLAGS ─────────────────────────────────────────────────────────────
story.append(section_header_table(" RED FLAGS — CONSULT YOUR DOCTOR IMMEDIATELY", RED_WARN, styles))
story.append(Spacer(1, 5))
flags = [
"Sudden decrease in urine output (< 400 mL/day)",
"Blood in urine (hematuria) or frothy urine",
"Severe leg/ankle swelling (edema)",
"Blood pressure > 180/110 mmHg despite medication",
"Blood glucose < 70 mg/dL (hypoglycemia: sweating, tremor, confusion)",
"Severe nausea, vomiting, inability to eat for > 24 hours",
"Sudden unexplained weight gain (> 2 kg in 2–3 days)",
"Muscle cramps, weakness, irregular heartbeat (may indicate high K+)",
"Severe flank pain or fever (suspect infection or obstruction)",
]
flag_box = colored_box([Paragraph(f"⚠ {f}", styles["warning"]) for f in flags], RED_LIGHT, styles, border_color=RED_WARN)
story.append(flag_box)
story.append(Spacer(1, 12))
# ── FOOTER ────────────────────────────────────────────────────────────────
story.append(HRFlowable(width="100%", thickness=0.5, color=GRAY_MID))
story.append(Spacer(1, 4))
story.append(Paragraph(
"Sources: Comprehensive Clinical Nephrology 7th Ed. (Elsevier) | "
"Smith and Tanagho's General Urology 19th Ed. | "
"WHO Healthy Diet Guidelines | KDOQI Nutritional Guidelines | ISRNM Commentary",
styles["footer"]
))
story.append(Paragraph(
"This document is for clinical guidance only. Individual dietary requirements must be tailored "
"by a qualified nephrologist and registered renal dietitian.",
styles["footer"]
))
story.append(Spacer(1, 3))
story.append(Paragraph("Generated by Orris Medical AI | August 2026", styles["footer"]))
doc.build(story)
print(f"PDF saved to: {OUTPUT_PATH}")
build_pdf()
cd /tmp/workspace/nephrectomy-diet && python generate_diet_pdf.py
Please give a diet plan what to eat or what to not eat after radical nephrectomy in a known case of DM and hypertension please give in a printable format pdf