New tool uses artificial intelligence to calculate harmful effects of medicines