(a) No patient may be placed involuntarily in seclusion or a mechanical restraint unless necessary because there is imminent physical danger to the patient or others and a physician so orders. A written memorandum of such order, and the reasons therefor, shall be placed in the patient’s permanent clinical record within twenty-four hours.

(b) Medication shall not be used as a substitute for an habilitation program.