Exchange of Israeli captives for prisoners comes as 50 Palestinians due to leave by Rafah crossing for hospitals abroad.