Section 7. (A) Upon the entry of a judgment in favor of a claimant under this chapter and following a separate hearing on the matter, the court shall enter an order either directing the expungement or sealing of those records of the claimant maintained by the department of criminal justice information services, the probation department, and the sex offender registry that directly pertain to the claimant's erroneous felony conviction case, including documents and other materials and any samples obtained from the claimant. The commonwealth, as well as any other law enforcement agency that may be directly affected by such expungement or sealing of such records including, but not limited to, the district attorney that prosecuted the felony case against the claimant, shall be given reasonable notice and an opportunity to be heard on the issue of whether such records, documents and materials shall be so expunged or sealed. In making its determination as to whether such records, documents and materials shall be so expunged or sealed, the court shall consider the interests of privacy and justice pertaining to the claimant's erroneous felony conviction as well as the probable effect of such expungement or sealing on relevant law enforcement entities and their ability to appropriately investigate and prosecute other persons for the felony which forms the basis of the claim or other crimes that may relate to the information contained in such records, documents and materials.
(B) Following a separate hearing conducted by the court, the court may also order the expungement or sealing of those records that directly pertain to the claimant's erroneous felony conviction case that are currently in the care, custody and control of other state, municipal or local departments, agencies, commissions or committees, including law enforcement entities. Any such agency, commission, committee or entity shall be given reasonable notice and an opportunity to be heard on the issue of whether such records, documents and materials shall be expunged or sealed pursuant to this section. In making its determination as to whether such records, documents and materials shall be expunged or sealed, the court shall consider those factors required for consideration by the court in paragraph (A).
(C) Any order to expunge or seal entered by the court shall provide that, in any employment application, the claimant may answer ''no record'' as to any charges expunged or sealed pursuant to this section in response to an inquiry regarding prior felony arrests, court appearances or criminal convictions.
(D) The charges and convictions expunged or sealed shall not operate to disqualify the claimant in any examination, appointment or application for public employment in the service of the commonwealth or any other political subdivision thereof, nor shall such charges and convictions be used against the claimant in any way in any court proceedings or hearings before any court, board or commission to which the claimant is a party to the proceedings.
(E) A settlement agreement pursuant to this chapter may include a stipulation or agreement to an order of expungement or sealing to be entered by the court. Such stipulation or agreement shall be filed with the court and the court shall enter an order directing the expungement or sealing of those records of the claimant maintained by the department of criminal justice information services, the probation department and the sex offender registry that directly pertain to the claimant's erroneous felony conviction, including documents and other materials and any biological samples or other materials obtained from the claimant. If the settlement does not include an agreement to an order of expungement or sealing, the claimant is entitled to seek expungement or sealing from the court.
(F) For the purposes of this chapter, ''expungement'' shall mean the permanent erasure and destruction of records.