
149 Cal.App.3d 650 (1983)
197 Cal. Rptr. 45
JORDAN D. HALLER, Plaintiff and Appellant,
v.
BURBANK COMMUNITY HOSPITAL FOUNDATION, Defendant and Respondent; BOARD OF TRUSTEES OF BURBANK COMMUNITY HOSPITAL FOUNDATION, Real Party in Interest and Respondent.
Docket No. 66833.
Court of Appeals of California, Second District, Division Seven.
December 8, 1983.
*652 COUNSEL
Rogers, Monsey, Woodbury, Phillips, Perry & Berggreen, James E. Rogers and Jonathan C. Reed for Plaintiff and Appellant.
Musick, Peeler & Garrett, Joseph A. Saunders, Jay D. Christensen and Maryl D. Raskin for Defendant and Respondent and for Real Party in Interest and Respondent.
*653 OPINION
THOMSON, J.
Jordan Haller, a licensed and board certified thoracic and cardiovascular surgeon, appeals from a judgment insofar as it denies his petition for a writ of mandate (Code Civ. Proc., § 1094.5). Petitioner sought to compel respondents Burbank Community Hospital Foundation and its board of trustees (board) (1) to set aside the board's October 8, 1979, decision restricting his practice at Burbank Community Hospital (hospital), restoring his prior unrestricted status; (2) to withdraw its October 17, 1979, disciplinary report to the State Board of Medical Quality Assurance (BMQA); and (3) to entertain his 1981 reappointment application for unrestricted staff privileges.
The superior court, treating the writ petition brought pursuant to Code of Civil Procedure section 1094.5 as a proceeding under section 1085, granted part of the requested relief by issuing a peremptory writ compelling respondents to give petitioner a hearing upon his 1981 application for restoration of full hospital privileges. The superior court, however, sustained a demurrer without leave to amend to that part of the petition addressing the October 8, 1979 restriction on petitioner's operating privileges on the grounds of failure to exhaust administrative remedies and inappropriateness of Code of Civil Procedure section 1094.5. The court also denied mandamus relief with respect to the BMQA disciplinary report, indicating that the court lacked jurisdiction in the matter.

Issues
The issues presented by this appeal are: (1) Was the demurrer properly sustained without leave to amend with respect to the October 8, 1979 decision to restrict petitioner's staff status? (2) Was the petition properly denied with respect to withdrawal of the BMQA disciplinary report? We will conclude, for the reasons that follow, that the trial court erred and accordingly reverse the judgment.

Facts
In 1972, petitioner joined the hospital medical staff. He was twice elected chief of surgery and enjoyed full operating privileges in his specialty of cardiovascular and thoracic surgery until October 1979. He has unrestricted operating privileges at seven other California hospitals and his specialized practice is entirely dependent upon referrals of other physicians which in turn depend upon his reputation in the community.
In August 1979, after a medical study suggesting a possible deviation from standard clinical practice, the hospital's executive committee ordered *654 the surgery committee to review the matter. On August 14, the chairman of the surgery ad hoc committee sent petitioner a letter informing him of an interview to be held in accordance with article IX, section 1, of the medical staff bylaws. On August 20, 1979, petitioner met with the ad hoc surgery committee members and a discussion was held about the incidence of complications of petitioner's surgery. Article IX, section 1(c), of the above cited bylaws specifically provides that this interview does not constitute a hearing.
By letter dated October 11, 1979, petitioner was informed that the board at its October 8, 1979, meeting had taken "action" requiring "`[t]hat any case [petitioner] consults on, in which a surgical procedure is recommended, must be seen by an independent qualified consultant, ... This condition to be for a period of six (6) months, and may be renewable at the judgment of the Surgery Committee.' [¶] This action may be appealed according to the procedures so outlined in the Medical Staff By-Laws."
On October 17, 1979, the hospital wrote a "Disciplinary Report" (see Bus. & Prof. Code, § 805) to the BMQA indicating that petitioner's staff privileges had been restricted for more than 45 days for medical disciplinary cause or reason as of October 8, 1979. The report described the specific restrictions and the surrounding circumstances.
On May 16, 1980, the hospital wrote petitioner a letter informing him that at the April 24 surgery committee meeting and the May 6 executive committee meeting, a motion was passed "reinstituting" the October 8, 1979 restriction for another six months with an additional condition that petitioner must perform a minimum of three major vascular surgery cases during that time. There was no mention in the letter of any right to a hearing or to an appeal.
On numerous occasions petitioner attempted to have his full privileges reinstated without resorting to litigation. On April 21, 1980, petitioner's attorney wrote a letter indicating petitioner's interest in having the decision "reversed."
On May 15, 1980, respondents' attorney wrote petitioner's counsel. After noting that he had been asked by the hospital to respond to petitioner's April 21 letter, respondents' attorney stated that petitioner no longer had any right to challenge the underlying restriction. The May 1980 letter stated that: (1) the October 1979 "decision has become final" due to a failure to previously request a hearing and therefore respondents' attorney was "at a loss so far as advising you what [petitioner] `would have to do to have the decision reversed' at the present time"; and (2) the April 1980 decision renewing and extending the restriction "is, of course, subject to [petitioner's] right *655 of appeal. However, ... such a right of appeal would not extend to the question of whether or not the original action was justified; rather, it would involve the question of whether or not [petitioner] has performed within the initial six months ... sufficient ... vascular procedures without complication to justify removal of the restriction."
Subsequent communications between the parties included a December 1980 letter by petitioner to the hospital, directly requesting that the restriction be rescinded and he be granted a hearing in accordance with the bylaws.
In March 1981, the BMQA informed petitioner that its "investigation revealed that there was no evidence to substantiate the allegations made." In May 1981, petitioner submitted his application for reappointment with full privileges and subsequently filed suit in March 1982.

Sustaining of a Demurrer Without Leave to Amend Was Improper
(1) In reviewing a judgment of dismissal entered upon the sustaining of a demurrer without leave to amend, we must treat the demurrer as admitting all material facts properly pleaded and all reasonable inferences which can be drawn therefrom. (Buckaloo v. Johnson (1975) 14 Cal.3d 815, 828 [122 Cal. Rptr. 745, 537 P.2d 865]; Glaire v. LaLanne-Paris Health Spa, Inc. (1974) 12 Cal.3d 915, 918 [117 Cal. Rptr. 541, 528 P.2d 357].) We must liberally construe the allegations of the complaint with a view to attaining substantial justice among the parties. (Ibid.) Moreover, a demurrer should not be sustained if the moving party has alleged facts entitling him to some sort of relief under any possible legal theory. (Woods v. Superior Court (1981) 28 Cal.3d 668, 673 [170 Cal. Rptr. 484, 620 P.2d 1032]; Barquis v. Merchants Collection Assn. (1972) 7 Cal.3d 94, 103 [101 Cal. Rptr. 745, 496 P.2d 817].)
(2) A petitioner's cause of action will not be defeated because of a mistaken request for Code of Civil Procedure section 1094.5 mandamus when Code of Civil Procedure section 1085 is appropriate. (Lowry v. Obledo (1980) 111 Cal. App.3d 14, 25 [169 Cal. Rptr. 732].) A demurrer must be overruled if a proper basis for issuance of mandamus is alleged; it is unimportant that plaintiff's pleading was not in form a petition for mandamus. (Woods v. Superior Court, supra, 28 Cal.3d at p. 673 [proceeding brought pursuant to § 1094.5 properly treated as one brought pursuant to § 1085]; see also Anton v. San Antonio Community Hosp. (1977) 19 Cal.3d 802, 813-814 [140 Cal. Rptr. 442, 567 P.2d 1162] [proceeding brought pursuant to § 1085 properly treated as one brought pursuant to § 1094.5].)
"Of course, mandamus pursuant to section 1094.5, commonly denominated as `administrative' mandamus, is mandamus still. It is not possessed *656 of `a separate and distinctive legal personality. It is not a remedy removed from the general law of mandamus or exempted from the latter's established principles, requirements and limitations.' [Citations.] The full panoply of rules applicable to `ordinary' mandamus applies to `administrative' mandamus proceedings, except where modified by statute." (Woods v. Superior Court, supra, 28 Cal.3d at pp. 673-674.)
(3a) Furthermore, the demurrer cannot be sustained on appeal on grounds that petitioner's action was barred by a failure to exhaust internal remedies. The doctrine of exhaustion of administrative or internal remedies has not hardened into inflexible dogma. (Volpicelli v. Jared Sydney Torrance Memorial Hosp. (1980) 109 Cal. App.3d 242, 253 [167 Cal. Rptr. 610]; Ogo Associates v. City of Torrance (1974) 37 Cal. App.3d 830, 834 [112 Cal. Rptr. 761].) (4) It does not preclude resort to the courts where its pursuit would be futile or would result in irreparable harm. (Hull v. Cason (1981) 114 Cal. App.3d 344, 359 [171 Cal. Rptr. 14]; Volpicelli v. Jared Sydney Torrance Memorial Hosp., supra.) "It is settled that the rule requiring exhaustion of administrative remedies does not apply where an administrative remedy is unavailable [citation] or inadequate [citation]." (Tiernan v. Trustees of Cal. State University & Colleges (1982) 33 Cal.3d 211, 217 [188 Cal. Rptr. 115, 655 P.2d 317].)
Preliminarily, we note that we need not reach petitioner's contention that the imposition of the 1979 restriction (and the BMQA report) prior to any hearing violated petitioner's "due process" rights. Asserted denial of the common law right to fair procedure is not ordinarily an excuse for failure to exhaust internal remedies. (See Roth v. City of Los Angeles (1975) 53 Cal. App.3d 679, 687 [126 Cal. Rptr. 163].) "The violation of its own rules which inflicts the initial wrong furnishes no right for direct resort to the courts." (Holderby v. Internat. Union Etc. Engrs. (1955) 45 Cal.2d 843, 847 [291 P.2d 463].) "It is only when the organization violates its rules for appellate review or upon a showing that it would be futile to invoke them that the further pursuit of internal relief is excused." (Ibid..)
(3b) Thus, the issue is whether the internal remedy provided by respondents was available and adequate. "[I]f the remedy provided does not itself square with the requirements of due process the exhaustion doctrine has no application." (Roth v. City of Los Angeles, supra, 53 Cal. App.3d at p. 688.)
On October 11, 1979, petitioner was notified that the board's October 8 action restricting his privileges "may be appealed according to the procedures so outlined in the Medical Staff By-Laws." Article III, section 5, of those bylaws, entitled "Hearing and Appellate Review Procedure," sets *657 forth separate procedures for a hearing and for appellate review. The appellate procedures are stated in subsection 6 which is entitled "Appeal to the Governing Body." Subdivision (a) of that subsection provides that a petitioner may request "an appellate review by the governing body" within 30 days after receiving notice "of an adverse recommendation or decision made or adhered to after a hearing," and subdivision (g) of that subsection provides that "[n]ew or additional matters not raised during the original hearing or in the hearing committee report" can only be introduced at the "appellate review" under "unusual circumstances" in the governing body's "sole discretion." (Italics added.)
It is undisputed that petitioner had never been afforded a hearing and was entitled to a hearing in accordance with subsections 1 through 5 of section 5 of the bylaws.[1] Respondents contend, and the trial court found, that the notice indicating the action "may be appealed" adequately informed petitioner he should request a hearing. Petitioner contends, however, that this nebulous invitation to appeal cannot be deemed an adequate procedural remedy. We agree.
In Martino v. Concord Community Hosp. Dist. (1965) 233 Cal. App.2d 51, 56 [43 Cal. Rptr. 255], the court noted that the hearing procedure provided in the bylaws was unavailable because the doctor's application for staff privileges was "deferred," rather than "rejected or denied." In Farmer v. City of Inglewood (1982) 134 Cal. App.3d 130, 138 [185 Cal. Rptr. 9], that court noted that the administrative remedy was unavailable because the civil service rule provided for appeal within 10 days after receiving the written grounds and no reasons were stated in the final notice of action. Similarly here, as in Martino and Farmer, no hearing was available to petitioner under the strict terms of the notice and the bylaws.
*658 At the very least, the language notifying petitioner that the decision could be appealed is ambiguous and therefore we cannot say respondents have demonstrated as a matter of law that plaintiff failed to exhaust an internal remedy which was available to him. (See Westlake Community Hosp. v. Superior Court (1976) 17 Cal.3d 465, 477 [131 Cal. Rptr. 90, 551 P.2d 410].) Indeed, in a July 30 letter to petitioner's counsel, respondents' counsel conceded its ambiguity, indicating that the use of that language was "unfortunate."
Moreover, even assuming petitioner was initially adequately advised of the availability of a hearing, the exhaustion doctrine does not bar mandamus relief. Idle pursuit of internal remedies is not required where, as here, an organization has made it clear what its ruling would be. (Jacobs v. State Bd. of Optometry (1978) 81 Cal. App.3d 1022, 1030 [147 Cal. Rptr. 225].) Respondents' May 1980 letter made it plain that petitioner would not be afforded any opportunity to challenge the restriction imposed on his surgical practice.
There is no merit to respondents' claim that petitioner had lost his right to a hearing on the underlying issue by failure to make a timely request. Although the bylaws state that the failure to request a hearing "within the time and in the manner herein provided shall be deemed a waiver," no time limits are provided. Thus petitioner cannot be deemed to have waived his hearing right to a restriction still in effect long before the expiration of any applicable statute of limitations, particularly in view of the renewal of the restriction for another six months at the same time he was invoking his hearing right.
Respondents' offer of a hearing on the renewed restriction limited only to the question of the number of surgical procedures performed during the prior six months was, of course, inadequate to satisfy his common law right to fair procedure. (See Bush v. California Conservation Corps (1982) 136 Cal. App.3d 194, 203 [185 Cal. Rptr. 892].) Since petitioner could positively state what the organization's decision in his particular case would be, there was no adequate remedy available. (Ogo Associates v. City of Torrance, supra, 37 Cal. App.3d at p. 834.) Additionally, we note that petitioner did again attempt to obtain internal relief by specifically requesting a hearing in December 1980. Petitioner certainly was not required to further pursue internal remedies in order to invoke the court's jurisdiction. (Ibid.)
Code of Civil Procedure section 1085 anticipates the arbitrary or improper refusal by an association to hold a hearing and authorizes resort to a writ of mandate to compel such a hearing. (See Morton v. Hollywood Park, Inc. (1977) 73 Cal. App.3d 248, 254 [139 Cal. Rptr. 584].) The superior court *659 properly treated the section 1094.5 petition as a section 1085 petition in one respect and ordered respondents to grant petitioner a hearing on his 1981 application for restoration of unrestricted privileges. The superior court should have also treated the remainder of the petition as a writ of traditional mandamus under section 1085.
Instead of sustaining the demurrer without leave to amend to petitioner's request to set aside the October 8, 1979, board decision, the trial court should have similarly ordered respondents to grant petitioner a hearing on the original (and renewed) restriction. Petitioner's failure to specifically request such relief is immaterial. (Tiernan v. Trustees of Cal. State University & Colleges, supra, 33 Cal.3d at p. 218, fn. 9.) A court may grant any relief consistent with the case made by the petitioner and embraced within the issue. (Ibid.) The essence of petitioner's complaint, as alleged in the petition and repeatedly stressed in the correspondence admitted in evidence, was that respondents had denied petitioner his right to a hearing.

Denial of Any Relief With Respect to the BMQA Report Was Improper
(5) We also conclude that the trial court abused its discretion in foreclosing any relief with respect to the BMQA disciplinary report. Although the BMQA terminated its investigation of petitioner in March 1981, concluding that the charges were unsubstantiated, the report still can cause petitioner irreparable harm. The BMQA must keep the report on file for five years and must send copies to every hospital where petitioner seeks appointment or reappointment. (See Bus. & Prof. Code, §§ 805, 805.5.) Indeed, petitioner included exhibits from two hospitals showing the report's prejudicial effect.
The trial court based its denial of this part of the petition on a purported lack of jurisdiction, thereby indicating its concern that BMQA was an indispensable party. We agree that BMQA should have been joined as a party in order to protect the public interest. The lack of joinder, however, did not warrant outright denial of the petition. Rather, the trial court should have directed petitioner to amend his petition to join BMQA as a party and then should have determined what relief, if any, petitioner is entitled to with respect to that report.
Accordingly, the judgment denying the petition is reversed. The demurrer to the petition without leave to amend is overruled. The superior court is directed (1) to issue a peremptory writ compelling respondents to grant petitioner a hearing on the propriety of the October 8, 1979, restriction of his staff privileges; and (2) (a) to direct petitioner to amend his petition to *660 join BMQA as a party, and (b) to determine whether the BMQA report was prematurely filed and should be withdrawn.

Disposition
The judgment is reversed and the cause is remanded for further proceedings consistent with the views expressed herein.
Schauer, P.J., and Johnson, J., concurred.
A petition for a rehearing was denied January 5, 1984, and respondents' petition for a hearing by the Supreme Court was denied February 1, 1984.
NOTES
[1]  Section 5, subsection 1, entitled "Right to Hearing and to Appellate Review," provides: "a. When any practitioner receives notice of a recommendation of the executive committee that if ratified by decision of the governing body will adversely affect his appointment to or status as a member of the medical staff or his exercise of clinical privileges, he shall be entitled to a hearing before an ad hoc committee of the medical staff. If the recommendation of the executive committee following such hearing is still adverse to the affected practitioner, he shall then be entitled to an appellate review by the governing body before the governing body makes a final decision on the matter.

"b. When any practitioner receives notice of a decision by the governing body that will affect his appointment to or status as a member of the medical staff or his exercise of clinical privileges, and such decision is not based on a prior adverse recommendation by the executive committee of the medical staff with respect to which he was entitled to a hearing and appellate review, he shall be entitled to a hearing by a committee appointed by the governing body, and if such hearing does not result in a favorable recommendation, to an appellate review by the governing body, before the governing body makes a final decision on the matter.
"c. All hearings and appellate reviews shall be in accordance with the procedural safeguards set forth herein to assure that the affected practitioner's rights are not violated."
