A justice of the superior court may, upon petition setting forth in ordinary language that the servant or employee of a certain person, has been injured in the course of his employment, through some defect in the ways, works or machinery owned or used by the employer, and that it is necessary in order to protect the interests of the injured person that an examination should be made of the ways, works or machinery through whose defect the injury occurred, and after such notice to the employer as any justice of said court may direct or approve, and a hearing, grant an order directing the employer or person in control of such ways, works or machinery to permit the person named in said order to make such examination, under conditions to be set forth in the order.
Mass. Gen. Laws ch. 153, § 9