Infant constipation/other GI issues

Sa

I'm taking my 7 month old to the dr tomorrow as she has been constipated for almost 3 weeks. I've been trying different home remedies but none of it is working. She is able to poop but not much and her bowel movements are firm and formed and it is soooo hard for her. She tries and tries and manages to squeak out a tiny bit.

For other people that have taken their babies to the doctor, what did the doctor do?? Did they give a prescription for something? Or suggest something OTC? Or did they order any tests as well? I'm worried if there could be an underlying problem (she has had lots of GI issues already: reflux, food allergies, slow weight gain, diarrhea for all of month 3 and 4). I'm not sure if I should request some sort of testing?