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.
FHIRQueryValidator can be configured at instantiation time to control validation strictness, target a specific FHIR version, and extend the built-in resource registry with custom resource types and search parameters.
Default configuration
With no arguments, the validator targets FHIR R4 and runs in strict mode — any unknown parameter name is treated as an error:Constructor parameters
The FHIR version to validate against. Currently
"R4" is supported. Set this explicitly if you need version-specific validation behavior.When
True, unknown search parameters are reported as errors and result.is_valid is False. When False, unknown parameters produce warnings instead, and the query is still considered valid. Use False during development or when working with FHIR server extensions.A dictionary of custom resource type definitions to add to the validator’s registry. Useful when working with FHIR profiles, implementation guides, or proprietary extensions. Keys are resource type names; values are lists of valid search parameter names.
A dictionary of additional search parameters to add to existing resource types. Keys are resource type names; values are lists of additional parameter names to allow.
Strict mode vs. non-strict mode
In strict mode (the default), unknown parameters are errors:Custom resource types
If you work with FHIR implementation guides that define custom resource types (e.g., US Core profiles or custom extensions), add them viacustom_resources:
Custom search parameters on existing resources
To add custom search parameters to standard FHIR resources without replacing the built-in definitions, usecustom_parameters:
Combining custom resources and parameters
Creating multiple validator instances
You can maintain separate validator instances for different contexts — for example, one strict validator for production queries and one permissive validator for exploratory development:Validator instances are stateless with respect to individual queries — you can safely reuse the same instance across many
validate_query() and validate_batch() calls. Creating a new instance resets all custom configuration.