FHIR R4 validator
Paste a FHIR R4 resource in JSON and see every problem at once: the element path, what is wrong and how to fix it. Free, no account.
Use synthetic data. The resource is checked in memory and is not stored or logged, but there is no reason to paste a real patient's record into any website.
What this validator checks
- Structure: required elements, unknown elements, arrays versus single values, JSON objects versus plain values, and only one element per choice type such as
value[x]. - Formats: FHIR
date,dateTime(a time needs a time zone),instant,decimal,id,uriandcode. - Required value sets:
statuson the resources that have one,Patient.gender, clinical and verification status of Condition and AllergyIntolerance, and AllergyIntolerancetypeandcriticality. - Optional profiles:
eu-lab(laboratory result: category, LOINC code, subject, status, time, value, UCUM unit, reference range) andips-observation(the minimum an observation needs in an International Patient Summary).
It covers the 26 resource types Anpheros stores: AllergyIntolerance, Appointment, Basic, CarePlan, CareTeam, Condition, Consent, DiagnosticReport, DocumentReference, Encounter, EpisodeOfCare, FamilyMemberHistory, Goal, Immunization, MedicationAdministration, MedicationStatement, Observation, Organization, Patient, Practitioner, PractitionerRole, Procedure, Provenance, QuestionnaireResponse, RelatedPerson, ServiceRequest. The structural rules come from the fhir.resources R4B models, which match R4 for these types.
What it does not check
- Whether codes exist in LOINC, SNOMED CT, RxNorm, CVX or ICD-10, or whether their display names match (no terminology server).
- Best-practice recommendations such as a human-readable narrative (
text) or a performer on every Observation. - FHIRPath invariants and implementation guides such as US Core, apart from the two profiles above.
- Whether references point to resources that exist.
- Strict JSON types for primitives: a numeric string such as
"120"is accepted where FHIR expects a number. - XML, Bundles and resource types outside the list above.
For full conformance testing, including terminology and implementation guides, use the official HL7 FHIR validator. This page is for the fast loop while you write code: paste, read the paths, fix, repeat.
Use it from code
The page calls a public endpoint you can call too, limited to 20 requests per minute per IP address and 100 kB per resource:
curl -s -X POST 'https://developers.anpheros.com/tools/fhir-validator/validate?profile=eu-lab' \
-H 'Content-Type: application/fhir+json' \
--data @observation.json
The answer is a FHIR OperationOutcome: one issue per problem, with severity, code, diagnostics and the element path in expression. Inside the platform the same checks run on every write and through POST /fhir/R4/{type}/$validate, which accepts the same profile parameter; see the API reference.
Valid examples to start from
The FHIR R4 JSON examples show a valid resource for each common type next to the mistakes that break it, with the exact error this validator returns.
POST /fhir/R4/Patient and $validate.Related guides
- How to store medical records using FHIR R4Tutorial: create a Patient, a blood-pressure Observation and a Condition, use a transaction, search, update with history and read provenance — every request with curl and the real response, on the free sandbox.
- How to import laboratory results into a FHIR recordTutorial: import a lab report as CSV and as HL7 v2 ORU^R01 into FHIR R4 Observations with LOINC codes and reference ranges, handle unmapped markers and resent reports, and trace each result to its laboratory.
- FHIR platformHL7 FHIR R4 explained and how Anpheros implements it as a managed FHIR database: 26 resource types, search, history, transactions, $everything, the International Patient Summary and the simpler REST view of the same data.