Whenever a proceeding is held in a superior court under the provisions of this chapter, involving a person who has been placed in a state hospital located outside the county of residence of the person, the provisions of this section shall apply. The appropriate financial officer or other designated official of the county in which the proceeding is held may make out a statement of all of the costs incurred by the county for the investigation, preparation, and conduct of the proceedings, and the costs of appeal, if any. The statement may be certified by a judge of the superior court of the county. The statement may then be sent to the county of residence of the person, which shall reimburse the county providing the services. If it is not possible to determine the actual county of residence of the person, the statement may be sent to the county in which the person was originally detained, which shall reimburse the county providing the services.
Ca. Welf. and Inst. Code § 4804