In my experience, I've noticed that my daughters become much more emotional and snippy when they're starting to feel better. While it's challenging, it is best to keep your cool and try to be a little extra-patient as she recovers.
Your friend's daughter certainly hasn't had it easy, I see. I am typically against spanking anyway, but this little girl is an extreme case which explains reasons on why NOT to spank. There are different options: time out, talk it out, tell her to let her frustration out on her pillow, ask for and give hugs, try to understand her perspective & acknowledge how she is feeling.
Stick to just a few *must do* for now & keep them simple. Like, 1.) She can't be violent 2.) She needs to follow your safety directions 3.) Something else similar. Point is to keep things simple & reinforce good behavior at every opportunity. She needs to learn what is and isn't considered to be "good" or healthy through positive reinforcement.
Gentle hugs and best wishes to you both!