Section 18(5)(c) in The Mental Healthcare Act, 2017
(c)ensure that the long term care in a mental health establishment for treatment of mental illness shall be used only in exceptional circumstances, for as short a duration as possible, and only as a last resort when appropriate community based treatment has been tried and shown to have failed;