Any physician and surgeon, including a psychiatrist, licensed to practice in this state, or any psychologist licensed to practice in this state who holds a doctoral degree and has at least two years of experience in the diagnosis and treatment of emotional and mental disorders, who is employed by the prisoner or his or her attorney to assist in the preparation of the defense, shall be permitted to visit the prisoner while he or she is in custody.