
150 S.W.3d 535 (2004)
Albert HAWKINS, in his capacity as Commissioner of Health & Human Services; the Texas Health and Human Services Commission; and the Texas Department of Health, Appellants,
v.
DALLAS COUNTY HOSPITAL DISTRICT d/b/a Parkland Health and Hospital System, Appellee.
No. 03-03-00355-CV.
Court of Appeals of Texas, Austin.
April 8, 2004.
*536 Robert L. Seibert, Asst. Atty. Gen., Austin, for Appellants.
Susan G. Conway, Vinson & Elkins, L.L.P., Austin, J.D. Epstein, Allyson Hancock Kinzel, Vinson & Elkins, L.L.P., Houston, for Appellee.
Before Chief Justice LAW, Justices B.A. SMITH and PATTERSON.

OPINION
W. KENNETH LAW, Chief Justice.
In this appeal, we consider the rules and formulas used to reimburse Texas teaching hospitals for a portion of their annual costs of providing graduate medical education to resident physicians. We affirm the judgment of the district court.

BACKGROUND
The dispute in this case requires us to discern the intent of the legislature when it created statutory language concerning how to allocate particular Medicaid funds to teaching hospitals in Texas. These funds are meant to reimburse those hospitals *537 for some of the costs associated with training medical residents. Thus, we will begin with a brief overview of the Medicaid program in Texas as it relates to these funds.
Medicaid is a federal-state assistance program, run by state governments within federal guidelines, that pays for health care services provided to eligible recipients  low-income people of any age  from federal, state, and local tax funds. See 42 U.S.C.A. §§ 1396-1396v (West 2003).[1] It is administered by the states. See id. §§ 1396, 1396(a)(2). The federal government pays a percentage of the total cost that a participating state incurs in providing Medicaid services. Id. § 1396b. Under the federally approved plan for the administration of the Medicaid program in Texas, teaching hospitals that provide inpatient hospital services to Medicaid-eligible individuals are entitled to Medicaid reimbursement for the cost of these services, including reimbursement for a portion of the costs associated with the hospital's resident-physician graduate medical-education and training (GME costs). See id. §§ 1396, 1396a, 1396d(a).
A similar program exists in Medicare,[2] and in April 1986 Congress established the current federal method for calculating reimbursable GME costs under that program. See id. § 1395ww(h) (West 2003); 42 C.F.R. § 413.86 (2004). Instead of annual determinations of cost actually incurred, Congress designated 1984 a baseline year for cost determinations, i.e., costs "recognized as reasonable" for that year would serve as the base figure used to calculate Medicare GME reimbursements for all subsequent years. See Regions Hosp. v. Shalala, 522 U.S. 448, 453, 118 S.Ct. 909, 139 L.Ed.2d 895 (1998). The 1984 per-resident amount, adjusted for inflation, would then be used to determine the provider's GME reimbursements for all fiscal years "beginning on or after July 1, 1985." See id. The provider's reimbursable costs for a particular year would be computed by multiplying the inflation-adjusted 1984 per-resident amount by the provider's weighted number of full-time-equivalent residents, as determined by section 1395ww(h)(4), and the hospital's Medicare patient load, as described in section 1395ww(h)(3)(C). No federal guideline governs the disbursement of Medicaid funds for GME costs.
In Texas, the Health and Human Services Commission (the department), of which Hawkins is the commissioner, directs the disbursement of Medicaid funds.[3] Tex. Gov't Code Ann. § 531.005 (West 1998), § 531.0055 (West Supp.2003); Tex. Hum. Res.Code Ann. § 32.021 (West Supp.2003).[4] In 1997, the legislature directed *538 the department to establish procedures and formulas to govern the allocation of these funds. See Act of May 12, 1997, 75th Leg., R.S., ch. 252, § 1, 1997 Tex. Gen. Laws 1182, 1182-84 (amended in part by and repealed in part by Act of June 2, 2003, 78th Leg., R.S., ch. 198, §§ 2.100(a), (b), 2003 Tex. Gen. Laws 611, 689) (Former section 32.0315).[5] At that time, the department calculated GME reimbursement based on a formula under rules substantially unchanged since 1987. Under the rule, the department used the federal Medicare reimbursement formula and, by reference, the GME cost-calculation methods and procedures prescribed under the federal Medicare Act. See 1 Tex. Admin. Code § 355.8063 (2003) (rule 8063). The difference between the two formulas can be simplified in this way: the department rule, mirroring the federal approach for the disbursement of Medicare funds, determines the GME by using a 1984 "base-period" figure (a hospital's Medicare-allowable GME costs for fiscal year 1984), adjusted for inflation to the current year, see id. § 355.8063(a);[6] the formula found in former section 32.0315 instead relies on a *539 "hospital's annual cost of training resident physicians for the fiscal year" for which it is to be reimbursed.[7] The department did not amend its rules or methodologies after former section 32.0315 went into effect.
Dallas County Hospital District operates Parkland Memorial Hospital (Parkland).[8] Parkland is the sole public hospital in Dallas County and the principal component of the health and hospital system in the Dallas County Hospital District. Parkland is an eligible Medicaid health care services provider under the Texas Medicaid program, and a teaching hospital entitled to Medicaid reimbursement for inpatient hospital services provided to Medicaid patients.
Parkland sued the department in district court, seeking a declaratory judgment that the rules, procedures and formulas used by Hawkins to allocate and distribute federal Medicaid funds were invalid and contrary to section former 32.0315. Parkland also sought a permanent injunction to enjoin the department from using the invalid rules, procedures, and formulas when calculating GME cost reimbursement. Parkland calculated that, for the period from 1998 to 2001, the department underpaid it $72,371,632 by using the base-year GME costs rather than the actual GME costs.[9]*540 In granting summary judgment and a permanent injunction in favor of Parkland, the district court declared that the rules, procedures, and formulas employed by the department, including rule 8063, violated the reimbursement calculation methodology guidelines promulgated in section 32.0315. See Former § 32.0315. This appeal followed.

DISCUSSION
In one issue, the department argues that former section 32.0315 authorized it to establish an alternative formula to reimburse a teaching hospital for the annual costs incurred to provide graduate medical education. See id. § 32.0315. In particular, it believes that various subsections of former section 32.0315 granted broad power to the department to establish formulas and methodologies to disburse Medicaid funds to teaching hospitals. Thus, it asserts that the statute, when read as a whole, indicates that the legislature offered the department an advisory, but not mandatory, reimbursement formula while at the same time giving the department discretion to establish an alternative formula.
Statutory construction is a question of law, which we review de novo. See Johnson v. City of Fort Worth, 774 S.W.2d 653, 656 (Tex.1989). The primary rule of statutory interpretation is to construe the statute as a whole so as to give effect to the legislative intent. See State v. Public Util. Comm'n, 883 S.W.2d 190, 196 (Tex.1994); see also Citizens Bank of Bryan v. First State Bank, 580 S.W.2d 344, 348 (Tex.1979). We are bound to construe the statute as written and, if possible, ascertain the legislature's intent from the language used in the statute. Del Indus., Inc. v. Tex. Workers' Comp. Ins. Fund, 973 S.W.2d 743, 745 (Tex.App.-Austin 1998), aff'd, 35 S.W.3d 591 (Tex.2000).
Statutory provisions, however, must not be isolated from the surrounding language nor construed apart from their context. Id. at 746. Disputed provisions of a statute are to be considered in context, not in isolation. See Texas Workers' Comp. Comm'n v. Continental Cas. Co., 83 S.W.3d 901, 905 (Tex.App.-Austin 2002, no pet.); see also Fitzgerald v. Advanced Spine Fixation Sys., 996 S.W.2d 864, 866 (Tex.1999). When interpreting a statute, we should give effect to all words of a statute and, if possible, not treat any statutory language as mere surplusage. See Continental Cas. Ins. Co. v. Functional Restoration Assoc., 19 S.W.3d 393, 402 (Tex.2000). We must presume that in enacting the statute the legislature intended the entire statute to be effective. See Tex. Gov't Code Ann. § 311.021(2) (West 1988). We presume that the legislature intended a reasonable and just result in enacting a statute. Id. § 311.021(3). In doing so, we are to consider, among other factors, the language of the statute, its legislative history, the nature and object to be obtained, and the consequences that would follow from alternative constructions, even when a statute is not ambiguous on its face. See Helena Chem. Co. v. Wilkins, 47 S.W.3d 486, 493 (Tex.2001).
When we consider former section 32.0315, we note that the legislature directed that the department "shall reimburse each teaching hospital" using the statutory formula. See Former § 32.0135(d). Under our rules of statutory construction, "shall" is generally construed *541 to be mandatory, but may in limited circumstances be construed to be directory. See Tex. Gov't Code Ann. § 311.016 (West 1998); Chisholm v. Bewley Mills, 155 Tex. 400, 287 S.W.2d 943, 945 (1956). In determining whether the legislature intended the particular provision to be mandatory, we should consider the nature and object of the entire act and the consequences that would follow each construction. Id. On its face, former subsection 32.0315(d) appears to be mandatory. See id. Because Hawkins argues that other subsections of former section 32.0315 contradict this interpretation, we now turn to the remainder of the statute to glean the intent of the legislature.
First, former section 32.0315(a) directs that the department "shall establish procedures and formulas for the allocation of federal medical assistance funds that are directed to be used to support graduate medical education." When we read this subsection with former section 32.0315(d), we note that the latter, in setting a formula, leaves undefined the methodology for the department to use to determine the values of several variables in any given situation. For example, it does not provide a formula to determine what constitutes a "patient day," either for Medicaid or for general accounting purposes. See Former § 32.0135(d). It does not define or describe how the department is to determine the annual cost of training resident physicians. See id. It does not provide criteria for determining how to determine "the weighted number of full-time equivalent resident physicians." See id. Thus, in order to implement the statutory formula, it was necessary for the department to formulate additional procedures and formulas. As a result, in former section 32.0315(a), the legislature seemed to have granted the department the authority to develop these necessary definitions and formulas in order to give effect to the reimbursement formula.
Next, former section 32.0315(b) directed that the department "shall allocate the funds in the manner the department determines most effectively and equitably achieves the purposes for which those federal funds are received." It also mandated that the department should take "into account other money available to support graduate medical education." Former § 32.0315(b). The focus of this subsection was not on the amounts to be reimbursed to each teaching hospital. Compare id., with Former § 32.0315(d). In other words, when determining the amount available for the reimbursement program, the department was to consider all funds available to support graduate medical education. In addition, the former section 32.0315(d) did not indicate that use of the statutory formula to reimburse teaching hospitals will exhaust all funds available. It did, however, outline various state policy objectives for the disbursement of funds. Former section 32.0315, then, limited the authority of the department in making the determinations allowed under the previous two subsections  in adopting or revising any formula, the department must have consulted with the Texas Higher Education Consulting Board.
Turning, then, to former section 32.0315(e), we note this subsection did not address the required formula for determining Medicaid reimbursement. Instead, it focused on the sources of information from which the department could establish a hospital's "average annual cost for training residents"  a variable in the former section 32.0315(d) formula defined as "GME." In arriving at a figure to use for that variable, the department could have used "the most recent Medicaid cost report submitted to the department by the hospital," or it could have developed "alternative *542 procedures to establish that cost." See Former § 32.0315(e). Whatever method the department chose, it was bound by the statutory definition, which limited the scope of the variable to the costs of training for the fiscal year.
We conclude, then, that former section 32.0315(d) created a mandatory formula for the department to determine the amounts of medical-education costs for the purposes of reimbursement. Former sections 32.0315(a), 32.0315(b), 32.0315(c), and 32.0315(e) granted the department limited discretionary powers to calculate the values of particular statutory variables, but the department could not contradict the terms of the formula. To hold otherwise would render irrelevant the formula in former section 32.0315(d).[10]

CONCLUSION
Because we overrule the department's issue, we affirm the judgment of the district court.
NOTES
[1]  The federal Department of Health and Human Services provides a concise summary of the Medicaid law as it relates to the federal-state partnership. See Centers for Medicare and Medicaid Services, Welcome to Medicaid: Site for State & Territorial Government Information, at http:// www.cms.hhs.gov/states/default.asp (last visited Mar. 19, 2004).
[2]  Medicare is a distinct medical insurance program run by the federal government that pays for health care services provided to covered beneficiaries  primarily people over the age of 65, regardless of income, and younger disabled and dialysis patients. See 42 U.S.C. §§ 1395-1395gg (West 1992 & Supp.2003).
[3]  Appellants present their legal issue together in one brief. Because that issue concerns the statutory authority of the health and human services commission, referred to as "the department" in the statute in question, we will refer to them collectively as "the department" when discussing their legal claims. See Tex. Hum. Res.Code Ann. § 32.003(3) (West 2001).
[4]  From 1991 to 1999, this program was operated by the department of health under an agreement with the health and human services commission.
[5]  Former section 32.0315 provided in relevant part:

(a) The department shall establish procedures and formulas for the allocation of federal medical assistance funds that are directed to be used to support graduate medical education in connection with the medical assistance program.
(b) The department shall allocate the funds in the manner the department determines most effectively and equitably achieves the purposes for which those federal funds are received, consistent with the needs of this state for graduate medical education and the training of resident physicians in accredited residency programs in appropriate fields and specialties, taking into account other money available to support graduate medical education. In determining the needs of this state for graduate medical education, the department shall give emphasis to graduate medical education in primary care specialties.
(c) The department shall consult with the Texas Higher Education Coordinating Board before adopting or revising a formula under this section. At the request of the department, the coordinating board shall provide the department with any information the board possesses to assist the department in administering this section.
(d) The department shall reimburse each teaching hospital under this section using the following formula:
R = GME/P × WNP × MD/TD
where:
"R" is the annual amount to be reimbursed;
"GME" is the hospital's annual cost of training resident physicians for the fiscal year; "P" is the number of resident physicians for the fiscal year;
"WNP" is the weighted number of full-time equivalent resident physicians trained by the hospital during the fiscal year and reported on its Medicaid cost report, adjusted to count each full-time equivalent resident in primary care as 1.2 residents and each other full-time equivalent resident as 1.0 residents;
"MD" means the number of patient days for the hospital for the fiscal year that are attributable to Medicaid patients; and "TD" means the total number of patient days for the hospital for the fiscal year.
(e) To determine a teaching hospital's average annual cost for training residents for purposes of this section, the department may use the most recent Medicaid cost report submitted to the department by the hospital, or may establish alternative procedures to determine that cost.
The legislature repealed subsections d and e in 2003. See Act of June 2, 2003, 78th Leg., R.S., ch. 198, §§ 2.100(a), (b), 2003 Tex. Gen. Laws 611, 689.
[6]  The rules outlined the department's formula in this way:

[T]he department ... groups hospitals into payment divisions using the average base year payment per case in each hospital after adjusting each hospital's base year payment per case by a case mix index, a cost-of-living index, and a budgetary reduction factor of 10%.
1 Tex. Admin. Code § 355.8063(a) (2003). They then defined "base year payment per case" as
The payment that would have been made to a hospital at the time covered inpatient hospital services were provided if the department or its designee reimbursed the hospital under similar methods and procedures used in the Social Security Act, Title XVIII [the Medicare Act], as amended, effective October 1, 1982 by public law 97-248.
Id. § 355.8063(b)(6).
The rule does not exactly lay out a formula for determining reimbursement. See id. Scott Reasonover, the department's manager of the hospital rate analysis division, articulates the formula he used, and has continued to use after the repeal of former section 32.0315(d), in this way:
R = (PRA) × (Weighted number of resident FTEs) × (MD/THD)
where:
"R" is the amount to be reimbursed;
"PRA" is the hospital's allowable graduate medical education cost of training resident physicians for the cost reporting period beginning on or after October 1, 1983 but before October 1, 1984, divided by the average number of full-time equivalent resident physicians for the cost reporting period beginning on or after October 1, 1983 but before October 1, 1984. The per resident amount is then adjusted for inflation;
"Weighted number of resident FTEs" is the weighted number of full-time equivalent resident physicians trained by the hospital during the cost reporting period;
"MD" is the total number of hospital patient days during the cost reporting period that are attributable to patients for whom payment is made by Medicaid. In calculating Medicaid patient days, nursery days are excluded;
"TD" is the total number of hospital patient days during the cost reporting period.
In calculating total hospital inpatient days, nursery days are excluded.
[7]  The parties in this case do not dispute other factors that may differ between the two formulas.
[8]  Because Parkland is the sole Medicaid-eligible hospital in the Dallas County Hospital District, we will refer to the appellee as "Parkland" in this opinion.
[9]  In its summary judgment evidence, Parkland included these figures:



                  Amount allocated as a result        Allocation resulting from
Fiscal Year        of the department's formula        using section 32.0315(d)      Difference
1998                       $ 6,356,013                      $22,220,937            $15,844,924
1999                       $ 6,932,503                      $24,230,656            $17,298,154
2000                       $ 6,690,777                      $26,183,281            $19,222,504
2001(interim)              $ 6,960,777                      $26,966,827            $20,006,050
Total                      $27,210,070                      $99,601,733            $72,371,632

We are aware that the arithmetic reflected in these figures is not entirely accurate. However, we reproduce them as contained in the record.
[10]  The department additionally states that the legislature never funded the increased expenditures that our holding would require if Parkland's figures are correct. It asserts that fact should compel us to consider our interpretation of former section 32.0315 unreasonable and unjust. See Tex. Govt Code Ann. § 311.021(2) (West 1998). Rather, if the legislature did not provide the appropriate amount of funding, the problem is that the legislature created an "unfunded mandate," not that the statute ought to be interpreted in a different way. This grievance is most appropriately brought to the legislature, not the courts. See, e.g., Socorro Indep. Sch. Dist. v. State Bd. of Educ., 968 S.W.2d 547, 553 (Tex.App.-Austin 1998, pet. denied); Mutchler v. Texas Dep't of Public Safety, 681 S.W.2d 282, 285 (Tex.App.-Austin 1984, no writ).
