Bug fix when renaming documents that are not yet assigned to a patient