People who experience persistent heartburn despite over-the-counter treatments need to check with their doctors