The High Court has ordered a teenager with a psychiatric illness to have blood samples taken against her will.
The 15-year-old has told doctors she wants to kill herself before her 16th birthday.
Medical staff treating the girl need the blood samples to establish if she has a life threatening physical disorder, known as neuropleptic malignant syndrome (NMS), and to ensure she is not developing diabetes from a particular drug treatment.
The girl, who cannot be named by court order, has bipolar affective disorder and was detained last October in an adolescent mental health inpatient unit under the Mental Health Act 2001.
She was previously admitted last year and the year before after she made attempts to take her own life.
Her detention was extended by District Court order to the end of this month.
The case involved consideration of issues including the definition of medical "treatment" under the 2001 Act.
It queries what circumstances such treatment may be lawfully administered to minors detained under Section 25 of that Act, which provides the HSE can apply to the District Court for detention of young people considered to have a psychiatric illness.
Mr Justice George Birmingham accepted the girl was a serious suicide risk who had not challenged her detention in an adolescent mental health inpatient unit for the purpose of "treatment".
In this case, the girl opposed the taking of blood samples, but doctors considered those necessary to monitor her reaction to her medication, a mood-altering drug.
The girl's parents also supported taking the samples.
The judge found the taking of a blood sample was in her "best interests" - the principal consideration under Section 4 of the Act - and a proportionate measure designed to protect her life and wellbeing.
She was "a serious suicide risk" and that risk was heightened in the lead up to her 16th birthday, he said.
The judge found the girl lacked the necessary mental capacity to refuse consent to the taking of blood samples.
While a doctor believed the girl's refusal could be linked with her wish to die, that same doctor believed her real belief was she would not die from an infection because she believed that "only happens to old people", the judge noted.
The judge stressed the girl's capacity to make medical decisions may fluctutate and he was not laying down a general principle 15 or 16-year-olds should always be regarded as lacking capacity.
Because the forcible taking of a blood sample involved a significant intereference with the autonomy and bodily integrity of the girl, and in circumstances where other treatments were and may still be sought, the HSE initiated proceedings and lawyers were appointed to represent her views.