For diabetes treatment, insulin injection is common, but researchers at MIT and Harvard developed insulin-containing capsules.

You dose a capsule and the capsule will stay inside the stomach with the heavy side downwards.
Next the needle jumps out of the capsule and sticks into the stomach wall.
Since the stomach wall does not have pain points, you don’t feel pain.
Insulin comes out from the tip of the needle and goes into the blood.
Finally the capsule comes out from the intestine. (MIT News)

The point is that the needle sticks into the stomach wall.
This technique may be applicable to other medicine.