Image caption St Andrew's Healthcare chief executive Katie Fisher said the causes of delays were complex

Up to 50 patients, some with learning disabilities and autism who should be released, are stuck in secure units run by a mental health hospital charity.

St Andrew's Healthcare, which treats up to 900 patients, told the BBC there was a lack of suitable community places.

Footage of a teenager locked in seclusion, able to touch their parent only through a door hatch at one of its units, has been shown to the BBC.

The hospital said seclusion was used as an emergency response only.

St Andrew's Healthcare runs four private hospitals that specialise in caring for patients with severe mental health and learning difficulties - 90% of referrals are from the NHS.

Patients are supposed to be admitted to these assessment and treatment units (ATUs) for nine to 18 months but the average stay nationally is five years.

Chief executive Katie Fisher told the BBC's Victoria Derbyshire programme one patient had been detained for an extra 524 days after they should have been released.

"It varies over time and of course the reasons for delays are complex," she said.

"This isn't someone sitting on something, who isn't doing their job properly.

"Maybe several attempts have been made to create a discharge and for several reasons that has fallen through."

Extreme distress

Last month, the programme reported that one St Andrew's Healthcare patient, Ayla Haines 26, had tried to kill herself after spending seven years in an ATU.

Following this, Labour's shadow care minister, Barbara Keeley, announced an all-party parliamentary group to investigate mental health hospitals.

On Monday, research by the children's commissioner for England found too many children were being admitted to mental health hospitals unnecessarily - despite a government pledge to move up to 50% of such patients into community settings by March 2019.

Ms Fisher said continuing to detain patients who no longer needed to be in ATUs was unacceptable,

"But actually, people's mental health and wellbeing can fluctuate over time, so it's not as simple as just saying someone needs to be here and someone doesn't need to be here."

Image caption One patient could have contact with their parent only through a hatch in a door

Hospitals use a seclusion room as a last resort if a patient is in extreme distress or is a risk to themselves or a member of staff.

In a damning report published this week, the Care Quality Commission (CQC) called for a review of every patient in long-term seclusion or segregation in mental health hospitals across the UK.

The Victoria Derbyshire programme was given footage of a teenager reaching their arm through a door hatch to enable contact with their parents during a visit to a St Andrew's hospital.

The parent told the programme the patient had been held in seclusion for months.

Low-stimulation rooms

A recent CQC inspection of St Andrew's Hospital in Northampton found one patient had had repeated and prolonged periods of seclusion over 18 months.

The hospital said it would not comment on individual cases.

But Ms Fisher said: "In some seclusion rooms for certain types of patients, there is the opportunity to for food and other things that patient might need to be given to them through an opening of the door, which means the door itself doesn't have to be opened.

"The use of seclusion rooms is only ever used as an emergency response and if all other efforts of de-escalation, both verbal and low-stimulation rooms, have failed."

Image caption Psychiatrist Paul Wallang says prone restraint should not be used

Another CQC inspection report, published in 2016, found a technique called prone - or face-down - restraint was being used widely across wards at the St Andrew's hospitals.

Its use has reduced - but there were still more than 1,000 recorded incidents last year.

Between 2016 and 2018, prone restraint was used by staff on patients 5,597 times.

Reducing numbers

This is despite a consultant psychiatrist at St Andrews telling the Victoria Derbyshire programme prone restraint should not be used.

"It is something that is associated with death in some circumstances - certainly within the charity, we have reduced the amount of prone restraint that we use drastically over many years," said Paul Wallang.

But he added: "Sometimes when somebody is restrained they will move into the restraint position in a prone.

"If that happens, we immediately move them to supine, which is face-up, a much safer way to restrain - and all of our staff are trained in that technique."

A government spokeswoman said: "The NHS is committed to reducing numbers of people with a learning disability and autistic people who are inpatients in mental health hospitals by 35% by the end of March 2020.

"And through the [NHS] Long Term Plan, we will reduce numbers even further by investing in specialist services and community crisis care and giving local areas greater control of their budgets to reduce avoidable admissions and enable shorter lengths of stay.

"The CQC is also undertaking an in-depth review into the use of seclusion, segregation and restraint - which should only be used as a last resort - in order to improve standards across the system."

Follow the BBC's Victoria Derbyshire programme on Facebook and Twitter - and see more of our stories here.