This section describes how PKB processes Time Stamp (TS) values in HL7 messages.

Accuracy

PKB supports time components up to and including millisecond accuracy. The time component representing ten-thousandths of a second may be provided, but will be ignored. Note that the ten-thousandths component will be truncated; the remaining time components will not be rounded.

HL7 permits a TS value to be of varying accuracy. For example, it is syntactically valid to provide just the date component (e.g. 20160701) or to provide both the date and time components (e.g. 20160701130506).

If no information has been provided then the value will be treated as absent. If at least the year has been provided then defaults will be applied to any omitted components. Omitted date components will be defaulted to one, omitted time components will be defaulted to zero. However, incomplete components will return an error. For example, it is not permitted to provide a one-digit hour value.

PKB does not store the original accuracy in which a TS value was provided. So a value that had a component defaulted to zero is currently indistinguishable from one that explicitly provided zero.

The table below provides a few illustrative examples.

Provided Value

Interpreted As

2016

20160101000000.000

201602

20160201000000.000

20160203

20160203000000.000

20160203111213

20160203111213.000

20160203111213.987

20160203111213.987

20160203111213.9876

20160203111213.987

2016020311121

ERROR

Time zones and offsets

TS values are treated by PKB as communicating an absolute point in time. We interpret the value you provide as being a fixed point in time, and persist that fixed point in time to the database. As such, every TS value is interpreted within a time zone (or having an offset from UTC). The time zone we use is determined according to the following hierarchy:

The benefit of storing TS values as absolute points in time is that they can subsequently be localised to the viewer's time zone. For example, when viewing an appointment in the web interface, the time will be localised to the time zone currently selected by the viewer.

PKB does not store the original time zone/offset in which a TS value is provided. As such, it is not possible to request to see a TS value in the original localisation. Please get in touch if this is a feature you think would be helpful.

Date and time of birth

PID-7 is the HL7 location for providing the date and time of birth of a patient. It is a little unusual, so we've given it a section of its own here.

Since PID-7 is a TS value, it is capable of representing an explicit point in time. This point in time is the patient's time of birth, but PKB does not store this value. There is no "time of birth" attribute on a [[Patient]].

However, PKB does capture a "date of birth". A patient's date of birth is the name of the date on which the patient was born according to the time zone in which they were born. Counter-intuitively, knowing the absolute point in time at which a patient is born is not sufficient to deduce their date of birth. By way of example, imagine you know a person is born right now, as you are reading this. You cannot know their birthday unless you also know where they were born (or more accurately, in which time zone they were born) since the name of the date is dependent upon their location relative to the international date line.

In order to handle this, PKB will extract the date component provided in PID-7 and store this as the "date of birth". The "date of birth" value is the literal value that was provided in PID-7, regardless of which time zone/offset would apply to the full PID-7 value, and ignoring any time components (if provided).

PKB customer sites: deploy | developer | information governance | procurement | manual

© Patients Know Best, Ltd. Registered in England and Wales Number: 6517382. VAT Number: GB 944 9739 67.

This API specification and design is licensed under a Creative Commons Attribution 4.0 International License.