What I mean is, if you're in a position to pick between going for medication or Investing, you should pick medication no matter what. But if you have the ability to go for the two without your investment fund affecting your other financial activities, then go for it.
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.