LUBBOCK, Texas (AP) _ A clerical error in the Legal Immigration Act of 1990 has created a loophole that rural hospitals are fighting to keep open so they can attract much-needed doctors.

The law, to take effect Oct. 1, would allow hospitals to hire foreign medical graduates for the first time in more than a decade.

Lawmakers in Washington have begun to close the loophole, but some are having second thoughts now as physician recruiters argue that this wrong is right.

The omission clears the way for foreign-trained doctors to qualify for a six-year work visa for the first time since 1977. The visas can be obtained within weeks. Under the old provisions, doctors had to get a regular visa or ''green card,'' which can take years to obtain.

Under either version, foreign medical students who receive their education and training in the United States must return home to practice for two years before being released to practice elsewhere.

The mistake originated from a clerical error in which several sentences were omitted from current law while rewriting the act.

Sens. Edward Kennedy, D-Mass., and Alan Simpson, R-Wyo., have introduced a technical amendment bill to correct the omission.

Hospital administrators' facing perpetual staff shortages are outraged that Congress wants to repair a mistake that they claim will help medically underserved areas.

''Tell Senator Kennedy to come down here and try to recruit a physician to a town of 3,000,'' said Ron Rives, an assistant vice president in charge of recruiting physicians at Methodist Hospital in Lubbock.

''The overall rural health care issues have got to be a priority in America or access to health care is going to be completely annihilated.''

Neither Kennedy nor Simpson returned repeated phone calls to their Washington offices by The Associated Press.

Half of the 422 hospitals that have closed nationwide since 1986 are in rural areas, according to the American Hospital Association in Chicago.

''There is no way to quantify how many of those hospitals closed due to doctor shortages,'' said Kim Byas, a rural hospital specialist with the AHA. ''But the loss of physicians in rural areas due to retirement, migration and burnout have been critical factors in hospital closings across the country.''

Despite the time needed to get doctors through immigration procedures, rural hospitals have looked overseas for doctors because American graduates simply aren't practicing in small towns.

According to a 1990 survey of more than 11,000 medical school seniors by the Association of American Medical Colleges in Washington, only 1.5 percent of the students would prefer practicing in a rural area.

The 280,000-member American Medical Association, the nation's largest society of physicians, has not expressed a position on the freer acceptance of foreign medical graduates.

Maria Beleda, a graduate of the University of the Philippines with a medical degree in psychiatry, needs the change in the law to fulfill her contract with a rural hospital in southern West Virginia. The hospital has been seeking a psychiatrist for three years.

''If I could get the work visa, I could be there in two weeks,'' Mrs. Beleda said. ''Otherwise it would take six years because the Philippines is six years behind in their immigration quotas.

''My family would be very happy in West Virginia,'' said Mrs. Beleda, who fears returning to the Philippines because of political turmoil. ''We come from a rural setting in the Philippines. We would settle there and raise our children.''

Rep. Lamar Smith, R-Texas, who was the ranking Republican on the House Subcommittee on International Law, Immigration and Refugees when the act was drawn up, said the provision allowing foreign medical graduates six-year work visas was ''clearly a typographical error.''

''The ... act was not intended to change the law with regard to foreign medical school graduates,'' Smith said. ''The technical amendment would return the provision to current law.''

The Senate last month passed the technical amendment bill. The House likely will vote on it later this month, Smith said.

But after hearing about the support for freer access to foreign graduates, Smith said he would try to bring the amendment bill up for debate in the House.

''If there is a proven need for foreign doctors to enter and we can ensure their competency, then we ought to consider the change,'' said Smith, who has had three hospitals close in his district recently.

Officials at understaffed hospitals say acceptance of foreign medical graduates would greatly increase the recruitment of Canadian doctors, whose licenses are readily accepted in the United States.

''We have hospital and clinic clients in states as disparate as California and Oklahoma who would be thrilled to hire qualified Canadian physicians,'' said James Merritt, president of Merritt, Hawkins and Associates, a national physician search firm based in Dallas.

''The new law would help extend medical coverage yet would not displace U.S. practitioners.''