Closed mbarton closed 3 months ago
I think the issue is with the bmiSDSData
returned from getDomainsAndData
:
For the 3.33 SDS line (the rightmost tallest one in the screenshot) the values ramp up quickly and then end up null
:
Ah I see those are the actual values from the reference set:
I think I will need @eatyourpeas input here on how that reference was calculated. There's also https://github.com/rcpch/digital-growth-charts-server/issues/217 raised already for the nulls
These values were calculated from our chart-coordinates endpoint and are possibly correct because of the way the maths works at higher values. The BMI curves in trisomy I find much less useful clinically for this reason. @statist7 would better be able to comment whether this is an actual error or whether this is more an issue for rendering where we simply apply an arbitrary upper limit to the visible value of y.
For particular configurations of L, M, S and z, BMI heads off to infinity. The relevant formula is Centile = M(1+LSz)^(1/L)
so if 1+LSz = 0
then there is a problem.
This happens when L is negative (which it nearly always is with BMI) and z is sufficiently large and positive. As @eatyourpeas says, perhaps test for and trap large BMI values.
Porting across https://github.com/rcpch/digital-growth-charts-server/issues/220 to this repo as it seems to be an issue with the chart rendering rather than the data returned from the API.
Storybook story to reproduce in the mbarton/trisomy21-bmi-rendering-issue branch: https://github.com/rcpch/digital-growth-charts-react-component-library/commit/6aa9181e7cc89c668191100086b0fc94aafd068c