encounter.visit is a nullable field, an encounter is not supposed to belong to a visit, you rather leave it 'visitless', it will be up to the user to add it to a visit if they wish to