Please give me a proper diet plan for GERD AND H PYLORI INFECTION

Reading File
Finding Sources
Finding Sources
Finding Sources
Searching PubMed

"gastroesophageal reflux" AND diet

Searching the Web

diet plan GERD H pylori infection foods to eat avoid

Reading File
Reading File

Diet Plan for GERD + H. pylori Infection

Important note first: diet alone cannot cure H. pylori — it requires antibiotic eradication therapy (typically a PPI plus 2 antibiotics, e.g., triple or quadruple therapy) prescribed by a doctor. Diet is an important supportive measure to reduce symptoms, protect the stomach lining, and improve treatment tolerance. Both conditions overlap heavily in their dietary management because both involve excess acid, gastric irritation, and a compromised gastric/esophageal lining — so one plan can address both together.

Core Principles

  1. Reduce gastric acid stimulation (avoid triggers of acid secretion and lower esophageal sphincter [LES] relaxation)
  2. Avoid mucosal irritants that worsen gastritis from H. pylori
  3. Eat small, frequent meals rather than large ones (reduces gastric distension and reflux)
  4. Maintain healthy weight — obesity is strongly linked to GERD, with meta-analyses showing an odds ratio of ~1.43 for overweight (BMI 25-29.9) and ~1.94 for obesity (BMI >30) compared with normal weight, along with higher rates of erosive esophagitis (Textbook of Family Medicine, 9e)
  5. Support the stomach's protective lining with foods that have anti-inflammatory/antibacterial properties (some evidence for honey, broccoli sprouts, green tea, and probiotics against H. pylori)

Foods to Eat

CategoryExamples
Easily digestible carbsWhite rice, oats, white bread/pasta, plain crackers, potatoes (boiled/baked)
Lean proteinsSkinless chicken/turkey, white fish, eggs, tofu, legumes (steamed/grilled/baked, not fried)
Low-acid fruitsBananas, melons, pears, apples (peeled if in acute phase)
Non-irritating vegetablesBroccoli, leafy greens, carrots, green beans, cooked/canned vegetables
Healthy fats (moderate amounts)Olive oil, avocado, nuts, seeds, fatty fish
ProbioticsPlain low-fat yogurt, kefir (may help suppress H. pylori and reduce antibiotic side effects)
Soothing drinksWeak herbal tea (non-caffeinated), water, diluted non-citrus juices
Other helpful additionsHoney, turmeric, ginger (mild amounts)

Foods to Avoid

  • Caffeine: coffee, black tea, cola, energy drinks (relaxes LES, stimulates acid)
  • Alcohol: irritates gastric mucosa and weakens LES
  • Spicy foods: chili, hot peppers, mustard, excess spices
  • High-fat/fried foods: fried meats, processed cheese, creamy sauces, fast food (slows gastric emptying, relaxes LES)
  • Acidic foods: citrus fruits (orange, lemon, grapefruit), tomato-based sauces, vinegar
  • Carbonated beverages: increase gastric distension and belching, worsening reflux
  • Chocolate and mint: both relax the LES
  • Processed/smoked/pickled foods: linked with higher H. pylori-associated gastric irritation
  • Large, heavy meals late at night

Sample One-Day Meal Plan

  • On waking: A glass of water, optionally with a small amount of honey
  • Breakfast: Oatmeal with banana, a boiled egg, weak herbal tea
  • Mid-morning snack: Plain low-fat yogurt with a few berries
  • Lunch: Grilled/steamed chicken or fish, boiled rice, steamed broccoli or green beans
  • Afternoon snack: A ripe pear or a few crackers with smooth peanut butter
  • Dinner (eaten at least 3 hours before lying down): Baked white fish or tofu, mashed potato, cooked carrots
  • Evening: Herbal (non-mint, non-caffeinated) tea if needed, avoid eating late

Lifestyle Measures (as important as diet)

  • Eat smaller meals more frequently rather than 2-3 large meals
  • Don't lie down for at least 3 hours after eating
  • Elevate the head of the bed by 6-8 inches if nighttime reflux occurs
  • Avoid tight clothing around the abdomen
  • Work toward weight loss if overweight/obese — this is one of the most evidence-backed interventions for GERD
  • Stop smoking (nicotine relaxes the LES and impairs healing of gastric mucosa)
  • Chew food slowly and thoroughly

What the evidence shows

A 2024 systematic review and meta-analysis of dietary intervention studies in GERD (Lakananurak et al., Nutrients 2024, PMID 38337748) found that low-carbohydrate and low-fat dietary patterns were associated with improved reflux symptoms and reduced esophageal acid exposure, supporting the general "avoid high-fat/refined-carb" approach outlined above. A separate 2025 systematic review on pediatric GERD also supports dietary modification plus probiotic supplementation as adjuncts to standard care (PMID 40604920). These are consistent with, and reinforce, the clinical dietary recommendations above — I did not find evidence contradicting the standard approach.

Bottom line

This diet plan reduces symptom burden and supports gut healing for both conditions simultaneously, but H. pylori still needs confirmed eradication (urea breath test, stool antigen test, or biopsy-based testing followed by antibiotic therapy) — please make sure this is being managed by a physician alongside the dietary changes. If you'd like, I can tailor this into a full weekly meal plan or account for other conditions (diabetes, IBS, allergies) you may have.

Generate a PDF quick-reference guide of foods to eat/avoid with this diet

Reading File
Browsing Directory

/tmp/skills/pdf

Running Command

mkdir -p /tmp/workspace/gerd-hpylori-diet && ls -la /tmp/workspace/

I'll build this with reportlab, using tables and color coding for a clean quick-reference sheet.
Writing File

~/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 &mdash; 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 &amp; 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 &amp; Mint", "Both relax the lower esophageal sphincter"),
    ("Processed Foods", "Smoked, pickled, or heavily processed/salted foods"),
]

eat_rows = [[section_header_row("&#10003; 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("&#10007; 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")
Running Command

cd /tmp/workspace/gerd-hpylori-diet && python3 build_pdf.py

Running Command

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/

It spilled to 2 pages. Let me tighten spacing to fit on a single page for a true "quick reference."
Editing File

~/gerd-hpylori-diet/build_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
Editing File

~/gerd-hpylori-diet/build_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
Now reduce padding/spacers throughout:
Editing File

~/gerd-hpylori-diet/build_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
Editing File

~/gerd-hpylori-diet/build_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
Editing File

~/gerd-hpylori-diet/build_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
Editing File

~/gerd-hpylori-diet/build_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
Editing File

~/gerd-hpylori-diet/build_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
Editing File

~/gerd-hpylori-diet/build_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
Editing File

~/gerd-hpylori-diet/build_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
Editing File

~/gerd-hpylori-diet/build_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/gerd-hpylori-diet/build_pdf.py'
Now rebuild and check page count.
Running Command

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)) "

Now fits on a single page as intended for a quick-reference sheet.

GERD Hpylori Diet Quick Reference

PDF Document · PDF

The one-page guide includes:
  • Foods to Eat (green) vs Foods to Avoid (red) side-by-side comparison table
  • A sample one-day meal plan
  • Key lifestyle tips (meal timing, sleep position, weight, smoking, etc.)
  • A footer reminder that H. pylori still requires physician-prescribed antibiotic eradication therapy
Feel free to print or save it as a fridge/counter reference. Let me know if you'd like a version with checkboxes for a printable weekly tracker, or one covering a full 7-day meal plan instead.

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

Running Command

ls -la /tmp/workspace/gerd-hpylori-diet/

I'll build a new PDF: a cover/quick-reference page followed by a 7-day meal plan (one page per day), all printable.
Writing File

~/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 &amp; H. pylori Diet",
    "7-Day Printable Diet Plan &mdash; Foods to Eat &amp; 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 &mdash; 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 &amp; 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 &amp; 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("&#10003; FOODS TO EAT", GREEN), section_header_row("&#10007; 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 &amp; 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 &amp; H. pylori 7-Day Diet Plan &mdash; 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")
Running Command

cd /tmp/workspace/gerd-hpylori-diet && python3 build_7day_pdf.py

Running Command

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/

8 pages as expected (1 quick-reference/cover page + 7 daily meal plan pages). The PDF is ready:

GERD Hpylori 7Day Diet Plan

PDF Document · PDF

What's inside:
  • Page 1: Quick-reference cover - foods to eat (green) vs. avoid (red), plus key lifestyle tips
  • Pages 2-8: One full day per page (Day 1-7), each with Breakfast, Mid-Morning Snack, Lunch, Afternoon Snack, Dinner, and Evening drink, all built from GERD/H. pylori-safe foods (lean proteins, low-acid fruits, non-fried preparations, no caffeine/alcohol/spice/acidic or fried foods)
Meal plan highlights:
  • Rotates proteins across the week: chicken, turkey, white fish, salmon, cod, eggs, tofu, lentils
  • Uses gentle carbs (rice, oats, potatoes, quinoa, white bread) and low-acid produce (banana, pear, melon, apple, broccoli, carrots, green beans, spinach)
  • All evening drinks are caffeine-free (chamomile, ginger, weak herbal tea)
  • Each page includes a reminder footer about eating slowly, not lying down after meals, and moderate portions
A reminder that stays true from before: this plan supports symptom control, but H. pylori eradication still needs a physician-prescribed antibiotic course. If you have any food allergies, diabetes, or other conditions to factor in, let me know and I can adjust the plan.

Find recent research on pre and probiotics for H. pylori and gerd management

Reading File
Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.
This is a shared conversation. Sign in to Orris to start your own chat.