Any patient committed to the care and custody of the Commissioner of Health pursuant to section 685 of this title shall be committed for a period of six months, and shall be subject to such posthospitalization program as may be established pursuant to section 687 of this title; except that such patient may be released from confinement by the Commissioner of Health at any time prior to the expiration of such six-month period if the Commissioner of Health determines and certifies in writing that the patient has been cured of his drug addiction and rehabilitated, or that his continued confinement is no longer necessary or desirable.