opinion: McKAY, Circuit Judge.
  Plaintiffs, seeking relief under 42 U.S.C. § 1983 (1982), brought this class action on behalf of medicaid recipients residing in nursing homes in Colorado. They alleged that the Secretary of Health and Human Services (Secretary) has a statutory duty under Title XIX of the Social Security Act, 42 U.S.C. §§ 1396-1396n (1982), commonly known as the Medicaid Act, to develop and implement a system of nursing home review and enforcement designed to ensure that medicaid recipients residing in medicaid certified nursing homes actually receive the optimal medical and psychosocial care that they are entitled to under the Act. The plaintiffs contended that the enforcement system developed by the Secretary is “facility oriented,” not “patient oriented” and thereby fails to meet the statutory mandate. The district court found that although a patient care or “patient oriented” management system is feasible, the Secretary does not have a duty to introduce and require the use of such a system. In re Estate of Smith v. O’Halloran, 557 F.Supp. 289, 295 (D.Colo.1983).
  The primary issue on appeal is whether the trial court erred in finding that the Secretary does not have a statutory duty to develop and implement a system of nursing home review and enforcement which focuses on and ensures high quality patient care. If the Secretary has such a duty we must determine whether the enforcement mechanism promulgated by the Secretary satisfies that duty.
  BACKGROUND
  The factual background of this complex lawsuit is fully discussed in the district court’s opinion. In re Estate of Smith v. O’Halloran, 557 F.Supp. 289 (D.Colo.1983). Briefly, plaintiffs instituted the lawsuit in an effort to improve the deplorable conditions at many nursing homes. They presented evidence of the lack of adequate medical care and of the widespread knowledge that care is inadequate. Indeed, the district court concluded that care and life in some nursing homes is so bad that the homes “could be characterized as orphanages for the aged.” Id. at 293.
  When the suit was filed in 1975, plaintiffs named Colorado nursing home operators, and federal and Colorado state governmental agencies and officials as defendants. In 1978, plaintiffs and the Colorado governmental defendants stipulated to dismissal, without prejudice, of the claims against the Colorado governmental defendants. Pursuant to the stipulation, the state defendants filed a complaint in intervention on behalf of the people of Colorado against the federal defendants. After extensive pretrial discovery and preparation, the district court ordered separate trials for the federal defendant and the nursing home operators. In 1980, the plaintiffs, plaintiffs in intervention and federal defendant jointly moved for a stay, based on proposed regulatory revisions, which the plaintiffs and plaintiffs in intervention believed would accomplish the ultimate objective of the litigation. However, the proposed changes in the regulations were never adopted and the lawsuit against the federal defendant proceeded to trial in June 1982. The trial court denied relief. This appeal is from that judgment.
  THE MEDICAID ACT
  An understanding of the Medicaid Act (the Act) is essential to understand plaintiffs’ contentions. The purpose of the Act is to enable the federal government to assist states in providing medical assistance to “aged, blind or disabled individuals, whose income and resources are insufficient to meet the costs of necessary medical services, and ... rehabilitation and other services to help such ... individuals to attain or retain capabilities for independence or self care.” 42 U.S.C. § 1396 (1982). To receive funding, a state must submit to the Secretary and have approved by the Secretary a plan for medical assistance which meets the requirements of 42 U.S.C. § 1396a(a).
  The district court detailed the requirements of section 1396a(a). See 557 F.Supp. at 294-95. A state seeking plan approval must establish or designate a single state agency to administer or supervise administration of the state plan, 42 U.S.C. § 1396a(a)(5), and must provide reports and information as the Secretary may require. Id. § 1396a(a)(6). Further, the state agency is responsible for establishing and maintaining health standards for institutions where the recipients of the medical assistance under the plan receive care or services. Id. § 1396a(a)(9)(A). The plan must include descriptions of the standards and methods the state will use to assure that medical or remedial care services provided to the recipients “are of high quality.” Id. § 1396a(a)(22)(D).
  The state plan must also provide “for a regular program of medical review____of each patient’s need for skilled nursing facility care ..., a written plan of care, and, where applicable, a plan of rehabilitation prior to admission to a skilled nursing facility____” Id. § 1396a(a)(26)(A). Further, the plan must provide for periodic inspections by medical review teams of:
  (i) the care being provided in such nursing facilities ... to persons receiving assistance under the State plan; (ii) with respect to each of the patients receiving such care, the adequacy of the services available in particular nursing facilities ... to meet the current health needs and promote the maximum physical well-being of patients receiving care in such facilities ...; (iii) the necessity and desirability of continued placement of such patients in such nursing facilities ...; and (iv) the feasibility of meeting their health care needs through alternative institutional or noninstitutional services.
  Id. § 1396a(a)(26)(B).
  The state plan must provide that any skilled nursing facility receiving payment comply with 42 U.S.C. § 1395x(j), which defines “skilled nursing facility” and sets out standards for approval under a state plan. Id. § 1396a(a)(28). The key requirement for purposes of this lawsuit is that a skilled nursing facility must meet “such other conditions relating to the health and safety of individuals who are furnished services in such institution or relating to the physical facilities thereof as the Secretary may find necessary____” Id. § 1395x(j)(15).
  The state plan must provide for the appropriate state agency to establish a plan, consistent with regulations prescribed by the Secretary, for professional health personnel to review the appropriateness and quality of care and services furnished to Medicaid recipients. Id. § 1396a(a)(33)(A). The appropriate state agency must determine on an ongoing basis whether participating institutions meet the requirements for continued participation in the Medicaid program. Id. § 1396a(a)(33)(B). While the state has the initial responsibility for determining whether institutions are meeting the conditions of participation, section 1396a(a)(33)(B) gives the Secretary the authority to “look behind” the state’s determination of facility compliance, and make an independent and binding determination of whether institutions meet the requirements for participation in the state Medicaid plan. Thus, the state is responsible for conducting the review of facilities to determine whether they comply with the state plan. In conducting the review, however, the states must use federal standards, forms, methods and procedures. 42 C.F.R. § 431.610(f)(1) (1983). From 1972 through 1980, Congress required the Secretary to reimburse the states for all necessary costs of inspecting long-term care facilities. See 42 U.S.C. § 1396b(a)(4) (1976). In 1980, Congress reduced the rate of reimbursement to seventy-five percent of such costs. 42 U.S.C. § 1396b(a)(2) (1982).
  The Secretary “shall approve” any plan which fulfills the requirements of section 1396a(a). Id. § 1396a(b). Once the state plan is approved, the Secretary reimburses the states according to percentages set out in section 1396b. If the state fails to show that it has an effective program of “utilization control” as defined in section 1396b(g)(3), the Secretary must reduce the percentage of reimbursement to the state. If after approving a state plan the Secretary determines that the plan has been so changed that it no longer complies with section 1396a(a), or that it complies on paper but not in its actual administration, the Secretary is required to terminate payments to the state, effectively disapproving the plan. Id. § 1396c.
  IMPLEMENTING REGULATIONS
  Congress gave the Secretary a general mandate to promulgate rules and regulations necessary to the efficient administration of the functions with which the Secretary is charged by the Act. 42 U.S.C. § 1302 (1982). Pursuant to this mandate the Secretary has promulgated standards for the care to be provided by skilled nursing facilities and intermediate care facilities. See 42 C.F.R. § 442.200-.516 (1983). Among other things, the regulations provide for the frequency and general content of patients’ attending physician evaluations, 42 C.F.R. § 405.1123(b), nursing services with policies “designed to ensure that each patient receives treatments, medications, ... diet as prescribed, ... rehabilitative nursing care as needed ..., is kept comfortable, clean, well-groomed, [is] protected from accident, injury, an infection, and [is] encouraged, assisted, and trained in self-care and group activities.” 42 C.F.R. § 405.1124(c). The rehabilitative nursing care is to be directed toward each patient achieving an optimal level of self-care and independence. Id. § 405.1124(e). The regulations require a written patient care plan to be developed and maintained for each patient. Id. § 405.1124(d). In addition to the rehabilitative nursing care provided for in section 405.1124(e) and (e), section 405.1126 provides specific standards for specialized rehabilitative services, as needed by patients to improve and maintain functioning. Finally, the regulations provide for treatment of the social and emotional needs of recipients. Id. § 405.1130.
  The Secretary has established a procedure for determining whether state plans comply with , the standards set out in the regulations. This enforcement mechanism is known as the “survey/certification” inspection system. Under this system, the states conduct reviews of nursing homes pursuant to 42 U.S.C. § 1396a(a)(33). The Secretary then determines, on the basis of the survey results, whether the nursing home surveyed is eligible for certification and, thus, eligible for Medicaid funds. The states must-use federal standards, forms, methods and procedures in conducting the survey. 42 C.F.R. § 431.610(f)(1). At issue in this case is the form SSA-1569, record, appendix vol. 1, at 93-127, which the Secretary requires the states to use to show that the nursing homes participating in Medicaid under an approved state plan meet the conditions of participation contained in the Act and the regulations. Plaintiffs contend that the form is “facility oriented,” in that it focuses on the theoretical capability of the facility to .provide high quality care, rather than “patient oriented,” which would focus on the care actually provided. The district court found, with abundant support in the record, that the “facility oriented” characterization is appropriate and that the Secretary has repeatedly admitted that the form is “facility oriented.” In re Estate of Smith, 557 F.Supp. at 295.
  THE' PLAINTIFFS’ CLAIMS
  Plaintiffs contend that the statutory requirements regarding the content of state plans create a correlative entitlement for Medicaid recipients to quality care. They argue that the Secretary has an enforcement obligation to insure compliance with the approved state plan. More specifically, plaintiffs argue that the Secretary has a statutory duty to develop an enforcement system whereby to receive medicaid funds states would be forced to use a patient care management system. Such a system would ensure, through the review process of section 1396a(a)(33), that Medicaid recipients residing in nursing homes certified for Medicaid participation are “actually, continuously receiving their Medicaid entitlements to optimal medical and psychosocial care in a safe, sanitary, rehabilitatively supportive, accessible, personalized environment and in a context of full civil liberties as a condition of such facilities’ receipt of Federal and State financial reimbursement from the Medicaid Program.” In re Estate of Smith, 557 F.Supp. at 292.
  The plaintiffs do not challenge the substantive medical standards, or “conditions of participation,” which have been adopted by the Secretary and which states must satisfy to have their plans approved. See 42 C.F.R. § 405.1101-.1137. Rather, plaintiffs challenge the enforcement mechanism the Secretary has established. The plaintiffs contend that the federal forms, form SSA-1569 in particular, which states are required to use, evaluate only the physical facilities and theoretical capability to render quality care. They claim that the surveys assess the care provided almost totally on the basis of the records, documentation and written policies of the facility being reviewed. Appellants’ brief at 10 (citing 45 Fed.Reg. 47,368 (1980)). Further, out of the 541 questions contained in the Secretary’s form SSA-1569 which must be answered by state survey and certification inspection teams, only 30 are “even marginally related to patient care or might require any patient observation____” Appellants’ brief at 10. Plaintiffs contend that the enforcement mechanism’s focus on the facility, rather tha,n on the care actually provided in the facility, results only in “paper compliance” with the substantive standards of the Act. Thus, plaintiffs contend, the Secretary has violated her statutory duty to assure that federal Medicaid monies are paid only to facilities which meet the substantive standards of the Act — facilities which actually provide high quality medical, rehabilitative and psychosocial care to resident Medicaid recipients.
  THE DISTRICT COURT’S HOLDING
  After hearing the evidence, the district court found the type of patient care management system advocated by plaintiffs clearly feasible and characterized the cur: rent enforcement system as “facility oriented.” In re Estate of Smith, 557 F.Supp. at 295. However, the court concluded that the failure to implement and require the use of a “patient oriented” system is not a violation of the Secretary’s statutory duty. Id. The essence of the district court’s holding was that the State of Colorado, not the federal government, is responsible for developing and enforcing standards which would assure high quality care in nursing homes and, thus, the State of Colorado, not the federal government, should have been the defendant in this case. Id. at 297.
  The district court found that the duty lies with the state because the Medicaid Act provides that states are responsible for establishing and maintaining health standards for provider institutions, 42 U.S.C. § 1396a(a)(9)(A), and the states determine what kind and how many professional medical and supporting personnel will be used to administer the state plan. Id. § 1396a(a)(22)(A). The state plan must include standards and methods which the state will use to assure that the medical assistance provided is of high quality. Id. § 1396a(a)(22)(D). Section 1396a(a)(33) provides that the responsibility for inspecting nursing homes for survey and certification purposes lies with the state. In re Estate of Smith, 557 F.Supp. at 295-96.
  The district court also concluded that the “look behind” provision of section 1396a(a)(33)(B), authorizing the Secretary to reject a survey/certification performed by the state agency and substitute her own independent and binding determination, is' “nothing more than permitted authority to intervene for the purpose of protecting the public funds used to reimburse the state.” Id. at 296. Nor did the district court believe that section 1302, the general mandate to make rules and regulations, imposes by itself a rulemaking duty on the Secretary. Further, the trial court held that, even if the Secretary has a duty to promulgate such regulations when section 1302 is read with section 1396a(a)(33)(A), the Secretary has satisfied that duty by promulgating the detailed regulations found in 42 C.F.R. Parts 430-456. 557 F.Supp. at 296.
  The district court also found it significant that under Colorado law, the State of Colorado is responsible for licensing nursing homes, suspending a license if the public health or welfare is endangered, for regulating nursing home administration, and licensing and regulating the various professions which provide care in nursing homes. Id. at 297-98. The district court found that these state statutes provided further credibility to its interpretation of the statute: that the state is primarily responsible for administering and enforcing the Medicaid Act and that the role of the federal government is essentially limited to providing financial assistance to states which meet the statutory requirements for participation. Id. at 296.
  THE SECRETARY’S DUTY
  After carefully reviewing the statutory scheme of the Medicaid Act, the legislative history, and the district court’s opinion, we conclude that the district court improperly defined the Secretary’s duty under the statute. The federal government has more than a passive role in handing out money to the states. The district court erred in finding that the burden of enforcing the substantive provisions of the Medicaid Act is on the states., The Secretary of Health and Human Services has a duty to establish a system to adequately inform herself as to whether the facilities receiving federal money are satisfying the requirements of the Act. These requirements include providing high quality patient care. This duty to be adequately informed is not only a duty to be.informed at the time a facility is originally certified, but is a duty of continued supervision.
  Nothing in the Medicaid Act indicates that Congress intended the physical facilities to be the end product. Rather, the purpose of the Act is to provide medical assistance and rehabilitative services. 42 U.S.C. § 1396. The Act repeatedly focuses on the care to be provided, with facilities being only part of that care. For example, the Act provides that health standards are to be developed and maintained, id. § 1396a(a)(9)(A), and that states must inform the Secretary what methods they will use to assure high quality care. Id. § 1396a(a)(22). In addition to the “adequacy of the services available,” the periodic inspections must address “the care being provided” in nursing facilities. Id. § 1396a(a)(26)(B). State plans must provide review of the “appropriateness and quálity of care and services furnished,” id. § 1396a(a)(33)(A), and do so on an ongoing basis. Id. § 1396a(a)(33)(B).
  While the district court correctly noted that it is the state which develops specific standards and actually conducts the inspection, there is nothing in the Act to indicate that the state function relieves the Secretary of all responsibility to ensure that the purposes of the Act are being accomplished. The Secretary, not the states, determines which facilities are eligible for federal funds. See Conf.Rep. No. 1605, 92nd Cong., 2d Sess., reprinted in 1972 U.S. Code Cong. & Ad. News, 4989, 5370, 5390. While participation in the program is voluntary, states who choose to participate must comply with federal statutory requirements. Harris v. McRae, 448 U.S. 297, 301, 100 S.Ct. 2671, 2680, 65 L.Ed.2d 784 (1980); Mississippi Hospital Association, Inc. v. Heckler, 701 F.2d 511, 515 (5th Cir.1983). The inspections may be conducted by the states, but the Secretary approves or disapproves the state’s plan for review. Further, the inspections must be made with federal forms, procedures and methods.
  It would be anomalous to hold that the Secretary has a duty to determine whether a state plan meets the standards of the Act while holding that the Secretary can certify facilities without informing herself as to whether the facilities actually perform the functions required by the state plan. The Secretary has a duty to ensure more than paper compliance. The federal responsibility is particularly evident in the “look behind” provision. 42 U.S.C. § 1396a(a)(33)(B) (1982). We do not read the Secretary’s “look behind” authority as being “nothing more than permitted authority ...” 557 F.Supp. 296, as the district court found. Rather, we find that the purpose of that section is to assure that compliance is not merely facial, but substantive.
  The legislative history makes clear that the “look behind” provision was added to the Act because the states were not properly carrying out the function of making sure that facilities were providing high quality care. The House report states:
  [T]he Committee is concerned that, without the authority to validate State agency compliance reviews and to make an independent judgment as to the extent of compliance by particular facilities, the Secretary lacks the means necessary to assure that Federal matching funds are being used to reimburse only those [skilled nursing facilities] and [intermediate care facilities] that actually comply with medicaid requirements.
  H.R.Rep. No. 1167, 96th Cong., 2d Sess., reprinted in 1980 U.S. Code Cong. & Ad. News 5526, 5570. The district court’s conclusion that this section merely provides the Secretary the authority to go behind a state’s determination of compliance if and when the Secretary wants to, but imposes no duty on the Secretary, ignores the purpose of the section and eliminates its effectiveness.
  By enacting section 1302 Congress gave the Secretary authority to promulgate regulations to achieve the functions with which she is charged. The “look-behind” provision and its legislative history clearly show that Congress intended the Secretary to be responsible for assuring that federal Medicaid money is given only to those institutions that actually comply with Medicaid requirements. The Act’s requirements include providing high quality medical care and rehabilitative services. In fact, the quality of the care provided to the aged is the focus of the Act. Being charged with this function, we must conclude that a failure to promulgate regulations that allow the Secretary to remain informed, on a continuing basis, as to whether facilities receiving federal money are meeting the requirements of the Act, is an abdication of the Secretary’s duty. While the Medicaid Act is admittedly very complex and the Secretary has “exceptionally broad authority to prescribe standards for applying certain sections of the Act,” Schweiker v. Gray Panthers, 453 U.S. 34, 43, 101 S.Ct. 2633, 2639, 69 L.Ed.2d 460 (1981), the Secretary’s authority cannot be interpreted so as to hold that that authority is merely permissive authority. The Secretary must insure that states comply with the congressional mandate to provide high quality medical care and rehabilitative services.
  The district court made a factual finding that the Secretary’s current method. of informing herself as to whether the facilities in question are satisfying the statutory requirements is “facility oriented,” rather than “patient oriented.” 557 F. Supp. at 295. This characterization is fully supported by the record. Having determined that the purpose and the focus of the Act is to provide high quality medical care, we conclude that by promulgating a facility oriented enforcement system the Secretary has failed to follow that focus and such failure is arbitrary and capricious. See Heckler v. Campbell, 461 U.S. 458, 103 S.Ct. 1952, 1957, 76 L.Ed.2d 66 (1983).
  REMEDY
  The district court found that the Secretary owed no duty to the plaintiffs and thus denied the requested relief. Plaintiffs contend that the district court has jurisdiction to compel the Secretary to perform her statutory duty pursuant to the Mandamus and Venue Act of 1962, 28 U.S.C. § 1361 (1982), federal question jurisdiction, 28 U.S.C. § 1331 (1982), and the Administrative Procedure Act, 5 U.S.C. §§ 701-706 (1982).
  This court considered the mandamus remedy in Carpet, Linoleum and Resilient Tile Layers, Local Union No. 419 v. Brown, 656 F.2d 564 (10th Cir.1981). We repeated there the general rule that mandamus is appropriate where the person seeking the relief “can show a duty owed to him by the government official to whom the writ is directed that is ministerial, clearly defined and peremptory.” Id. at 566 (quoting Schulke v. United States, 544 F.2d 453, 455 (10th Cir.1976)). This ministerial-discretionary dichotomy, we noted, “is merely shorthand for the well-taken rule that to the extent a statute vests discretion in a public official, his exercise of that discretion should not be controlled by the judiciary.” Id. The judiciary is not a “super agency” controlling the affairs of an agency which is part of another branch of government. Id.
  [I]t is the court’s duty in a mandamus action to measure the allegations in the complaint against the statutory and constitutional framework to determine whether the particular official actions complained of fall within the scope of the discretion which Congress accorded the administrators____ In other words, even in an area generally left to agency discretion, there may well exist statutory or regulatory standards delimiting the scope or manner in which such discretion can be exercised. In these situations, mandamus will lie when the standards have been ignored or violated.
  Id. (quoting Davis Associates, Inc. v. Secretary, Department of Housing and Urban Development, 498 F.2d 385, 389 & n. 5 (1st Cir.1974)). If, after studying the statute and its legislative history, the court determines that the defendant official has failed to discharge a duty which Congress intended him to perform, the court should compel performance, thus effectuating the congressional purpose. Carpet, Linoleum and Resilient Tile Layers, 656 F.2d at 566.
  We also held in Carpet, Linoleum and Resilient Tile Layers that 28 U.S.C. § 1331 gives the district court jurisdiction to issue a mandatory injunction. The injunctive remedy is provided for by the Administrative Procedure Act, 5 U.S.C. § 706(1), where a court' reviewing agency action is authorized to “compel agency action unlawfully withheld.” Thus, in Carpet, Linoleum and Resilient Tile Layers, 656 F.2d at 567, we concluded that a mandatory injunction is essentially in the nature of mandamus, and jurisdiction can be based on either 28 U.S.C. § 1361, § 1331, or both.
  Applying these principles, we find that jurisdiction exists and mandamus is an appropriate remedy. The Secretary has a duty to promulgate regulations which will enable her to be informed as to whether the nursing facilities receiving federal Medicaid funds are actually providing high quality medical care. This conclusion is fully supported by the statute and its legislative history. The statute vests broad discretion in the Secretary as to how that duty is best accomplished. The court is not a “super agency” and cannot control the specifics of how the Secretary satisfies the duty. This is not a question of controlling the Secretary’s discretion because the Secretary has failed to discharge her statutory duty altogether. Thus, the court should “compel performance and thus effectuate the congressional purpose,” behind the statutory scheme. Carpet, Linoleum and Resilient Tile Layers, 656 F.2d at 566. The case is thus remanded for further proceedings not inconsistent with this opinion.
  REVERSED AND REMANDED.
  . The Act defines various health care services that qualify for federal assistance. Relevant here are skilled nursing facilities, § 1396d(a)(4) and § 1396d(f), which states must have to receive funding, and intermediate care facilities, § 1396d(a)(15) and § 1396d(c) and (d), which states may receive funding to operate, but states are not required to operate.
  . The state plan must provide for similar review of intermediate care facilities. § 1396a(a)(31).
  . Our conclusions are further evidenced by Congress’ recent amendment to the Medicaid Act. Tax Reform Act of 1984, Pub.L. No. 98-369 (1984). Directly in response to the district court’s opinion in this case, Congress amended the Act specifically imposing upon the Secretary a duty to assure that Medicaid patients in skilled nursing and intermediate care facilities receive high quality medical care. The legislative history indicates that Congress was merely reaffirming the Secretary's duty under existing law because Congress believed the district court misinterpreted the statute. 130 Cong.Rec. H 6544, 6740 (daily ed. June 22, 1984); Deficit Reduction Act of 1984, Conf.Rep. No. 861, 98th Cong., 2d Sess. 1363 (1984). We do not address the issue of whether a current legislature’s comment on the intent of a previous legislature is binding. However, the amendment and its legislative history make the Secretary’s duty under the Act even more clear.