A 17 year-old Jehovah's Witness who was fighting a court order to have a life-saving blood transfusion has lost an appeal just four months shy of his 18th birthday.

The religious teenager, who is being treated for Hodgkin's Lymphoma at The Sydney Children's Hospital, had threatened to rip the IV needle from his arm and said it would be akin to rape if he was given a blood transfusion while under anaesthetic.

A Supreme Court judge ruled in April that the boy, known as X for legal reasons, had to have the transfusion but his family appealed it, arguing that he was "highly intelligent" and his maturity and competency should be enough to override the court's power.

Justice John Basten rejected the appeal on Friday morning but said the order would be removed when X turned 18 in January, allowing him to make the potentially life-or-death decision for himself.

His doctor, Professor Glenn Marshall, told the court earlier this year that X had an 80 per cent chance of dying from anaemia if he didn't have the transfusion.