Within 30 days after the petition for rehearing is denied, or, if the petition is granted, within 30 days after the rendition of amended findings of fact on rehearing, any person affected thereby, including this system, may apply to the Supreme Court or to the court of appeal of the appellate district in which he or she resides, for a writ of review, for the purpose of inquiring into and determining the lawfulness of the findings of the Workers’ Compensation Appeals Board.