Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FI-3565: Bump core validator to 6.5.0 #80

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repositories {
}

dependencies {
implementation("ca.uhn.hapi.fhir", "org.hl7.fhir.validation", "6.4.0")
implementation("ca.uhn.hapi.fhir", "org.hl7.fhir.validation", "6.5.0")

// validator dependency needed for terminology (why can't it get this automatically?)
implementation("com.squareup.okhttp3", "okhttp", "4.12.0")
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/org/mitre/inferno/Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent;
import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.utils.validation.constants.ReferenceValidationPolicy;
import org.hl7.fhir.utilities.FhirPublication;
import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
Expand All @@ -35,6 +36,8 @@
import org.hl7.fhir.validation.BaseValidator.ValidationControl;
import org.hl7.fhir.validation.ValidationEngine;
import org.hl7.fhir.validation.ValidationEngine.ValidationEngineBuilder;
import org.hl7.fhir.validation.cli.services.DisabledValidationPolicyAdvisor;
import org.hl7.fhir.validation.instance.advisor.BasePolicyAdvisorForFullValidation;
import org.mitre.inferno.rest.IgResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -85,7 +88,7 @@ public Validator(String igDir, boolean displayIssuesAreWarnings) throws Exceptio
// The two lines below turn off URL resolution checking in the validator.
// This eliminates the need to silence these errors elsewhere in Inferno
// And also keeps contained resources from failing validation based solely on URL errors
ValidationControl vc = new BaseValidator(hl7Validator.getContext(), null, false)
ValidationControl vc = new BaseValidator(hl7Validator.getContext(), null, false, null)
.new ValidationControl(false, IssueSeverity.INFORMATION);
hl7Validator.getValidationControl().put("Type_Specific_Checks_DT_URL_Resolve", vc);

Expand Down Expand Up @@ -113,6 +116,10 @@ public Validator(String igDir, boolean displayIssuesAreWarnings) throws Exceptio
hl7Validator.setDoNative(false);
hl7Validator.setAnyExtensionsAllowed(true);
hl7Validator.setDisplayWarnings(displayIssuesAreWarnings);
DisabledValidationPolicyAdvisor policyAdvisor = new DisabledValidationPolicyAdvisor();
policyAdvisor.setPolicyAdvisor(
new BasePolicyAdvisorForFullValidation(ReferenceValidationPolicy.CHECK_TYPE_IF_EXISTS));
hl7Validator.setPolicyAdvisor(policyAdvisor);
hl7Validator.prepare();

packageManager = new FilesystemPackageCacheManager.Builder().build();
Expand Down
Loading