How are you? Recurrent pain in the flank region after getting treated for urinary tract infections could be due a strong organism causing the infection, decreased immunity inthe patient, any abnormality in the anatomy of the urinary tract, stones in the kidney or ureter, incomplete recovery from previous infection.
Did you ever experience these symptoms before? What was the organism which caused the infection? Do you have fever, night sweats, blood in urine, burning sensation? There could be an abcess or tumor outgrowth which could be causing the pain. Get a repeat urine examination, ultrasound done. If there is no finding in these tests go for an MRI and take a course of antibiotics.
Visit your urologist if symptoms persist after the course of antibiotics.