module.exports = { slug: "hydration-estimate-by-weight", title: "Daily fluid estimate by weight (Holliday-Segar)", deck_category: "health", description: "Estimates a general daily maintenance fluid volume from body weight using the Holliday-Segar rule of thumb.", inputs: [ { name: "weight_kg", type: "number", unit: "kg", required: true, description: "Body weight in kilograms", min: 0 } ], outputs: [ { name: "daily_fluid_ml", unit: "mL/day", description: "Estimated daily maintenance fluid volume" } ], steps: [ "This is a general rule of thumb, not a personalized prescription.", "For the first 10 kg of weight: 100 mL/kg/day.", "For the next 10 kg (weight from 10 to 20 kg): 50 mL/kg/day.", "For weight above 20 kg: 20 mL/kg/day.", "Sum the three tiers that apply and round to the nearest whole mL/day." ], constants: [ { name: "tier1_upper_kg", value: 10, unit: "kg", source: 0 }, { name: "tier1_rate", value: 100, unit: "mL/kg/day", source: 0 }, { name: "tier2_upper_kg", value: 20, unit: "kg", source: 0 }, { name: "tier2_rate", value: 50, unit: "mL/kg/day", source: 0 }, { name: "tier3_rate", value: 20, unit: "mL/kg/day", source: 0 } ], sources: [ { kind: "edition_page", value: "Holliday MA, Segar WE. The maintenance need for water in parenteral fluid therapy. Pediatrics. 1957;19(5):823-832.", title: "Original publication of the Holliday-Segar maintenance fluid rule", publisher: "Pediatrics (American Academy of Pediatrics)", retrieved_utc: "2026-09-30T19:45:00Z", note: "Source of the 100/50/20 mL-per-kg tiered rule used here as a general daily fluid estimate for any body weight." } ], disclaimer: "General formula only. Not medical advice. Dosing decisions belong to a licensed clinician and the product's label.", questionText(inputs) { return `Using the Holliday-Segar general rule of thumb, what is the estimated daily fluid need for a person weighing ${inputs.weight_kg} kg?`; }, run(inputs) { const { weight_kg } = inputs; if (typeof weight_kg !== "number" || weight_kg <= 0) throw new Error("weight_kg must be a positive number"); let remaining = weight_kg; let total = 0; const tier1 = Math.min(remaining, 10); total += tier1 * 100; remaining -= tier1; if (remaining > 0) { const tier2 = Math.min(remaining, 10); total += tier2 * 50; remaining -= tier2; } if (remaining > 0) { total += remaining * 20; } const dailyFluid = Math.round(total); return { answer: `${dailyFluid} mL/day`, values: { daily_fluid_ml: dailyFluid } }; }, examples: [ { name: "worked example", inputs: { weight_kg: 70 }, expected: { answer: "2500 mL/day" }, check: "First 10 kg: 10*100=1000. Next 10 kg: 10*50=500. Remaining 50 kg: 50*20=1000. Total = 1000+500+1000 = 2500." }, { name: "test vector: small child weight", inputs: { weight_kg: 8 }, expected: { answer: "800 mL/day" }, check: "Only tier 1 applies: 8*100 = 800." } ] };