Every FHIR query begins with a resource type — the noun that tells the server what kind of data you want. Resource types are not just naming conventions; they are formal definitions in the FHIR R4 specification that enumerate exactly which search parameters are valid for each type. FHIR Query Validator uses these definitions as the source of truth: if a parameter is not defined for the resource type in your query, the validator reports an error. Understanding how resource types work — and why they differ — helps you write queries that pass validation on the first attempt.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.
What FHIR resource types are
A FHIR resource type is a structured data object with a defined schema, a set of valid search parameters, and a role in the clinical or administrative domain. The FHIR R4 specification defines over 140 resource types, ranging from foundational clinical types likePatient and Observation to administrative types like Organization and infrastructure types like CapabilityStatement.
Each resource type has:
- A fixed set of search parameters (e.g.,
family,birthdateforPatient) - A search parameter type for each parameter (string, date, token, reference, quantity, or URI), which determines valid value formats
- An optional set of allowed modifiers per parameter
- A set of allowed prefixes for date and quantity parameters
family is valid for Patient but not for Observation. code is valid for Observation but not for Patient. This is why the resource type is the first thing FHIR Query Validator checks.
Categories of FHIR resource types
FHIR resource types fall into three broad categories. The distinction matters for understanding which types appear in typical healthcare data pipelines and which search parameters each category tends to define.- Clinical resources
- Administrative resources
- Infrastructure resources
Clinical resources represent patient health data — the core content of a medical record. These are the most commonly queried resource types in healthcare applications.
| Resource type | Description |
|---|---|
Patient | Demographics, identifiers, and contact information for a person receiving care |
Observation | Measurements and simple assertions (vital signs, lab results, survey answers) |
Condition | Clinical conditions, diagnoses, and problems recorded for a patient |
MedicationRequest | Prescriptions and medication orders for a patient |
Procedure | Actions performed on or for a patient (surgeries, therapies, other interventions) |
AllergyIntolerance | Recorded allergies and adverse reaction risks |
DiagnosticReport | Reports from diagnostic services, including lab panels and imaging |
Immunization | Administration of a vaccine or other immunizing agent |
CarePlan | Descriptions of planned activities for a patient, often multi-disciplinary |
How resource types affect search parameter validity
The FHIR R4 specification defines search parameters per resource type. FHIR Query Validator loads these definitions to determine which parameters are valid in a query.resource_type_check.py
Some search parameters are defined across all resource types. The
_id, _lastUpdated, _tag, _profile, and _security control parameters are universal. _count, _sort, _include, and _revinclude are also broadly available. FHIR Query Validator recognizes these as valid for any resource type.Checking supported resource types at runtime
You can inspect which resource types the validator knows about using thesupported_resources attribute. This returns a list of resource type name strings.
check_supported.py
Checking supported search parameters at runtime
Thesupported_search_parameters attribute returns a dictionary mapping each resource type name to its list of valid search parameter names.
check_params.py
Key resource types and their search parameters
The following table covers the FHIR resource types most commonly used in clinical and analytics applications. Each row lists the most frequently used search parameters.| Resource type | Category | Key search parameters |
|---|---|---|
Patient | Clinical | family, given, birthdate, gender, identifier, address-city, address-postalcode, deceased, general-practitioner, organization |
Observation | Clinical | code, patient, subject, category, date, status, value-quantity, component-code, performer |
Condition | Clinical | patient, subject, code, clinical-status, verification-status, category, onset-date, recorded-date, severity |
MedicationRequest | Clinical | patient, subject, medication, status, intent, authoredon, requester, category, encounter |
Encounter | Administrative | patient, subject, status, type, class, date, participant, practitioner, location, reason-code |
DiagnosticReport | Clinical | patient, subject, code, category, status, date, issued, performer, result, encounter |
Procedure | Clinical | patient, subject, code, status, date, performer, encounter, reason-code, category |
AllergyIntolerance | Clinical | patient, code, clinical-status, verification-status, type, category, criticality, onset, recorder |
Immunization | Clinical | patient, status, vaccine-code, date, lot-number, performer, reaction, location |
Organization | Administrative | name, identifier, type, address, address-city, address-state, partof, active, endpoint |
Practitioner | Administrative | name, family, given, identifier, gender, address, address-city, active, telecom |
Location | Administrative | name, identifier, type, address, address-city, address-state, operational-status, organization, partof |
Resource type names are case-sensitive
FHIR resource type names always use PascalCase. The validator checks case exactly.Common capitalization mistakes
Common capitalization mistakes
capitalization.py
Next steps
Supported resources reference
The full list of FHIR R4 resource types and their complete search parameter sets supported by the validator.
FHIR for developers
A broader introduction to FHIR, the REST API model, and FHIR search query anatomy.