Masturbating in hospitals.

This is a serious question. I am NOT talking about someone staying in the hospital for a day to a week or anything like that. Not to mention it is illegal because of public indecency. I'm talking about people who basically live their life in the hospital. I know they are sick but I also know that they could be horny so that's why I'm asking. Would they be allowed to masturbate IF they are capable of doing it? Are there any nurses or doctors on here that have dealt with this?