Dr. John Ogle Warfield Jr., 79, a surgeon in private practice in Washington for 34 years who later worked as a medical consultant, died Tuesday at his Washington home after a heart attack.

Besides his private practice, Dr. Warfield was chairman of the surgical departments at the old Garfield Memorial Hospital and at Children's and Arlington hospitals and the Washington Hospital Center.

Following his retirement in 1960, he was staff surgeon for the Bionetics Medical Laboratories in Kensington until 1965, when he became a consultant to the D.C. Public Health Department's Community Health and Hospital Administration.

Dr. Warfield also lectured on clinicsurgery and physiology at Georgetown University Medical School, George Washington University Medical School and the Baltimore College of Dental Surgery. He was the author of numerous papers in his field.

He was born in Baltimore. He earned bachelor's and master's degrees from St. John's College in Annapolis and earned a medical degree from the University of Maryland's medical school in Baltimore, where he received the Gold Medal and Hirsh Pasthology Award.

Dr. Warfield was a life member of the D.C. Medical Society and a fellow of the American and International Colleges of Surgeons. He was a founder and former officer of the Medical Arts Society and the Washington Academy of Surgeons. He received the Vincennial Medal from Georgetown University Medical School.

He also belonged to numerous hereditary societies, including the Society of Colonial Wars, the Sons of the Revolution and the Society of the Cincinnati. He was a founder of the Huguenot Society in Maryland.

Dr. Warfield was a member of the Cosmos Club in Washington.

Survivors include his wife, Elisabeth Baldwin Warfield, of Washington; a daughter, Elisabeth W. Volpe, of McLean; a son, John Ogle Iii of Falls Church; a sister, Elizabeth H. Baldwin of Washington; a brother, Edwin S., of Elizabethtown, Pa., and a grandson.

The family suggests that expressions of sympathy be in the form of contributions to the Children's Hospital National Medical Center, or to St. Alban's Church in Washington.