Primitive Pythagorean codes