New device warns patients of heart attack hours before it happens