Hi,
   I understand your concern.
    Your grand daughter seems to be in lot of trouble.poor thing! 
  *  It seems she has injured few rectal blood vessels/ mucosa & probably has developed piles. due to 
constipation & hard stools. Bleeding flowing up to the leg demands a check up by an ano-rectal surgeon.. to find type /extent of problem & get it  treated first. 
    - To investigate or treat bowel infection/ worm infestation is another thing to get treated.
  * After the treatment follow the advise given by the doctor plus-either of following & help her getting daily motion is important.
     - add fibrous items to her food (Fruits , salads, vegetables with skins,along with lot of water through out the day.
    - Addition of figs ( dry fruit, syrup )helps.
     - addition of 
Aloevera syrup ( Kumari asava ) in prescribed dose 
    - Giving  stool softner like 
Lactulose syrup daly in suitable dose.. till her constipation is gone
   * helping her to form regular bowel habit  will help in long run.
   Thanks..
  *