With dementia cases on the rise in Scotland, it is more important than ever to ensure that patients whose condition is severe enough to require detention under the Mental Health Act are treated fairly.

In the case of these two patients at the Royal Alexandra Hospital in Paisley, that has not happened.

It is possible that the failure to realise their detention certificates had lapsed boils down to an admin error, but it is a serious one.

Read more: Scottish Government slammed over support given to dementia patients 

The bottom line is that these two patients were in a position where they should have been free to leave the psychiatric if they or their families wanted, but they were never given that choice.

Even if they had told medical staff that they wished to be discharged, those staff were under the mistaken impression that they remained subject to the Mental Health Act and were therefore not free to go.

In short, they were potentially "deprived of liberty" against their will, and when it was no longer appropriate.

Read more: Dementia is now leading killer of women in Scotland 

Inspectors have also flagged issues around these patients' medication because, again, paperwork was lacking.

In one case, a patient was being given treatment not covered by their T3 certificate. A T3 certificate is used to authorise medical treatment for patients who do not have the capacity to consent.

In the case of a 'T3' detention, the treating doctor is required to contact the Mental Welfare Commission after two months of compulsory treatment has elapsed. An independent doctor will then either authorise continued treatment or a change in treatment.

Read more: Study to investigate links between Alzheimer's and gut health

Without this it is impossible to say whether the patient's treatment was suitable or unsuitable - we can only be sure that it had not been properly authorised.

It is also worrying that a dementia patient whose treatment had been authorised under a T2 certificate - used for patients who do have the capacity to consent - was simultaneously receiving physical treatment under the Incapacity Act.