The purpose of the Medicaid 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 serves, and . . . rehabilitation and other services to help such . . . individuals to attain or retain capabilities for independence or self-care.' To receive funding, the state must submit to D and have approved by D a plan for medical assistance which meets the requirements of the Act. Congress gave D 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. The Act and its implementing regulations are extensive and at first blush both state and patient-centric in their required goals. D had established a procedure for determining whether state plans comply with the standards set out in the regulations. 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. Form SSA-1569 is part of that process. Ps 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. Ps instituted the lawsuit in an effort to improve the deplorable conditions at many nursing homes. Seeking relief under 42 U.S.C. § 1983 (1982), Ps brought this class action on behalf of Medicaid recipients residing in nursing homes in Colorado. They alleged that the D has a statutory duty under Title XIX of the Social Security Act, 42 U.S.C. §§ 1396-1396n (1982), 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. D had developed 'facility-oriented,' not 'patient-oriented' standards. Ps claimed this failed to meet the statutory mandate. Ps presented evidence of the lack of adequate medical care and of the widespread knowledge that care is inadequate. 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.' The trial court denied relief. The district court found that the 'facility-oriented' characterization is appropriate. The district court found that the duty lies with the state because the Act provides that states are responsible for establishing and maintaining health standards for provider institutions Ps appealed.