No physician shall be entitled to receive any public funds as a fee for attending or treating an indigent patient hospitalized under the provisions of this article, it being the intent and purpose of this article that all such professional medical services shall be furnished by such physician without cost to the state or any participating county, but this shall not be construed as prohibiting any physician, hospital or other interested party from collecting from such patient, or from relatives or others upon whom such patient is legally dependent or from other third parties the amount of any charges for hospitalization or professional medical services rendered to such patient; provided, that if any hospital shall collect from any such indigent patient, or from relatives or others upon whom such patient is legally dependent or from other third parties any charges for costs of hospitalization for such patient, public funds provided under this article shall be used only to the extent necessary to insure payment of hospital costs allowed under this article after deducting from such hospital costs the amount of any such charges collected by such hospital.