Have you tried talking to her about this? It might be that she thinks the only way she can get special attention is to be sick. It’s a very bad habit that probably started when she was young. It probably worked for her at some point in her life. She may not understand that now acting sick is pushing you away, not drawing you closer.
As her friend, perhaps you can let her know that you are her friend because of all her fine qualities, not because you feel sorry for her sick self. Share with her how sad you are that she is so insecure that she thinks the only way you will give her attention is if she is ill or dying. Make it clear that she doesn’t have to earn your care by being sick. Good friends listen to each other, give each other attention, and spend time together because they want to, not because they have to.
I hope you can give her this important information and that she can listen to you. Clearly, there is something positive about the friendship or you would have given up on her long ago. She is lucky indeed to have a friend who cares enough to want to help her instead of just pulling away.
I wish you well.