Thank you for that question. It's an important one.
The legislation makes it clear that it needs to be an adult who is capable of giving consent and informed consent at that. You are right that in some cases, such as in the case of mental illness, the illness may be such that it compromises a person's capacity. This decision will rely on the good judgment of professionals who are in the business of establishing capacity.
As you have indicated, there are a number of specialists who sometimes need to be called in and consulted on a case-by-case basis if the clarity of a person's capacity is not there. Certainly one would assume the medical professional in this case would determine that the person is capable. If there were any doubt and question, this would not stop them. There would be nothing in the legislation that would prevent someone from making a determination by an extra step to confirm a person's capacity.