XSD HL7 International · 4.0.1

HL7 FHIR R4

FHIR R4 resources in XML

Any FHIR R4 resource in its XML form: Patient, Observation, Bundle and the other 140-odd resource types.

About

FHIR is the HL7 standard for exchanging healthcare data through APIs. Most servers speak JSON, but every resource also has an XML form, defined by these schemas. R4 (4.0.1) is the release most national profiles and certified systems are built on.

The main schema includes one schema per resource type, so a document is checked against whichever resource its root element names.

Good to know

  • The schemas check structure and data types only. FHIR invariants (FHIRPath constraints), terminology bindings and profiles (US Core, IPS and so on) need a FHIR validator and are not checked here.
  • The schema package also ships Schematron files; they are not run here.
  • The example is the Patient example from the FHIR R4 specification.

Files

150 files · 2.9 MB

The validator loads all of these with their folder structure, so includes and imports resolve as published.

Example document

patient-example.xml · 3.8 KB · valid against this schema

In CI and from code

The same schema by its name, fhir-r4, through the API.

npx @xmlvalid/cli validate "**/*.xml" --schema fhir-r4
- uses: xmlvalid/validate-action@v1
  with:
    files: "**/*.xml"
    schema: fhir-r4
    api-key: ${{ secrets.XMLVALID_API_KEY }}
curl https://xmlvalid.com/api/v1/validations \
  -H "Authorization: Bearer $XMLVALID_API_KEY" \
  -F document={{ $schema->example ?? 'document.xml' }} -F schema=fhir-r4

Free accounts get 100 API validations a month. On Pro, a URL monitor can check a published document against this schema every hour and email you when it breaks. More CI setups