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-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/JpaPatientEverythingTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/JpaPatientEverythingTest.java index c825c88229b9..7746ad1defea 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/JpaPatientEverythingTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/JpaPatientEverythingTest.java @@ -696,7 +696,7 @@ public void patientEverything_shouldReturnConsent_whenConsentRefersToPatientAsAc Reference referenceToPatient = createPatient(); Consent consent = new Consent(); - Consent.provisionComponent provisionComponent = new Consent.provisionComponent(); + Consent.ProvisionComponent provisionComponent = new Consent.ProvisionComponent(); Consent.provisionActorComponent actorComponent = new Consent.provisionActorComponent(); actorComponent.setReference(referenceToPatient); provisionComponent.setActor(List.of(actorComponent)); diff --git a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/test/BaseJpaR4Test.java b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/test/BaseJpaR4Test.java index 2fb5a9b87f63..74a94d7b43b3 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/test/BaseJpaR4Test.java +++ b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/test/BaseJpaR4Test.java @@ -1065,5 +1065,16 @@ public ContainedReferenceValidationPolicy policyForContained(IResourceValidator String url) { return ContainedReferenceValidationPolicy.CHECK_VALID; } + + + @Override + public boolean isSuppressMessageId(String path, String messageId) { + return false; + } + + @Override + public ReferenceValidationPolicy getReferencePolicy() { + return ReferenceValidationPolicy.IGNORE; + } } } diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/validation/ValidatorPolicyAdvisor.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/validation/ValidatorPolicyAdvisor.java index 166f3a50383b..7c6f7204e7a9 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/validation/ValidatorPolicyAdvisor.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/validation/ValidatorPolicyAdvisor.java @@ -117,4 +117,14 @@ public List getImpliedProfilesForResource( List messages) { return Arrays.asList(); } + + @Override + public boolean isSuppressMessageId(String path, String messageId) { + return false; + } + + @Override + public ReferenceValidationPolicy getReferencePolicy() { + return ReferenceValidationPolicy.IGNORE; + } } diff --git a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/FhirDefaultPolicyAdvisor.java b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/FhirDefaultPolicyAdvisor.java index c9d01882e4a4..83e97cf95724 100644 --- a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/FhirDefaultPolicyAdvisor.java +++ b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/FhirDefaultPolicyAdvisor.java @@ -85,4 +85,14 @@ public List getImpliedProfilesForResource( List messages) { return Arrays.asList(); } + + @Override + public boolean isSuppressMessageId(String path, String messageId) { + return false; + } + + @Override + public ReferenceValidationPolicy getReferencePolicy() { + return ReferenceValidationPolicy.IGNORE; + } } 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..67942dde1f7c 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 @@ -129,6 +129,9 @@ 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/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/FhirInstanceValidatorDstu3Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/FhirInstanceValidatorDstu3Test.java index d04e90d2d7a8..b32c5f522b5d 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/FhirInstanceValidatorDstu3Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/FhirInstanceValidatorDstu3Test.java @@ -700,10 +700,14 @@ else if (t.getMessage().contains("side is inherently a collection") && t.getMess } else if (t.getMessage().equals("The nominated WG 'rcrim' is unknown")) { //The rcrim workgroup is now brr http://www.hl7.org/Special/committees/rcrim/index.cfm return false; + } else if (t.getMessage().contains("which is experimental, but this structure is not labeled as experimental") + //DSTU3 resources will not pass validation with this new business rule (2024-09-17) https://github.com/hapifhir/org.hl7.fhir.core/commit/7d05d38509895ddf8614b35ffb51b1f5363f394c + ) { + return false; } else if (t.getSeverity() == ResultSeverityEnum.WARNING - && ( t.getMessageId().equals("VALIDATION_HL7_PUBLISHER_MISMATCH") - || t.getMessageId().equals("VALIDATION_HL7_PUBLISHER_MISMATCH2") - || t.getMessageId().equals("VALIDATION_HL7_WG_URL") + && ( "VALIDATION_HL7_PUBLISHER_MISMATCH".equals(t.getMessageId()) + || "VALIDATION_HL7_PUBLISHER_MISMATCH2".equals(t.getMessageId()) + || "VALIDATION_HL7_WG_URL".equals(t.getMessageId()) )) { // Workgroups have been updated and have slightly different naming conventions and URLs. return false; diff --git a/pom.xml b/pom.xml index e422d75986a1..e39438198eac 100644 --- a/pom.xml +++ b/pom.xml @@ -938,7 +938,7 @@ - 6.3.23 + 6.4.0 2.41.1 -Dfile.encoding=UTF-8 -Xmx2048m