~/vishakha-nutrition-guide/create_guide.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
VerticalAlign, PageNumber, Header, Footer, ImageRun, PageBreak
} = require('docx');
const fs = require('fs');
// Color palette
const COLORS = {
darkGreen: "1B5E20",
medGreen: "2E7D32",
lightGreen: "E8F5E9",
orange: "E65100",
lightOrange: "FFF3E0",
red: "B71C1C",
lightRed: "FFEBEE",
blue: "0D47A1",
lightBlue: "E3F2FD",
yellow: "F57F17",
lightYellow: "FFFDE7",
gray: "424242",
lightGray: "F5F5F5",
white: "FFFFFF",
teal: "004D40",
lightTeal: "E0F2F1",
};
function heading1(text) {
return new Paragraph({
text,
heading: HeadingLevel.HEADING_1,
spacing: { before: 360, after: 160 },
children: [new TextRun({ text, bold: true, size: 32, color: COLORS.darkGreen, font: "Calibri" })]
});
}
function heading2(text, color = COLORS.medGreen) {
return new Paragraph({
spacing: { before: 280, after: 120 },
children: [new TextRun({ text, bold: true, size: 26, color, font: "Calibri" })]
});
}
function heading3(text) {
return new Paragraph({
spacing: { before: 200, after: 80 },
children: [new TextRun({ text, bold: true, size: 22, color: COLORS.teal, font: "Calibri" })]
});
}
function para(text, options = {}) {
return new Paragraph({
spacing: { before: 60, after: 60 },
children: [new TextRun({ text, size: 20, font: "Calibri", color: COLORS.gray, ...options })]
});
}
function bullet(text, bold = false) {
return new Paragraph({
bullet: { level: 0 },
spacing: { before: 40, after: 40 },
children: [new TextRun({ text, size: 20, font: "Calibri", color: COLORS.gray, bold })]
});
}
function subbullet(text) {
return new Paragraph({
bullet: { level: 1 },
spacing: { before: 30, after: 30 },
children: [new TextRun({ text, size: 19, font: "Calibri", color: COLORS.gray })]
});
}
function divider() {
return new Paragraph({
spacing: { before: 120, after: 120 },
border: { bottom: { color: COLORS.lightGreen, size: 6, style: BorderStyle.SINGLE } },
children: [new TextRun({ text: "" })]
});
}
function colorBox(text, bgColor = COLORS.lightGreen, textColor = COLORS.darkGreen) {
return new Paragraph({
spacing: { before: 80, after: 80 },
indent: { left: 200, right: 200 },
shading: { type: ShadingType.CLEAR, color: "auto", fill: bgColor },
children: [new TextRun({ text, size: 20, font: "Calibri", color: textColor, bold: true })]
});
}
function makeTable(headers, rows, headerBg = COLORS.medGreen) {
const headerRow = new TableRow({
tableHeader: true,
children: headers.map(h => new TableCell({
shading: { type: ShadingType.CLEAR, color: "auto", fill: headerBg },
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: h, bold: true, size: 19, color: COLORS.white, font: "Calibri" })]
})]
}))
});
const dataRows = rows.map((row, i) => new TableRow({
children: row.map((cell, j) => new TableCell({
shading: { type: ShadingType.CLEAR, color: "auto", fill: i % 2 === 0 ? COLORS.white : COLORS.lightGray },
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({
alignment: j === 0 ? AlignmentType.LEFT : AlignmentType.CENTER,
children: [new TextRun({ text: cell, size: 19, font: "Calibri", color: COLORS.gray, bold: j === 0 })]
})]
}))
}));
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [headerRow, ...dataRows],
margins: { top: 80, bottom: 80, left: 80, right: 80 }
});
}
function statusTable() {
const rows = [
["Haemoglobin", "11.6 g/dL", "12.0-16.0 g/dL", "⚠ LOW - Mild Anaemia", COLORS.lightOrange],
["Vitamin D (25-OH)", "9.6 ng/mL", "30-100 ng/mL", "🔴 DEFICIENT - Severe", COLORS.lightRed],
["Vitamin B12", "242 pg/mL", "211-911 pg/mL", "✓ Normal (low-normal)", COLORS.lightGreen],
["Serum Calcium", "9.84 mg/dL", "8.5-10.5 mg/dL", "✓ Normal", COLORS.lightGreen],
["Blood Sugar (RBS)", "80 mg/dL", "80-120 mg/dL", "✓ Normal", COLORS.lightGreen],
["HbA1c", "5.4%", "≤5.6%", "✓ Non-Diabetic", COLORS.lightGreen],
["TSH (Thyroid)", "1.20 µIU/mL", "0.30-4.50", "✓ Excellent", COLORS.lightGreen],
["Serum Cholesterol", "127.3 mg/dL", "<200 mg/dL", "✓ Excellent", COLORS.lightGreen],
];
const headerRow = new TableRow({
tableHeader: true,
children: ["Test", "Your Value", "Normal Range", "Status"].map(h =>
new TableCell({
shading: { type: ShadingType.CLEAR, color: "auto", fill: COLORS.teal },
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: h, bold: true, size: 19, color: COLORS.white, font: "Calibri" })]
})]
})
)
});
const dataRows = rows.map(([test, val, range, status, bg]) =>
new TableRow({
children: [test, val, range, status].map((cell, j) =>
new TableCell({
shading: { type: ShadingType.CLEAR, color: "auto", fill: j === 3 ? bg : COLORS.white },
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({
alignment: j === 0 ? AlignmentType.LEFT : AlignmentType.CENTER,
children: [new TextRun({ text: cell, size: 19, font: "Calibri", color: COLORS.gray, bold: j === 0 || j === 3 })]
})]
})
)
})
);
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [headerRow, ...dataRows],
margins: { top: 80, bottom: 80, left: 80, right: 80 }
});
}
// ─── BUILD DOCUMENT ───────────────────────────────────────────────────────────
const doc = new Document({
styles: {
default: {
document: {
run: { font: "Calibri", size: 20 }
}
}
},
sections: [{
properties: {
page: {
margin: { top: 900, bottom: 900, left: 1000, right: 1000 }
}
},
headers: {
default: new Header({
children: [new Paragraph({
alignment: AlignmentType.RIGHT,
border: { bottom: { color: COLORS.medGreen, size: 4, style: BorderStyle.SINGLE } },
children: [new TextRun({ text: "Personalized Preconception Nutrition Guide | Vishakha Akash Bhatiya", size: 17, color: COLORS.medGreen, font: "Calibri", italics: true })]
})]
})
},
footers: {
default: new Footer({
children: [new Paragraph({
alignment: AlignmentType.CENTER,
border: { top: { color: COLORS.lightGreen, size: 4, style: BorderStyle.SINGLE } },
children: [
new TextRun({ text: "Generated by Orris Health Assistant | Based on Lab Report dated 22/02/2026 | Page ", size: 16, color: COLORS.gray, font: "Calibri" }),
new TextRun({ children: [PageNumber.CURRENT], size: 16, font: "Calibri", color: COLORS.gray }),
]
})]
})
},
children: [
// ── COVER ──────────────────────────────────────────────────────────────
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 600, after: 100 },
children: [new TextRun({ text: "🌿", size: 72, font: "Segoe UI Emoji" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 0, after: 80 },
children: [new TextRun({ text: "PERSONALIZED PRECONCEPTION", bold: true, size: 42, color: COLORS.darkGreen, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 0, after: 80 },
children: [new TextRun({ text: "NUTRITION GUIDE", bold: true, size: 42, color: COLORS.darkGreen, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 80, after: 40 },
shading: { type: ShadingType.CLEAR, color: "auto", fill: COLORS.lightGreen },
children: [new TextRun({ text: "Prepared for: Vishakha Akash Bhatiya | Age: 29 years", size: 22, color: COLORS.teal, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 20, after: 40 },
shading: { type: ShadingType.CLEAR, color: "auto", fill: COLORS.lightGreen },
children: [new TextRun({ text: "Based on Lab Report: 22/02/2026 | Guide Date: June 2026", size: 20, color: COLORS.teal, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 40, after: 600 },
children: [new TextRun({ text: "Goal: Optimize Nutrition for Conception & Healthy Pregnancy", size: 21, color: COLORS.orange, font: "Calibri", bold: true, italics: true })]
}),
// Page break after cover
new Paragraph({ children: [new PageBreak()] }),
// ── SECTION 1: YOUR HEALTH SNAPSHOT ───────────────────────────────────
heading1("1. Your Health Snapshot"),
para("The following table summarizes your key lab results from your full body report dated 22/02/2026. Your nutrition plan is designed specifically to address your deficiencies and support healthy conception."),
new Paragraph({ spacing: { before: 160, after: 160 }, children: [new TextRun("")] }),
statusTable(),
new Paragraph({ spacing: { before: 200, after: 100 }, children: [new TextRun("")] }),
colorBox("⚠ Two key issues identified: (1) Mild Iron Deficiency Anaemia (2) Severe Vitamin D Deficiency. Both are addressed in this guide.", COLORS.lightOrange, COLORS.orange),
colorBox("✓ Excellent findings: Thyroid (TSH 1.20), Blood Sugar (HbA1c 5.4%), Cholesterol all normal. Strong foundation for conception.", COLORS.lightGreen, COLORS.darkGreen),
divider(),
// ── SECTION 2: YOUR NUTRIENT TARGETS ──────────────────────────────────
heading1("2. Your Daily Nutrient Targets"),
para("Based on your reports and preconception needs, these are your personal daily targets:"),
new Paragraph({ spacing: { before: 120, after: 120 }, children: [new TextRun("")] }),
makeTable(
["Nutrient", "Your Status", "Daily Target", "Priority"],
[
["Iron", "Low (Hb 11.6)", "27 mg/day (pregnancy) / 18 mg now", "🔴 HIGH"],
["Vitamin D", "Severely Deficient (9.6)", "1000-2000 IU/day (maintenance)", "🔴 HIGH"],
["Folic Acid", "Being supplemented ✓", "500 mcg/day (already taking)", "✓ MET"],
["Calcium", "Normal (9.84)", "1000 mg/day total", "⚠ MODERATE"],
["Vitamin B12", "Low-normal (242)", "2.4 mcg/day", "⚠ MONITOR"],
["Protein", "Not tested", "60-75 g/day", "⚠ IMPORTANT"],
["Omega-3", "Not tested", "200-300 mg DHA/day", "⚠ IMPORTANT"],
["Zinc", "Not tested", "8-11 mg/day", "⚠ IMPORTANT"],
],
COLORS.blue
),
divider(),
// ── SECTION 3: IRON NUTRITION PLAN ────────────────────────────────────
heading1("3. Iron Nutrition Plan"),
colorBox("Your Haemoglobin: 11.6 g/dL | Target: ≥12.0 g/dL | Pattern: Iron Deficiency Anaemia (Mentzer Index 20.51)", COLORS.lightOrange, COLORS.orange),
heading2("Best Iron-Rich Foods for Indian Diet"),
heading3("Non-Vegetarian Sources (Heme Iron - absorbs best at 15-35%)"),
makeTable(
["Food", "Serving", "Iron Content", "How to Use"],
[
["Chicken Liver", "50g", "Very High (~6mg)", "Weekly once - curry or stir fry"],
["Eggs", "2 eggs daily", "~2mg", "Boiled, omelette, bhurji"],
["Chicken", "100g", "~1.5mg", "Grilled, curry"],
["Fish (Pomfret/Rohu)", "100g", "~1mg", "2-3 times/week"],
],
COLORS.orange
),
new Paragraph({ spacing: { before: 120, after: 60 }, children: [new TextRun("")] }),
heading3("Vegetarian Sources (Non-Heme Iron - always add lemon to boost absorption)"),
makeTable(
["Food", "Serving", "Iron Content", "Best Way to Use"],
[
["Spinach (Palak)", "1 cup cooked", "~3.6mg", "Sabzi + squeeze lemon on top"],
["Methi (Fenugreek)", "1 cup cooked", "~3.7mg", "Thepla, sabzi, paratha"],
["Ragi (Nachni)", "1 cup cooked", "~3.3mg", "Roti, porridge, dosa"],
["Chana (Chickpeas)", "1 cup cooked", "~4.7mg", "Sabzi, salad, chaat"],
["Rajma (Kidney Beans)", "1 cup cooked", "~3.9mg", "Dal, curry"],
["Moong Dal", "1 cup cooked", "~2.8mg", "Daily dal"],
["Beetroot", "1 medium", "~1.1mg", "Juice, salad, raita"],
["Pomegranate", "1 medium", "~0.8mg + Vitamin C", "Daily fruit - dual benefit"],
["Dates (Khajur)", "5-6 dates", "~1.0mg", "Snack or with warm milk"],
["Jaggery (Gud)", "1 tbsp", "~0.9mg", "Replace sugar in chai/dessert"],
["Pumpkin Seeds", "30g handful", "~2.5mg", "Snack, sprinkle on food"],
["Sesame Seeds (Til)", "2 tbsp", "~2.6mg", "Chutney, ladoo, add to food"],
["Watermelon Seeds", "30g", "~2.1mg", "Roasted snack"],
["Lotus Seeds (Makhana)", "30g", "~1.5mg", "Roasted snack"],
],
COLORS.orange
),
new Paragraph({ spacing: { before: 160, after: 80 }, children: [new TextRun("")] }),
heading2("Iron Absorption: Do's and Don'ts", COLORS.red),
makeTable(
["✅ BOOSTS Iron Absorption", "❌ BLOCKS Iron Absorption"],
[
["Lemon juice / orange juice with meals", "Tea or chai within 1 hour of iron tablet"],
["Tomatoes and amla (Vitamin C)", "Coffee within 1 hour of iron tablet"],
["Take iron tablet on empty stomach", "Milk or dairy with iron tablet"],
["Cook in cast iron kadhai", "Calcium tablet at same time as iron"],
["Eat Vitamin C fruit after iron-rich meals", "Antacids near iron tablet timing"],
],
COLORS.medGreen
),
new Paragraph({ spacing: { before: 160, after: 80 }, children: [new TextRun("")] }),
heading2("Iron Tablet Schedule", COLORS.orange),
colorBox("MORNING (Empty Stomach, 7:00 AM): Take Ferrous Sulphate + Folic Acid tablet with a glass of warm lemon water or orange juice. Wait 30 minutes before breakfast.", COLORS.lightOrange, COLORS.orange),
colorBox("EVENING (After Dinner, 8:00 PM): Take Calcium + Vitamin D3 tablet. This separation of 12+ hours from iron maximises absorption of both.", COLORS.lightBlue, COLORS.blue),
divider(),
// ── SECTION 4: VITAMIN D PLAN ──────────────────────────────────────────
heading1("4. Vitamin D Recovery Plan"),
colorBox("Your Vitamin D: 9.6 ng/mL | Target: 30-100 ng/mL | Status: SEVERELY DEFICIENT | Gap: +20 ng/mL needed", COLORS.lightRed, COLORS.red),
heading2("Three-Step Recovery Strategy"),
heading3("Step 1 - Get the Right Prescription (This Week)"),
bullet("Visit your doctor and request: Vitamin D3 60,000 IU sachet once per week for 8-12 weeks"),
bullet("Brand options available in India: D-Rise, Calcirol, Uprise-D3, Shelcal-D60"),
bullet("Take sachet dissolved in warm milk or water, with a fatty meal (for best absorption)"),
bullet("Take on the same day every week - e.g. every Sunday morning"),
new Paragraph({ spacing: { before: 80, after: 40 }, children: [new TextRun("")] }),
heading3("Step 2 - Daily Sunlight Exposure (Start Today - Free!)"),
makeTable(
["Factor", "Details"],
[
["Best Time", "10:00 AM to 12:00 PM (UV-B is strongest)"],
["Duration", "20-30 minutes daily (or 5 days/week minimum)"],
["Skin Exposed", "Arms and legs - sleeveless top + shorts/capri"],
["Location", "Open outdoor space - terrace, garden, balcony (NOT through glass window)"],
["Sunscreen", "Do NOT apply during this 20-30 min window"],
["Cloudy Days", "Still go out - some UV-B penetrates clouds"],
["Monsoon (Jul-Sep)", "Cloud cover reduces benefit - rely more on sachet during this period"],
],
COLORS.yellow
),
new Paragraph({ spacing: { before: 120, after: 60 }, children: [new TextRun("")] }),
heading3("Step 3 - Vitamin D Rich Foods (Supportive)"),
makeTable(
["Food", "Vitamin D per Serving", "Frequency"],
[
["Egg yolk (2 eggs)", "~80 IU", "Daily"],
["Salmon/Tuna (100g)", "~300-450 IU", "2-3 times/week"],
["Fortified milk (250ml)", "~100-130 IU", "Daily"],
["Fortified curd/yogurt", "~80 IU", "Daily"],
["Mushrooms (sun-exposed)", "~200 IU", "2-3 times/week"],
["Ghee (1 tsp)", "Trace amounts", "Daily cooking"],
],
COLORS.yellow
),
new Paragraph({ spacing: { before: 160, after: 80 }, children: [new TextRun("")] }),
heading2("Expected Vitamin D Recovery Timeline"),
makeTable(
["Approach", "Rise per Month", "Time to Reach 30 ng/mL"],
[
["250 IU tablet only (current)", "1-2 ng/mL", "10-15 months (too slow)"],
["Sunlight 20-30 min daily", "4-6 ng/mL", "3-5 months"],
["60,000 IU sachet weekly", "8-10 ng/mL", "2-3 months"],
["✅ Sachet + Sunlight (Recommended)", "12-15 ng/mL", "6-8 weeks"],
],
COLORS.medGreen
),
divider(),
// ── SECTION 5: CALCIUM & BONE HEALTH ──────────────────────────────────
heading1("5. Calcium & Bone Health"),
colorBox("Your Serum Calcium: 9.84 mg/dL ✓ NORMAL | Target: 1000 mg/day total from all sources", COLORS.lightGreen, COLORS.darkGreen),
heading2("Calcium-Rich Foods (Indian Diet)"),
makeTable(
["Food", "Calcium per Serving", "Daily Goal"],
[
["Milk (full fat, 250ml)", "~300 mg", "1-2 glasses"],
["Curd/Dahi (150g)", "~200 mg", "1 bowl daily"],
["Paneer (50g)", "~200 mg", "3-4 times/week"],
["Buttermilk/Chaas (250ml)", "~150 mg", "Daily with meals"],
["Ragi flour (100g)", "~344 mg", "Roti or porridge"],
["Sesame seeds/Til (2 tbsp)", "~280 mg", "Add to chutneys/ladoo"],
["Rajma cooked (1 cup)", "~50 mg", "Weekly"],
["Spinach cooked (1 cup)", "~245 mg", "With lemon"],
["Almonds (30g)", "~75 mg", "Daily snack"],
["Broccoli (1 cup cooked)", "~60 mg", "2-3 times/week"],
],
COLORS.blue
),
new Paragraph({ spacing: { before: 120, after: 60 }, children: [new TextRun("")] }),
colorBox("Your calcium tablet provides 500 mg. Aim to get the remaining 500 mg from 1 glass milk + 1 bowl curd daily.", COLORS.lightBlue, COLORS.blue),
divider(),
// ── SECTION 6: FOLIC ACID & B12 ───────────────────────────────────────
heading1("6. Folic Acid & Vitamin B12"),
heading2("Folic Acid - You Are Well Covered ✅"),
bullet("Currently taking: 500 mcg folic acid daily (Ferrous Sulphate + Folic Acid tablet)"),
bullet("Recommended dose: 400-500 mcg/day - your dose is PERFECT"),
bullet("Continue without break throughout trying to conceive and into pregnancy"),
bullet("Critical for neural tube formation in first 28 days of pregnancy"),
new Paragraph({ spacing: { before: 120, after: 60 }, children: [new TextRun("")] }),
heading2("Folate-Rich Foods (Dietary Folic Acid - in addition to your tablet)"),
makeTable(
["Food", "Folate per Serving", "How to Include"],
[
["Spinach (1 cup cooked)", "~263 mcg", "Daily sabzi with lemon"],
["Moong dal (1 cup cooked)", "~358 mcg", "Daily dal"],
["Chickpeas / Chana (1 cup)", "~282 mcg", "Sabzi or salad"],
["Asparagus (6 spears)", "~135 mcg", "Stir fry or soup"],
["Beetroot (1 cup)", "~148 mcg", "Juice or salad"],
["Edamame/Soyabean (1/2 cup)", "~241 mcg", "Snack or sabzi"],
["Sunflower seeds (30g)", "~82 mcg", "Sprinkle on salads"],
["Orange (1 medium)", "~40 mcg", "Daily fruit"],
],
COLORS.medGreen
),
new Paragraph({ spacing: { before: 160, after: 80 }, children: [new TextRun("")] }),
heading2("Vitamin B12 - Low-Normal (242 pg/mL) - Monitor"),
colorBox("B12: 242 pg/mL (normal range 211-911). Low-normal. Demand increases in pregnancy. Boost dietary intake now.", COLORS.lightYellow, COLORS.yellow),
makeTable(
["Food", "B12 per Serving", "Frequency"],
[
["Eggs (2 whole)", "~1.2 mcg", "Daily"],
["Milk (250ml)", "~1.0 mcg", "Daily"],
["Curd (150g)", "~0.5 mcg", "Daily"],
["Paneer (50g)", "~0.4 mcg", "3-4 times/week"],
["Chicken (100g)", "~0.3 mcg", "2-3 times/week"],
["Fish (100g)", "~1.5-3 mcg", "2-3 times/week"],
],
COLORS.yellow
),
divider(),
// ── SECTION 7: PROTEIN & OMEGA-3 ──────────────────────────────────────
heading1("7. Protein & Omega-3 Fatty Acids"),
heading2("Protein (Target: 60-75g/day before pregnancy, 75-100g during pregnancy)"),
para("Protein is essential for egg quality, uterine lining development, and fetal growth."),
makeTable(
["Food", "Protein per Serving", "Daily Inclusion"],
[
["Eggs (2 whole)", "~12g", "Daily"],
["Dal (1 cup cooked)", "~9g", "Every meal"],
["Paneer (100g)", "~18g", "Daily or alternate"],
["Curd/Greek yogurt (150g)", "~8g", "Daily"],
["Chicken (100g)", "~27g", "3-4 times/week"],
["Fish (100g)", "~20g", "2-3 times/week"],
["Rajma/Chana (1 cup)", "~15g", "3-4 times/week"],
["Tofu (100g)", "~8g", "Alternate with paneer"],
["Milk (250ml)", "~8g", "Daily"],
["Nuts - almonds/walnuts (30g)", "~6g", "Daily snack"],
],
COLORS.teal
),
new Paragraph({ spacing: { before: 160, after: 80 }, children: [new TextRun("")] }),
heading2("Omega-3 Fatty Acids (Important for Egg Quality & Baby's Brain)"),
makeTable(
["Food", "Omega-3 Content", "How to Use"],
[
["Walnuts (4-5 daily)", "~2.5g ALA", "Morning snack or with curd"],
["Flaxseeds (1 tbsp ground)", "~1.6g ALA", "Add to roti dough, smoothie"],
["Chia seeds (1 tbsp)", "~1.8g ALA", "Soak overnight, add to food"],
["Fatty fish - Salmon/Mackerel (100g)", "~1.5-2g EPA/DHA", "2-3 times/week"],
["Mustard oil (for cooking)", "Contains ALA", "Use for daily cooking"],
],
COLORS.teal
),
divider(),
// ── SECTION 8: FOODS TO AVOID ─────────────────────────────────────────
heading1("8. Foods & Habits to Avoid"),
makeTable(
["What to Avoid", "Why", "What to Do Instead"],
[
["Tea/coffee within 1 hr of iron tablet", "Tannins block iron absorption by 60%", "Take iron with lemon water, have chai 1hr later"],
["Milk with iron tablet", "Calcium competes with iron", "Have milk 2 hrs after iron tablet"],
["Calcium + Iron tablets together", "Compete for same absorption pathway", "Separate by 2+ hours always"],
["Processed/junk food", "Empty calories, no nutrients", "Replace with nuts, fruits, homemade snacks"],
["Excess tea/coffee (>2 cups/day)", "Reduces iron and B12 absorption", "Switch to coconut water, herbal tea"],
["Alcohol", "Reduces folate absorption, harms egg quality", "Avoid completely while trying to conceive"],
["Smoking (active/passive)", "Reduces fertility, harms egg quality", "Avoid completely"],
["Excess salt/pickles", "Can affect blood pressure in pregnancy", "Reduce gradually"],
["Very high Vitamin A (retinol)", "Toxic to fetus in high doses", "Avoid liver >once/week; avoid retinol supplements"],
["Raw/undercooked meat or eggs", "Risk of infection (Toxoplasma, Salmonella)", "Always cook thoroughly"],
["High mercury fish (swordfish, shark)", "Mercury harms fetal brain", "Choose low-mercury fish (rohu, pomfret, salmon)"],
],
COLORS.red
),
divider(),
// ── SECTION 9: SAMPLE MEAL PLAN ───────────────────────────────────────
heading1("9. Your Sample Daily Meal Plan"),
colorBox("This meal plan is designed specifically for your deficiencies: High in iron, folate, calcium, Vitamin B12 and Omega-3.", COLORS.lightTeal, COLORS.teal),
new Paragraph({ spacing: { before: 160, after: 80 }, children: [new TextRun("")] }),
makeTable(
["Time", "What to Eat", "Key Nutrient Provided"],
[
["7:00 AM\n(Wake up)", "Iron + Folic Acid tablet with warm lemon water / orange juice\n(Empty stomach - 30 min before breakfast)", "Iron absorption maximised with Vitamin C"],
["7:30 AM\nBreakfast", "Option A: 2 boiled eggs + ragi porridge with jaggery + 1 glass milk\nOption B: Methi thepla (2) + curd + 1 orange\nOption C: Poha with sprouted moong + pomegranate", "Iron, Protein, Folate, B12, Calcium"],
["10:00-11:30 AM\nSunlight", "20-30 minutes outdoors with arms & legs exposed\n(terrace/garden, not through glass)", "Vitamin D3 synthesis"],
["11:00 AM\nMid-morning snack", "4-5 walnuts + 5-6 almonds + 2-3 dates\nOR: 1 bowl sprouts chaat with lemon", "Iron, Omega-3, Folate, Energy"],
["1:00 PM\nLunch", "2 ragi/wheat roti + palak dal OR rajma + curd + salad with lemon + 1 katori sabzi", "Iron, Folate, Calcium, Protein"],
["3:30 PM\nAfternoon snack", "1 pomegranate OR 1 glass pomegranate juice\nOR: roasted pumpkin/watermelon seeds (30g)", "Iron + Vitamin C (dual boost)"],
["6:00 PM\nEvening", "1 cup green tea OR coconut water + 1 small fruit\n(NOT chai - avoid tannins)", "Hydration, antioxidants"],
["8:00 PM\nDinner", "2 wheat roti + paneer bhurji / chicken / fish curry + beetroot salad + 1 glass warm milk before bed", "Protein, B12, Calcium, Iron"],
["8:00 PM\n(With dinner)", "Calcium + Vitamin D3 tablet\n(2 hrs+ after iron tablet taken in morning)", "Calcium absorption with food"],
["Sunday only", "Vitamin D3 60,000 IU sachet dissolved in warm milk\n(Same day every week, with fatty meal)", "Vitamin D rapid correction"],
],
COLORS.teal
),
divider(),
// ── SECTION 10: SUPPLEMENT SCHEDULE ───────────────────────────────────
heading1("10. Your Complete Supplement Schedule"),
makeTable(
["Supplement", "Dose", "When to Take", "Duration", "Status"],
[
["Ferrous Sulphate + Folic Acid", "60mg Iron + 500mcg Folic Acid", "Morning empty stomach with lemon water", "Continue indefinitely (through pregnancy)", "✓ Already taking"],
["Calcium + Vitamin D3", "500mg Ca + 250 IU D3", "Evening after dinner (2hr away from iron)", "Continue daily", "⚠ Dose too low - D3 needs increase"],
["Vitamin D3 Sachet", "60,000 IU (D-Rise / Calcirol)", "Once weekly (e.g. every Sunday morning)", "8-12 weeks then retest", "🔴 GET PRESCRIPTION NOW"],
["Folic Acid", "Already in Iron tablet (500mcg)", "-", "Until end of breastfeeding", "✓ Covered"],
["Vitamin B12", "From diet (eggs, milk, fish)", "-", "Monitor; supplement if vegetarian", "⚠ Boost from diet"],
],
COLORS.medGreen
),
divider(),
// ── SECTION 11: LIFESTYLE ──────────────────────────────────────────────
heading1("11. Lifestyle Recommendations"),
heading2("Exercise"),
bullet("30 minutes moderate exercise 5 days/week - walking, yoga, swimming"),
bullet("Yoga poses that support fertility: Butterfly pose (Baddha Konasana), Bridge pose, Child's pose"),
bullet("Avoid extreme high-intensity workouts - can disrupt ovulation"),
bullet("Your husband: Regular exercise improves sperm quality and count"),
heading2("Sleep"),
bullet("7-8 hours quality sleep every night"),
bullet("Sleep regulates reproductive hormones (LH, FSH, progesterone)"),
bullet("Poor sleep increases cortisol which can delay ovulation"),
heading2("Stress Management"),
bullet("10-15 minutes daily meditation or deep breathing"),
bullet("High stress raises cortisol which directly suppresses reproductive hormones"),
bullet("Proven techniques: Pranayama (Anulom Vilom), progressive muscle relaxation, journaling"),
bullet("Keep trying-to-conceive process positive - avoid obsessing over timing"),
heading2("Hydration"),
bullet("8-10 glasses of water daily"),
bullet("Good hydration supports cervical mucus production - important for sperm transport"),
bullet("Coconut water is excellent - natural electrolytes + hydration"),
heading2("For Your Husband"),
bullet("Zinc 15-25mg daily (from pumpkin seeds, nuts, lean meat)"),
bullet("Vitamin C 500mg daily (from citrus fruits)"),
bullet("Avoid hot baths, saunas, tight underwear - heat reduces sperm count"),
bullet("No smoking or excess alcohol"),
bullet("Keep phone away from trouser pocket - electromagnetic radiation may affect sperm"),
divider(),
// ── SECTION 12: FERTILE WINDOW ────────────────────────────────────────
heading1("12. Your Fertile Window - June 2026"),
colorBox("Last Period: June 8, 2026 | Cycle Length: 26 days | Estimated Ovulation: June 20", COLORS.lightGreen, COLORS.darkGreen),
new Paragraph({ spacing: { before: 120, after: 80 }, children: [new TextRun("")] }),
makeTable(
["Date", "Day of Cycle", "Action"],
[
["June 14-15", "Day 7-8", "Start using OPK (ovulation test strips) from today"],
["June 16-17", "Day 9-10", "Begin having sex every 1-2 days - sperm survives 3-5 days"],
["June 18-19", "Day 11-12", "🟢 HIGH FERTILITY - Have sex today"],
["June 20", "Day 13", "🔴 PEAK OVULATION DAY - Most important day"],
["June 21-22", "Day 14-15", "🟢 Still fertile - have sex today"],
["June 23+", "Day 16+", "Fertile window likely closed"],
["July 8+", "If period doesn't come", "Take pregnancy test"],
],
COLORS.darkGreen
),
new Paragraph({ spacing: { before: 120, after: 80 }, children: [new TextRun("")] }),
colorBox("Signs of Ovulation to Watch: Egg-white stretchy cervical mucus | Mild one-sided pelvic pain | Positive OPK test | Slight rise in basal body temperature", COLORS.lightTeal, COLORS.teal),
divider(),
// ── SECTION 13: WHEN TO SEE DOCTOR ────────────────────────────────────
heading1("13. When to See Your Doctor"),
makeTable(
["Situation", "Action", "Urgency"],
[
["Get Vitamin D sachet prescription", "Visit GP or gynecologist this week", "🔴 URGENT - This week"],
["Retest: CBC, Ferritin, Vitamin D, Urine", "Book lab tests this week", "🔴 URGENT - This week"],
["Positive pregnancy test", "See gynecologist within 1 week of positive test", "🔴 URGENT when it happens"],
["Discharge with smell/itching/color change", "See doctor immediately", "🔴 Immediate"],
["Periods become irregular (<21 or >35 days)", "See gynecologist", "⚠ Within 2 weeks"],
["No conception after 9-12 months of trying", "Full fertility evaluation for both partners", "⚠ Planned"],
["Routine Vitamin D retest", "After 8-12 weeks of sachet treatment", "⚠ Planned - August 2026"],
],
COLORS.red
),
divider(),
// ── SECTION 14: QUICK REFERENCE CARD ─────────────────────────────────
heading1("14. Quick Reference Card"),
heading2("Daily Checklist"),
bullet("☐ Iron tablet - morning, empty stomach, with lemon water"),
bullet("☐ 20-30 min sunlight between 10 AM - 12 PM"),
bullet("☐ 1 glass milk OR 1 bowl curd"),
bullet("☐ Squeeze lemon on dal/sabzi at lunch"),
bullet("☐ 1 handful nuts (walnuts + almonds)"),
bullet("☐ 1 iron-rich fruit (pomegranate / dates)"),
bullet("☐ Calcium tablet - evening after dinner"),
bullet("☐ 8 glasses water"),
bullet("☐ NO tea/coffee within 1 hour of iron tablet"),
new Paragraph({ spacing: { before: 120, after: 80 }, children: [new TextRun("")] }),
heading2("Weekly Checklist"),
bullet("☐ Sunday: Vitamin D3 60,000 IU sachet (once per week)"),
bullet("☐ Eggs at least 5 days this week"),
bullet("☐ Fish or chicken 2-3 times this week"),
bullet("☐ Ragi at least 3 times this week"),
bullet("☐ Leafy greens (palak/methi) at least 4 times this week"),
divider(),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 200, after: 100 },
shading: { type: ShadingType.CLEAR, color: "auto", fill: COLORS.lightGreen },
children: [new TextRun({ text: "Wishing you a healthy and successful conception journey!", bold: true, size: 24, color: COLORS.darkGreen, font: "Calibri", italics: true })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 60, after: 200 },
children: [new TextRun({ text: "This guide is based on your personal lab report (22/02/2026) and is for informational purposes. Please consult your gynecologist for medical decisions.", size: 16, color: COLORS.gray, font: "Calibri", italics: true })]
}),
]
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/vishakha-nutrition-guide/Vishakha_Preconception_Nutrition_Guide.docx', buffer);
console.log('Document created successfully!');
}).catch(err => {
console.error('Error:', err);
process.exit(1);
});