
    Betty BOZEMAN, etc., Appellant, v. HERNANDO COUNTY, et al., Appellees.
    No. 88-1925.
    District Court of Appeal of Florida, Fifth District.
    Sept. 7, 1989.
    
      John W. Mitzel of Mitzel and Mitzel, P.A., Tampa, for appellant.
    R. Barry Morgan of Adams, Hill, Fulford & Morgan, Orlando, for appellees.
   DANIEL, Chief Judge.

Appellant Betty Bozeman, as guardian for Carolyn Harrington, has taken this appeal from the final order of summary judgment entered in favor of appellees Hernan-do County and Board of Trustees of Lykes Memorial Hospital.

Bozeman instituted this action by filing a complaint against Hernando County and the Board of Trustees of Lykes Memorial Hospital. In her complaint Bozeman alleges that in May of 1981, Carolyn Harrington arrived at the emergency room of Lykes Memorial Hospital seeking emergency medical treatment and that Harrington was injured as a result of negligent medical care which she received from the emergency room physicians. Bozeman sought to impose liability upon appellees based on the theory of negligence as well as on the theory that Harrington was a third party beneficiary of the employment contract between the hospital and the emergency room physicians. Appellees filed a motion to dismiss Bozeman’s complaint, asserting that the complaint failed to set forth a cause of action upon which relief could be granted. Following, a hearing on appellees’ motion to dismiss, the trial court entered an order which granted summary judgment in favor of appellees.

On appeal Bozeman contends that it was error for the trial court to, sua sponte, enter summary judgment in favor of appel-lees. We agree.

It is settled law that the function of a motion to dismiss is to raise a question of law concerning the sufficiency of the plain-, tiff’s complaint. In ruling on a motion to dismiss the ultimate question before the trial court is whether, assuming the plaintiff is able to prove all of the allegations set forth in the complaint, such would establish a cause of action against the defendant. Lanzo Construction Company, Florida v. Orange County, Florida, Camp, Dresser and McKee, Inc., 546 So.2d 432 (Fla. 5th DCA 1989). See also Dawson v. Blue Cross Association, 293 So.2d 90 (Fla. 1st DCA 1974). In contrast, when reviewing a motion for summary judgment, the trial court is not limited simply to the four corners of the complaint. Rather, the trial court is able to review the pleadings, depositions and admissions on file, together with the affidavits, if any, in order to determine whether the moving party is entitled to judgment as a matter of law. Odham v. Foremost Dairies, Inc., 128 So.2d 586 (Fla.1961). Here, appellees filed a motion to dismiss Bozeman’s complaint; however, the trial court sua sponte considered the motion as one for summary judgment. The trial court then proceeded to enter summary judgment in favor of appellees based upon information which was not set forth in the complaint. This was error. See Ehmann v. Florida National Bank at Ocala, 515 So.2d 1063 (Fla. 5th DCA 1987).

Application of the proper standard of review to the instant case reveals that dismissal of count I (the third party beneficiary count) of Bozeman’s complaint is warranted because the complaint, standing alone, indicates that Harrington was at most an incidental third party beneficiary of the stated employment contract. See Aetna Casualty & Surety Company v. Jelac Corporation, 505 So.2d 37 (Fla. 4th DCA 1987); Health Application Systems v. Hartford Life and Accident Insurance Company, 381 So.2d 294 (Fla. 1st DCA 1980). However, dismissal of count II (the negligence count) is not warranted because the allegations set forth in the complaint are sufficient to state a cause of action against appellees on the theory that the emergency room physicians were apparent agents of the hospital. See Webb v. Priest, 413 So.2d 43 (Fla. 3d DCA 1982). See also Insinga v. La Bella, 543 So.2d 209 (Fla.1989) (the supreme court acknowledged the viability of a negligence action against a hospital based on the theory of apparent agency while authorizing the recognition of the corporate negligence doctrine.)

Accordingly, we affirm the dismissal of count I, reverse the dismissal of count II, and remand the matter to the trial court for proceedings consistent with this opinion.

AFFIRMED in part; REVERSED in part; REMANDED.

DAUKSCH, J., and ORFINGER, Retired, concur.  