From 68c10155528d7a8b4f147dd1d7bd6403f8766514 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Tue, 1 Mar 2022 05:23:48 -0800 Subject: [PATCH] Bump core to 5.6.36 (#3433) * Bump version * Add changelog, make use of theNoInactive flag * add test * remove magic strings --- .../changelog/6_0_0/3432-funcreplace-fix.yaml | 5 +++ ...ourceDaoR4SearchCustomSearchParamTest.java | 35 +++++++++++++++++++ .../fhir/r5/hapi/ctx/HapiWorkerContext.java | 4 ++- .../VersionSpecificWorkerContextWrapper.java | 2 +- pom.xml | 3 +- 5 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_0_0/3432-funcreplace-fix.yaml diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_0_0/3432-funcreplace-fix.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_0_0/3432-funcreplace-fix.yaml new file mode 100644 index 00000000000..555f9ce2d4c --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_0_0/3432-funcreplace-fix.yaml @@ -0,0 +1,5 @@ +--- +type: fix +issue: 3418 +jira: SMILE-3850 +title: "Updated the FHIR core libs to 5.6.36 to support fix for funcReplace in FHIRPathEngine." diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchCustomSearchParamTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchCustomSearchParamTest.java index 0561da7a1bc..e9d7f434d45 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchCustomSearchParamTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchCustomSearchParamTest.java @@ -7,8 +7,10 @@ import ca.uhn.fhir.interceptor.api.HookParams; import ca.uhn.fhir.interceptor.api.IAnonymousInterceptor; import ca.uhn.fhir.interceptor.api.Pointcut; import ca.uhn.fhir.jpa.api.config.DaoConfig; +import ca.uhn.fhir.jpa.api.model.DaoMethodOutcome; import ca.uhn.fhir.jpa.model.entity.ModelConfig; import ca.uhn.fhir.jpa.model.entity.NormalizedQuantitySearchLevel; +import ca.uhn.fhir.jpa.model.entity.ResourceIndexedSearchParamString; import ca.uhn.fhir.jpa.model.entity.ResourceIndexedSearchParamToken; import ca.uhn.fhir.jpa.model.search.StorageProcessingMessage; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; @@ -201,6 +203,39 @@ public class FhirResourceDaoR4SearchCustomSearchParamTest extends BaseJpaR4Test assertEquals(0, search.size()); } + @Test + public void testReplaceInFhirPathInSearchParameterWorksAsExpected() { + String rawValue = "778-62-8144"; + String strippedValue = "778628144"; + + SearchParameter numberParameter = new SearchParameter(); + numberParameter.setId("stripped-ssn"); + numberParameter.setName("SSN with no dashes"); + numberParameter.setCode("stripped-ssn"); + numberParameter.setDescription("SSN with no dashes"); + numberParameter.setUrl("http://example.com/stripped-ssn"); + numberParameter.setStatus(Enumerations.PublicationStatus.ACTIVE); + numberParameter.addBase("Patient"); + numberParameter.setType(Enumerations.SearchParamType.STRING); + numberParameter.setExpression("Patient.identifier.where(system='http://hl7.org/fhir/sid/us-ssn' and value.matches('.*')).select(value.replace('-',''))"); + mySearchParameterDao.update(numberParameter); + + mySearchParamRegistry.refreshCacheIfNecessary(); + + Patient patient = new Patient(); + patient.setActive(true); + patient.addIdentifier().setSystem("http://hl7.org/fhir/sid/us-ssn").setValue(rawValue); + myPatientDao.create(patient); + + IBundleProvider search; + + search = myPatientDao.search(SearchParameterMap.newSynchronous("stripped-ssn", new StringParam(strippedValue))); + assertEquals(1, search.size()); + + search = myPatientDao.search(SearchParameterMap.newSynchronous("stripped-ssn", new StringParam(rawValue))); + assertEquals(0, search.size()); + } + @Test public void testCreatePhoneticSearchParameterWithOptionalCharacterLength() { String testString = "Richard Smith"; diff --git a/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/ctx/HapiWorkerContext.java b/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/ctx/HapiWorkerContext.java index a2f278f6672..a4f0264ac8e 100644 --- a/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/ctx/HapiWorkerContext.java +++ b/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/ctx/HapiWorkerContext.java @@ -281,8 +281,9 @@ public final class HapiWorkerContext extends I18nBase implements IWorkerContext } @Override - public ValueSetExpander.ValueSetExpansionOutcome expandVS(ConceptSetComponent theInc, boolean theHierarchical) throws TerminologyServiceException { + public ValueSetExpander.ValueSetExpansionOutcome expandVS(ConceptSetComponent theInc, boolean theHierarchical, boolean theNoInactive) throws TerminologyServiceException { ValueSet input = new ValueSet(); + input.getCompose().setInactive(!theNoInactive); //TODO GGG/DO is this valid? input.getCompose().addInclude(theInc); IValidationSupport.ValueSetExpansionOutcome output = myValidationSupport.expandValueSet(new ValidationSupportContext(myValidationSupport), null, input); return new ValueSetExpander.ValueSetExpansionOutcome((ValueSet) output.getValueSet(), output.getError(), null); @@ -443,6 +444,7 @@ public final class HapiWorkerContext extends I18nBase implements IWorkerContext throw new UnsupportedOperationException(Msg.code(230)); } + @Override public String getLinkForUrl(String corePath, String url) { throw new UnsupportedOperationException(Msg.code(231)); diff --git a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapper.java b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapper.java index 93d4cb5794e..cadf799e81a 100644 --- a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapper.java +++ b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapper.java @@ -305,7 +305,7 @@ public class VersionSpecificWorkerContextWrapper extends I18nBase implements IWo } @Override - public ValueSetExpander.ValueSetExpansionOutcome expandVS(org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent inc, boolean heirarchical) throws TerminologyServiceException { + public ValueSetExpander.ValueSetExpansionOutcome expandVS(ValueSet.ConceptSetComponent inc, boolean hierarchical, boolean noInactive) throws TerminologyServiceException { throw new UnsupportedOperationException(Msg.code(664)); } diff --git a/pom.xml b/pom.xml index 692a526eb88..6961e4549ae 100644 --- a/pom.xml +++ b/pom.xml @@ -739,6 +739,7 @@ Google + theGOTOguy Ben Li-Sauerwine @@ -756,7 +757,7 @@ - 5.6.35 + 5.6.36 1.0.3 -Dfile.encoding=UTF-8 -Xmx2048m