Note: Refer to the article Dates and times in CDA for an overview of the subject and links to other relevant CDA PRO Know articles and CDA PRO Learn sessions.

There are many contexts in which an XML sub-element is added to “something” in CDA in order to capture the time interval when that “something” took place, or is relevant.

Usually, an XML element in CDA that represents a time interval is named effectiveTime – but it can also be named time or something else.

Time Interval Format
The XML element that represents a time interval has sub-elements named low, high, center, and/or width. Various combinations of these sub-elements (but not all combinations) are allowed.

The most common combination of sub-elements is low and high. Here is an example of a time interval (August 22nd 2013 from 6pm to 7pm) represented in an XML element named effectiveTime:

<effectiveTime xsi:type="IVL_TS">
   <low value="20130822180000"/>
   <high value="20130822190000"/>
</effectiveTime>

Always Extend to “Seconds” Resolution
For reasons explained in the article A very common mistake with date ranges, you should always extend date range endpoints to seconds resolution.

The inclusive attribute
An optional attribute named inclusive in the low or high XML sub-elements can be added and set to “false” (it defaults to “true”) to exclude the endpoint time (in the example above: excluding exactly 6pm and/or exactly 7pm).

Using nullFlavor with Time Intervals
The nullFlavor attribute (refer to the article The nullFlavor attribute) can be used to indicate that one of the endpoints of a time interval is not available – and why it is not available.
Shown below are two examples of how nullFlavor can be used in expressing a time interval:

<!-- From 1985 until the present time -->
<effectiveTime xsi:type="IVL_TS">
   <low value="19850101000000"/>
   <high nullFlavor="NI"/>
</effectiveTime>


<!-- From an unknown starting date until Jan 15, 2012 -->
<effectiveTime xsi:type="IVL_TS">
   <low nullFlavor="UNK"/>
   <high value="20120115235959"/>
</effectiveTime>



Note that leaving a sub-element off entirely is the equivalent of including the nullFlavor attribute and setting it to the value “NI” for “no information”. So, the first example could have just left off the high sub-element altogether.

Other CDA PRO Know Articles Referenced In This Article