Compton scattering of an X-ray photon by an open-shell atom