You need to discuss this with your family doctor, the hospital is not usually setup for this type of problem. Perhaps the infection is causing the problem, but you can't be sure about it. I know this will be difficult if you do not have insurance and cannot pay the doctor. If this is a problem, many doctors and clinics will see you on a sliding scale. And a lot of them will not charge you the full price, instead charging the same as an insurance company would pay. (Insurance companies have contracts that allow them to pay less the normally charged amount, this pretty much universal.) Another option is to go to your county health department, they can work with you regarding payment and they usually use a sliding scale as well.
When you first wake up in the morning is when you should have your strongest erection. If you are having trouble you need to see the doctor. I am not sure what all the causes are, but blood pressure can cause this and so can hormonal issues. For example, my pituitary gland stopped working and I now must take take hormone replacements every day, including testosterone. These problems are treatable. There are some very serious conditions that could cause this where delay can be really bad, even dangerous. Try not to worry about this since this is most likely not the problem, but a tumor in right -well, wrong really- place. Don't put it off!
have your kidney infection attended to urgently. when it is resolved your erection count should stabilise. don't worry and eat healthily. masturbation will not harm you, in fact it may help