Wondering if its harram to invest in stocks that use for example marijuana or shrooms that would be otherwise harram but in this case used for medical purposes?

Refrain from it