CHICAGO (AP) _ Two men who posed as doctors and fraudulently treated as many as 45,000 patients were among six people indicted for Medicaid fraud, Attorney General Neil F. Hartigan said Sunday.

Two doctors, two pharmacists and two men hired by the doctors to pose as physicians defrauded the state of more than $500,000, Hartigan said. Four clinics and pharmacies in Chicago, Chicago Heights, Robbins and Midlothian were also implicated in the schemes.

The six were indicted on felony charges of vendor fraud and theft by deception. The two men practicing medicine without a license were charged additionally with that felony.

Oscar Hosenilla, 48, and Babu Rao Surapaneni, 47, are accused of performing examinations, prescribing medications and ordering lab tests and X-rays at two health care clinics in what Hartigan called a ''particularly vicious'' scheme.

Surapaneni practiced at two clinics in south suburban Robbins and Midlothian from January 1986 to December 1988 with Dr. Chowdary Adusumilli, 50, also was indicted. They are charged with billing the state for more than $40,000 in fraudulent claims, Hartigan said.

Hosenilla was employed by Dr. Henry Pimental, 52, at the Reymar Clinic and Englewood Clinical Laboratory in Chicago from July 1985 to April 1988. The clinic was contracted through the Chicago Health Maintenance Organization to provide care to HMO members. The two are charged with billing the state more than $150,000 in false claims.

The indictments were returned by a Cook County grand jury late Friday, Hartigan's office said.

''These defendants have not only put people's lives in danger, but robbed the state of vital funds to provide health services to people who are most needy,'' Hartigan said.

George Smith, head of the state's Medicaid Fraud Division, said the phony doctors treated an average of 30 patients a day over a two- and three-year period. He knew of no reported injuries or malpractice as a result of the fraudulent care.

''I consider this scandalous,'' Hartigan said. ''People who sign up rely on (the HMO's) good faith to provide quality medical service.''

He said his office was investigating Chicago HMO to determine whether criminal negligence was involved and whether HMO officials should have known a phony doctor was practicing in a clinic sanctioned by them.

If found guilty, the defendants would have to return the money they billed the state, and could be sentenced to 14 years in prison and be fined $10,000 for each offense.

In another case, Dr. Nathan Potkin, 74, the pharmacist for the Rivera Nursing Home in suburban Chicago Heights, billed the state for high-priced medications which were never ordered by the patients' physicians and never given to patients, Hartigan said.

The sixth man charged, pharmacist Larry White, 54, submitted fraudulent vouchers for more than $61,000 for drugs that were never prescribed at the Larr Pharmacy in Chicago, the attorney general said.