diff --git a/snomed/com.b2international.snowowl.snomed.common/src/com/b2international/snowowl/snomed/common/SnomedConstants.java b/snomed/com.b2international.snowowl.snomed.common/src/com/b2international/snowowl/snomed/common/SnomedConstants.java index 4f5149bf91c..33004e2db9f 100644 --- a/snomed/com.b2international.snowowl.snomed.common/src/com/b2international/snowowl/snomed/common/SnomedConstants.java +++ b/snomed/com.b2international.snowowl.snomed.common/src/com/b2international/snowowl/snomed/common/SnomedConstants.java @@ -252,20 +252,7 @@ private Concepts() { } public static final String REFSET_REPLACED_BY_ASSOCIATION = "900000000000526001"; public static final String REFSET_SAME_AS_ASSOCIATION = "900000000000527005"; public static final String REFSET_SIMILAR_TO_ASSOCIATION = "900000000000529008"; - public static final String REFSET_WAS_A_ASSOCIATION = "900000000000528000"; - - public static final Set HISTORICAL_ASSOCIATION_REFSETS = ImmutableSet.of( - REFSET_HISTORICAL_ASSOCIATION, - REFSET_ALTERNATIVE_ASSOCIATION, - REFSET_MOVED_FROM_ASSOCIATION, - REFSET_MOVED_TO_ASSOCIATION, - REFSET_POSSIBLY_EQUIVALENT_TO_ASSOCIATION, - REFSET_REFERS_TO_ASSOCIATION, - REFSET_REPLACED_BY_ASSOCIATION, - REFSET_SAME_AS_ASSOCIATION, - REFSET_SIMILAR_TO_ASSOCIATION, - REFSET_WAS_A_ASSOCIATION); - + public static final String REFSET_WAS_A_ASSOCIATION = "900000000000528000"; // simple map type refsets public static final String CTV3_SIMPLE_MAP_TYPE_REFERENCE_SET_ID = "900000000000497000"; diff --git a/snomed/com.b2international.snowowl.snomed.datastore/src/com/b2international/snowowl/snomed/datastore/request/rf2/validation/Rf2GlobalValidator.java b/snomed/com.b2international.snowowl.snomed.datastore/src/com/b2international/snowowl/snomed/datastore/request/rf2/validation/Rf2GlobalValidator.java index 384858a6155..34e38e6b11f 100644 --- a/snomed/com.b2international.snowowl.snomed.datastore/src/com/b2international/snowowl/snomed/datastore/request/rf2/validation/Rf2GlobalValidator.java +++ b/snomed/com.b2international.snowowl.snomed.datastore/src/com/b2international/snowowl/snomed/datastore/request/rf2/validation/Rf2GlobalValidator.java @@ -15,9 +15,7 @@ */ package com.b2international.snowowl.snomed.datastore.request.rf2.validation; -import static com.b2international.snowowl.snomed.common.SnomedConstants.Concepts.HISTORICAL_ASSOCIATION_REFSETS; -import static com.b2international.snowowl.snomed.common.SnomedConstants.Concepts.REFSET_CONCEPT_INACTIVITY_INDICATOR; -import static com.b2international.snowowl.snomed.common.SnomedConstants.Concepts.REFSET_DESCRIPTION_INACTIVITY_INDICATOR; +import static com.b2international.snowowl.snomed.common.SnomedConstants.Concepts.*; import static com.google.common.collect.Sets.newHashSet; import java.io.IOException; @@ -43,6 +41,7 @@ import com.b2international.snowowl.snomed.datastore.request.rf2.importer.Rf2AssociationRefSetContentType; import com.b2international.snowowl.snomed.datastore.request.rf2.importer.Rf2AttributeValueRefSetContentType; import com.b2international.snowowl.snomed.datastore.request.rf2.importer.Rf2EffectiveTimeSlice; +import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -56,6 +55,18 @@ public class Rf2GlobalValidator { private static final int RAW_QUERY_PAGE_SIZE = 500_000; private final Logger log; + + private static final Set HISTORICAL_ASSOCIATION_REFSETS_TO_VALIDATE = ImmutableSet.of( + REFSET_HISTORICAL_ASSOCIATION, + REFSET_ALTERNATIVE_ASSOCIATION, + REFSET_MOVED_TO_ASSOCIATION, + REFSET_MOVED_FROM_ASSOCIATION, + REFSET_POSSIBLY_EQUIVALENT_TO_ASSOCIATION, + REFSET_REFERS_TO_ASSOCIATION, + REFSET_REPLACED_BY_ASSOCIATION, + REFSET_SAME_AS_ASSOCIATION, + REFSET_SIMILAR_TO_ASSOCIATION, + REFSET_WAS_A_ASSOCIATION); private Map dependenciesByEffectiveTime; private Map skippableMemberDependenciesByEffectiveTime; @@ -215,7 +226,7 @@ private void validateType(Rf2EffectiveTimeSlice slice, ImportDefectAcceptor glob final String referenceSet = member[5]; final String type = member[0]; - boolean invalidHistoricalAssociationMember = HISTORICAL_ASSOCIATION_REFSETS.contains(referenceSet) && !Rf2AssociationRefSetContentType.TYPE.equals(type); + boolean invalidHistoricalAssociationMember = HISTORICAL_ASSOCIATION_REFSETS_TO_VALIDATE.contains(referenceSet) && !Rf2AssociationRefSetContentType.TYPE.equals(type); boolean invalidAttributeTypeMember = (REFSET_CONCEPT_INACTIVITY_INDICATOR.equals(referenceSet) || REFSET_DESCRIPTION_INACTIVITY_INDICATOR.equals(referenceSet)) && !Rf2AttributeValueRefSetContentType.TYPE.equals(type);