Improve/clarify how duration magnitude() is calculated with the average durations for years and months
Description
Activity

Pablo Pazos January 28, 2022 at 2:23 PM
Exactly! This is to improve inter-spec navigability, no changes to the spec per se.

Pieter Bos January 28, 2022 at 10:59 AM(edited)
Shouldn’t be any discussion: the specification is already fully there. This is only a clarification of the existing specification, consisting of one (perhaps two) link(s) from an existing text to a referenced specification, plus one added formula to clarify the text that is already there. No any other changes. This is only because three different implementers got their implementation wrong here.
Ian McNicoll January 28, 2022 at 10:36 AM
Thx both - as long as there is 'prior art' we can draw on and we don't need to get into a long complex discussion!!

Pieter Bos January 28, 2022 at 10:14 AM
It is a relatively minor issue, but three separate implementations got this wrong based on the spec, in different ways. This is necessary to ensure among other things, AQL is handled the same by different vendors.
The fix is also small and should not impact readability of the spec.

Pablo Pazos January 27, 2022 at 9:56 PM
this has several implications for data processing and querying, when comparing durations that are not normalized. In those cases the magnitude() method is required. This is not directly related to clinical use but to enabling data processability.
Details
Details
Reporter

Talking with @pieter in Slack: We both missed that [the spec of how the DV_DURATION.magnitude() is calculated], but it's difficult to reach that definition form the current model: - in data types DV_DURATION.magnitude() mentions Iso8601_duration.to_seconds() but you need to open the right spec to find the class because there is no link, if you don't know from memory where that is, it's difficult to find it (it took me a couple of tries to find the class) - then the description of to_seconds() is "Total number of seconds equivalent (including fractional) of entire duration. Where non-definite elements such as year and month (i.e. 'Y' and 'M') are included, the corresponding 'average' durations from Time_definitions are used to compute the result." Which is not clear since it doesn't say how to use the average durations, IMO a formula is needed there.