Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SO-4280: Enforce new rules to determine definition status of a concept #663

Open
wants to merge 2 commits into
base: 7.x
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
SO-4280: Enforce new rules to determine definition status of a concept:
* If a concept only has equivalent class axioms make it defined
* If a concept only has sub class axioms make it primitive
* If a concept contains a mixture make it primitive as well
  • Loading branch information
AAAlinaaa committed Sep 17, 2020
commit 494e67e5ea68bdda1861f55ebae147b427d8f6f4
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public final class SnomedOWLAxiomHelper {

private static final String EQUIVALENTCLASSES = "equivalentclasses";
private static final String SUBCLASSOF = "subclassof";

public static String getDefinitionStatusFromExpressions(Set<String> owlExpressions) {
if (owlExpressions.isEmpty()) {
Expand All @@ -35,10 +35,10 @@ public static String getDefinitionStatusFromExpressions(Set<String> owlExpressio

return owlExpressions.stream()
.filter(expression -> !Strings.isNullOrEmpty(expression))
Copy link
Member

@apeteri apeteri Sep 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filter GCI axioms here (in class SnomedOWLAxiomHelper), not in the create or update requests. They don't have a say in the concept's suggested definition status, but should be going through when creating or updating a SNOMED CT concept, just as before.

Or did they cause some other problem?

.filter(expression -> expression.toLowerCase(Locale.ENGLISH).contains(EQUIVALENTCLASSES))
.filter(expression -> expression.toLowerCase(Locale.ENGLISH).contains(SUBCLASSOF))
.findFirst()
.map(equivalentClassesAxiom -> Concepts.FULLY_DEFINED)
.orElse(Concepts.PRIMITIVE);
.map(equivalentClassesAxiom -> Concepts.PRIMITIVE)
.orElse(Concepts.FULLY_DEFINED);
}

}