(a)
Except as otherwise provided in this section, in determining residence for purposes of being entitled to hospitalization in this state and for purposes of returning patients to the states of their residence, an adult person who has lived continuously in this state for a period of one year and who has not acquired residence in another state by living continuously therein for at least one year subsequent to his residence in this state shall be deemed to be a resident of this state. Except as otherwise provided in this section a minor is entitled to hospitalization in this state if the parent or guardian or conservator having custody of the minor has lived continuously in this state for a period of one year and has not acquired residence in another state by living continuously therein for
at least one year subsequent to his residence in this state. The parent, guardian, or conservator shall be deemed a resident of this state for the purposes of this section, and the minor shall be eligible for hospitalization in this state as a person with a mental health disorder. The eligibility of the minor for hospitalization in this state ceases when the parent, guardian, or conservator ceases to be a resident of this state and the minor shall be transferred to the state of residence of the parent, guardian, or conservator in accordance with the applicable provisions of this code. Time spent in a public institution for the care of persons with developmental disabilities or mental health disorders, or on leave of absence therefrom, shall not be counted in determining the matter of residence in this or another state.
(b)
Residence acquired in this or in another state shall not be lost by reason of military service in the Armed Forces of the
United States.