A hiatal hernia is often discovered during a test or procedure to determine the cause of heartburn or chest or upper abdominal pain. These tests or procedures include: X-ray of your upper digestive system. X-rays are taken after you drink a chalky liquid that coats and fills the inside lining of your digestive tract.
https://www.mayoclinic.org/diseases-conditions/hiatal-hernia/diagnosis-treatment/drc-20373385

