Any public agency that applies for or accepts state assistance for any hospital under this article does so on condition that the hospital for which such assistance is requested and accepted, at all times during which it is operated, (a) shall be qualified for a license under Chapter 2 (commencing with Section 1400) of Division 2 of this code (whether or not Chapter 2 is otherwise applicable to the hospital), and be subject to inspection under Chapter 2 to the same extent as are other hospitals to which Chapter 2 applies; or shall be qualified for a license under Part 2 (commencing with Section 5699) of Division 5 of the Welfare and Institutions Code (whether or not Division 5 is otherwise applicable to the hospital), and be subject to inspection under Division 5 to the same extent as are other hospitals to which Division 5 applies; and (b) shall not restrict patients to those unable to pay for their care.