The parents of a boy with a rare genetic condition have gone to the High Court to fight the NHS's decision to refuse funding for a "life-changing" drug.
The seven-year-old, who a judge has said should be identified only as S, has severe autism and phenylketonuria (PKU), which inhibits his ability to digest protein.
His autism affects his ability to comply with the dietary restrictions which form the standard treatment for PKU, so his doctors sought funding for a drug called Kuvan.
S's counsel, Ian Wise QC, told Mrs Justice Andrews in London on Tuesday that funding had been repeatedly refused by NHS England with differing reasons given, leaving S at risk of the consequences of poorly-controlled PKU, including brain damage.
He said the decision to refuse funding should be quashed as it was "irrational, unreasonable and unlawful", as well as contrary to the 2004 Children Act and Article 8 of the European Convention on Human Rights, which covers private and family life.
S's father has told the court that his management had become more difficult over time because he would not take his supplements and was becoming more and more interested in normal foods since going to school and seeing what other children were eating.
The only method the family could use to maintain his phenylalanine levels was to seriously reduce his food intake.
"It is awful to make your child miss meals but the alternative, which is a risk of cognitive damage and all the other problems associated with too high phenylalanine levels, is worse," he said.
If prescribed Kuvan, S - who is of low weight and short for his age - would be able to get a proportion of vitamins and minerals from ordinary food.
His doctors say that every possible strategy had been considered, including admission to hospital, but the only potential solution is Kuvan.
S's father has branded the decision "extremely frustrating, unfair and inhumane".
"No family should have to fight with the NHS for over 18 months to ensure that their child is given proper treatment.
"It is clear to me they do not want to fund this life-changing drug."
At the start of the two-day contested hearing, the judge said it was important to clarify the court's role.
"If a rational conclusion was reached on the material then, however sympathetic one might be to this little boy's plight, the court cannot interfere.
"It is very important to explain the limits to which a court can intervene.
"I cannot substitute my view for that of these experienced clinicians.
"It is not for a judge to decide what is in the best interests of S.
"The question is whether this decision is susceptible to being interfered with on public law grounds."
Jenni Richards QC, for NHS England, told the judge that there was no basis for impugning on rationality grounds the judgments reached as to clinical and cost effectiveness or equity of funding.
NHS England had a policy, which was unchallenged, not to commission Kuvan because of insufficient evidence as to its medium and long term clinical effectiveness.
The mainstay of PKU treatment was - and would remain, even with Kuvan - dietary control.
Despite S's poor compliance with dietary supplements due to his autism, the evidence before the decision-makers was that his phenylalanine levels were currently reasonably well controlled and generally within acceptable limits due to his parents' efforts.
She said that S's consultant acknowledged that, in terms of neurological impairment, his overall development outcome would mostly be affected by the severity of his autism rather than his PKU.
He also accepted that Kuvan would not be expected to significantly alter or improve S's behaviour.
"In those circumstances, and notwithstanding the protestations, criticisms and complaints set out ... NHS England was plainly rationally entitled to conclude that there was insufficient evidence of clinical effectiveness and insufficient evidence of there being significantly more clinical benefit to the claimant than to others, and thus to decline funding.
"Further, in light of the fact that NHS England's judgment is that there is insufficient evidence of medium or long term clinical effectiveness to justify routine commissioning; NHS England's judgment that there was insufficient evidence of significantly more clinical benefit to the claimant; and the potential current and future costs of the treatment, NHS England was plainly entitled to conclude that there was insufficient evidence of cost effectiveness to justify funding.
"Indeed, such a conclusion inevitably followed."
Ms Richards said that any order compelling NHS England to fund S's treatment would be "wholly wrong".
"The court's function is to consider the lawfulness of NHS England's decision-making.
"It is no part of the court's function to allocate scarce NHS resources or to take decisions about the equitable division of those resources."
A decision in the case is expected to be reserved to a later date.