Stream: implementers
Topic: DateTime precision
Nick George (Oct 19 2020 at 16:11):
Hello - I was looking at the regex for some datatypes, and noticed that the significant figures for fractional seconds for datetime (and similar) are essentially unbounded: /\.[0-9]+/
Then there is the caveat that the regexs are informative rather than authoritative... is there any authoritative position on fractional seconds?
Jenni Syed (Oct 20 2020 at 00:02):
May want to see this caveat too "Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored at receiver discretion."
Jenni Syed (Oct 20 2020 at 00:03):
From http://hl7.org/fhir/datatypes.html#dateTime to make sure we're talking about the same thing
Jenni Syed (Oct 20 2020 at 00:03):
I didn't actually realize that fractional seconds were supported, given that seconds themselves were ignorable
Jenni Syed (Oct 20 2020 at 00:09):
but I believe it's inherited from the xs:dateTime requirements, which also has unbounded fractional seconds
Grahame Grieve (Oct 20 2020 at 04:04):
I think that the reference implementations only support nanoseconds, but I haven't actually checked e.g. the validator past that point
Morten Ernebjerg (Jun 08 2021 at 10:11):
Just came across this thread after actually misinterpreting the spec to say that the second precision is limited :grimacing:. I read the DateTime documentation which says
The format is YYYY, YYYY-MM, YYYY-MM-DD or YYYY-MM-DDThh:mm:ss+zz:zz (...)
In such format strings, I would interpret each character as standing for exactly one character/number and I read the sentence as giving a complete list of allowed formats - in which case it looks like only whole seconds are allowed. I actually deliberate ignored the RegExps due to the warning @Nick George pointed out above. Might it be worth updating the documentation text to make this clearer (I'd be happy to open a ticket but just wanted to rule out that I'm grossly misreading smt.).
Lloyd McKenzie (Jun 08 2021 at 13:38):
Ticket sounds like a good idea. Please submit one @Morten Ernebjerg :)
Morten Ernebjerg (Jun 09 2021 at 06:12):
Ticket FHIR-32883
Last updated: Apr 12 2022 at 19:14 UTC