Hair Falling Out

My hair has been growing for around 4 years now and it has reached my lower back. I love my long hair, but a lot falls out. I went to the doctor and she gave me pills and treatments for around $300. She also told me I had a lack in Vitamin D. After using the medicine, my hair didn’t really stop significantly, so I went to get a trim and it stopped for a week or two. Now, my hair is back to falling out. Should I just cut it up to my shoulders? I’m afraid to cut my long hair and then still have hair falling put. What should I do??