It sounds as if it could be a vasovagal nerve response, which can result in fainting, or near-fainting, episodes.
Pinkpixie and Lindaru mentioned a couple of emotional and physical triggers that can cause a vasovagal nerve response. Other common precipitators include the sight of blood, sudden pain, fear, hunger, standing up too quickly, or standing in place too long.
It's good that your girlfriend is following up with a doctor, just to be on the safe side.
Good luck to her.