Computer-assisted delivery of medication via infusion or injection