How a portable heart monitoring device helped protect mental health patients