Details
-
Change Request
-
Resolution: Unresolved
-
Medium
-
Clinical Quality Language (FHIR)
-
1.5 [deprecated]
-
Clinical Decision Support
-
Developers Guide
Description
The "CumulativeDuration" function provided in the documentation does not work correctly and returns an unexpected result [object Object]0. The function is defined as follows:
/* @author: Ludwig van Beethoven @description: Determines the cumulative duration of a list of intervals @comment: This function collapses the input intervals prior to determining the cumulative duration to ensure overlapping intervals do not contribute multiple times to the result */ define function "CumulativeDuration"(Intervals List<Interval<DateTime>>): Sum((collapse Intervals) X return all duration in days of X)
However, the following alternative function definition produces the correct result:
define function "CumulativeDuration"(Intervals List<Interval<DateTime>>): Sum((collapse Intervals) I return (difference in days between start of I and end of I) + 1)
Please investigate and update the documentation to provide the correct "CumulativeDuration" function definition to prevent future confusion and ensure accurate results for users.
For example:
Test Results: