Yes, it is possible. The examination of mental condition of the accused is performed always by an expert in psychiatry. A court order, and in pre-trial proceedings an order of the presiding judge, is needed. In case an outpatient examination is insufficient, the examination is carried out in a medical facility or if the accused is in custody, in the hospital for the accused and convicted (Section 148 of the Code of Criminal Procedure). The examination of mental condition of a witness is performed in the event of substantial doubt that the ability to perceive correctly or to give testimony of the witness, whose testimony is of material importance for the decision, is substantially diminished. A court order, and in pre-trial proceedings an order of the presiding judge, is needed. It is not admissible to perform the examination of the witness in a medical facility (Section 150 of the Code of Criminal Procedure).