The characters combine to create a vivid image: “hanging a medicine gourd (to signal one's practice) in order to help the world.” The physical act of hanging the gourd is linked to the grand, moral purpose of serving humanity.
The soul of this idiom lies in the legend of 壶公 (Hú Gōng), or the “Gourd Lord,” from the historical text *Book of the Later Han*. The story tells of an old man who sold medicine in the marketplace. He would hang a single gourd from a pole to mark his stall. Though he charged very little, his medicines were miraculously effective. At the end of each day, he would leap into the hanging gourd and vanish. An official named Fei Changfang (费长房) secretly observed this and, realizing the old man was a supernatural being (an immortal), asked to become his apprentice. Fei followed him into the gourd and discovered a magnificent, paradise-like world inside. He went on to learn the arts of healing and Daoism from the Gourd Lord. Because of this tale, “悬壶 (xuán hú)” - hanging a gourd - became a literary and elegant synonym for practicing medicine. The addition of “济世 (jì shì)” - to aid the world - embeds this practice within the Confucian and Daoist values of selfless service and social responsibility.
This is a highly formal and laudatory idiom. You will almost never hear it in casual, everyday conversation. Its use is reserved for specific contexts:
It always carries a deeply positive and respectful connotation. Using it lightly would sound pretentious or out of place.