Indeed it isn’t, and like you’ve correctly identified, demand is inelastic. But it’s still a market subject to competitive forces, provided they exist.
> If drug x is what is keeping you alive and they have a patent on it its not like you can't buy the drug.
The drug x did not emerge spontaneously. Someone decided to create it because it was a demand for it and it was an opportunity for profit.
Had the research not occurred, the drug wouldn’t have been created at all. So the way I see it, having an expensive drug (I will maybe be kept alive) is preferred to not having it at all (I definitely won't be kept alive). Plus, patents do expire as far as I’m aware.
Yes, I understand people want drugs at prices they can afford but this is not solvable by simply price fixing without generating unintended consequences.