From the Catechism:
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.
2279 Even if death is thought imminent, the ordinary care owed to a sick person cannot be legitimately interrupted. The use of painkillers to alleviate the sufferings of the dying, even at the risk of shortening their days, can be morally in conformity with human dignity if death is not willed as either an end or a means, but only foreseen and tolerated as inevitable Palliative care is a special form of disinterested charity. As such it should be encouraged.
Note that a paragraph 2278 is worded in the disjunctive, ie with an “or”, not an “and”. Therefore, such treatment can be legitimately refused is it is merely “burdensome”. It needn’t be dangerous and extraordinary and disproprotiaonate to the outcome also.
Any one of the factors is arguably sufficient to justify a refusal of treatment.