Before I formed you in the womb I knew you, and before you were born I consecrated you. 72 My frame was not hidden from you, when I was being made in secret, intricately wrought in the depths of the earth. 73

Catechism number 2278

Discontinuing medical procedures that are burdensome, dangerous, extraordinary, or disproportionate to the expected outcome can be legitimate; it is the refusal of "over-zealous" treatment.
Here one does not will to cause death; one's inability to impede it is merely accepted.
The decisions should be made by the patient if he is competent and able or, if not, by those legally entitled to act for the patient, whose reasonable will and legitimate interests must always be respected.

Official source ↗