
308 N.W.2d 11 (1981)
Daniel SNETHEN, Appellant,
v.
STATE of Iowa, Appellee.
No. 64689.
Supreme Court of Iowa.
July 15, 1981.
*13 James Cleary, Des Moines, for appellant.
Thomas J. Miller, Atty. Gen., Shirley Ann Steffe, Asst. Atty. Gen., Dan Johnston, Polk County Atty., and Carol Ann Nix, Asst. Polk County Atty., for appellee.
Considered by UHLENHOPP, P. J., and HARRIS, McGIVERIN, LARSON, and SCHULTZ, JJ.
SCHULTZ, Justice.
Petitioner Daniel Snethen appeals from the denial of an application for postconviction relief challenging his conviction of first-degree murder. Snethen alleges that the trial court erred in finding that he had not proved his claim of ineffective assistance of counsel. The ineffective assistance of counsel claim is premised on trial counsel's failure to object to rebuttal expert testimony of Dr. Paul Loeffelholz, a psychiatrist who examined Snethen under court order. Snethen contends the testimony was objectionable because it (1) violated the attorney-client privilege and infringed upon his right to assistance of counsel, and (2) violated the physician-patient privilege. We affirm the trial court.
On October 23, 1974, Snethen was indicted by a Polk County Grand Jury for the murder of Timothy Hawbaker. On November 14, 1974, the trial court granted Snethen's application for psychiatric evaluation to determine whether he was competent to stand trial and whether he was insane at the time of his alleged participation in the homicide. Pursuant to court order, Snethen was admitted to the Iowa Security Medical Facility at Oakdale for evaluation. The order required that the court be provided with a written report of such evaluation. In a report made on January 9, 1975, Dr. Loeffelholz expressed the opinion that Snethen was competent to participate in the pending judicial proceedings.
On January 30, 1975, however, a jury found Snethen incompetent to stand trial. Pursuant to section 783.3, The Code 1973, the trial court found that discharge would endanger public peace and safety and ordered Snethen recommitted to the Oakdale facility until such time as he was found competent to stand trial. Snethen remained at Oakdale until Dr. Loeffelholz made a second report to the court, again opining that Snethen was competent to stand trial.
Prior to the scheduled competency trial Snethen filed a motion for a continuance and appointment of an impartial psychiatrist to make an independent evaluation of his competency to stand trial. With the agreement of Snethen's counsel, the trial court ordered an evaluation by Dr. John Garfield, a clinical psychologist. On May 21, 1975, a jury found Snethen competent to stand trial.
Prior to trial Snethen filed notice of his intention to rely on the defense of insanity. The notice listed Dr. Garfield as an expert witness who was intended to be called on *14 Snethen's behalf. The State then filed notice of its intention to call rebuttal witnesses, including Dr. Loeffelholz.
At trial Dr. Garfield testified concerning the insanity defense, concluding that Snethen suffered from a mental disorder described as paranoid delusional beliefs or a psychotic paranoid state. Dr. Loeffelholz, called as a rebuttal witness for the State, disputed Dr. Garfield's opinions and testified as to conversations he had with, and statements made by, Snethen on the two occasions he was committed to the Oakdale facility. Although objections were made to part of Dr. Loeffelholz's testimony, no objections were made on the basis of either the attorney-client or physician-patient privileges.
Snethen was subsequently found guilty of murder in the first degree in violation of sections 690.1-.2, The Code 1973. His conviction and sentence were affirmed by this court in State v. Snethen, 245 N.W.2d 308 (Iowa 1976). He later filed a pro se application for postconviction relief, and new counsel was appointed for the postconviction proceeding. Present counsel was thereafter appointed for the purpose of this appeal.
I. General principles. In a postconviction proceeding the petitioner has the burden of proof to establish by a preponderance of the evidence a claim of ineffective assistance of counsel. Kellogg v. State, 288 N.W.2d 561, 563 (Iowa 1980). There is a presumption that counsel is competent, which must be overcome by the petitioner, Sims v. State, 295 N.W.2d 420, 423 (Iowa 1980); but the ultimate test is whether under the entire record and totality of the circumstances counsel's performance was within the range of normal competency, Hinkle v. State, 290 N.W.2d 28, 30 (Iowa 1980); State v. Massey, 207 N.W.2d 777, 780 (Iowa 1973). "Such circumstances must include an affirmative factual basis demonstrating counsel's inadequacy of representation." Hinkle v. State, 290 N.W.2d at 30.
When a claim of ineffective assistance of counsel rests upon a specific act or omission of counsel at trial, as it does in this case, relief will be granted only if it appears that the defendant was prejudiced thereby. See id. at 34. Thus, two conditions must be satisfied before a party will be found to have been denied a fair trial due to inadequacy of counsel: It must be shown that (1) counsel failed to perform an essential duty, and (2) prejudice resulted therefrom.
When a postconviction petitioner alleges violation of constitutional rights, as here, we make an independent evaluation of the totality of the circumstances. This is equivalent to a de novo review. Sims v. State, 295 N.W.2d at 422.
II. Physician-patient privilege. Snethen asserts that his trial counsel's failure to object to Dr. Loeffelholz's testimony on the basis that it violated the physician-patient privilege constitutes ineffective assistance of counsel. In its finding of facts and conclusions of law, the trial court stated:
Wilson made several valid objections during direct examination of Dr. Loeffelholz. None raised a claim of doctor-patient privilege. In this case Wilson stated he did not believe the doctor-patient relationship existed as the Court had ordered evaluation and report....

....
... The entire record has been reviewed and studied in light of Petitioner's contentions. This Court finds Petitioner has failed to meet his burden of proof.
We agree with the finding of the trial court.
The physician-patient privilege prohibits a physician from disclosing any confidential communication entrusted to the physician in his or her professional capacity. § 622.10, The Code 1975. Three elements must be established in order for the privilege to be applicable: (1) the relationship of doctor-patient; (2) the acquisition of the information or knowledge during this relationship; and (3) the necessity of the information to enable the physician to treat the patient skillfully. State v. Cole, 295 N.W.2d 29, 32 (Iowa 1980); State v. Nowlin, 244 N.W.2d 596, 602 (Iowa 1976); State v. District Court, 218 N.W.2d 641, 643 (Iowa 1974). We have held that the third requirement *15 of the privilege is lacking in court-ordered evaluations: The communication is not for the purpose of treatment but to evaluate the mental condition for the benefit of the court. State v. Cole, 295 N.W.2d at 33; State v. Nowlin, 244 N.W.2d at 602; State v. Mayhew, 170 N.W.2d 608, 615-16 (Iowa 1969).
Snethen points out, however, that his second confinement at Oakdale was pursuant to a court order following a determination of incompetency to stand trial. He argues that the language of section 783.3, The Code 1973that "no further proceedings shall be taken under the indictment until his reason is restored"implies a directive for treatment of one found incompetent to stand trial. He thus claims that all three elements are met with respect to the second commitment.
We do not agree that Snethen's second commitment was for the purpose of treatment. The January 30, 1975, court order specifically provided that the sheriff give physical custody of Snethen to the Iowa Security Medical Facility at Oakdale, that he remain in the custody of the facility until found competent to stand trial, and that a written report of such evaluation be provided the court. The order did not provide for treatment. In Cole we stated that the unambiguous provisions of a court order are controlling. See 295 N.W.2d at 33.
We therefore conclude that the third requirement of the privilegethe necessity of the information to enable the physician to treat the patient skillfullywas lacking, and the physician-patient privilege did not exist with respect to either commitment to Oakdale. Since the physician-patient privilege did not exist, there is no merit in Snethen's contention that trial counsel was ineffective in failing to object on that basis.
Snethen nevertheless maintains that Dr. Loeffelholz's testimony should have been objected to on the ground that its admission would be fundamentally unfair. Collins v. Auger, 577 F.2d 1107 (8th Cir. 1978), cert. denied, 439 U.S. 1133, 99 S.Ct. 1057, 59 L.Ed.2d 96 (1979), is cited as authority for this position. In that case Collins was granted a mental evaluation to determine his competency to stand trial. During the course of interviews with a psychiatrist at the Iowa Security Medical Facility at Oakdale Collins confessed that he had committed the crime for which he was charged, and the statements made to the psychiatrist were admitted into evidence at trial. The United States Court of Appeals for the Eighth Circuit held that Collins had been denied due process of law because it was fundamentally unfair to allow a court-appointed psychiatrist to testify concerning a defendant's incriminating admissions during a psychiatric evaluation.[1] The court reasoned that a defendant should not be compelled to choose between exercising the fifth amendment right against self-incrimination[2] and the fourteenth amendment due process right to seek available defenses. Id. at 1109-10.
Failure to object to Dr. Loeffelholz's testimony on the ground that its admission would violate Snethen's due process rights was not presented to the trial court in the *16 postconviction proceeding as a basis for the claim of ineffective assistance of trial counsel, however. It is well established that an issue not presented at trial cannot be raised for the first time on appeal. State v. Matlock, 289 N.W.2d 625, 628 (Iowa 1980); State v. Lemburg, 257 N.W.2d 39, 46 (Iowa 1977). Therefore, error has not been preserved with respect to this issue.
Even assuming, arguendo, that the issue had been properly raised, we find no merit in it. In 1975, at the time of trial, Iowa case law held that the physician-patient privilege did not apply to court-ordered evaluations. See State v. Mayhew, 170 N.W.2d at 615. At the postconviction proceeding Snethen's trial counsel testified that Dr. Loeffelholz was employed by the State, was not Snethen's personal physician, and had performed a court-ordered evaluation. Trial counsel further stated that he did not consider the communications with Dr. Loeffelholz to be privileged. This understanding was consistent with the existing state of our case law. Collins was not decided until three years later. Counsel need not be a crystal gazer; it is not necessary to know what the law will become in the future to provide effective assistance of counsel. Boyer v. Patton, 579 F.2d 284, 288 (3d Cir. 1978). To violate constitutional standards, defense counsel's error must be such that a reasonably competent attorney acting as a diligent and conscientious advocate would not have made. Cooper v. Fitzharris, 586 F.2d 1325, 1330 (9th Cir. 1978), cert. denied, 440 U.S. 974, 99 S.Ct. 1542, 59 L.Ed.2d 793 (1979). We therefore conclude that under the totality of the circumstances defense counsel was not ineffective in failing to object to Dr. Loeffelholz's testimony on the basis that its admission would violate due process.
In addition, the failure to raise the due process objection did not constitute prejudicial error affecting a substantial right. See Scott v. Oliver, 552 F.2d 20, 21 (1st Cir. 1977). There was evidence of statements to peace officers by Snethen admitting his complicity in the murder. Snethen's step-brother also testified concerning the events leading to the confrontation between Snethen and the victim, and that Snethen admitted committing the murder. Snethen was clearly implicated in the homicide without Dr. Loeffelholz's testimony.
III. Attorney-client privilege and assistance of counsel. Snethen asserts that his evaluation by Dr. Loeffelholz during his first commitment at Oakdale, upon court order pursuant to his own application, was for the purpose of aiding his counsel and himself in presenting his case and evaluating viable defenses. He contends that his trial counsel's failure to object to the testimony of Dr. Loeffelholz deprived him of his rights to a fair trial and assistance of counsel, as guaranteed by the sixth and fourteenth amendments to the United States Constitution. Snethen's contentions are based on United States v. Alvarez, 519 F.2d 1036 (3d Cir. 1975).
In Alvarez the United States Court of Appeals for the Third Circuit held that confidential communications to a psychiatrist hired by the defendant for the purpose of trial preparation and possible testimony were protected by the attorney-client privilege, and that to compel the psychiatrist to testify regarding the confidential communications would deprive the defendant of effective assistance of counsel:
The effective assistance of counsel with respect to the preparation of an insanity defense demands recognition that a defendant be as free to communicate with a psychiatric expert as with the attorney he is assisting. If the expert is later used as a witness on behalf of the defendant, obviously the cloak of privilege ends. But when ... the defendant does not call the expert the same privilege applies with respect to communications from the defendant as applies to such communications to the attorney himself.
Id. at 1046 (footnote omitted).
We need not reach the merits of Snethen's assignment of error, however, because this issue was not presented to the trial court in the postconviction proceeding. The *17 only issue presented in that proceeding regarding Dr. Loeffelholz's testimony was whether trial counsel's failure to object on the basis of the physician-patient privilege constituted ineffective assistance of counsel. Snethen now seeks to expand this objection by asserting that Dr. Loeffelholz was an agent of his trial attorney and the attorney should have objected to Loeffelholz's testimony on the basis of the attorney-client privilege and a corresponding deprivation of assistance of counsel. Since the State was not alerted to this issue, however, it had no opportunity to present evidence to refute Snethen's present contentions.
As noted in division III, an issue not presented at trial cannot be raised for the first time on appeal. Hence, there is nothing for us to review.
IV. Conclusion. We have thoroughly considered all of petitioner Snethen's arguments and find them to be without merit. The trial court correctly concluded that Snethen did not sustain his burden of proving by a preponderance of the evidence ineffective assistance of trial counsel. On the basis of the record before us, we therefore hold that trial counsel's performance was within the range of normal competency.
AFFIRMED.
NOTES
[1]  The Cole holding that the physician-patient privilege does not arise with respect to court-ordered evaluations because communications during such examinations are not for the purpose of treatment but to evaluate a defendant's mental condition for the benefit of the court was expressly limited to the statutory privilege of section 622.10. The constitutional implications of forced disclosure of physician-patient communications were not addressed. See 295 N.W.2d at 36.
[2]  This fifth amendment right was recently addressed in Estelle v. Smith, ___ U.S. ____, 101 S.Ct. 1866, 68 L.Ed.2d 359 (1981). The trial court admitted a psychiatrist's testimony, which was based on a court-ordered psychiatric evaluation to determine competency to stand trial, in a capital sentencing proceeding. The United States Supreme Court held that the testimony violated Smith's right against compelled self-incrimination because prior to the evaluation he had not been advised of his Miranda rights. The Court also held that Smith's sixth amendment right to assistance of counsel had been abridged since defense counsel were not notified in advance of the use to which the psychiatrist's findings could be employed. These issues are not before us in the present appeal.
