delivered the opinion of the court:
This matter has been appealed to this court by plaintiff-appellant, Melba Curtis, from an order dismissing plaintiff’s second amended complaint with prejudice entered on September 18, 1986, and an order entered November 13, 1986, denying plaintiff’s motion to reconsider.
The underlying facts of the case arose from the alleged refusal of the defendant Henry Wolfe, M.D. (Dr. Wolfe) to prepare his testimony, assist in cross-examination of defendant doctors and testify as an expert in a previous lawsuit where the plaintiff had sued for alleged malpractice. The cause of action against defendants James A. White and Carle Foundation Hospital was based upon their alleged action in inducing and directing Dr. Wolfe not to testify as an expert in the preceding case although Dr. Wolfe had previously agreed to testify as an expert on behalf of the plaintiff (Curtis).
Dr. Wolfe was a treating physician of the plaintiff’s subsequent to an abdominal hysterectomy performed by Dr. James Goldenstein and Dr. Bernard Ruder on or about January 24, 1979. In the prior malpractice action (Curtis v. Goldenstein (1984), 125 Ill. App. 3d 562, 465 N.E.2d 1367), plaintiff alleged medical negligence against Dr. James Goldenstein and Dr. Bernard Ruder, both of whom were obstetricians and gynecologists, in the performance of an abdominal hysterectomy on or about January 24, 1979. Dr. Wolfe subsequently treated plaintiff at Carle Clinic Association and Carle Foundation Hospital in Urbana, Illinois, from January 30, 1979, to March 17, 1979.
Plaintiff in the prior case then named Dr. Wolfe as her expert witness in the malpractice action and defendants’ counsel deposed Dr. Wolfe on June 1, 1982.
Apparently plaintiff was prohibited from presenting any expert witness other than Dr. Wolfe at trial as a sanction for failing to attend pretrial conferences and causing other delay in the underlying case. Plaintiff moved for a continuance of the trial, stating that Dr. Wolfe refused to give an opinion at trial but had rendered an expert opinion at his deposition on June 1, 1982, and further, that plaintiff’s counsel had arranged for a pretrial meeting with Dr. Wolfe approximately a week before the trial but was prevented from meeting with Dr. Wolfe due to the interference of James White and Carle Foundation Hospital. The motion was denied.
Plaintiff, however, subpoenaed Dr. Wolfe to testify at trial and then attempted to call Dr. Wolfe as an adverse witness in her case in chief. The court denied plaintiff’s motion, but gave plaintiff the opportunity to renew the motion to examine Dr. Wolfe as an adverse witness if Dr. Wolfe’s testimony deviated from the testimony at deposition. Plaintiff did not renew her motion to examine Dr. Wolfe as an adverse witness. On cross-examination, Dr. Wolfe indicated that he had no opinion concerning the treatment given by Doctors Golden-stein and Ruder.
The trial court in the prior case then directed a verdict in favor of defendants which was affirmed by this court in Curtis v. Golden-stein (1984), 125 Ill. App. 3d 562, 465 N.E.2d 1367.
The present action was subsequently filed by plaintiff against Dr. Wolfe, James White and Carle Foundation Hospital. Ultimately, the trial court granted defendants’ motion to dismiss pursuant to section 2 — -619(a)(9) of the Illinois Code of Civil Procedure (Ill. Rev. Stat. 1985, ch. 110, par. 2 — 619(a)(9)). In doing so, the trial court took judicial notice of the underlying case file in Curtis v. Goldenstein to find that Dr. Wolfe had testified in the underlying case, that Dr. Wolfe did not testify differently from his deposition, and that plaintiff made no motion, after being given leave, to examine Dr. Wolfe as an adverse witness if Dr. Wolfe testified contrary to his deposition testimony.
Plaintiff on appeal bases her cause of action against Dr. Wolfe on two theories. First, that Dr. Wolfe breached his contractual duty with plaintiff by not meeting with plaintiff prior to trial to discuss the case, by not helping plaintiff prepare cross-examination of the defendant doctors and by failing to render an opinion as to the operating procedures and care given by the defendant doctors. Second, in plaintiffs reply brief and at oral argument, plaintiff raised the issue that Dr. Wolfe breached a fiduciary duty owed to plaintiff when he failed to give an expert opinion at the preceding trial.
A motion to dismiss filed pursuant to section 2 — 619(a)(9) of the Illinois Code of Civil Procedure must demonstrate “[tjhat the claim asserted against defendant is barred by other affirmative matter avoiding the legal effect of or defeating the claim.” (Ill. Rev. Stat. 1985, ch. 110, par. 2 — 619(a)(9).) Therefore, the trial court, in taking judicial notice of the underlying malpractice case, determined that Dr. Wolfe had given testimony pursuant to the alleged contract and dismissed the case. Accordingly, the cause of action filed against James White and Carle Foundation Hospital was also dismissed.
We agree that the trial court properly dismissed plaintiffs complaint after taking into account the file of the preceding malpractice case. In Brewer v. Stovall (1977), 54 Ill. App. 3d 261, 369 N.E.2d 365, the court discussed the meaning of “affirmative matters” as applied to a motion to dismiss. The court held that a motion to dismiss was not intended to include every statement of evidentiary fact which tends to negate the allegations of the complaint. Instead, the motion to dismiss is properly used to set forth affirmative defenses. 54 Ill. App. 3d 261, 361 N.E.2d 365.
The substance of the underlying case of which the trial court took notice was, in our opinion, an affirmative defense of the complaint, not evidentiary facts designed to negate the allegations of the complaint. Defendants do not deny that Dr. Wolfe made an oral contract to prepare for trial and testify. They merely assert that Dr. Wolfe complied with the alleged terms of the contract by testifying in the underlying case. Therefore, the question remains whether the alleged contractual obligation was satisfied by Dr. Wolfe when he testified in the earlier trial.
Plaintiff asserts that Dr. Wolfe was contracted to render an expert opinion in the case. As to this assertion, we note that Dr. Wolfe, according to the previous court file, gave an opinion at deposition. We note further that upon direct examination of Dr. Wolfe by plaintiff, plaintiff was given, leave to renew a motion to treat Dr. Wolfe as an adverse witness if his testimony at trial differed from his prior deposition testimony. Plaintiff never renewed her motion. Therefore, when Dr. Wolfe stated at trial that he had no opinion regarding the care given by Dr. Goldenstein and Dr. Ruder, plaintiff should have renewed her motion to treat Dr. Wolfe as an adverse witness if, in fact, Dr. Wolfe had an opinion and was not testifying consistently with his deposition testimony.
We find the Wisconsin Supreme Court case of Griffith v. Harris (1962), 17 Wis. 2d 255, 116 N.W.2d 133, although not directly on point, instructive to the present situation. In Griffith, the plaintiff sued two physicians for not testifying on the plaintiff’s behalf in an underlying medical malpractice case. At the time of trial, the physicians notified plaintiff’s attorney that they would not testify without a subpoena, and if subpoenaed, they would not testify favorably for the plaintiff. The subsequent case against the physicians then alleged that the physicians refused to testify on behalf of the plaintiff at trial, causing dismissal of plaintiff’s cause of action. The Wisconsin Supreme Court rejected plaintiff’s claims as against public policy. The court stated:
“A litigant and a prospective witness may lawfully contract between themselves that the latter will appear at a trial; the breach of such contract would give rise to the damages which reasonably flow from a witness’ failure to appear. This might include the expense involved in seeking a substitute witness or perhaps the costs incurred in procuring a postponement of the trial. However, a contract creating an obligation not only to appear but also to testify in a certain manner on behalf of a party to a lawsuit, is against public policy.” Griffith v. Harris (1962), 17 Wis. 2d 255, 258-59, 116 N.W.2d 133, 135.
In this case, it is true that Dr. Wolfe testified without giving an opinion as he allegedly had contracted to do. If in fact Dr. Wolfe had an opinion that was not divulged, plaintiff should have used impeachment methods to inform the court of a prior opinion. The Griffith case indicates parties may lawfully contract between themselves that a doctor will appear and testify at trial and we believe that a contract creating any further obligation with regard to the type of testimony falls within the parameters of Griffith as against public policy.
As to plaintiff’s assertion that Dr. Wolfe had a fiduciary duty as a professional to render an opinion in court on behalf of plaintiff, we pass no judgment as the allegation is not contained within the complaint. We note, however, that Dr. Wolfe did not claim that he refused to give an opinion, simply that he had no opinion to give.
Lastly, because plaintiff’s cause of action against Dr. Wolfe was properly dismissed, her cause of action for tortious interference with a contractual relationship against James White and Carle Foundation Hospital must also fail.
Accordingly, the decision of the trial court is affirmed.
Affirmed.
WOMBACHER, J., concurs.