Please give me a proper diet plan for GERD AND H PYLORI INFECTION
"gastroesophageal reflux" AND diet
diet plan GERD H pylori infection foods to eat avoid
| Category | Examples |
|---|---|
| Easily digestible carbs | White rice, oats, white bread/pasta, plain crackers, potatoes (boiled/baked) |
| Lean proteins | Skinless chicken/turkey, white fish, eggs, tofu, legumes (steamed/grilled/baked, not fried) |
| Low-acid fruits | Bananas, melons, pears, apples (peeled if in acute phase) |
| Non-irritating vegetables | Broccoli, leafy greens, carrots, green beans, cooked/canned vegetables |
| Healthy fats (moderate amounts) | Olive oil, avocado, nuts, seeds, fatty fish |
| Probiotics | Plain low-fat yogurt, kefir (may help suppress H. pylori and reduce antibiotic side effects) |
| Soothing drinks | Weak herbal tea (non-caffeinated), water, diluted non-citrus juices |
| Other helpful additions | Honey, turmeric, ginger (mild amounts) |
Generate a PDF quick-reference guide of foods to eat/avoid with this diet
/tmp/skills/pdf
mkdir -p /tmp/workspace/gerd-hpylori-diet && ls -la /tmp/workspace/
~/gerd-hpylori-diet/build_pdf.py
from reportlab.lib.pagesizes import letter
from reportlab.lib.units import inch
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer, HRFlowable, ListFlowable, ListItem
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT
GREEN = colors.HexColor("#2e7d32")
RED = colors.HexColor("#c62828")
LIGHT_GREEN = colors.HexColor("#e8f5e9")
LIGHT_RED = colors.HexColor("#ffebee")
DARK = colors.HexColor("#222222")
BLUE_HEAD = colors.HexColor("#1565c0")
GREY = colors.HexColor("#f2f2f2")
styles = getSampleStyleSheet()
title_style = ParagraphStyle(
"TitleStyle", parent=styles["Title"], fontSize=20, textColor=colors.white,
alignment=TA_CENTER, spaceAfter=2
)
subtitle_style = ParagraphStyle(
"SubtitleStyle", parent=styles["Normal"], fontSize=11, textColor=colors.white,
alignment=TA_CENTER, spaceAfter=0
)
section_head = ParagraphStyle(
"SectionHead", parent=styles["Heading2"], fontSize=13, textColor=colors.white,
spaceBefore=0, spaceAfter=0, alignment=TA_LEFT, leftIndent=0
)
body = ParagraphStyle("Body", parent=styles["Normal"], fontSize=9.5, leading=13, textColor=DARK)
body_bold = ParagraphStyle("BodyBold", parent=body, fontName="Helvetica-Bold")
cell_style = ParagraphStyle("Cell", parent=styles["Normal"], fontSize=9, leading=12.5, textColor=DARK)
cell_head = ParagraphStyle("CellHead", parent=styles["Normal"], fontSize=9.5, leading=12, textColor=colors.white, fontName="Helvetica-Bold")
note_style = ParagraphStyle("Note", parent=styles["Normal"], fontSize=8.5, leading=11.5, textColor=colors.HexColor("#555555"))
footer_style = ParagraphStyle("Footer", parent=styles["Normal"], fontSize=7.5, leading=10, textColor=colors.HexColor("#777777"), alignment=TA_CENTER)
def P(text, style=cell_style):
return Paragraph(text, style)
doc = SimpleDocTemplate(
"/tmp/workspace/gerd-hpylori-diet/GERD_Hpylori_Diet_Quick_Reference.pdf",
pagesize=letter,
topMargin=0.35*inch, bottomMargin=0.4*inch,
leftMargin=0.5*inch, rightMargin=0.5*inch,
title="GERD & H. pylori Diet Quick Reference",
)
elements = []
# ---------- HEADER BANNER ----------
header_table = Table(
[[Paragraph("GERD & H. pylori Diet", title_style)],
[Paragraph("Quick-Reference Guide to Foods to Eat & Avoid", subtitle_style)]],
colWidths=[7.0*inch]
)
header_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#0d47a1")),
("TOPPADDING", (0,0), (-1,0), 10),
("BOTTOMPADDING", (0,0), (-1,0), 2),
("TOPPADDING", (0,1), (-1,1), 0),
("BOTTOMPADDING", (0,1), (-1,1), 10),
("ALIGN", (0,0), (-1,-1), "CENTER"),
]))
elements.append(header_table)
elements.append(Spacer(1, 12))
# ---------- INTRO NOTE ----------
intro = Paragraph(
"This sheet supports symptom relief for <b>Gastroesophageal Reflux Disease (GERD)</b> and "
"<b>H. pylori-related gastritis</b>. Diet does not cure H. pylori — antibiotic eradication "
"therapy prescribed by a physician is required. Use this guide alongside medical treatment.",
note_style
)
elements.append(intro)
elements.append(Spacer(1, 10))
# ---------- EAT / AVOID TABLE ----------
def section_header_row(text, bgcolor):
p = Paragraph(text, cell_head)
t = Table([[p]], colWidths=[3.35*inch])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bgcolor),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 8),
]))
return t
eat_items = [
("Grains & Starches", "White rice, oats, white bread/pasta, plain crackers, boiled/baked potatoes"),
("Lean Proteins", "Skinless chicken, turkey, white fish, eggs, tofu, legumes (grilled/baked/steamed, not fried)"),
("Low-Acid Fruits", "Bananas, melons, pears, apples (peeled during flare-ups)"),
("Vegetables", "Broccoli, leafy greens, carrots, green beans (cooked or canned)"),
("Healthy Fats (moderate)", "Olive oil, avocado, nuts, seeds, fatty fish"),
("Probiotics", "Plain low-fat yogurt, kefir"),
("Drinks", "Water, weak herbal tea (non-caffeinated), diluted non-citrus juice"),
("Helpful Extras", "Honey, turmeric, mild ginger"),
]
avoid_items = [
("Caffeine", "Coffee, black tea, cola, energy drinks"),
("Alcohol", "Beer, wine, spirits"),
("Spicy Foods", "Chili, hot peppers, mustard, excess spice blends"),
("High-Fat / Fried Foods", "Fried meats, processed cheese, creamy sauces, fast food"),
("Acidic Foods", "Citrus fruits, tomato sauces/ketchup, vinegar"),
("Carbonated Drinks", "Soda, sparkling water"),
("Chocolate & Mint", "Both relax the lower esophageal sphincter"),
("Processed Foods", "Smoked, pickled, or heavily processed/salted foods"),
]
eat_rows = [[section_header_row("✓ FOODS TO EAT", GREEN)]]
eat_data = [[P("<b>"+cat+"</b>", cell_style), P(items)] for cat, items in eat_items]
avoid_rows = [[section_header_row("✗ FOODS TO AVOID", RED)]]
avoid_data = [[P("<b>"+cat+"</b>", cell_style), P(items)] for cat, items in avoid_items]
eat_table = Table(eat_data, colWidths=[1.35*inch, 2.0*inch])
eat_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LIGHT_GREEN),
("GRID", (0,0), (-1,-1), 0.5, colors.white),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
]))
avoid_table = Table(avoid_data, colWidths=[1.5*inch, 1.85*inch])
avoid_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LIGHT_RED),
("GRID", (0,0), (-1,-1), 0.5, colors.white),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
]))
two_col = Table(
[[eat_rows[0][0], avoid_rows[0][0]], [eat_table, avoid_table]],
colWidths=[3.35*inch, 3.35*inch]
)
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),
]))
elements.append(two_col)
elements.append(Spacer(1, 14))
# ---------- SAMPLE DAY ----------
sample_head = section_header_row("SAMPLE ONE-DAY MEAL PLAN", BLUE_HEAD)
sample_head._argW[0] = 6.7*inch
sample_data = [
["On Waking", "Glass of water, optional splash of honey"],
["Breakfast", "Oatmeal with banana, boiled egg, weak herbal tea"],
["Mid-Morning Snack", "Plain low-fat yogurt with a few berries"],
["Lunch", "Grilled chicken or fish, boiled rice, steamed broccoli or green beans"],
["Afternoon Snack", "Ripe pear or crackers with smooth peanut butter"],
["Dinner (3+ hrs before bed)", "Baked white fish or tofu, mashed potato, cooked carrots"],
["Evening", "Non-mint herbal tea if needed; avoid eating late"],
]
sample_table_rows = [[P("<b>"+t+"</b>", cell_style), P(d)] for t, d in sample_data]
sample_table = Table(sample_table_rows, colWidths=[1.9*inch, 4.8*inch])
sample_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), GREY),
("GRID", (0,0), (-1,-1), 0.5, colors.white),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("ROWBACKGROUNDS", (0,0), (-1,-1), [GREY, colors.white]),
]))
elements.append(Table([[sample_head]], colWidths=[6.7*inch], style=TableStyle([
("LEFTPADDING", (0,0), (-1,-1), 0), ("RIGHTPADDING", (0,0), (-1,-1), 0),
])))
elements.append(sample_table)
elements.append(Spacer(1, 14))
# ---------- LIFESTYLE TIPS ----------
tips_head = section_header_row("KEY LIFESTYLE TIPS", colors.HexColor("#6a1b9a"))
elements.append(Table([[tips_head]], colWidths=[6.7*inch], style=TableStyle([
("LEFTPADDING", (0,0), (-1,-1), 0), ("RIGHTPADDING", (0,0), (-1,-1), 0),
])))
elements.append(Spacer(1, 4))
tips = [
"Eat small, frequent meals instead of large ones",
"Don't lie down for at least 3 hours after eating",
"Elevate the head of the bed 6-8 inches if nighttime reflux occurs",
"Avoid tight clothing around the abdomen",
"Work toward a healthy weight - excess weight strongly worsens GERD",
"Stop smoking - nicotine relaxes the sphincter and impairs mucosal healing",
"Eat slowly and chew food thoroughly",
]
tip_list = ListFlowable(
[ListItem(Paragraph(t, body), bulletColor=colors.HexColor("#6a1b9a")) for t in tips],
bulletType="bullet", start="circle", leftIndent=14, bulletFontSize=6, spaceBefore=2, spaceAfter=2
)
elements.append(tip_list)
elements.append(Spacer(1, 14))
elements.append(HRFlowable(width="100%", thickness=0.7, color=colors.HexColor("#cccccc")))
elements.append(Spacer(1, 6))
footer = Paragraph(
"This guide is for general educational purposes and supports, but does not replace, medical care. "
"H. pylori requires physician-directed antibiotic eradication therapy. Consult your doctor or a registered "
"dietitian for a plan personalized to your health needs.",
footer_style
)
elements.append(footer)
doc.build(elements)
print("PDF created successfully")
cd /tmp/workspace/gerd-hpylori-diet && python3 build_pdf.py
cd /tmp/workspace/gerd-hpylori-diet && python3 -c " from pypdf import PdfReader r = PdfReader('GERD_Hpylori_Diet_Quick_Reference.pdf') print('pages:', len(r.pages)) print('size:', r.pages[0].mediabox) " ls -la /tmp/workspace/gerd-hpylori-diet/
~/gerd-hpylori-diet/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
~/gerd-hpylori-diet/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
~/gerd-hpylori-diet/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
~/gerd-hpylori-diet/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
~/gerd-hpylori-diet/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
~/gerd-hpylori-diet/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
~/gerd-hpylori-diet/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
~/gerd-hpylori-diet/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
~/gerd-hpylori-diet/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
~/gerd-hpylori-diet/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
cd /tmp/workspace/gerd-hpylori-diet && python3 build_pdf.py && python3 -c " from pypdf import PdfReader r = PdfReader('GERD_Hpylori_Diet_Quick_Reference.pdf') print('pages:', len(r.pages)) "
GERD Hpylori Diet Quick Reference
PDF Document · PDF
Please give me a 7 days diet plan for GERD and h pylori infection what to eat and what to avoid give me a pdf printable format
ls -la /tmp/workspace/gerd-hpylori-diet/
~/gerd-hpylori-diet/build_7day_pdf.py
from reportlab.lib.pagesizes import letter
from reportlab.lib.units import inch
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer, HRFlowable,
ListFlowable, ListItem, PageBreak
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT
GREEN = colors.HexColor("#2e7d32")
RED = colors.HexColor("#c62828")
LIGHT_GREEN = colors.HexColor("#e8f5e9")
LIGHT_RED = colors.HexColor("#ffebee")
DARK = colors.HexColor("#222222")
BLUE_HEAD = colors.HexColor("#1565c0")
NAVY = colors.HexColor("#0d47a1")
PURPLE = colors.HexColor("#6a1b9a")
GREY = colors.HexColor("#f2f2f2")
DAY_BG = colors.HexColor("#e3f2fd")
styles = getSampleStyleSheet()
title_style = ParagraphStyle("TitleStyle", parent=styles["Title"], fontSize=20, textColor=colors.white, alignment=TA_CENTER, spaceAfter=2)
subtitle_style = ParagraphStyle("SubtitleStyle", parent=styles["Normal"], fontSize=11, textColor=colors.white, alignment=TA_CENTER, spaceAfter=0)
day_title_style = ParagraphStyle("DayTitle", parent=styles["Title"], fontSize=18, textColor=colors.white, alignment=TA_CENTER, spaceAfter=2)
day_sub_style = ParagraphStyle("DaySub", parent=styles["Normal"], fontSize=10, textColor=colors.white, alignment=TA_CENTER, spaceAfter=0)
body = ParagraphStyle("Body", parent=styles["Normal"], fontSize=8.3, leading=10.8, textColor=DARK)
cell_style = ParagraphStyle("Cell", parent=styles["Normal"], fontSize=8, leading=10.5, textColor=DARK)
cell_style_lg = ParagraphStyle("CellLg", parent=styles["Normal"], fontSize=10, leading=14, textColor=DARK)
cell_head = ParagraphStyle("CellHead", parent=styles["Normal"], fontSize=9, leading=11, textColor=colors.white, fontName="Helvetica-Bold")
meal_label_style = ParagraphStyle("MealLabel", parent=styles["Normal"], fontSize=10.5, leading=13, textColor=colors.white, fontName="Helvetica-Bold")
note_style = ParagraphStyle("Note", parent=styles["Normal"], fontSize=7.8, leading=10.2, textColor=colors.HexColor("#555555"))
footer_style = ParagraphStyle("Footer", parent=styles["Normal"], fontSize=7, leading=9, textColor=colors.HexColor("#777777"), alignment=TA_CENTER)
tip_footer_style = ParagraphStyle("TipFooter", parent=styles["Normal"], fontSize=8.5, leading=11, textColor=colors.HexColor("#333333"))
def P(text, style=cell_style):
return Paragraph(text, style)
doc = SimpleDocTemplate(
"/tmp/workspace/gerd-hpylori-diet/GERD_Hpylori_7Day_Diet_Plan.pdf",
pagesize=letter,
topMargin=0.3*inch, bottomMargin=0.3*inch,
leftMargin=0.5*inch, rightMargin=0.5*inch,
title="GERD & H. pylori 7-Day Diet Plan",
)
elements = []
def banner(main_text, sub_text, bg=NAVY, main_style=title_style, sub_style=subtitle_style, width=7.0*inch):
t = Table([[Paragraph(main_text, main_style)], [Paragraph(sub_text, sub_style)]], colWidths=[width])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,0), 6),
("BOTTOMPADDING", (0,0), (-1,0), 1),
("TOPPADDING", (0,1), (-1,1), 0),
("BOTTOMPADDING", (0,1), (-1,1), 6),
("ALIGN", (0,0), (-1,-1), "CENTER"),
]))
return t
def section_header_row(text, bgcolor, width=3.35*inch):
p = Paragraph(text, cell_head)
t = Table([[p]], colWidths=[width])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bgcolor),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 8),
]))
return t
# =========================================================
# PAGE 1: COVER + QUICK REFERENCE (Eat / Avoid)
# =========================================================
elements.append(banner(
"GERD & H. pylori Diet",
"7-Day Printable Diet Plan — Foods to Eat & Avoid",
))
elements.append(Spacer(1, 6))
intro = Paragraph(
"This 7-day plan supports symptom relief for <b>Gastroesophageal Reflux Disease (GERD)</b> and "
"<b>H. pylori-related gastritis</b>. Diet does not cure H. pylori — antibiotic eradication "
"therapy prescribed by a physician is required. Use this plan alongside medical treatment. "
"Adjust portion sizes to your calorie needs; consult a doctor or dietitian for personalization.",
note_style
)
elements.append(intro)
elements.append(Spacer(1, 8))
eat_items = [
("Grains & Starches", "White rice, oats, white bread/pasta, plain crackers, boiled/baked potatoes"),
("Lean Proteins", "Skinless chicken, turkey, white fish, eggs, tofu, legumes (grilled/baked/steamed)"),
("Low-Acid Fruits", "Bananas, melons, pears, apples (peeled during flare-ups)"),
("Vegetables", "Broccoli, leafy greens, carrots, green beans (cooked or canned)"),
("Healthy Fats (moderate)", "Olive oil, avocado, nuts, seeds, fatty fish"),
("Probiotics", "Plain low-fat yogurt, kefir"),
("Drinks", "Water, weak herbal tea (non-caffeinated), diluted non-citrus juice"),
("Helpful Extras", "Honey, turmeric, mild ginger"),
]
avoid_items = [
("Caffeine", "Coffee, black tea, cola, energy drinks"),
("Alcohol", "Beer, wine, spirits"),
("Spicy Foods", "Chili, hot peppers, mustard, excess spice blends"),
("High-Fat / Fried Foods", "Fried meats, processed cheese, creamy sauces, fast food"),
("Acidic Foods", "Citrus fruits, tomato sauces/ketchup, vinegar"),
("Carbonated Drinks", "Soda, sparkling water"),
("Chocolate & Mint", "Both relax the lower esophageal sphincter"),
("Processed Foods", "Smoked, pickled, or heavily processed/salted foods"),
]
eat_data = [[P("<b>"+cat+"</b>", cell_style), P(items)] for cat, items in eat_items]
avoid_data = [[P("<b>"+cat+"</b>", cell_style), P(items)] for cat, items in avoid_items]
eat_table = Table(eat_data, colWidths=[1.35*inch, 2.0*inch])
eat_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LIGHT_GREEN),
("GRID", (0,0), (-1,-1), 0.5, colors.white),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 3), ("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 6), ("RIGHTPADDING", (0,0), (-1,-1), 6),
]))
avoid_table = Table(avoid_data, colWidths=[1.5*inch, 1.85*inch])
avoid_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LIGHT_RED),
("GRID", (0,0), (-1,-1), 0.5, colors.white),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 3), ("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 6), ("RIGHTPADDING", (0,0), (-1,-1), 6),
]))
two_col = Table(
[[section_header_row("✓ FOODS TO EAT", GREEN), section_header_row("✗ FOODS TO AVOID", RED)],
[eat_table, avoid_table]],
colWidths=[3.35*inch, 3.35*inch]
)
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),
]))
elements.append(two_col)
elements.append(Spacer(1, 10))
elements.append(Table([[section_header_row("KEY LIFESTYLE TIPS", PURPLE, width=6.7*inch)]], colWidths=[6.7*inch],
style=TableStyle([("LEFTPADDING",(0,0),(-1,-1),0),("RIGHTPADDING",(0,0),(-1,-1),0)])))
elements.append(Spacer(1, 3))
tips = [
"Eat small, frequent meals instead of large ones",
"Don't lie down for at least 3 hours after eating",
"Elevate the head of the bed 6-8 inches if nighttime reflux occurs",
"Avoid tight clothing around the abdomen; maintain a healthy weight",
"Stop smoking and limit alcohol - both impair mucosal healing",
"Eat slowly and chew food thoroughly; avoid overeating",
]
tip_list = ListFlowable(
[ListItem(Paragraph(t, body), bulletColor=PURPLE) for t in tips],
bulletType="bullet", start="circle", leftIndent=14, bulletFontSize=6, spaceBefore=1, spaceAfter=1
)
elements.append(tip_list)
elements.append(Spacer(1, 8))
elements.append(HRFlowable(width="100%", thickness=0.7, color=colors.HexColor("#cccccc")))
elements.append(Spacer(1, 4))
elements.append(Paragraph(
"This guide is for general education and supports, but does not replace, medical care. "
"H. pylori requires physician-directed antibiotic eradication therapy.",
footer_style
))
elements.append(PageBreak())
# =========================================================
# 7-DAY MEAL PLAN — one page per day
# =========================================================
days_plan = [
("DAY 1", [
("Breakfast", "Oatmeal with sliced banana and a drizzle of honey; herbal tea"),
("Mid-Morning Snack", "Plain low-fat yogurt with a few blueberries"),
("Lunch", "Grilled chicken breast, steamed white rice, steamed green beans"),
("Afternoon Snack", "Rice crackers with smooth peanut butter"),
("Dinner", "Baked white fish (cod/tilapia), mashed potato, steamed carrots"),
("Evening", "Chamomile tea (caffeine-free)"),
]),
("DAY 2", [
("Breakfast", "Scrambled eggs cooked in olive oil, white toast, sliced pear"),
("Mid-Morning Snack", "Small handful of almonds with a banana"),
("Lunch", "Sliced turkey and avocado on white bread, side of leafy greens with olive oil"),
("Afternoon Snack", "Melon slices (cantaloupe or honeydew)"),
("Dinner", "Tofu and vegetable stir-fry (broccoli, carrots, light soy sauce, no chili) with rice"),
("Evening", "Mild ginger tea"),
]),
("DAY 3", [
("Breakfast", "Oat porridge with grated apple and a pinch of cinnamon"),
("Mid-Morning Snack", "Kefir smoothie blended with banana"),
("Lunch", "Baked salmon, white rice or quinoa, steamed green beans"),
("Afternoon Snack", "Whole-grain crackers with cottage cheese"),
("Dinner", "Broth-based chicken and vegetable soup (mild seasoning), bread roll"),
("Evening", "Weak herbal tea"),
]),
("DAY 4", [
("Breakfast", "Boiled eggs, small bowl of oatmeal, honey"),
("Mid-Morning Snack", "Pear slices with a few walnuts"),
("Lunch", "Grilled turkey burger (white bun, lettuce, no ketchup/mustard), steamed carrots"),
("Afternoon Snack", "Plain yogurt with a touch of honey"),
("Dinner", "Baked cod, mashed sweet potato, sauteed spinach"),
("Evening", "Chamomile tea"),
]),
("DAY 5", [
("Breakfast", "Yogurt parfait with banana slices and oats"),
("Mid-Morning Snack", "Rice cakes with smooth almond butter"),
("Lunch", "Mild lentil soup (no tomato base), white rice, steamed broccoli"),
("Afternoon Snack", "Banana or melon slices"),
("Dinner", "Grilled chicken, roasted potatoes, green beans"),
("Evening", "Mild ginger tea"),
]),
("DAY 6", [
("Breakfast", "Oatmeal with diced pear and honey"),
("Mid-Morning Snack", "Pumpkin seeds and a banana"),
("Lunch", "Tofu and vegetable stir-fry with white rice"),
("Afternoon Snack", "Plain low-fat yogurt"),
("Dinner", "Baked white fish, quinoa, steamed carrots and green beans"),
("Evening", "Herbal tea"),
]),
("DAY 7", [
("Breakfast", "Scrambled eggs, whole-grain toast, banana"),
("Mid-Morning Snack", "Kefir (plain)"),
("Lunch", "Grilled chicken salad (leafy greens, cucumber, olive oil dressing), bread roll"),
("Afternoon Snack", "Pear or rice crackers"),
("Dinner", "Baked turkey meatballs (olive oil glaze, no tomato sauce), mashed potato, steamed broccoli"),
("Evening", "Chamomile tea"),
]),
]
meal_icons = {
"Breakfast": "\u2600 Breakfast",
"Mid-Morning Snack": "\u25CF Mid-Morning Snack",
"Lunch": "\u25A0 Lunch",
"Afternoon Snack": "\u25CF Afternoon Snack",
"Dinner": "\u25B2 Dinner",
"Evening": "\u2764 Evening",
}
for i, (day_name, meals) in enumerate(days_plan):
elements.append(banner(day_name, "GERD & H. pylori-Friendly Meal Plan", bg=NAVY,
main_style=day_title_style, sub_style=day_sub_style))
elements.append(Spacer(1, 10))
row_data = []
for meal, desc in meals:
label = meal_icons.get(meal, meal)
row_data.append([P(label, cell_head), P(desc, cell_style_lg)])
meal_table = Table(row_data, colWidths=[1.7*inch, 5.0*inch])
meal_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,-1), BLUE_HEAD),
("BACKGROUND", (1,0), (1,-1), DAY_BG),
("GRID", (0,0), (-1,-1), 0.75, colors.white),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 10),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("ROWBACKGROUNDS", (1,0), (1,-1), [DAY_BG, colors.white]),
]))
elements.append(meal_table)
elements.append(Spacer(1, 16))
elements.append(HRFlowable(width="100%", thickness=0.6, color=colors.HexColor("#cccccc")))
elements.append(Spacer(1, 6))
elements.append(Paragraph(
"<b>Reminder:</b> Eat slowly, avoid lying down for 3 hours after dinner, "
"and keep meal portions moderate. Drink water between meals rather than with large meals.",
tip_footer_style
))
elements.append(Spacer(1, 4))
elements.append(Paragraph(f"GERD & H. pylori 7-Day Diet Plan — Page {i+2} of 8", footer_style))
if i < len(days_plan) - 1:
elements.append(PageBreak())
doc.build(elements)
print("7-day PDF created successfully")
cd /tmp/workspace/gerd-hpylori-diet && python3 build_7day_pdf.py
cd /tmp/workspace/gerd-hpylori-diet && python3 -c " from pypdf import PdfReader r = PdfReader('GERD_Hpylori_7Day_Diet_Plan.pdf') print('pages:', len(r.pages)) " ls -la /tmp/workspace/gerd-hpylori-diet/
GERD Hpylori 7Day Diet Plan
PDF Document · PDF
Find recent research on pre and probiotics for H. pylori and gerd management