If you want somethings and not others, say so. if you really and truly want nothing except palliative care, say so. Have the discussion with your doc. Make appropriate plans and put them in a legal document. Let your family know. Thats all it takes.
I am right now in the process of drawing up a directive that will state that I will be given only palliative care if I come down with certain ailments (and severe dementia is one of them). I choose to not live under those circumstances.
Such a legal document followed by a trusted person with power-of-attorney can make it stick. It is my understanding that if a hospital will not follow those instructions, then the person with power-of-attorney can go to a court and make them do it.
If you live in California, you probably should get what is known as a POLST (physicians orders for life saving treatment). States are starting to recognize this document and take it is priority one because it is a written order by your doc saying what to do (in great specificity). Eventually all states will use this type of form because it is the standard at the VA and for Medicare. It is becoming more usual in all states and doctors and health care professionals are being trained on it.