Yep. And an Advanced Health Directive. It might have a different name in other countries. In Australia, it's something you write while still compis mentis. It's about 8 pages long and it covers every possible contingency for what might happen to you and how you wish to be treated if it happens.
For instance, if an accident or disease leaves you unable to communicate your wishes, how do you want the medicos to treat you and to what level? If you are in a completely vegetative state, do you wish the life-support to be turned off? If you have a major heart attack or stroke, do you wish to be revived?
If you are one of the unlucky orphans who has no relatives and no spouse, who would speak for you if you could not speak for yourself?
Who would you appoint as your Enduring Guardian (legally appointed carer and decision maker)? Who would you appoint as your Power-of-Attourney to look after your financial and property affairs? Which doctors and specialists do you want as their advisors on your behalf?
Usually it is next of kin who are consulted and who have the legal say on your behalf, but if you've never discussed these things with them, they might decide something for you that is the opposite of what you want. Or often next of kin have terrible arguments about it and the family doesn't recover. Or they know what you want but can't bear to do it. Or if you are gay but not in a state that permits same-sex marriage, your relatives will get the choice and your life-partner will not be allowed to be with you.
An Advanced Health Directive is a legally binding document which solves all these issues. It can also be invoked as a temporary directive for people who have periods of psychosis or some physical illness which makes them temporarily unable to speak for yourself.