Not medication, I wouldn't recommend investing even if a person doesn't have enough money saved before they go for investment because savings are more important as it is a fund that is always readily available for you to use in emergencies whereas an investment doesn't have that nature and only the profits generated from an investment can be used for such situations.
So in my opinion, investment should be the last option on one's list of things to do with their income, and before it, should come basic expenses, medication if any, savings, charity if one can afford it, and then investment because all other things are more important.
To have a happy investment life, one needs an emergency fund to make his investment life go smooth as possible. Most investors make the mistake of not having an emergency fund saved specifically for instances of emergency like sudden sickness or anything that has to do with spending money. Though it's good for someone to have enough money before starting up an investment journey, so you'll not end up spending from your investment when needs arises but if you don't have the a plan strategy, even with all you money you have, when emergencies strick you might end up withdrawing your investment to settle those things.