When it appears to the Superior Court or to any municipal court, from the evidence or otherwise, that any person coming before such court on any charge, may have a venereal disease in an infectious stage, it shall be the duty of such court to order the person to submit to a medical examination for venereal diseases, in a jail or at a hospital or clinic or by such physician as may be selected or appointed for the purpose, and if found to have a venereal disease in an infectious stage to submit to treatment in such jail, hospital or clinic or by such officer or to other treatment permitted under the medical practice act.
N.J.S. § 26:4-49.7