There is no psychotherapist-patient privilege if the psychotherapist is appointed by the court to examine the patient, unless the psychotherapist is appointed upon request of the patient's lawyer to obtain information to advise the patient of whether or not to utilize a defense based on insanity or on his mental or emotional condition. There is no privilege if the psychotherapist is appointed by the Board of Prison Terms to examine the patient.