Apothecary was a term for one who formulated and dispensed medicine to physicians, surgeons, and patients. They also dispensed general medical advice and performed other jobs later done by specialists, such as midwifery and surgery.
Apothecaries were common in Earth's Ancient West era. As such, one was present in a Melkotian recreation of Tombstone. On an isolated Skagaran colony where Humans had not changed much culturally, an apothecary shop operated as late as 2153. (TOS: "Spectre of the Gun"; ENT: "North Star")