Skip to content

Suppress validation issues

Some validation issues are known and not relevant for your use case (e.g. a warning caused by the implementation guide itself). This guide shows how to remove them from the validation results. Suppressed issues are configured per implementation guide, with an optional version.

Choose the implementation guide

The suppressed issues are listed under the package of an implementation guide, which can be given with or without a version:

  • name#version (e.g. hl7.fhir.r4.core#4.0.1): the issues are suppressed only when this version of the guide is used;
  • name (e.g. ch.fhir.ig.ch-elm): the issues are suppressed whatever the version of the guide, so the configuration doesn't have to be changed when a new version of the guide is installed.

Both can be used for the same guide: the issues listed under the name and those listed under the name with the version of the guide are all suppressed.

matchbox:
  fhir:
    context:
      suppressWarnInfo:
        ch.fhir.ig.ch-elm:          # all the versions of CH ELM
          - "regex:Binding for path (.+) has no source, so can't be checked"
        ch.fhir.ig.ch-elm#1.4.0:    # only version 1.4.0
          - "Constraint failed: dom-6:"

The issues of a guide are suppressed in every validation that uses it, also as a dependency: the issues listed under hl7.fhir.r4.core#4.0.1 are suppressed in all the validations against R4 guides. With onlyOneEngine, all the issues of the configuration are suppressed, whatever the guide. If the $validate request gives its own suppressed issues (parameters suppressWarnInfos and suppressErrors), the configuration is not used for that validation.

Suppress warnings and information messages

List the messages in matchbox.fhir.context.suppressWarnInfo:

  • to match an exact substring of the message, add the text;
  • to match a regular expression, add the prefix regex:.
matchbox:
  fhir:
    context:
      suppressWarnInfo:
        hl7.fhir.r4.core#4.0.1:
          - "Constraint failed: dom-6:"
          - "regex:Entry '(.+)' isn't reachable by traversing forwards from the Composition"
        ch.fhir.ig.ch-elm:
          - "regex:Binding for path (.+) has no source, so can't be checked"
          - "regex:None of the codings provided are in the value set 'Observation Interpretation Codes'(.*)"

Suppress errors

Errors are matched by their message id, not by their text. Find the message id of the error in the list of message ids and list it in matchbox.fhir.context.suppressError. To limit the suppression to some paths of the resource, add a regular expression for the path after @^: messageId@^regex.

For example, errors about unknown extensions look like this:

Bundle.entry[17].resource/Patient/e5ZHnklVuYuT85PnDVOepOg3/.extension[6].url:
URL value 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-sex' does not resolve

The following configuration suppresses them for all extensions, and suppresses another error for RelatedPerson only:

matchbox:
  fhir:
    context:
      suppressError:
        hl7.fhir.r4.core#4.0.1:
          - "Extension_EXTP_Context_Wrong@^RelatedPerson"
          - "Type_Specific_Checks_DT_URL_Resolve@^.*extension.*url"

Accept unknown extensions

To accept extensions from some domains only, instead of suppressing the errors, set matchbox.fhir.context.extensions to a comma-separated list of URL patterns (the default any accepts all extensions).