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

Add parentIds/ancestorIds fields to concept domain #950

Merged
merged 1 commit into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.b2international.snowowl.core.domain;

import java.util.List;
import java.util.SortedSet;

import com.b2international.snowowl.core.ResourceURI;
Expand All @@ -37,6 +38,9 @@ public final class Concept extends BaseComponent {
private String iconId;
private SortedSet<String> alternativeTerms;

private List<String> parentIds;
private List<String> ancestorIds;

private Float score;

private Object internalConcept;
Expand Down Expand Up @@ -81,6 +85,22 @@ public SortedSet<String> getAlternativeTerms() {
public Float getScore() {
return score;
}

public List<String> getParentIds() {
return parentIds;
}

public void setParentIds(List<String> parentIds) {
this.parentIds = parentIds;
}

public List<String> getAncestorIds() {
return ancestorIds;
}

public void setAncestorIds(List<String> ancestorIds) {
this.ancestorIds = ancestorIds;
}

@JsonIgnore
public void setInternalConcept(Object internalConcept) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ private Concept toConcept(ResourceURI codeSystem, SnomedConcept snomedConcept, S
concept.setAlternativeTerms(FluentIterable.from(snomedConcept.getPreferredDescriptions())
.transform(pd -> pd.getTerm())
.toSortedSet(Comparator.naturalOrder()));
concept.setParentIds(snomedConcept.getParentIdsAsString());
concept.setAncestorIds(snomedConcept.getAncestorIdsAsString());
if (requestedExpand) {
concept.setInternalConcept(snomedConcept);
}
Expand Down