How is an atrial septal defect diagnosed?