Omg! What do I do?

I dated a girl a year and a half ago. I was busy with school, and acted distant and planned boring dates. Soon after we kind of ghosted each other. Then I realised what I had done, and tried to get close to her again, and it was working. We would text a lot, and sit with each other in class. So one day I asked her out tell him I still liked her, and I wanted to be more than friends. She agreed to get coffee with me, and then when I texted her to pick a date she told me she "didn't want any sort of relationship!" So I backed off, and I left during the summer for L. A., because I got accepted into Keck University for medicine. Anyways, when I got back home I saw her, and it felt like someone kicked me in the chest. Why do I still care about her? How do I move on? I thought I was over her. My friend says "you're going to be a doctor, and better off than she will ever be!"