Question: where does IVL_TS.value come from?

Aug 25, 2011

The abstract IVL type has the interval properties "low", "high", "width" and "center". So why does the IVL_TS type (the XML rendition of the abstract, in principle, statement of the IVL data type) have a value element in it - where does that come from? ### Background The IVL type is defined as "A set of consecutive values of an ordered base data type". As such, it has the following properties:

 low   the low limit
 high  the high limit
 width  The difference between high and low boundary
 center  The arithmetic mean of the IVL (low plus high divided by 2)
 lowClosed  Specifies whether low is included in the IVL (is closed) or excluded from the IVL (is open)
 highClosed  Specifies whether high is included in the IVL (is closed) or excluded from the IVL (is open)

The low, high, width and center properties are related to each other, if you know ay two of them, then you know all of them. But you might only know one of them. When this in principle definition is represented in XML in IVL_TS, the format is :

<!-- type IVL -->
<x
   nullFlavor = (...)
   operator = (I | E | A | H | P) : I
   >
   **Content**: ( low, high, center, width )
</x>

Operator relates to some other aspect that we’ll ignore here. low and high carry a “inclusive” attribute for lowClosed and highClosed. So in the XML, an IVL looks like this:

<effectiveTime>
   <low value='200012041000'/>
   <high value='200012041030'/>
</effectiveTime>

 The value attribute

In an instance, this form is also allowed:

<effectiveTime value="20001204"/>

Where did this come from? Well, the data types define the notion of “promotion”. The concept is simple - you can “promote” 2000-12-04 into an interval that includes from the start of the day (midnight) through to the end of the day (every instance up to but not including midnight). So if you converted 2000-12-04 to an interval, it would look like this:

<effectiveTime>
   <low value='200012040000' inclusive="true"/>
   <high value='200012050000' inclusive="false"/>
</effectiveTime>

And since you can do that, why not let that go in the instance? Anyone encountering a simple time value in place of an interval can just automatically expand it into an interval.

The XML definition of the IVL_TS doesn’t mention the value attribute, because it’s sort of not really the IVL_TS type, it’s the TS type being used in it’s place - which is allowed.

However because you have to describe this in schema, the IVL_TS extends SXCM_TS (defined to support the full been mighty and terrifying GTS), and that extends TS. So in the XML R1 data types used in CDA, and IVL_TS extends TS, and you can put either a proper interval, or just a value.