Consistently support negative durations

Description

For DV_DURATION it says in the spec:

"A sign may be used to indicate the duration is backwards in time rather than forwards."

But then it insists on its value being ISO8601 which (in its pure version at least) doesn’t allow negatives.

However, negative durations are supported in various places, e.g. "-P1D" This is what the xml duration is doing as well (base on ISO8601 but allow negative), see https://www.w3.org/TR/xmlschema-2/#duration . Java and I believe .NET as well are doing similar things.

Seems like there is a little inconsistency in the spec and we should fix the spec

  • to indicate ISO8601 plus a ‘deviation for negation, in line with W3C etc etc’;

  • add Heather’s example of a negative adjusted age somewhere in the text to indicate the negation possibility.

Example/Use case from Heather Leslie
There is a clinical situation where you can have a negative ‘adjusted age’ where there is a premature infant, now chronologically 2 months old but born 3 months premature - they are said to have an adjusted, or corrected, age of -1 month. Clinically this is important when related to expected development/behaviour/functional capacity. If they were 3 months premature then you would only worry about their development related to their adjusted age, not their chronological age. By the age of 2 or 3, the difference has usually disappeared and adjusted age becomes less relevant.
So a negative (type of) age, which is clearly not permitted with DV_DURATION, is clinically necessary. And it should be able to be expressed in a combo of weeks, months +/- years.
It makes sense for both the chronological age and adjusted age to use the same data type.

For more details see the related discussion at https://discourse.openehr.org/t/duration-data-type/621

Reporter

Sebastian Garde

Raised By

Sebastian Garde
Thomas Beale

Components

Affects versions

Configure