Recurrent UTI-one has to rule out conditions like vesico ureteric reflux ,congenital Kidney
and ureter anomalies by appropriate tests like MCUG ultrasound
kidneys etc which might have been done by your urologist
By now she must be on some antibiotic prophylaxis
in view of recurrent UTI and now pyelonephritis
.Is she otherwise normal neurologically?In girls local hygiene especially after passing tools is very important.foburination she can try double voiding technique (after passing urine once agin she must try to strain and pass urine to completelybdrain the bladder),plenty of water and oral fluids.For costipation,give her high fibre diet,prunes,fruits and again plentyof water and try these!