A 23-year-old woman is evaluated for an 8-month history of alternating diarrhea and constipation, generalized abdominal discomfort, bloating, increased flatulence, nausea, and occasional passage of mucus following bowel movements. She has up to five loose, nonbloody bowel movements daily, described as oatmeal in consistency, alternating with periods of constipation. Abdominal discomfort is described as a generalized ache coming in waves and sometimes improves after a bowel movement. She has not had any improvement in her symptoms with the avoidance of milk or a short course of probiotics. Her medical history is unremarkable. There is no family history of gastrointestinal malignancies or inflammatory bowel disease. Her medications are ibuprofen and loperamide.

On physical examination, blood pressure is 130/80 mm Hg, and pulse rate is 62/min. Abdominal examination reveals generalized abdominal tenderness but is otherwise normal. Rectal examination findings are normal.

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