A 28-year-old woman is evaluated in the emergency department for right flank pain of several days' duration and an episode of gross hematuria. She is in her 24th week of pregnancy, which has been uncomplicated, and she has had regular obstetric care. She reports no fevers or chills, abdominal pain, changes in bowel habits, dysuria, or urinary frequency. Family history is notable for her mother with kidney stones. Her only medication is a prenatal vitamin.

On physical examination, the patient is in moderately painful distress localized to the right flank area. Temperature is 37.0 °C (98.6 °F), blood pressure is 118/68 mm Hg, pulse rate is 78/min, and respiration rate is 12/min. BMI is 28. She has a gravid uterus, and the abdominal examination is otherwise unremarkable. There is no costovertebral angle or suprapubic tenderness. The remainder of the examination is normal.

Urinalysis shows large blood and >50,000 erythrocytes/hpf but is otherwise normal.

Which of the following is the most appropriate diagnostic test to perform next?