Details
-
Change Request
-
Resolution: Not Persuasive with Modification
-
Highest
-
FHIR Core (FHIR)
-
R4
-
Modeling & Methodology
-
Datatypes
-
2.24.0.1
-
-
Abdul-Malik Shakir / Grahame Grieve : 5-0-0
-
Correction
-
Non-compatible
-
R5
Description
This dateTime does not pass XML Schema validation (fhir-all.xsd):
<date value="2021-11-21+01:00"/>
This is because of the timezone part that is only accepted when at least an hour is present. Reading the spec it incorrectly says date SHALL not have timezone, and it does not say that for dateTime. Nonetheless this rule that violates common understanding of what a date/dateTime is, is enforced on dateTime as well
A date with timezone is a valid date coming from current-date(), and xs:date. To fix, all that is required is to remove the additional pattern specification in the schema:
<xs:simpleType name="date-primitive"> <xs:restriction> <xs:simpleType> <xs:union memberTypes="xs:gYear xs:gYearMonth xs:date"/> </xs:simpleType> <!--<xs:pattern value="([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1]))?)?"/>--> </xs:restriction> </xs:simpleType> <!-- .. --> <xs:simpleType name="dateTime-primitive"> <xs:restriction> <xs:simpleType> <xs:union memberTypes="xs:gYear xs:gYearMonth xs:date xs:dateTime"/> </xs:simpleType> <!--<xs:pattern value="([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?"/>--> </xs:restriction> </xs:simpleType>
By not allowing timezone on date, FHIR makes simple things harder. My code `current-date()` now needs extending into `substring(string(current-date()), 1, 10)` in many places.
Attachments
Issue Links
- relates to
-
FHIR-38006 Dissambiguate timezone and timezone offset.
- Published