Skip to content

Commit 9cb727c

Browse files
committed
fix(snomed): filter by type id first then calc. revision prop changes...
...for descriptions when calculating relevant description changes for concept semantic updates
1 parent d46c2a4 commit 9cb727c

File tree

1 file changed

+6
-5
lines changed
  • snomed/com.b2international.snowowl.snomed.datastore/src/com/b2international/snowowl/snomed/datastore/index/change

1 file changed

+6
-5
lines changed

snomed/com.b2international.snowowl.snomed.datastore/src/com/b2international/snowowl/snomed/datastore/index/change/ConceptChangeProcessor.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,10 @@ private Map<String, SnomedDescriptionIndexEntry> getDescriptionDocuments(Staging
236236
// add dirty descriptions with relevant changes from tx
237237
staging
238238
// XXX accepts only relevant property changes, lang member detection should take care about acceptability changes
239-
.getChangedRevisions(SnomedDescriptionIndexEntry.class, ALLOWED_DESCRIPTION_CHANGE_FEATURES)
239+
.getChangedRevisions(SnomedDescriptionIndexEntry.class)
240+
.filter(diff -> !Concepts.TEXT_DEFINITION.equals(((SnomedDescriptionIndexEntry) diff.newRevision).getTypeId()))
241+
.filter(diff -> diff.hasRevisionPropertyChanges(ALLOWED_DESCRIPTION_CHANGE_FEATURES))
240242
.map(diff -> (SnomedDescriptionIndexEntry) diff.newRevision)
241-
.filter(description -> !Concepts.TEXT_DEFINITION.equals(description.getTypeId()))
242243
.forEach(description -> descriptions.put(description.getId(), description));
243244

244245
// add detached descriptions
@@ -253,9 +254,9 @@ private Map<String, SnomedDescriptionIndexEntry> getDescriptionDocuments(Staging
253254
.map(member -> member.getReferencedComponentId())
254255
.forEach(descriptionsToLoad::add);
255256

256-
staging.getChangedRevisions(SnomedRefSetMemberIndexEntry.class, ALLOWED_LANG_MEMBER_CHANGE_FEATURES)
257-
.map(diff -> (SnomedRefSetMemberIndexEntry) diff.newRevision)
258-
.map(member -> member.getReferencedComponentId())
257+
staging.getChangedRevisions(SnomedRefSetMemberIndexEntry.class)
258+
.filter(diff -> diff.hasRevisionPropertyChanges(ALLOWED_LANG_MEMBER_CHANGE_FEATURES))
259+
.map(diff -> ((SnomedRefSetMemberIndexEntry) diff.newRevision).getReferencedComponentId())
259260
.forEach(descriptionsToLoad::add);
260261

261262
staging.getRemovedObjects(SnomedRefSetMemberIndexEntry.class)

0 commit comments

Comments
 (0)