Card #139 refactored patient migration