
    Dwight W. KELSEY, Appellant, v. Dr. EWING, individually and as well as in his official capacity as physician for the Department of Corrections, Stillwater State Prison, Appellee.
    No. 80-2144.
    United States Court of Appeals, Eighth Circuit.
    Submitted May 22, 1981.
    Decided June 24, 1981.
    Dwight W. Kelsey, pro se.
    Ward, Gray & Oehler, Ltd., and Robert S. Abdalian, Rochester, Minn, (argued), for appellant.
    Warren R. Spannaus, Atty. Gen., State of Minnesota, St. Paul, Minn., David L. Valen-tini, Sp. Asst. Atty. Gen., St. Paul, Minn, (argued), for appellee.
    Before HEANEY and BRIGHT, Circuit Judges, and OREN HARRIS, Senior District Judge.
    
      
       THE HONORABLE OREN HARRIS, United States Senior District Judge for the Eastern and Western Districts of Arkansas, sitting by designation.
    
   HEANEY, Circuit Judge.

Appellant Dwight W. Kelsey, an inmate at the Minnesota Correctional Facility at Stillwater, appeals from the December 2, 1980, order of the district court dismissing his claim brought under 42 U.S.C. § 1983. We reverse.

Kelsey’s complaint, filed pro se on July 18, 1980, sought injunctive, declaratory and monetary relief for violations of his constitutional rights in the medical treatment he received at the Stillwater facility. The named defendant, Dr. James W. Ewing, is a physician at the St. Paul Ramsey Medical Center who has provided services at the Stillwater prison since January 1,1980, pursuant to contract with the Minnesota Department of Corrections. Kelsey alleged that he was not given prompt and adequate treatment for a number of health problems, that medical information was being withheld from him, and that his medical records were improperly disclosed to a third party.

On October 30, 1980, Dr. Ewing filed a motion to dismiss the complaint for lack of subject matter jurisdiction and failure to state a claim upon which relief can be granted. See Fed.R.Civ.P. 12(b)(1) & 12(b)(6). Accompanying Dr. Ewing’s motion was his affidavit in which he summarized his treatment of Kelsey. The motion was assigned to United States Magistrate Brian P. Short who, on November 3, 1980, recommended that the district court dismiss the suit on the ground that it was frivolous. The magistrate had before him Kelsey’s complaint and Dr. Ewing’s affidavit, but held no hearing and offered Kelsey no opportunity to file responsive affidavits prior to making the recommendation. The district court dismissed Kelsey’s complaint based on the recommendation of the magistrate.

Kelsey filed this timely appeal from the order of dismissal, arguing that the district court improperly treated the defendant’s motion as a motion for summary judgment without giving him notice and an opportunity to respond as required by Fed.R.Civ.P. 12(b) & 56. Furthermore, Kelsey maintains, his complaint was sufficient to raise genuine factual issues which precluded dismissal. Dr. Ewing responds that the dismissal was appropriate because Kelsey’s claim was frivolous and insubstantial, and further argues that the claim for damages is barred by the doctrine of executive immunity.

We need not agonize over the issues raised by this appeal. The district court clearly erred in dismissing Kelsey’s claim. Even if we assume that it was appropriate for the magistrate to treat the appellee’s motion as one for summary judgment and to consider Dr. Ewing’s affidavit, and even if we assume all statements contained in the affidavit are true, Kelsey’s complaint contains sufficient unrebutted allegations to raise a factual question about whether he was unconstitutionally deprived of medical care while incarcerated at Stillwater.

Summary judgment is appropriate only when no genuine issue of material fact remains in dispute and the movant is clearly entitled to judgment as a matter of law. Fed.R.Civ.P. 56(c); Vette Co. v. Aetna Cas. & Sur. Co., 612 F.2d 1076, 1077 (8th Cir. 1980). For the purposes of summary judgment, uncontested allegations must be taken as true in accordance with the Court’s obligation to view the case in the light most favorable to the nonmoving party. See Starling v. Valmac Indus., Inc., 589 F.2d 382, 386 (8th Cir. 1979). Here, there are a number of allegations in Kelsey’s complaint that are not addressed by Dr. Ewing’s affidavit, including (1) that Kelsey was still bleeding from surgery incisions when he was returned to prison in April, 1980, (2) that he was kept in lock-up in unhealthful living conditions and was denied a medically prescribed diet because Dr. Ewing refused to change his medical status following surgery; (3) that he was denied information about a heart condition; (4) that he was refused an examination of his swollen leg following surgery; (5) that he had been given false information by Dr. Ewing concerning “an osteo chondroma on his spine;” and (6) that Dr. Ewing had violated the confidentiality of his medical records by disclosing information contained in them. Furthermore, allegations relating to events predating Dr. Ewing’s tenure at Stillwater are unanswered by his affidavit, including that Kelsey had to wait ten years to obtain a pair of bifocal glasses, ten years to have his hernia repaired and six years to obtain surgery on a vein in his right leg.

Deliberate indifference to the serious medical needs of prisoners constitutes unnecessary and wanton infliction of pain proscribed by the Eighth Amendment. See Estelle v. Gamble, 429 U.S. 97, 104, 97 S.Ct. 285, 291, 50 L.Ed.2d 251 (1976); Cummings v. Roberts, 628 F.2d 1065, 1067-1068 & n.3 (8th Cir. 1980); Hall v. Ashley, 607 F.2d 789, 791 (8th Cir. 1979). Kelsey’s uncontested allegations, when taken as a whole, are more than sufficient to state such a constitutional claim. Accordingly, the district court erred in dismissing the complaint as frivolous.

The order of the district court is reversed and the cause is remanded for further proceedings consistent with this opinion. 
      
      . Because we conclude that Kelsey’s complaint is sufficient to survive a motion for dismissal even if all the statements in Dr. Ewing’s affidavit are taken as true, we need not determine whether it was reversible error for the magistrate to consider Dr. Ewing’s affidavit without ensuring that Kelsey was given notice and an opportunity to respond. See, e. g., Davis v. Zahradnick, 600 F.2d 458, 460 (4th Cir. 1979); Kelsey v. State, 565 F.2d 503, 506 n.2 (8th Cir. 1977).
     
      
      . Kelsey’s complaint names only Dr. Ewing and his agents and employees as defendants. To the extent that certain of Kelsey’s claims arise from events preceding Dr. Ewing’s arrival at Stillwater, Kelsey may not be able to recover monetary damages against the defendants named in his complaint. In his appeal brief, Kelsey asks this Court to grant him an opportunity to amend his complaint. We leave that decision to the district court in the first instance.
      We also leave to the district court the question of whether Dr. Ewing is entitled to executive immunity from Kelsey’s claim for monetary relief.
     
      
      . We note that some of Kelsey’s claims arise from alleged violations of a consent decree issued in Hines v. Anderson, 439 F.Supp. 12 (D.Minn.1977), a class action involving prisoners’ medical rights at the Stillwater prison. Although we need not decide the issue, it is possible that some of Kelsey’s monetary claims are barred by the terms of that decree. Because of the complexity of the questions involved, the district court may wish to consider appointing counsel for Kelsey to ensure that any potential res judicata problems arising from the 1977 consent decree are fully addressed.
     