Snippet to calculate doses for oral antibiotics used for treating cellulitis in pediatric patients (as per Bugs and drugs):
{note}
Antibiotic: {formmenu: Cephalexin; Clindamycin; name=abx}
{endnote}
{if: abx = "Cephalexin"}
{note: trim=yes}
Cellulitis - Cephalexin
Weight: {formtext: name=weight} kg
Duration: {formmenu: 5 days; 7-10 days; name=duration}
-- Note: If minimal response at 3 days, duration is 7-10 days total
Ref: Bugs and Drugs
{endnote}
{note: preview=no; trim=yes}
{wt_dose=(weight * 40) /4}
{if: wt_dose > 500}{dose=500}{else}{dose=wt_dose}{endif}
{endnote: trim=no}
Cephalexin 40mg/kg/d PO div QID x {=duration} (maximum 500 mg/dose)
Weight: {=weight} kg
Rx: Cephalexin {=dose; format=,.0f} mg PO QID x {=duration}
{elseif: abx = "Clindamycin"}
{note: trim=yes}
Cellulitis - Clindamycin
Weight = {formtext: name=weight} kg
Dose: {formmenu: 20; 25; 30; 35; 40; name=dose_clinda} mg/kg/d
Duration: {formmenu: 5 days; 7-10 days; name=duration}
-- Note: If minimal response at 3 days, duration is 7-10 days total
Ref: Bugs and Drugs
{endnote}
{note: preview=no; trim=yes}
{daily_dose=(weight * dose_clinda) / 4}
{if: daily_dose > 450}{dose=450}{else}{dose=daily_dose}{endif}
{endnote: trim=no}
Clindamycin 20-40mg/kg/d PO ÷ QID x {=duration} (max 450mg/dose)
Weight: {=weight} kg
Rx: Clindamycin {=dose; format=,.0f} mg PO QID x {=duration}
{endif}