An intelligent environment for preventing medication errors in home treatment