Doctors can refuse to treat patients if they feel it serves no purpose
When parents and doctors cannot agree over the treatment children should receive, it is left to the courts to decide what route to take.
The parents of Charlotte Wyatt, who is seriously ill after being born prematurely 11 months ago, want doctors to keep treating her.
But having already resuscitated Charlotte three times after she stopped breathing, staff at the Portsmouth hospital where she is being cared for say she should be allowed to die if her breathing stops again.
The case is now being decided in the High Court.
Doctors can refuse to treat a patient if they feel it is in the person's best interests.
Dr Michael Wilks, of the British Medical Association's ethics committee, told BBC Five Live the decision will be taken if the treatment serves no purpose or if the quality of life is deemed to be so low that it is not beneficial.
He said: "A doctor's job is to make clinical judgements about whether treatment is appropriate or not. If it is not appropriate it should be withdrawn."
And he said while it was difficult, the public should also consider the wider implications of giving treatment.
"Every time we give unnecessary treatment we spend NHS resources and deprive someone else of these resources."
He said court was a last resort and was not always the best place to make clinical decisions but sometimes it was the only way.
"These are hugely difficult decisions for doctors and, of course, for families."
In a radio debate with Dr Wilks, Michael Summers, chairman of the Patients Association, agreed such cases were hard to resolve.
"It is very difficult to decide."
But he added: "At the end of the day it's the patient's quality of life which is uppermost in people's minds."
However, cases are also taken to court where doctors want to treat a patient but parents are against it.
One of the most high-profile recent case was that of the Maltese conjoined twins Rosie and Gracie, who shared a heart.
In that case, doctors argued Gracie would benefit from the operation to separate her from her sister because her heart was keeping both girls alive, and it could not bear the strain.
But the operation would result in certain death for Rosie.
Their parents had argued against the procedure, saying doctors were playing God.
In 2001, judges decided the operation should go ahead. Rosie died but Gracie survived and went back to Malta with her parents.