
721 So.2d 685 (1998)
Ex parte Warden Leoneal DAVIS and Deputy Warden Charles Boutwell.
(In re Leola PINKNEY, as administratrix of the estate of inmate Donald L. Williams v. Leoneal DAVIS and Charles Boutwell).
1970535.
Supreme Court of Alabama.
September 4, 1998.
*686 Ellen Leonard, asst. atty. gen., Department of Corrections, for petitioner.
Jill T. Karle of Karle & Green, L.L.C., Alabaster, for respondent.
LYONS, Justice.
Leoneal Davis, as warden of the Draper Correctional Facility, and Charles Boutwell, as deputy warden of that facility, are defendants in an action pending in the Montgomery Circuit Court. They petition for a writ of mandamus directing that court to enter a summary judgment in their favor, based upon their defenses of absolute sovereign immunity and/or discretionary-function immunity. We grant their petition.

I.
Leola Pinkney, as administratrix of the estate of Donald L. Williams, deceased, who had been an inmate in the Alabama prison system, brought a wrongful death action against Leoneal Davis, in his official capacity as warden of the Draper Correctional Facility ("Draper"); Charles Boutwell, in his official *687 capacity as a deputy warden of Draper; and certain other correctional officers at Draper. She alleged that the defendants had a duty to maintain the security, care, and welfare of the inmates at Draper; that they had breached this duty by failing to provide Williams with adequate medical care; and that their failure had caused Williams's death.[1]
On the defendants' motion, the action was removed to the United States District Court for the Middle District of Alabama. That court entered a summary judgment in favor of the defendants on certain federal claims included in the complaint. That court then remanded the case to the Montgomery Circuit Court. The defendants then moved for a summary judgment in the circuit court, arguing that they were immune from suit, pursuant to Article I, § 14, of the Alabama Constitution. The trial court entered a summary judgment in favor of all the defendant correctional officers except Davis and Boutwell, on the basis of discretionary function immunity. The trial court held that only Davis and Pinkney were charged with the responsibility for Williams's health and care and that these duties were discretionary functions; however, the trial court concluded that the evidence created genuine issues of material fact as to whether Davis and Boutwell, in performing their discretionary functions, had caused Williams's death by actions undertaken willfully, maliciously, or in bad faith, and that the defense of sovereign immunity therefore would not apply to them.

II.
In July 1993, Williams was sentenced to serve three years in the custody of the Alabama Department of Corrections. Williams suffered from sarcoidosis, an autoimmune disease that primarily affected his lungs and caused him to experience shortness of breath, chest pain, and recurrent bouts of pneumonia. Although sarcoidosis is incurable, it is not always fatal; certain medications, primarily Prednisone, a corticosteroid, can induce remission of the disease. When he was sentenced, Williams was regularly taking prescribed medication, including Prednisone, to control his sarcoidosis.
After being sentenced, Williams entered the Montgomery County Correctional Facility to await transfer to a state correctional facility; while incarcerated in the Montgomery County facility, Williams was provided with his medication. Williams was transferred to the Kilby Correctional Facility on August 12, 1993. At that time, QuestCare, Inc., a private corporation, was under contract with Kilby prison to provide necessary medical care to inmates in that prison. The day after Williams arrived, a licensed practical nurse employed by QuestCare completed a "report of health assessment" for Williams; in it, she noted that Williams suffered from sarcoidosis and that his current prescribed medications were Prednisone, inhalers, and an antidepressant. The patient note/physician orders do not indicate any treatment or the issuance of any medication to Williams.
During August 1993, Williams reported to the Kilby health care unit several times, complaining of shortness of breath and chest pain, and was twice admitted to the Kilby hospital unit. A QuestCare physician confirmed that Williams suffered from sarcoidosis and prescribed Prednisone for him; initially, he prescribed only half the dosage Williams was taking before he was incarcerated, but he increased the dosage after receiving Williams's medical records. In September, Williams again reported to the health care unit, this time with a fever, a low pulse, and marked wheezing. A QuestCare physician changed Williams's Prednisone dosage, first doubling it, then gradually reducing it to zero at the end of five days.
Approximately two weeks later, Williams was transferred to Draper; at that time, his medication records listed his only medications as a bronchial dilator, an inhaler, and Elavil. Williams was not prescribed Prednisone at the time of the transfers. Draper, likewise, had a contract with QuestCare, whereby Questcare would provide medical *688 care to the inmates at Draper. Six days after he arrived at Draper, Williams appeared at the facility's health care unit complaining of breathing problems. He was not referred to a physician. Several days later, he again reported to the health care unit, and on that visit he told the attending nurse that he had sarcoidosis. Over the course of the next several weeks, he was given an inhaler, but was not prescribed Prednisone.
During this period, Williams regularly telephoned his mother, Leola Pinkney, to report that he was feeling ill and that he was not receiving his proper medication. After each of these calls, Pinkney would telephone Boutwell's office and alert his secretary, Janet Findley, that Williams was ill and needed medical care. Findley testified in deposition that she did not recall immediately passing this information on to Boutwell, but that she did inform him of Pinkney's concerns. Findley testified that each time Pinkney called, Findley notified the prison medical staff and relayed to Pinkney any further information she could get about Williams's condition.
On November 13, 1993, Pinkney visited her son and was shocked at his apparent ill health. On that date, she scheduled an appointment for Williams to be examined on November 19 at a local Veterans Administration ("VA") hospital outside the prison, and the appointment was approved by one of the prison doctors. However, Pinkney did not inform any prison officials about the appointment until November 17, when she telephoned Findley to ask about transportation for Williams. Findley informed Pinkney that any outside medical appointments for inmates had to be made through the prison and that the prison had certain mandatory security procedures for transporting prisoners to such appointments. She told Pinkney that two days' notice was not sufficient to arrange for Williams to be transported to his appointment. Findley personally telephoned the VA hospital and cancelled the appointment Pinkney had made; however, she rescheduled an appointment for Williams for November 30. Findley notified Boutwell that she had made an appointment for Williams to be examined at the VA hospital and told him about Pinkney's concerns for her son's health.
On November 20, 1993, Pinkney received a telephone call from a Draper inmate, who notified her that she should not come to visit her son because he was too weak to get out of his bed. There is evidence that on November 23 Pinkney telephoned Warden Davis and told him her son was very ill and that she was afraid he might die. She asked Davis to allow her son to be taken to an emergency room in a hospital outside the prison. There ensued a discussion concerning the possible transfer of Williams; however, the QuestCare physician on duty declined to authorize the transfer and Davis did not overrule the doctor's decision.
On November 28, Williams visited the health care unit; the nurse noted that he was emaciated, that he weighed 121 pounds, and that he had not been eating because "he is too weak to go to chow." Later that day, Williams returned to sick call in a disoriented condition and told the attending nurse that he had been having breathing problems all day. He was transferred to the Montgomery Regional Medical Center, and he arrived there with a collapsed lung and a temperature exceeding 104°. A chest X-ray revealed that he was suffering from pneumonia, and he was further diagnosed with malnutrition, at a weight of 117 pounds. He remained at the hospital approximately three weeks, until his death on December 22, 1993, from multiple organ failure, sarcoidosis, and sepsis.

III.
We note that Article I, § 14, of the Alabama Constitution of 1901, provides "[t]hat the State of Alabama shall never be made a defendant in any court of law or equity," and that this sovereign immunity extends to State employees acting within the general scope of their authority in performing functions that involve a degree of discretion. McDuffie v. Roscoe, 679 So.2d 641 (Ala.1996). "Discretionary acts" are defined as "those acts as to which there is no hard and fast rule as to the course of conduct that one must or must not take and those acts requiring exercise in judgment and choice and involving what is just and proper under *689 the circumstances." Wright v. Wynn, 682 So.2d 1, 2 (Ala.1996). To claim the benefit of sovereign immunity, a defendant State employee has the burden of establishing that the plaintiff's claims arise from the employee's performance of discretionary functions for the State. Wright.
However, a State officer or employee is not protected by discretionary immunity if in performing his discretionary functions he willfully, maliciously, fraudulently, or in bad faith injures someone. Barnes v. Dale, 530 So.2d 770 (Ala.1988). Once a defendant demonstrates that a plaintiff's claims arise from the defendant's performance of a discretionary function, the burden then shifts to the plaintiff to establish that the defendant acted in bad faith or with malice or willfulness, in order to deny the defendant discretionary immunity from suit. Wright v. Wynn, supra. The applicability of the doctrine of discretionary function must be determined on a case-by-case basis, and it is a question of law to be decided by the trial court. McDuffie v. Roscoe, supra. A petition for a writ of mandamus is the proper means for achieving appellate review of a trial court's denial of absolute and discretionary-function immunity. Ex parte Wanger, 709 So.2d 455 (Ala.1997).
As noted, the trial court found that Pinkney's claims against Davis and Boutwell arose from their performance of discretionary functions; however, the court then found that there was substantial evidence creating a genuine question of material fact as to whether Davis and Boutwell had caused Williams's death by performing these functions willfully, maliciously, or in bad faith.

A. Claims against Warden Leoneal Davis

Pinkney bases her claims against Leoneal Davis on the theory that, as a warden of Draper, Davis was charged with the responsibility of ensuring that inmates receive prompt medical care; that he was aware on November 23, 1993, at the very latest, that Williams was seriously ill; and that he breached his duty to Williams by failing to supervise the medical personnel at Draper or to take prompt action to give Williams medical attention on November 23.
Pinkney concedes that it was the duty of QuestCare, not Davis, to provide actual medical services to Williams. The record shows that after Davis spoke with Pinkney on November 23, he notified the prison medical personnel of Williams's condition, and that it was QuestCare medical personnel who decided not to approve Williams's transfer to an outside hospital. Davis has no medical training, and he did not question the decision of Williams's doctors not to hospitalize Williams that night. Instead, Davis left Williams in the care of doctors who had been treating Williams since he arrived at Draper, and he did not intervene to override their decisions as to Williams's course of treatment.
Williams was undeniably ill on November 23, and there is evidence that Davis was aware of this; however, the evidence does not suggest that Davis acted willfully, maliciously, or in bad faith in failing to override QuestCare's decision not to hospitalize Williams on that day. The evidence merely shows that Davis chose to accept the decision of Williams's doctors, who had more knowledge than Davis did about medicine in general and about Williams's case in particular. The QuestCare medical staff was on contract with the prison to make such decisions based on their expertise, and the fact that they did not successfully treat Williams's illness does not make Davis liable for leaving Williams to their care. The trial court properly determined that in referring Williams to the care of QuestCare physicians Davis was performing a discretionary function; however, there being no evidence that in performing this function Davis caused Williams's death by acting maliciously, willfully, or in bad faith, the court erred in denying Davis a summary judgment on Pinkney's claims.

B. Claims against Deputy Warden Boutwell

Pinkney bases her claims against Charles Boutwell on allegations that Boutwell had a duty to ensure that inmates received prompt medical care when necessary and that, although Boutwell had had direct knowledge, over at least a two-week period, that Williams's health was deteriorating, he nevertheless refused to allow Williams to keep *690 his appointments with an outside VA hospital.
We note that, according to the record, the assistant warden's job description requires him to "insure that each inmate receives prompt medical attention when necessary." The record shows that, during a period of approximately two weeks before Williams was hospitalized on November 28, Pinkney made numerous telephone calls to Janet Findley to report that her son was very ill. However, the evidence does not show that Boutwell had direct knowledge of Williams's condition, until November 17. On that day, Pinkney telephoned Findley and informed her that she had scheduled an appointment for Williams to be examined at a local VA hospital on November 19. Findley advised Pinkney that, because the appointment had not been made through the prison and adequate supervision of Williams could not be arranged on such short notice, the appointment would have to be canceled. Findley obtained approval from QuestCare physicians to allow Williams to be examined outside the prison, then rescheduled the appointment at the local VA hospital. Findley informed Boutwell that she had made the appointment for Williams.
Williams did not keep the appointment Findley made for him, and this is the crux of Pinkney's claim against Boutwell; Pinkney argues that, although Boutwell's determining whether to allow Williams to see an outside doctor was a discretionary act, Boutwell performed the act maliciously by failing to enable Williams to keep his VA hospital appointment. As to the first appointment, it is clear that Boutwell himself was not involved in canceling it; rather, his secretary determined that it had not been made pursuant to the procedures Draper requires to be followed when an inmate is allowed to go beyond the grounds of the prison.[2] As to the second appointment, which Findley made for Williams, Boutwell points out that the appointment was made for November 30, two days after Williams was admitted to the Montgomery Regional Medical Center. Pinkney does not dispute the date of the appointment. Clearly, there was no reason for Boutwell to arrange for Williams to keep his November 30 appointment, when Williams was undergoing emergency treatment at another outside hospital. There is no evidence to support a finding that Boutwell maliciously or willfully failed to obtain reasonable medical care for Williams. The trial court, therefore, erred in denying Boutwell's motion for a summary judgment based upon discretionary-function immunity.
A writ of mandamus should be issued only where the petitioner has a clear legal right to the order sought and has no other adequate remedy. C & G Development v. Planning Comm'n of the City of Homewood, 548 So.2d 451 (Ala.1989). Davis and Boutwell have demonstrated that, based on the defense of sovereign immunity, they have a clear legal right to a judgment on Pinkney's claims against them. Their petition for the writ of mandamus is granted.
PETITION GRANTED.
HOOPER, C.J., and MADDOX, SHORES, HOUSTON, and SEE, JJ., concur.
COOK, J., dissents.
NOTES
[1]  Pinkney also made claims against QuestCare, Inc., a company that had contracted with the State of Alabama to provide medical care to inmates in the Alabama prison system; these claims are not relevant to this petition.
[2]  Obviously, concerns of public safety and preventing escapes make these precautions necessary, and Findley properly adhered to them.
