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;
}
Aggregations