Smart monitoring of medicines could improve patient safety