From 43e28da0c58137f24ac9b54a119a4c6bacc3c6d4 Mon Sep 17 00:00:00 2001 From: dotasek Date: Mon, 7 Oct 2024 09:23:30 -0400 Subject: [PATCH] Bump org.hl7.fhir.core to 6.3.25 (#6293) * org.hl7.fhir.core bump 6.3.25 * Add setting for UnknownCodeSystemsCauseErrors + fix tests * Spotless * Don't expose unknownCodeSystemsCausesErrors for now. Use a constant. --- .../uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java | 6 +++--- .../hapi/validation/validator/FhirInstanceValidator.java | 1 + .../common/hapi/validation/validator/ValidatorWrapper.java | 3 +++ pom.xml | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java index 3de4d680d9d2..65eb5737e2b0 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java @@ -228,7 +228,7 @@ public void testValidateCodeInEnumeratedValueSetWithUnknownCodeSystem_Warning() encoded = encode(oo); ourLog.info(encoded); assertThat(oo.getIssue()).hasSize(1); - assertEquals("CodeSystem is unknown and can't be validated: http://cs for 'http://cs#code1' (error because this is a required binding)", oo.getIssueFirstRep().getDiagnostics()); + assertEquals("CodeSystem is unknown and can't be validated: http://cs for 'http://cs#code1'", oo.getIssueFirstRep().getDiagnostics()); assertEquals(OperationOutcome.IssueSeverity.WARNING, oo.getIssueFirstRep().getSeverity()); // Invalid code @@ -334,7 +334,7 @@ public void testValidateCodeInNonEnumeratedValueSetWithUnknownCodeSystem_Warning encoded = encode(oo); ourLog.info(encoded); assertThat(oo.getIssue()).hasSize(1); - assertEquals("CodeSystem is unknown and can't be validated: http://cs for 'http://cs#code1' (error because this is a required binding)", oo.getIssueFirstRep().getDiagnostics()); + assertEquals("CodeSystem is unknown and can't be validated: http://cs for 'http://cs#code1'", oo.getIssueFirstRep().getDiagnostics()); assertEquals(OperationOutcome.IssueSeverity.WARNING, oo.getIssueFirstRep().getSeverity()); // Invalid code @@ -343,7 +343,7 @@ public void testValidateCodeInNonEnumeratedValueSetWithUnknownCodeSystem_Warning encoded = encode(oo); ourLog.info(encoded); assertThat(oo.getIssue()).hasSize(1); - assertEquals("CodeSystem is unknown and can't be validated: http://cs for 'http://cs#code99' (error because this is a required binding)", oo.getIssue().get(0).getDiagnostics()); + assertEquals("CodeSystem is unknown and can't be validated: http://cs for 'http://cs#code99'", oo.getIssue().get(0).getDiagnostics()); assertEquals(OperationOutcome.IssueSeverity.WARNING, oo.getIssue().get(0).getSeverity()); } diff --git a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/FhirInstanceValidator.java b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/FhirInstanceValidator.java index 70af4473f18a..33e8844f951d 100644 --- a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/FhirInstanceValidator.java +++ b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/FhirInstanceValidator.java @@ -35,6 +35,7 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IInsta private boolean noBindingMsgSuppressed = false; private volatile VersionSpecificWorkerContextWrapper myWrappedWorkerContext; private boolean errorForUnknownProfiles = true; + private boolean assumeValidRestReferences; private List myExtensionDomains = Collections.emptyList(); private IValidatorResourceFetcher validatorResourceFetcher; diff --git a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/ValidatorWrapper.java b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/ValidatorWrapper.java index c5ed37b55190..ac383cc3ca7e 100644 --- a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/ValidatorWrapper.java +++ b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/ValidatorWrapper.java @@ -47,6 +47,7 @@ class ValidatorWrapper { private boolean myAssumeValidRestReferences; private boolean myNoExtensibleWarnings; private boolean myNoBindingMsgSuppressed; + private Collection myExtensionDomains; private IValidatorResourceFetcher myValidatorResourceFetcher; private IValidationPolicyAdvisor myValidationPolicyAdvisor; @@ -129,6 +130,8 @@ public List validate( v.setResourceIdRule(IdStatus.OPTIONAL); v.setNoTerminologyChecks(myNoTerminologyChecks); v.setErrorForUnknownProfiles(myErrorForUnknownProfiles); + /* setUnknownCodeSystemsCauseErrors interacts with UnknownCodeSystemWarningValidationSupport. Until this interaction is resolved, the value here should remain fixed. */ + v.setUnknownCodeSystemsCauseErrors(true); v.getExtensionDomains().addAll(myExtensionDomains); v.setFetcher(myValidatorResourceFetcher); v.setPolicyAdvisor(myValidationPolicyAdvisor); diff --git a/pom.xml b/pom.xml index 7b79145abe17..8ba126cd114c 100644 --- a/pom.xml +++ b/pom.xml @@ -949,7 +949,7 @@ - 6.3.23 + 6.3.25 2.41.1 -Dfile.encoding=UTF-8 -Xmx2048m