Upvote:2
You'll have to declare a refusal on any future visa application, and give details. Don't be tempted not to declare it: Australia shares immigration data with the Five Eyes treaty countries (Australia, New Zealand, Canada, United States and UK). You should assume all five will know, and perhaps others by association.
Whether a refusal on medical grounds will adversely affect your future applications is a different question. Each country has different health requirements, and those requirements can vary depending on what sort of visa you're seeking. A short term tourist visa is likely to have less stringent health requirements than an application for permanent residence.
A known but untreated condition is likely to be viewed less favourably than if you are receiving treatment. Psychosis covers a wide range of symptoms, so the actual effect on your visa will be down to reports by your doctors. Something that has required hospitalisation is clearly serious so you should seek treatment anyway.
Withdrawing your application now will certainly ensure that you're not refused a visa. It will also guarantee that you won't get one that might otherwise be granted. It won't help with health declarations on future applications, and if you leave your condition untreated, you'll come up against your current problem again, sooner or later.
Only you can decide whether to withdraw. If you're already seeking treatment ask your doctor for advice.
Consider also whether your university exchange can be deferred while you receive treatment. It might be appropriate to withdraw now and reapply in the future.