 Your express intention is not to kill the child, obviously. It's to treat the medical condition. A consequence of that will be that the child will die. But that would be a principle of double effect, just like self-defense.