I have GERD and started taking Prilosac. It does take several days before it's of any help. I suggest that the doctor has said to try it for a month before sending him to a specialist because he knows that it takes that long to know if it's helping.
I also suggest that he may continue to be constipated and this is a part of the pain. Continue giving him the Miralax. Be sure his diet has enough fiber and that he's drinking enough fluids.
Here are guidelines from The Mayo Clinic. http://www.mayoclinic.com/health/constipation-in-children...
"Lifestyle and home remedies
By Mayo Clinic staff
Often, simple changes in diet and routine help relieve constipation in children:
A high-fiber diet. A diet rich in fiber will help your child's body form soft, bulky stool. The amount of fiber a child needs every day varies by weight. Give your child 0.5 grams of fiber every day for each kilogram of body weight. One kilogram is equivalent to 2.2 pounds. So if your child weighs 44 pounds, divide that number by 2.2 to figure out your child's weight in kilograms. In this case, the child weighs 20 kilograms. To figure out the fiber, multiply the weight in kilograms by 0.5, which in this example leads to 10 grams of fiber daily. The upper limit of daily fiber for children is 35 grams.
Offer your child high-fiber foods, such as beans, whole grains, fruits and vegetables. Limit foods that have little or no fiber, such as cheese, meat and processed foods. But start slowly, adding just several grams of fiber a day over several weeks to reduce the amount of gas and bloating that can occur in someone who's not used to consuming high-fiber foods.
Adequate fluids. Water and other fluids will help soften your child's stool. Be wary of offering your child too much milk, however. For some children, excess milk contributes to constipation.
Adequate time for bowel movements. Encourage your child to sit on the toilet for five to 10 minutes within 30 minutes of each meal. Follow the routine every day, even during holidays and vacations.
Be supportive. Reward your child's efforts, not results. Give children small rewards for trying to move their bowels. Possible rewards include stickers or a special book or game that's only available after (or possibly during) toilet time. And don't punish a child who has soiled his or her underwear."