Skip to content

Narrative HTML validation ignores some errors #3100

Open

Description

Describe the bug
The HTML validation of a resource narrative can ignore errors that should be raised.

If the narrative contains html errors that should be ignored the validation function exits without completing the rest of the validation which may find additional errors that shouldn't be ignored.

FHIR Version?
Core

Data provider?
N/A

To Reproduce
Steps to reproduce the behavior:

  1. Create a FHIR resource (i.e. Patient) with a text narrative containing html errors that can be ignored by the narrative html validator as well as html errors that cannot be ignored:
{
  "resourceType": "Patient",
  "id": "example",
  "text": {
    "status": "generated",
    "div": "<div><!-- Comment ended with a dash. This error should be ignored --->\"><not_valid_tag>This tag should return validation error</not_valid_tag></div>"
  },
  "name": [
    {
      "family": "Windsor",
      "given": [
        "Peter",
        "James"
      ]
    }
  ]
}
  1. Create the resource POST {{fhirurl}}/Patient
    

Expected behavior
400 Bad Request response for "Illegal element name 'NOT_VALID_TAG'."

Actual behavior
201 Created response

AB#101209

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    BugBug bug bug.SpecificationAn issue referring or related to the FHIR Specification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions