73 Pa.C.S. § 4707
(a) General rule.— Upon order of the board of health or upon order of a health officer if there is no board of health, the following individuals may enter a premises in the township where an infectious or contagious disease or a nuisance detrimental to the public health is suspected and examine and abate the disease or nuisance:
(b) Search warrant.— If entry to the premises under subsection (a) is prevented, the board of health or health officer may obtain an administrative search warrant from a magisterial district judge with jurisdiction over the premises upon a showing of any of the following: