Believe it or not it was ketchup that was sold in the 1830's and used as medicine. It was even called "Dr. Mile's compound Extract of Tomato." At first it wasn't made out of tomatoes since everyone thought tomatoes were poisonous. Ketchup was mainly used as a medicine to help with digestive problems.
Hope this helps :)