Descendent fix (#5669)

* Fix "is-a" ValueSet expansion, add "descendent-of" support

* Fixed tests in DSTU3 and R5

* Trigger new build

* Revert "Trigger new build"

This reverts commit 46c672b338.

* fix default partition setting on resource (#5617)

* fix default partition setting on resource

* changelog

* Handle DEFAULT partition in rule checker.

* Fix spotless

---------

Co-authored-by: Michael Buckley <michaelabuckley@gmail.com>
Co-authored-by: James Agnew <jamesagnew@gmail.com>

* pom bump, doc add, version enum add (#5616)

Co-authored-by: Long Ma <long@smilecdr.com>

* fix default partition setting on resource (#5618)

* fix default partition setting on resource
* Handle DEFAULT partition in rule checker.

Co-authored-by: Ken Stevens <khstevens@gmail.com>

* Add setting to make broker not use JacksonMessageConverter (#5611)

* Add setting to make broker not use JacksonMessageConverter

* Add changelog

* Implement suggestions

---------

Co-authored-by: juan.marchionatto <juan.marchionatto@smilecdr.com>

* Fix version

* add changelog, add attribution, remove accidental bring-overs

* add changelog, add attribution, remove accidental bring-overs

* Finish jira section

---------

Co-authored-by: Ole Hedegaard <ohe@trifork.com>
Co-authored-by: Ken Stevens <khstevens@gmail.com>
Co-authored-by: Michael Buckley <michaelabuckley@gmail.com>
Co-authored-by: James Agnew <jamesagnew@gmail.com>
Co-authored-by: longma1 <32119004+longma1@users.noreply.github.com>
Co-authored-by: Long Ma <long@smilecdr.com>
Co-authored-by: jmarchionatto <60409882+jmarchionatto@users.noreply.github.com>
Co-authored-by: juan.marchionatto <juan.marchionatto@smilecdr.com>
This commit is contained in:
Tadgh 2024-02-05 14:39:04 -08:00 committed by GitHub
parent d63d3cab46
commit ace3fccf31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 67 additions and 17 deletions

View File

@ -0,0 +1,6 @@
---
type: fix
issue: 5603
jira: SMILE-8000
title: "Previously, the semantics of `is-a` were incorrect in Valueset Expansion. The implementation previously used the behaviour of `descendent-of`, which means that `A is-a A` was not being considered as true. This has been corrected. In addition,
`descendent-of` is now supported, which compares for strict descendency, and does not include itself. Thanks to Ole Hedegaard (@ohetrifork) for the fix."

View File

@ -0,0 +1,3 @@
---
release-date: "2023-05-18"
codename: "Borealis"

View File

@ -1598,6 +1598,16 @@ public class TermReadSvcImpl implements ITermReadSvc, IHasScheduledJobs {
TermConcept code = findCodeForFilterCriteria(theSystem, theFilter);
if (theFilter.getOp() == ValueSet.FilterOperator.ISA) {
ourLog.debug(
" * Filtering on specific code and codes with a parent of {}/{}/{}",
code.getId(),
code.getCode(),
code.getDisplay());
b.must(f.bool()
.should(f.match().field("myParentPids").matching("" + code.getId()))
.should(f.match().field("myId").matching(code.getId())));
} else if (theFilter.getOp() == ValueSet.FilterOperator.DESCENDENTOF) {
ourLog.debug(
" * Filtering on codes with a parent of {}/{}/{}", code.getId(), code.getCode(), code.getDisplay());

View File

@ -786,7 +786,7 @@ public class FhirResourceDaoR4SearchWithElasticSearchIT extends BaseJpaTest impl
logAndValidateValueSet(result);
ArrayList<String> codes = toCodesContains(result.getExpansion().getContains());
assertThat(codes, containsInAnyOrder("childAAA", "childAAB"));
assertThat(codes, containsInAnyOrder("childAA", "childAAA", "childAAB"));
}
@Test

View File

@ -313,7 +313,7 @@ public class FhirResourceDaoDstu3TerminologyTest extends BaseJpaDstu3Test {
.setSystem(codeSystem.getUrl())
.addFilter()
.setProperty("concept")
.setOp(FilterOperator.ISA)
.setOp(FilterOperator.DESCENDENTOF)
.setValue("dogs");
myValueSetDao.create(valueSet, mySrd);
@ -504,7 +504,7 @@ public class FhirResourceDaoDstu3TerminologyTest extends BaseJpaDstu3Test {
logAndValidateValueSet(result);
ArrayList<String> codes = toCodesContains(result.getExpansion().getContains());
assertThat(codes, containsInAnyOrder("childAAA", "childAAB"));
assertThat(codes, containsInAnyOrder("childAA", "childAAA", "childAAB"));
}
@ -535,7 +535,7 @@ public class FhirResourceDaoDstu3TerminologyTest extends BaseJpaDstu3Test {
logAndValidateValueSet(result);
ArrayList<String> codes = toCodesContains(result.getExpansion().getContains());
assertThat(codes, containsInAnyOrder("childAAA", "childAAB"));
assertThat(codes, containsInAnyOrder("childAA", "childAAA", "childAAB"));
}
@ -650,7 +650,7 @@ public class FhirResourceDaoDstu3TerminologyTest extends BaseJpaDstu3Test {
ValueSet vs = new ValueSet();
ConceptSetComponent include = vs.getCompose().addInclude();
include.setSystem(URL_MY_CODE_SYSTEM);
include.addFilter().setProperty("concept").setOp(FilterOperator.ISA).setValue("ParentA");
include.addFilter().setProperty("concept").setOp(FilterOperator.DESCENDENTOF).setValue("ParentA");
ValueSet result = myValueSetDao.expand(vs, null);
logAndValidateValueSet(result);
@ -669,7 +669,7 @@ public class FhirResourceDaoDstu3TerminologyTest extends BaseJpaDstu3Test {
vs = new ValueSet();
include = vs.getCompose().addInclude();
include.setSystem(URL_MY_CODE_SYSTEM);
include.addFilter().setProperty("concept").setOp(FilterOperator.ISA).setValue("ParentA");
include.addFilter().setProperty("concept").setOp(FilterOperator.DESCENDENTOF).setValue("ParentA");
result = myValueSetDao.expand(vs, null);
logAndValidateValueSet(result);

View File

@ -230,7 +230,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
ConceptSetComponent include = myLocalVs.getCompose().addInclude();
include.setSystem(theCodeSystemUrl);
include.setVersion(theValueSetVersion);
include.addFilter().setProperty("concept").setOp(FilterOperator.ISA).setValue("ParentA");
include.addFilter().setProperty("concept").setOp(FilterOperator.DESCENDENTOF).setValue("ParentA");
return myLocalVs;
}

View File

@ -353,7 +353,7 @@ public class FhirResourceDaoR4TerminologyTest extends BaseJpaR4Test {
.setSystem(codeSystem.getUrl())
.addFilter()
.setProperty("concept")
.setOp(FilterOperator.ISA)
.setOp(FilterOperator.DESCENDENTOF)
.setValue("dogs");
myValueSetDao.create(valueSet, mySrd);
@ -584,7 +584,7 @@ public class FhirResourceDaoR4TerminologyTest extends BaseJpaR4Test {
logAndValidateValueSet(result);
ArrayList<String> codes = toCodesContains(result.getExpansion().getContains());
assertThat(codes, containsInAnyOrder("childAAA", "childAAB"));
assertThat(codes, containsInAnyOrder("childAA", "childAAA", "childAAB"));
}
@ -610,6 +610,34 @@ public class FhirResourceDaoR4TerminologyTest extends BaseJpaR4Test {
logAndValidateValueSet(result);
ArrayList<String> codes = toCodesContains(result.getExpansion().getContains());
assertEquals(3, codes.size());
assertThat(codes, containsInAnyOrder("childAA", "childAAA", "childAAB"));
}
@Test
public void testExpandWithDescendentOfInExternalValueSetReindex() {
TermReindexingSvcImpl.setForceSaveDeferredAlwaysForUnitTest(true);
createExternalCsAndLocalVs();
myResourceReindexingSvc.markAllResourcesForReindexing();
myResourceReindexingSvc.forceReindexingPass();
myResourceReindexingSvc.forceReindexingPass();
myTerminologyDeferredStorageSvc.saveDeferred();
myTerminologyDeferredStorageSvc.saveDeferred();
myTerminologyDeferredStorageSvc.saveDeferred();
ValueSet vs = new ValueSet();
ConceptSetComponent include = vs.getCompose().addInclude();
include.setSystem(TermTestUtil.URL_MY_CODE_SYSTEM);
include.addFilter().setOp(FilterOperator.DESCENDENTOF).setValue("childAA").setProperty("concept");
ValueSet result = myValueSetDao.expand(vs, null); // breakpoint
logAndValidateValueSet(result);
ArrayList<String> codes = toCodesContains(result.getExpansion().getContains());
assertEquals(2, codes.size());
assertThat(codes, containsInAnyOrder("childAAA", "childAAB"));
}
@ -795,7 +823,7 @@ public class FhirResourceDaoR4TerminologyTest extends BaseJpaR4Test {
ValueSet vs = new ValueSet();
ConceptSetComponent include = vs.getCompose().addInclude();
include.setSystem(TermTestUtil.URL_MY_CODE_SYSTEM);
include.addFilter().setProperty("concept").setOp(FilterOperator.ISA).setValue("ParentA");
include.addFilter().setProperty("concept").setOp(FilterOperator.DESCENDENTOF).setValue("ParentA");
ValueSet result = myValueSetDao.expand(vs, null);
logAndValidateValueSet(result);
@ -814,7 +842,7 @@ public class FhirResourceDaoR4TerminologyTest extends BaseJpaR4Test {
vs = new ValueSet();
include = vs.getCompose().addInclude();
include.setSystem(TermTestUtil.URL_MY_CODE_SYSTEM);
include.addFilter().setProperty("concept").setOp(FilterOperator.ISA).setValue("ParentA");
include.addFilter().setProperty("concept").setOp(FilterOperator.DESCENDENTOF).setValue("ParentA");
result = myValueSetDao.expand(vs, null);
logAndValidateValueSet(result);

View File

@ -202,7 +202,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
myLocalVs.setUrl(URL_MY_VALUE_SET);
ConceptSetComponent include = myLocalVs.getCompose().addInclude();
include.setSystem(codeSystem.getUrl());
include.addFilter().setProperty("concept").setOp(FilterOperator.ISA).setValue("ParentA");
include.addFilter().setProperty("concept").setOp(FilterOperator.DESCENDENTOF).setValue("ParentA");
myLocalValueSetId = myValueSetDao.create(myLocalVs, mySrd).getId().toUnqualifiedVersionless();
}
@ -1199,7 +1199,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.setSystem(URL_MY_CODE_SYSTEM)
.addFilter()
.setProperty("concept")
.setOp(FilterOperator.ISA)
.setOp(FilterOperator.DESCENDENTOF)
.setValue("A");
myLocalVs
.getCompose()

View File

@ -167,7 +167,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
myLocalVs.setUrl(URL_MY_VALUE_SET);
ConceptSetComponent include = myLocalVs.getCompose().addInclude();
include.setSystem(codeSystem.getUrl());
include.addFilter().setProperty("concept").setOp(FilterOperator.ISA).setValue("ParentA");
include.addFilter().setProperty("concept").setOp(FilterOperator.DESCENDENTOF).setValue("ParentA");
myLocalValueSetId = myValueSetDao.create(myLocalVs, mySrd).getId().toUnqualifiedVersionless();
}

View File

@ -196,7 +196,7 @@ public class ResourceProviderR4ValueSetVerCSVerTest extends BaseResourceProvider
ConceptSetComponent include = myLocalVs.getCompose().addInclude();
include.setSystem(theCodeSystemUrl);
include.setVersion(theValueSetVersion);
include.addFilter().setProperty("concept").setOp(FilterOperator.ISA).setValue("ParentA");
include.addFilter().setProperty("concept").setOp(FilterOperator.DESCENDENTOF).setValue("ParentA");
return myLocalVs;
}

View File

@ -208,7 +208,7 @@ public class ResourceProviderR5ValueSetTest extends BaseResourceProviderR5Test {
myLocalVs.setUrl(URL_MY_VALUE_SET);
ConceptSetComponent include = myLocalVs.getCompose().addInclude();
include.setSystem(codeSystem.getUrl());
include.addFilter().setProperty("concept").setOp(Enumerations.FilterOperator.ISA).setValue("ParentA");
include.addFilter().setProperty("concept").setOp(Enumerations.FilterOperator.DESCENDENTOF).setValue("ParentA");
myLocalValueSetId = myValueSetDao.create(myLocalVs, mySrd).getId().toUnqualifiedVersionless();
}

View File

@ -231,7 +231,7 @@ public class ResourceProviderR5ValueSetVersionedTest extends BaseResourceProvide
ConceptSetComponent include = myLocalVs.getCompose().addInclude();
include.setSystem(theCodeSystemUrl);
include.setVersion(theValueSetVersion);
include.addFilter().setProperty("concept").setOp(FilterOperator.ISA).setValue("ParentA");
include.addFilter().setProperty("concept").setOp(FilterOperator.DESCENDENTOF).setValue("ParentA");
return myLocalVs;
}

View File

@ -26,6 +26,9 @@ public abstract class BaseChannelSettings implements IChannelSettings {
private ChannelRetryConfiguration myRetryConfigurationParameters;
// init true to match previous behaviour
private boolean myUseJacksonMessageConverter = true;
/**
* Default true. Used by IChannelNamer to decide how to qualify the channel name.
*/