A 30-year-old woman at 7 weeks’ gestation presents with vaginal bleeding and mild lower abdominal pain. Her last menstrual period was 7 weeks ago. She is haemodynamically stable. A urine pregnancy test is positive. What is the most important initial investigation to exclude an ectopic pregnancy?