...
(4) A person who has been adjudicated as an incompetent or who has been involuntarily committed to a mental institution for inpatient care and treatment under section 302, 303 or 304 of the provisions of the act of July 9, 1976 (P.L.817, No.143), known as the Mental Health Procedures Act. This paragraph shall not apply to any proceeding under section 302 of the Mental Health Procedures Act unless the examining physician has issued a certification that inpatient care was necessary or that the person was committable.
...