Hacker stole therapy notes, blackmailed thousands of patients: court