
449 So.2d 788 (1984)
B.V. CLEMONS
v.
FAIRVIEW MEDICAL CENTER, INC., and Sylvester L. Reeder, III, Administrator of Fairview Medical Center, Inc.
82-749.
Supreme Court of Alabama.
April 6, 1984.
Tyrone C. Means of Massey, Means & Thomas, Montgomery, for appellant.
Solomon S. Seay, Jr., Montgomery, for appellees.
FAULKNER, Justice.
B.V. Clemons brought this action for injunctive relief, seeking to require Fairview Medical Center to reinstate his medical staff privileges at the hospital. Fairview and its administrator filed a motion to dismiss, asserting, inter alia, that the complaint failed to state a claim on which relief could be granted. After a hearing on plaintiff's application for a temporary restraining order, the trial court entered an order granting the defendants' motion to dismiss. Clemons appeals, and we reverse.
Although the trial court's order purported to grant the defendants' motion to dismiss, we note that the court considered matters outside the pleadings in making its decision. If, on a motion to dismiss for failure to state a claim, matters outside the pleadings are presented to and not excluded by the trial court, the motion is properly treated as a motion for summary judgment. Rule 12(b), A.R.Civ.P. An appellate court will uphold the granting of a summary judgment when there exists no genuine issue of material fact and a party, in this case the defendant, is entitled to prevail as a matter of law. Green v. Bradley Construction, Inc., 431 So.2d 1226 (Ala.1983).
*789 This case involves the interpretation of Fairview's medical staff by-laws and the question of their application, vel non, to the plaintiff's clinical privileges at the hospital. The by-laws provide a comprehensive procedure governing the granting, modification, and termination of clinical privileges at the hospital. The terms "medical staff privileges" and "clinical privileges" refer simply to the right of an individual to treat patients at Fairview. Fairview's medical staff, then, consists of the practitioners who have been granted clinical privileges in the manner prescribed in the by-laws.
The facts are basically undisputed. Clemons, a licensed physical therapist, entered into a contract with Fairview in 1980 granting him the exclusive right to provide specified services to patients at the hospital. In exchange for the exclusive right to provide physical therapy services at the hospital, Clemons agreed to allow the hospital to bill Clemons's patients for his services and to keep a portion of the funds collected. In order for Clemons to be eligible to treat patients at Fairview, it was necessary for him to obtain clinical privileges. He submitted an application for membership on the medical staff, along with a letter stating that he was making application for the privilege of practicing physical therapy at Fairview. By return mail, Fairview advised Clemons that the board of directors had approved his appointment to the medical staff at the hospital. Enclosed with the letter was a copy of the by-laws and rules and regulations of the medical staff. Clemons treated all of Fairview's patients requiring his services until his contract expired on June 30, 1982. At that time the contract was awarded to another physical therapist. Although his contract had expired, Clemons took the position that, as a member of the Fairview medical staff, he was still entitled to treat patients at the hospital. Presumably, Clemons could treat any patients who, either on their own or through their physician, requested his services. Clemons would, then, bill his patients directly. On December 3, 1982, however, Fairview sent Clemons a letter stating that, after a review of the medical staff by-laws, it had determined that physical therapists were not eligible for membership on the medical staff. Clemons's initial appointment to the staff was, therefore, Fairview said, an error, and by the letter Fairview purported to terminate Clemons's medical staff privileges.
On appeal Clemons argues that the termination of his medical staff privileges was a violation of the provisions of the medical staff by-laws. He takes the position that the by-laws constituted a contract between him and the hospital which Fairview breached by terminating his membership on the staff without providing him a hearing as is provided for in the by-laws.
The hospital argues that Clemons was not entitled to the due process safeguards set out in the by-laws because he was never entitled to become a member of the medical staff. The by-laws provide that membership on the medical staff "shall be extended only to professional competent practitioners" who meet the qualifications set out in the by-laws. The term "practitioner" is defined as an appropriately licensed physician, dentist, or podiatrist. Since Clemons is neither a physician, a dentist, nor a podiatrist, the hospital argues that he was not eligible to join the medical staff and, therefore, was not entitled to enjoy medical staff privileges.
Although, in our examination of the by-laws, we note that the term "practitioner" is used throughout the document, we also note that the by-laws govern the granting of clinical privileges to physical therapists as well. Physical therapists are members of a class referred to in the by-laws as "allied health professionals." Article IV of the by-laws is entitled "Categories Of The Medical Staff." It contains four sections, one of which sets forth the criteria for determining the eligibility of allied health professionals to treat patients at the hospital. In addition to the inherent ambiguity of the by-laws, which purport to apply only to physicians, dentists and podiatrists, yet govern the clinical privileges of those who treat patients under the supervision of physicians *790 as well, the testimony at the hearing supported Clemons's assertion that he and the hospital agreed that his clinical privileges were to be governed by the medical staff by-laws. The assistant administrator of the hospital, Robert Taylor, testified that it had been the practice of the hospital in the past to treat the allied health professional staff as a part of the medical staff. On questioning by plaintiff's attorney, Mr. Taylor testified:
"Q. [The] allied health professional staff, sir, is governed by the medical staff and the medical staff by-laws; isn't that correct?
"A. Yes.
"Q. Now, under your reading and your interpretation of the by-laws, must an allied health professional have clinical privileges in order to practice his profession at Fairview Medical Center?
"A. Yes."
On examination by the defendant's attorney, Mr. Taylor was questioned about the basis for his construction of the by-laws with regard to allied health professionals.
"Q. Now, you threw a term at me, Robert, that I do not find anywhere allied health professional staff. Where did you get that term from?
"A. Okay. I can only go on what has been the practice. The allied health professionals have been considered the allied health professional staff of the medical staff.
"Q. Is there any place in the [by-laws] or any other document that you are familiar with that makes any provision for an allied health professional staff?
"A. It is covered under the categories of the medical staff, and it is listed as number four, as allied health professional."
In our opinion the defendants were not entitled to a judgment as a matter of law. The by-laws themselves are ambiguous with regard to their applicability to the plaintiff. Furthermore, there was evidence which would support a conclusion that the hospital made representations to Clemons when he began practicing at the hospital that he would be treated as a member of the medical staff and that he was accorded membership on the staff for over two years before the hospital reinterpreted the by-laws. Whether the hospital should now be allowed to rely on another interpretation of the by-laws is a question which should be determined after a full hearing on the merits.
In Medical & Surgical Society of Montgomery County v. Weatherly, 75 Ala. 248 (1883) (subsequent proceedings reported at 76 Ala. 567), this Court ruled that a medical society could be compelled to reinstate a member whose membership was terminated in a manner contrary to the provisions of the society's constitution and by-laws. Plaintiff's complaint, therefore, stated a claim on which relief can be granted. The record, when viewed most favorably toward the plaintiff, who is the non-movant, does not support a conclusion that the defendants were entitled to a judgment as a matter of law. The trial court's order is reversed and the case is hereby remanded.
REVERSED AND REMANDED.
TORBERT, C.J., and ALMON, EMBRY and ADAMS, JJ., concur.
