The J.B. Johnson medical building, a community health center that has been almost totally unused in an impoverished Washington neighborhood for five years, may be operating next summer as a long-term nursing care facility, the U.S. Department of Housing and Urban Development said yesterday.

HUD Secretary Patricia Roberts Harris announced that HUD, which guaranteed the mortgage on the facility and foreclosed on the property in the summer of 1976, has transferred the health center to the U.S. Department of Health, Education and Welfare.

HEW, in turn, is negotiating transfer of the facility at 1st and K Streets NW to the District of Columbia government.

The facility would provide long-term nursing care for 250 St. Elizabeths Hospital patients who no longer require intensive in-patient psychiatric treatment, and also would offer outpatient health care and mental health services to residents of the surrounding neighborhoods.

The J.B. Johnson building was completed in 1972, "in an area of Washington that desperately neede, and still needs, its services," Secretary Harris said. "I am extremely pleased it will at long last be out to the use ofr which it was originally intended, and will serve as a vialbe alternative for meeting the needs of St. Elizabeths patients who require care in a less restrictive and less expensive setting."

An HEW spokesman said transfer to the District government, which has frequently asked HUD for the facility, is expected withing six months. He said that he expects the District to share in the cost of renovating the building to bring it up to fire and safety code standards. Renovation could cost as much as $500,000, the spokesman said.

The HEW spokesman added that the District has submitted an application to the regional HEW office, asking for $500,000 to renovate the facility under legislation providing construction of hospitals and medical facilities.

Albert P. Russo, director of the D.C. Department of Human Resources, said DHR plans to operate the facility as part of its community health and hospital administration, the division that overseas D.C. Village, Glenn Dale Hospital, and community health centers in the city. He said an alternative would be to have an outside organization operate the facility under contract with DHR.

Russo estimated that it might cost $3.5 million a year to operate, staff, and pay for food, supplies and utilities at the facility. Russon said federal Medicaid reimbursements are expected to "substantially" cover those costs.

The J.B. Johnson building was built more than five years ago by the National Medical Association Foundation Plan, Inc., a foundation originally affiliated with the black National Medical Association. The facility was to stand as a national model of quality medical care in the inner city. Planning for it had begun in 1968 during the administration of Lyndon B. Johnson.

"It was ahead of its time. It was a dream of the black physicians of America," Robert Winston, president of the foundation, said in an interview three months ago. The facility was to have provided routine medical and dental care as well as hospitalization within a ghetto area deprived of medical care.

The project was plagued with problems almost from the beginning, however. The black-owned construction firm hired to build the facility went bankrupt, and federal grants dried up between the late 1960s and early 1973s.

By the time the building was dedicated, HEW had strengthened its life and safety health code standards for medical facilities. The J.B. Johnson building had several deficiencies under the new code requirements, including elevator problems, insufficient emergency lighting and not enough fire extinguishers and fire doors, according to files in the regional HUD office.

The code deficiencies meant that the J.B. Johnson center could not receive Medicaid or Medicare reimbursements - a big blow to a facility that was intended for lower-income patients who would need assistance in paying their bills.

The building contains $200,000 worth of equipment - beds, matresses, wheelcharis, dental units, sophisticated X-ray equipment - unused and covered with dust. Security officers guard the building around the clock.