Class FHIRValidator


  • public class FHIRValidator
    extends Object
    • Method Detail

      • validate

        public List<OperationOutcome.Issue> validate​(Resource resource,
                                                     String... profiles)
                                              throws FHIRValidationException
        Validate a Resource against constraints in the base specification and resource-asserted profile references or specific profile references but not both.

        Resource-asserted profile references that are not available in the FHIRRegistry result in issues with severity WARNING.

        Unknown profile references passed as arguments to this method result in issues with severity ERROR.

        Profiles that are incompatible with the resource type being validated result in issues with severity ERROR.

        Profile references that are passed into this method are only applicable to the outermost resource (not contained resources).

        Parameters:
        resource - a Resource instance (the target of validation)
        profiles - specific profile references to validate the resource against
        Returns:
        a non-null, possibly empty list of issues generated during validation (sorted by severity)
        Throws:
        FHIRValidationException - for errors that occur during validation
      • validate

        public List<OperationOutcome.Issue> validate​(Resource resource,
                                                     boolean includeResourceAssertedProfiles,
                                                     String... profiles)
                                              throws FHIRValidationException
        Validate a Resource against constraints in the base specification and resource-asserted profile references and/or specific profile references.

        Resource-asserted profile references that are not available in the FHIRRegistry result in issues with severity WARNING.

        Unknown profile references passed as arguments to this method result in issues with severity ERROR.

        Profiles that are incompatible with the resource type being validated result in issues with severity ERROR.

        Profile references that are passed into this method are only applicable to the outermost resource (not contained resources).

        Parameters:
        resource - a Resource instance (the target of validation)
        includeResourceAssertedProfiles - whether or not to consider resource-asserted profiles during validation
        profiles - specific profile references to validate the resource against
        Returns:
        a non-null, possibly empty list of issues generated during validation (sorted by severity)
        Throws:
        FHIRValidationException - for errors that occur during validation
      • validate

        public List<OperationOutcome.Issue> validate​(FHIRPathEvaluator.EvaluationContext evaluationContext,
                                                     String... profiles)
                                              throws FHIRValidationException
        Validate a resource, using an FHIRPathEvaluator.EvaluationContext, against constraints in the base specification and resource-asserted profile references or specific profile references but not both.

        Resource-asserted profile references that are not available in the FHIRRegistry result in issues with severity WARNING.

        Unknown profile references passed as arguments to this method result in issues with severity ERROR.

        Profiles that are incompatible with the resource type being validated result in issues with severity ERROR.

        Profile references that are passed into this method are only applicable to the outermost resource (not contained resources).

        Parameters:
        evaluationContext - the FHIRPathEvaluator.EvaluationContext for this validation which includes a FHIRPathTree built from a Resource instance (the target of validation)
        profiles - specific profile references to validate the evaluation context against
        Returns:
        a non-null, possibly empty list of issues generated during validation (sorted by severity)
        Throws:
        FHIRValidationException - for errors that occur during validation
      • validate

        public List<OperationOutcome.Issue> validate​(FHIRPathEvaluator.EvaluationContext evaluationContext,
                                                     boolean includeResourceAssertedProfiles,
                                                     String... profiles)
                                              throws FHIRValidationException
        Validate a resource, using an FHIRPathEvaluator.EvaluationContext, against constraints in the base specification and resource-asserted profile references and/or specific profile references.

        Resource-asserted profile references that are not available in the FHIRRegistry result in issues with severity WARNING.

        Unknown profile references passed as arguments to this method result in issues with severity ERROR.

        Profiles that are incompatible with the resource type being validated result in issues with severity ERROR.

        Profile references that are passed into this method are only applicable to the outermost resource (not contained resources).

        Parameters:
        evaluationContext - the FHIRPathEvaluator.EvaluationContext for this validation which includes a FHIRPathTree built from a Resource instance (the target of validation)
        includeResourceAssertedProfiles - whether or not to consider resource-asserted profiles during validation
        profiles - specific profile references to validate the evaluation context against
        Returns:
        a non-null, possibly empty list of issues generated during validation (sorted by severity)
        Throws:
        FHIRValidationException - for errors that occur during validation