In this case Charles Willman, M.D., relator, filed a petition in mandamus alleging that respondent St. Joseph Hospital wrongfully denied him his vested right to admit and attend patients in the hospital and praying that a writ of mandamus be issued compelling the hospital to reinstate his former medical staff membership and clinical privileges. The trial court rendered judgment on the pleadings in favor of Dr. Will-man, and the hospital appealed to this court. On that appeal, we reversed the trial court’s judgment and held that the facts alleged in the petition could not support a judgment for Dr. Willman on any ground. State ex rel. Willman v. St. Joseph Hospital, 684 S.W.2d 408 (1984) (Will-man I). Upon remand, the trial court dismissed the petition for failure to state a claim and denied Dr. Willman leave to amend his petition. Dr. Willman now appeals asserting that the trial court erred in sustaining the motion to dismiss his petition, in ruling that it lacked jurisdiction to hear the merits of his claim and in denying him leave to amend his petition. We affirm in part and reverse in part and remand.
St. Joseph hospital is a not-for-profit corporation organized under the laws of Missouri. Dr. Willman is a medical practitioner who had enjoyed clinical privileges at the respondent hospital until June 8, 1983. In November that year, the hospital’s board of directors permanently revoked his privileges by affirming earlier decisions of various medical staff committees.
Dr. Willman then filed a petition in mandamus against the hospital seeking to regain his hospital privileges. He asserted that the hospital wrongfully revoked his privileges because the procedures employed by the board and medical staff committees were not in accord with the hospital’s corporate bylaws and medical staff bylaws. The operative facts of the petition were not really in dispute.
In its answer filed December 7, 1983, the hospital admitted the text of its bylaws quoted in the petition and admitted that certain actions were taken and hearings held by the hospital’s board of directors *830and medical staff committees during the revocation proceedings. Most of the paragraphs of the petition that were denied by the answer were those which undertook to interpret the bylaws or those which asserted that the actions taken by the hospital constituted a violation of the bylaws.
Dr. Willman then moved for judgment on the pleadings. The trial court, Judge Merrill Steeb, sustained the motion, concluding that the facts necessary for decision were admitted by the hospital and that the only issues remaining were issues of law. He concluded that the hospital bylaws, the rules and the regulations of the medical staff constitute a contract between the hospital and individual members of the staff and govern the rights and duties of Dr. Willman and the hospital. He also concluded that the corporate bylaws gave the medical staff committee the authority only to recommend revocation of a practitioner’s privileges to the board of directors and that only the board itself had the authority to revoke a practitioner’s privileges. He found that the hospital admitted that the medical staff committee undertook to revoke Dr. Willman’s privileges and sent him a letter stating that it had done so. The court concluded that the vote of the committee to revoke the doctor’s privileges and that the letter sent by the hospital advising him that his privileges had been revoked and barring him from exercising those privileges constituted a breach of contract. The court then issued a peremptory writ of mandamus ordering the hospital to permit Dr. Willman to exercise his hospital privileges. The hospital appealed that decision to this court.
Our opinion of November 7, 1984, which reversed the judgment of the circuit court, stated that the facts of this case were not in dispute. Willman I at 409. We held that the circuit court erred in its interpretation of the hospital bylaws and in concluding that the bylaws were violated so as to constitute a breach of contract. Id. at 410.
For purposes of that opinion we assumed without deciding that the bylaws did constitute a contract and that mandamus was the appropriate remedy. Id. The opinion said that the problem was that the undisputed facts could not support a judgment for Dr. Willman on any ground. Id. It set out all of the actions taken and proceedings held by each of the various medical staff committees, the hospital’s board of directors, and Dr. Willman. It reviewed and interpreted many of the corporate and medical staff bylaws and determined that the undisputed facts revealed that the doctor was afforded all the required procedures. The opinion concluded that, except for one insignificant deviation, the hospital had followed the bylaws and held that the trial court erred in concluding that the deviation constituted a breach of contract. Id. at 411.
Willman I also recognized that the doctor’s petition alleged that the bylaws had been violated in several respects. Although the trial court based its decision on only one of the alleged violations, the opinion then addressed the remainder of them to show that judgment could not have been entered for the doctor on any ground. We considered and discussed each alleged violation and explained why each claim lacked merit. Finally, we concluded that the doctor had been afforded ample procedural rights to satisfy due process requirements. Accordingly, we reversed the judgment, remanded the case, and directed the trial court to quash its peremptory writ of mandamus. Id. at 411-12.
After the mandate in Willman I issued on February 28, 1985, the trial court quashed the writ and inadvertently closed the file. By letter dated March 25, 1985, Dr. Willman asserted that the court file had been prematurely closed before any final judgment had been rendered. Judge Steeb recognized that the court file had been improperly closed and that the case was still pending before him. On the hospital’s motion for a change of judge, the case was then transferred to Judge Gary Fenner.
*831Next the hospital filed a motion to dismiss the claim for lack of jurisdiction, or, in the alternative, for failure to state a claim, asserting that the court of appeals fully disposed of all issues presented by the pleadings. Oral argument was heard on the motion on April 25, 1985, and Judge Fenner orally sustained the motion.
On April 29,1985, Dr. Willman, by letter, requested clarification of the court’s order and leave of court to file an amended petition. Pursuant to that request, the trial court entered judgment on May 1, 1985, stating that Willman I had found that Dr. Willman’s petition failed to state a claim upon which relief could be granted. The trial court also held that it lacked jurisdiction to proceed further upon the claim based upon Willman I and upon Richardson v. St John’s Mercy Hospital, 674 S.W.2d 200 (Mo.App.1984). The court denied leave to amend the petition and dismissed Dr. Willman’s petition with prejudice.
Dr. Willman then appealed to the Supreme Court of Missouri asserting jurisdiction in that court based upon the issue of the validity of a provision of the Constitution of Missouri. The Supreme Court later transferred the case to us.
Dr. Willman raises three points on appeal. He contends that the trial court erred in dismissing his petition, in ruling that it lacked jurisdiction to proceed further in the case and in denying him leave to amend his petition. We affirm that part of the judgment dismissing the petition but reverse that part denying Dr. Willman leave to amend and remand the case with directions to the trial court to permit him to file an amended petition.
I.
Dr. Willman claims that the trial court erred in dismissing his petition for failure to state a claim arguing that Willman I merely held that he was not entitled to a judgment on the pleadings, not that the petition failed to state a claim. He asserts that the trial court based its judgment on the pleadings upon only one of the several alleged bylaw violations and that Willman I holds only that the trial court erred in that particular.1 In his reply brief, the doctor strongly contends that our opinion was based only upon the undisputed facts and that, therefore, the disputed facts remain for resolution at trial. He misinterprets our opinion in Willman I
At the outset, that opinion stated that the facts of the case were not in dispute. Willman I at 409. After reexamining the petition and answer in light of our previous opinion, we again find that most of the operative facts pleaded by the petition were admitted by the answer and our opinion assumed that those few not admitted were, nevertheless, true. For example, we assumed for purposes of decision that the bylaws constituted a contract between Dr. Willman and the hospital. Id. at 410. Most of the paragraphs in the petition which were denied by the answer were either those which undertook to interpret the bylaws (questions of law) or those which stated that certain actions taken by the hospital constituted violations of the bylaws (conclusions).
Specifically, Dr. Willman alleges that paragraph 61 of the petition constituted and remains a disputed fact. That paragraph reads as follows: “Relator’s vested right to privileges in St. Joseph Hospital has not been revoked under lawful authority or due process of law and relator’s hospital staff membership and clinical privileges are still in force and effect, as a matter of law and right.” On this point the doctor is in error. Our opinion fully disposed of this paragraph as without merit. First, we assumed, for the sake of argument, that the bylaws constituted a contract between the doctor and the hospi*832tal. Id. at 410. We then found that, under our interpretation of the bylaws, the undisputed facts indicated that the hospital had conducted Dr. Willman’s revocation proceedings in accordance with the bylaws in all significant respects. Id. at 410-11. We further held that, even if the hospital’s actions constituted state action, the doctor was afforded ample procedural rights to satisfy any constitutional requirements. Id. at 412.
Our opinion recognized that' the trial court based its judgment on the pleadings upon only one of the several bylaw violations alleged in the petition. Nevertheless, we specifically addressed each remaining alleged violation and dismissed each of them as having no merit “to show that no ground appears upon which judgment could have been entered for the doctor.” Id. at 411-12.
Although we never specifically stated that Dr. Willman’s petition failed to state a claim, our opinion effectively so held by considering and dismissing as without merit each claim in the petition. Upon remand, the trial court correctly dismissed the petition. Under our previous interpretation of the bylaws, the petition fails to state a claim. Accordingly, we affirm the trial court’s dismissal of the petition, but, as we shall show, Dr. Willman should have been granted leave to file an amended petition.
II.
Dr. Willman also asserts that the trial court erred in ruling that under Richardson v. St. John’s Mercy Hospital, 674 S.W.2d 200 (Mo.App.1984), it lacked jurisdiction to proceed further in the case. We agree that Richardson would not have precluded the trial court from hearing the merits of the petition upon the contract claim2 if it had stated a valid claim of a violation of the hospital bylaws, and, of course, Richardson does not preclude the trial court from allowing the doctor leave to amend his petition. The Richardson case involved a doctor’s claim that a private hospital had denied him due process of law under the Fourteenth Amendment when its administrative board restricted his hospital privileges. The court there held that it could not review the hospital’s action under the Fourteenth Amendment because no “state action” was involved in the case.
The Due Process Clause is no longer in issue here. Willman I held that even if the hospital’s conduct were state action, “the doctor was afforded ample procedural rights to satisfy any constitutional requirements.” Willman I at 412. Thus, Richardson is inapplicable here.
III.
Finally, Dr. Willman asserts that, even if the trial court correctly dismissed the petition, it erred in denying him leave to amend his petition. With this we agree.
Rule 67.06 3 states that “[o]n sustaining a motion to dismiss a claim ... the court shall freely grant leave to amend and shall specify the time within which the amendment shall be made or amended pleading filed....” Our Supreme Court has stated the general rule that “[ojrdinarily when a first pleading is ruled to be insufficient in a trial court, the party is afforded a reasonable time to file an amended pleading if desired.” Dietrich v. Pulitzer Publishing Company, 422 S.W.2d 330, 334 (Mo.1968).
We cannot now say that Dr. Will-man’s motion to amend was untimely as the hospital urges. In the first appeal, the judgment on the pleadings was appealed to *833us by the hospital from a judgment in favor of the doctor. At first blush, our opinion was subject to the interpretation that we merely held that the doctor was not entitled to a judgment on the pleadings, and we did not specifically direct the trial court to dismiss the petition. In fact, upon remand and after an inadvertent closing of the file, Judge Steeb ruled that the case still pended before him. Not until April 15, 1985, did the hospital file its motion to dismiss the petition for failure to state a claim or lack of jurisdiction. Oral arguments were heard on the motion on April 25, 1985, and the court orally sustained the motion. Only four days later Dr. Willman filed his motion for clarification and for leave to amend. Perhaps he was not certain whether the trial court had ruled that it lacked jurisdiction or that , the petition failed to state a claim. The request was timely in those circumstances.
In Willman I we reversed the case with a general remand so that the doctor would be able to amend. See Yamnitz v. Polytech, Inc., 586 S.W.2d 76, 83 (Mo.App.1979); Kestner v. Jakobe, 446 S.W.2d 188, 196 (Mo.App.1969). In his judgment entry of May 1, 1985, Judge Fenner found both that the petition failed to state a claim and that under Richardson he lacked jurisdiction to proceed further. Although he recognized that the doctor filed the motion for leave to amend, he did not specifically deny the motion. Apparently, the judge did not deny the doctor’s motion to amend because he thought the motion untimely but denied it on jurisdictional grounds. The trial court dismissed Dr. Willman’s first petition with prejudice, therefore, res judicata would bar him from filing a new action against the hospital on the basis of the same facts. Since we are affirming the trial court’s dismissal of the petition, justice requires that we allow Dr. Willman to file an amended petition.
For the foregoing reasons, we affirm that part of the trial court’s judgment that dismisses the petition for failure to state a claim and reverse the part that denied leave to file an amended petition. We remand the case with directions to the trial court to permit Dr. Willman to file an amended petition.
SHANGLER, J., concurs.
MANFORD, J., dissents by way of separate opinion.
. Much of Dr. Willman's brief seems to assert that the hospital denied him due process, but we specifically rejected that argument in our previous opinion and will not reiterate it here.
. Willman I did not hold nor do we hold here that the hospital’s corporate and medical staff bylaws constitute a contract between the doctor and the hospital.
. Missouri Rules of Civil Procedure.