Any of the following persons, in order of priority stated, may authorize and consent to a postmortem examination and autopsy on a decedent's body for the purpose of determining the cause of death of the decedent, for the advancement of medical or dental education and research, or for the general advancement of medical or dental science, if:
The order of priority shall be as follows:
If the physician or surgeon has actual notice of contrary indications by the decedent or of opposition to an autopsy by a member of the same or a prior class, the autopsy shall not be performed. The persons authorized herein may authorize or consent to the autopsy after death or before death.
In cases of death where official inquiry is authorized or required by law, the provisions of Article 1 (§ 32.1-277 et seq.) of Chapter 8 of Title 32.1 shall apply. If at the time of death, a postmortem examination is authorized or required by law, any prior authorization or consent pursuant to this section shall not be valid unless the body is released by the Office of the Chief Medical Examiner.
A surgeon or physician acting in accordance with the terms of this section shall not have any liability, civil or criminal, for the performance of the autopsy.
Va. Code § 54.1-2973