Any determination of a person's incapacity to refuse treatment with antipsychotic medication made pursuant to Section 5334 shall remain in effect only for the duration of the detention period described in Section 5150 or 5250, or both, or until capacity has been restored according to standards developed pursuant to subdivision (c) of Section 5332, or by court determination, whichever is sooner.
Ca. Welf. and Inst. Code § 5336