(h) If the defendant has performed satisfactorily in diversion, at the end of the period of diversion, the court shall dismiss the defendant’s criminal charges that were the subject of the criminal proceedings at the time of the initial diversion. A court may conclude that the defendant has performed satisfactorily if the defendant has substantially complied with the requirements of diversion, has avoided significant new violations of law unrelated to the defendant’s mental health condition, and has a plan in place for long-term mental health care. If the court dismisses the charges, the clerk of the court shall file a record with the Department of Justice indicating the disposition of the case diverted pursuant to this section. Upon successful completion of diversion, if the court dismisses the charges, the arrest upon which the diversion was based shall be deemed never to have occurred, and the court shall order access to the record of the arrest restricted in accordance with Section 1001.9, except as specified in subdivisions (j) and (k). The defendant who successfully completes diversion may indicate in response to any question concerning the defendant’s prior criminal record that the defendant was not arrested or diverted for the offense, except as specified in subdivision (j).