LinuxForHealth / hl7v2-fhir-converter

Converts HL7 v2 Messages to FHIR Resources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create thread-safe alternative to DATE_TIME; deprecate DATE_TIME

cragun47 opened this issue · comments

Running the converter on servers in different time zones for users also in different time zones presents a problem because the current config.properties is too static and the recently added .withZoneIdText() is not thread safe because it relied on using a static class as a global store.

DATE_TIME will be deprecated in favor of a GeneralUtility that will process an HL7 time according to these rules:

  • If an HL7 DateTime from HL7 has a ZoneId contained in the DateTime, use it.
  • If it has no ZoneId, and the Run Time ZoneIdText (RTZ) is set, use that.
  • If it has no ZoneId, and not RTZ, but there is a config.properties ZoneId, use that.
  • If it has no ZoneId, and not RTZ, and no config.properties ZoneId, use the local timezone (of the server).

DATE_TIME handler will be removed and all uses of DATE_TIME will be converted to the new GeneralUtility dateTimeWithZoneId which takes the HL7 dateTime string and the RTZ, which is in a reserved variable ZONEID.

The config value .withZoneIdText() can be an offset e.g. "+04:00", or one of the official matching cities for ZoneId e.g. "Europe/Paris"

In release 1.0.18