Search in sources :

Example 1 with DroolsRelationship

use of org.snomed.snowstorm.validation.domain.DroolsRelationship in project snowstorm by IHTSDO.

the class ConceptValidationHelper method replaceTemporaryUUIDWithSCTID.

public static List<InvalidContent> replaceTemporaryUUIDWithSCTID(final List<InvalidContent> invalidContentWarnings, final Concept concept) {
    replaceInvalidContentTemporaryUUIDWithSCTIDInConcept(invalidContentWarnings, concept);
    replaceInvalidContentTemporaryUUIDWithSCTIDIn(invalidContentWarnings, concept.getDescriptions(), (final InvalidContent invalidContentWarning, final Description description) -> {
        final Component component = invalidContentWarning.getComponent();
        if (component instanceof DroolsDescription) {
            final DroolsDescription droolsDescription = (DroolsDescription) component;
            if (description != null && description.getReleaseHash() != null && description.getReleaseHash().equals(droolsDescription.getReleaseHash())) {
                invalidContentWarning.setComponent(new DroolsDescription(description));
            }
        }
    });
    replaceInvalidContentTemporaryUUIDWithSCTIDIn(invalidContentWarnings, concept.getRelationships(), (final InvalidContent invalidContentWarning, final Relationship relationship) -> {
        final Component component = invalidContentWarning.getComponent();
        if (component instanceof DroolsRelationship) {
            final DroolsRelationship droolsRelationship = (DroolsRelationship) component;
            if (relationship != null && relationship.getReleaseHash() != null && relationship.getReleaseHash().equals(droolsRelationship.getReleaseHash())) {
                invalidContentWarning.setComponent(new DroolsRelationship(null, false, relationship));
            }
        }
    });
    replaceInvalidContentTemporaryUUIDWithSCTIDInAxiom(invalidContentWarnings, concept.getClassAxioms(), false);
    replaceInvalidContentTemporaryUUIDWithSCTIDInAxiom(invalidContentWarnings, concept.getGciAxioms(), true);
    return invalidContentWarnings;
}
Also used : DroolsDescription(org.snomed.snowstorm.validation.domain.DroolsDescription) DroolsDescription(org.snomed.snowstorm.validation.domain.DroolsDescription) InvalidContent(org.ihtsdo.drools.response.InvalidContent) DroolsRelationship(org.snomed.snowstorm.validation.domain.DroolsRelationship) Component(org.ihtsdo.drools.domain.Component) DroolsRelationship(org.snomed.snowstorm.validation.domain.DroolsRelationship)

Aggregations

Component (org.ihtsdo.drools.domain.Component)1 InvalidContent (org.ihtsdo.drools.response.InvalidContent)1 DroolsDescription (org.snomed.snowstorm.validation.domain.DroolsDescription)1 DroolsRelationship (org.snomed.snowstorm.validation.domain.DroolsRelationship)1