 During 1788, on temporary leave from the army, he traveled throughout Mexico to devote himself to the study of local flora and traditional remedies used by natives.He conducted a series of experiments at the hospital of San Juan de Dios, publishing "Tratado de las virtudes del agave y la begonia" ("Treatise on the benefits of agave and begonia") in Madrid in 1794.Back in Spain, he became the physician of King Charles IV.