diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/ValidateCommand.java b/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/ValidateCommand.java index dce4014b655..b1a97c85a97 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/ValidateCommand.java +++ b/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/ValidateCommand.java @@ -159,7 +159,8 @@ public class ValidateCommand extends BaseCommand { break; } - case DSTU3: { + case DSTU3: + case R4: { FhirInstanceValidator instanceValidator = new FhirInstanceValidator(ctx); val.registerValidatorModule(instanceValidator); ValidationSupportChain validationSupport = new ValidationSupportChain(new DefaultProfileValidationSupport(ctx), new InMemoryTerminologyServerValidationSupport(ctx)); diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/src/test/java/ca/uhn/fhir/cli/ValidateCommandTest.java b/hapi-fhir-cli/hapi-fhir-cli-api/src/test/java/ca/uhn/fhir/cli/ValidateCommandTest.java index 6b10c9f2bf7..3b6be9de8df 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-api/src/test/java/ca/uhn/fhir/cli/ValidateCommandTest.java +++ b/hapi-fhir-cli/hapi-fhir-cli-api/src/test/java/ca/uhn/fhir/cli/ValidateCommandTest.java @@ -12,7 +12,7 @@ public class ValidateCommandTest { } @Test - public void testValidateLocalProfile() { + public void testValidateLocalProfileDstu3() { String resourcePath = ValidateCommandTest.class.getResource("/patient-uslab-example1.xml").getFile(); ourLog.info(resourcePath); @@ -22,4 +22,16 @@ public class ValidateCommandTest { "-p", "-n", resourcePath}); } + + @Test + public void testValidateLocalProfileR4() { + String resourcePath = ValidateCommandTest.class.getResource("/patient-uslab-example1.xml").getFile(); + ourLog.info(resourcePath); + + App.main(new String[] { + "validate", + "-v", "R4", + "-p", + "-n", resourcePath}); + } }