(1) a juvenile court commits a child to the temporary legal custody of the department under § 37-1-175,
(2) the department shall provide the necessary care, training, or treatment for the child in the least drastic alternative way that is available and suitable to meet the child's needs, AND
(3) community mental health centers and community programs that receive grants or contracts from the department to provide such services to children shall, at the direction of the department, provide the community-based services necessary to meet the child's needs for treatment in the least drastic alternative to hospitalization, AND
(4)
(A) placing the child in inpatient care in a hospital or treatment resource is the least drastic alternative way that is available to the department and is suitable to meet the child's needs,
(B) the department shall apply for the child's admission to a hospital or treatment resource under title 33, chapter 6, part 2 or 4 or shall initiate proceedings under title 33, chapter 6, part 5.