hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
1.94k stars 1.3k forks source link

DateAndList datatype doesn't support datetimestamp without milisec with zoneID(2015-02-07T13:28:17+00:00) #6043

Open AjeetYadav07 opened 4 days ago

AjeetYadav07 commented 4 days ago

Sending 2015-02-07T13:28:17+00:00(when not including milisec) for the last_updated parameter in our questionnaire API (using hapi library DateAndList type) might cause hapi to return an error. It seems DateAndList might not expect time zones without milisecond.

{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "processing", "diagnostics": "HAPI-1883: Invalid date/time format: "2015-02-07T13:28:17 00:00": Expected character '.' at index 19 but found " } ] }

Expected behavior it should accept the zone offset without milisecond precision as well.

Screenshots image

Environment (please complete the following information):

rajankapadia commented 3 days ago

As per HL7 FHIR specification given in to below URL "dateTime" data type should support Format : YYYY-MM-DDThh:mm:ss+zz:zz . We had seen current HAPI FHIR implementation is always expecting millsec if we pass +zz:zz ( timezone) component as a input.

https://www.hl7.org/fhir/R4/datatypes.html#dateTime