Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dhanyasukumaran1/fhir_query_validator/llms.txt

Use this file to discover all available pages before exploring further.

FHIR Query Validator is a Python tool that validates FHIR REST API queries against the HL7 FHIR R4 specification. Whether you’re building a healthcare application, running analytics on FHIR data, or exploring FHIR search capabilities in a Jupyter notebook, this tool helps you catch query errors early — before they cause silent failures or unexpected results in production.

Quickstart

Validate your first FHIR query in under 5 minutes with a working Python example.

Installation

Install FHIR Query Validator and set up your Python environment.

Core Concepts

Understand FHIR resources, search parameters, and how validation works.

Usage Guide

Learn to validate single queries, batch queries, and handle validation results.

What it validates

FHIR Query Validator checks your queries against the HL7 FHIR R4 specification, covering the most common sources of query errors:

Resource types

Verify that resource types like Patient, Observation, and Encounter are spelled correctly and supported.

Search parameters

Validate that search parameters match the FHIR spec for each resource type.

Query syntax

Catch malformed query strings, missing required fields, and invalid value formats.

Error reporting

Get detailed, actionable error messages that tell you exactly what’s wrong and how to fix it.

Get started

1

Install the package

Install FHIR Query Validator using pip:
pip install fhir-query-validator
2

Validate your first query

Import the validator and check a FHIR query string:
from fhir_query_validator import FHIRQueryValidator

validator = FHIRQueryValidator()
result = validator.validate_query("Patient?family=Smith&birthdate=1990-01-01")

if result.is_valid:
    print("Query is valid")
else:
    for error in result.errors:
        print(f"Error: {error}")
3

Explore advanced features

Use batch validation, custom configuration, and detailed error inspection to integrate the validator into your workflow. See the Usage Guide for more.
FHIR Query Validator targets the HL7 FHIR R4 specification. See the supported resources reference for the full list of validated resource types and search parameters.

Build docs developers (and LLMs) love