birthDate Must Be YYYY, YYYY-MM, or YYYY-MM-DD
The FHIR date type is ISO-8601 with dashes and variable precision. birthDate must be a year, year-month, or full date. A time component is not allowed on a date element.
FHIR · Error
The error
birthDate must be YYYY, YYYY-MM, or YYYY-MM-DDWhy it happens
Carrying an HL7v2 contiguous-digit date (19800101) into FHIR, adding a time or timezone, or using slashes (01/01/1980).
How to fix it
Format as YYYY-MM-DD with dashes. The HL7v2 value 19800101 becomes 1980-01-01. Do not append a T or a time; a date element holds only date precision.
Example
The snippet below triggers the error:
{
"resourceType": "Patient",
"birthDate": "19800101"
}The corrected version:
{
"resourceType": "Patient",
"birthDate": "1980-01-01"
}Frequently asked questions
What is the difference between a FHIR date and dateTime?
A date is YYYY, YYYY-MM, or YYYY-MM-DD with no time. A dateTime adds a time and timezone (2024-01-15T13:55:00Z). birthDate is a date, so it must not include a time component.
Related
- Open the FHIR Validator
- All validation errors
- resourceType Is Required
- Unknown FHIR R4 Resource Type
- Required Element Is Missing for This Resource
- gender Must Be male, female, other, or unknown
- instant Must Include a Timezone
- Resource id Has an Invalid Format
- subject Must Be a Reference Object, Not a String
- Reference Should Be Type/id, urn:uuid, or an Absolute URL