Obstetrics and gynecology is the medical specialty that encompasses the two subspecialties of obstetrics and gynecology.