The kidney function's recovery including the residual swelling of the urinary tract after the initial correction of the obstruction depends upon the severity and the duration of the initial obstruction in the urinary tract. Normally, the residual swelling should resolve over the period of few weeks with recovery of kidney's filtering function if effected, occurring sooner subsequent to the surgical correction of the obstructing source. Presence of persistent hydroureteronephrosis (swelling of the urinary tract) on the right side more than 7 months from the initial diagnosis and the surgery along with recurrent pain on the right flank as described, may point towards the underlying obstruction. You may need to undergo Radionuclide renal scan study along with CT scan of the kidneys and the urinary tract to study the cause of probable recurrent obstruction as well as the kidney's filtering function.