Skip to content

DateTimes and Offsets

smacadam edited this page Apr 11, 2024 · 1 revision

Background

Proper FHIR guidance says we must include a valueDateTime in addition to the effectiveDateTime field for partial dates​. This topic was discussed 26 January 2024 with the FHIR leadership group.

Problem

valueDateTimes can include an offset, but IJE does not support offsets. This means roundtrip data would lose the offset data​ if its initially defined in the valueDateTimes.

Guidance​

  • When producing dateTime, the library should set the valueDateTime to the most significant degree possible, even if other parts are present. e.g. "2023-11- 12:23" should populate valueDateTime with "2023-11" only, due to unknown day value, even though time value is known. ​
  • Use the _effectiveDateTime fields to create valid fhir datetimes with unspecified offsets. This will address the fact that IJE does not support offsets and we can support roundtrip translation from IJE to FHIR without misrepresenting time​
  • Jurisdictions are instructed to use local time in their data​
  • If both birthDate and _birthDate are provided, but are inconsistent, where should the library pull the date parts from?​
    • The library should pull the date parts from the extension _birthDate​
  • Preference of _birthDate over birthDate should be specified in the IG so the community is aware of how this would be handled​
  • The IG should also specify that these values _birthDate and birthDate should always be in sync​
  • The IG can include the fhir date time format in an example for clarity

Example of what the fhir data will look like when it includes both the value date time and effective date time.

"birthDate": "2004-08", ​
"_birthDate": {​
  "extension": [​
  {​
  "extension": [​
    {​
    "url": "http://hl7.org/fhir/us/vrdr/StructureDefinition/Date-Day",​
    "valueUnsignedInt": unknown​
    },​
    {​
    "url": "http://hl7.org/fhir/us/vrdr/StructureDefinition/Date-Year",​
    "valueUnsignedInt": 2004​
    },​
    {​
    "url": "http://hl7.org/fhir/us/vrdr/StructureDefinition/Date-Month",​
    "valueUnsignedInt": 08​
    },​
    {​
    "url": "http://hl7.org/fhir/us/vrdr/StructureDefinition/Date-Hour",​
    "valueUnsignedInt": 11​
    },​
    {​
    "url": "http://hl7.org/fhir/us/vrdr/StructureDefinition/Date-Minutes",​
    "valueUnsignedInt": 11​
    }​
  ],​
  "url": "http://hl7.org/fhir/us/vrdr/StructureDefinition/PartialDate"​
  }​
  ]​
}
Clone this wiki locally