module.exports = { slug: "pediatric-dose-per-kg-per-day-divided", title: "Pediatric per-dose amount from mg/kg/day divided", deck_category: "health", description: "Computes the per-dose amount when a total daily mg/kg/day dose is divided into a number of doses per day, general formula only.", inputs: [ { name: "weight_kg", type: "number", unit: "kg", required: true, description: "Body weight in kilograms", min: 0 }, { name: "mg_per_kg_per_day", type: "number", unit: "mg/kg/day", required: true, description: "Total daily dose per kilogram of body weight", min: 0 }, { name: "doses_per_day", type: "integer", required: true, description: "Number of equally divided doses given per day", min: 1 } ], outputs: [ { name: "daily_total_mg", unit: "mg", description: "Total daily dose" }, { name: "per_dose_mg", unit: "mg", description: "Amount per individual dose" } ], steps: [ "daily_total_mg = weight_kg * mg_per_kg_per_day.", "per_dose_mg = daily_total_mg / doses_per_day.", "Round both results to 2 decimal places." ], constants: [], sources: [ { kind: "edition_page", value: "Standard pediatric weight-based dosing arithmetic (total daily dose = weight x mg/kg/day, then divided evenly across the number of daily doses)", title: "General pediatric dosing-by-weight-and-frequency method", publisher: "Standard pharmacology reference practice (e.g. Harriet Lane Handbook, dosing chapter)", retrieved_utc: "2026-09-30T19:30:00Z", note: "This card performs only the general arithmetic; the mg/kg/day figure and dose frequency are supplied as inputs, never baked in." } ], disclaimer: "General formula only. Not medical advice. Dosing decisions belong to a licensed clinician and the product's label.", questionText(inputs) { return `Using this general formula, for a ${inputs.weight_kg} kg child at ${inputs.mg_per_kg_per_day} mg/kg/day divided into ${inputs.doses_per_day} doses per day, what is the amount per dose?`; }, run(inputs) { const { weight_kg, mg_per_kg_per_day, doses_per_day } = inputs; if (typeof weight_kg !== "number" || weight_kg <= 0) throw new Error("weight_kg must be a positive number"); if (typeof mg_per_kg_per_day !== "number" || mg_per_kg_per_day < 0) throw new Error("mg_per_kg_per_day must be a non-negative number"); if (!Number.isInteger(doses_per_day) || doses_per_day < 1) throw new Error("doses_per_day must be a positive integer"); const dailyTotalRaw = weight_kg * mg_per_kg_per_day; const perDoseRaw = dailyTotalRaw / doses_per_day; const dailyTotal = Math.round(dailyTotalRaw * 100) / 100; const perDose = Math.round(perDoseRaw * 100) / 100; return { answer: `${perDose.toFixed(2)} mg per dose`, values: { daily_total_mg: dailyTotal, per_dose_mg: perDose } }; }, examples: [ { name: "worked example", inputs: { weight_kg: 20, mg_per_kg_per_day: 30, doses_per_day: 3 }, expected: { answer: "200.00 mg per dose" }, check: "20 * 30 = 600 mg/day total; 600 / 3 = 200.00 mg per dose." }, { name: "test vector: non-integer split", inputs: { weight_kg: 15, mg_per_kg_per_day: 40, doses_per_day: 4 }, expected: { answer: "150.00 mg per dose" }, check: "15 * 40 = 600 mg/day total; 600 / 4 = 150.00 mg per dose." } ] };