Thank you for your query,
Your child seems to have fecal impaction
with enterocolitis or dysentry
But dysentry or the other rare possibilities of inflammatory bowel disorders like Crohn's and ulcerative colitis
to be ruled out.
Stool should be given for stool routine examination and for culture to rule out any infectious causes.
Consult your Gastroenterologist for further examination and evaluation.
Hope I have answered your query.