-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trisomy-21-bmi-rendering-issue-fix #96
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6aa9181
Add story for https://github.com/rcpch/digital-growth-charts-server/i…
mbarton 46b7b08
add upperlimit filter for values > 500 in domains of visible data
eatyourpeas bf84648
trap null values of y leading to error in tooltip
eatyourpeas 057f044
bump patch 7.0.8
eatyourpeas 417036f
Merge branch 'live' into mbarton/trisomy-21-bmi-rendering-issue
eatyourpeas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
import type { Measurement } from "../../interfaces/RCPCHMeasurementObject"; | ||
|
||
export const trisomy21HighBMI: Measurement[] = [ | ||
{ | ||
"birth_data": { | ||
"birth_date": "2006-05-08", | ||
"gestation_weeks": 40, | ||
"gestation_days": 0, | ||
"estimated_date_delivery": "2006-05-08", | ||
"estimated_date_delivery_string": "Mon 08 May, 2006", | ||
"sex": "male" | ||
}, | ||
"measurement_dates": { | ||
"observation_date": "2022-11-01", | ||
"chronological_decimal_age": 16.484599589322382, | ||
"corrected_decimal_age": 16.484599589322382, | ||
"chronological_calendar_age": "16 years, 5 months, 3 weeks and 3 days", | ||
"corrected_calendar_age": "16 years, 5 months, 3 weeks and 3 days", | ||
"corrected_gestational_age": { | ||
"corrected_gestation_weeks": null, | ||
"corrected_gestation_days": null | ||
}, | ||
"comments": { | ||
"clinician_corrected_decimal_age_comment": "Born at term. No correction has been made for gestation.", | ||
"lay_corrected_decimal_age_comment": "Your child was born on their due date.", | ||
"clinician_chronological_decimal_age_comment": "Born Term. No correction has been made for gestation.", | ||
"lay_chronological_decimal_age_comment": "Your child was born on their due date." | ||
}, | ||
"corrected_decimal_age_error": null, | ||
"chronological_decimal_age_error": null | ||
}, | ||
"child_observation_value": { | ||
"measurement_method": "bmi", | ||
"observation_value": 36.3, | ||
"observation_value_error": null | ||
}, | ||
"measurement_calculated_values": { | ||
"corrected_sds": 1.9929195642473767, | ||
"corrected_centile": 97.7, | ||
"corrected_centile_band": "This body mass index measurement is on or near the 98th centile.", | ||
"chronological_sds": 1.9929195642473767, | ||
"chronological_centile": 97.7, | ||
"chronological_centile_band": "This body mass index measurement is on or near the 98th centile.", | ||
"corrected_measurement_error": null, | ||
"chronological_measurement_error": null, | ||
"corrected_percentage_median_bmi": 163.3208998549931, | ||
"chronological_percentage_median_bmi": 163.3208998549931 | ||
}, | ||
"plottable_data": { | ||
"centile_data": { | ||
"chronological_decimal_age_data": { | ||
"x": 16.484599589322382, | ||
"y": 36.3, | ||
"b": null, | ||
"centile": 97.7, | ||
"sds": 1.9929195642473767, | ||
"bone_age_label": null, | ||
"events_text": null, | ||
"bone_age_type": null, | ||
"bone_age_sds": null, | ||
"bone_age_centile": null, | ||
"observation_error": null, | ||
"age_type": "chronological_age", | ||
"calendar_age": "16 years, 5 months, 3 weeks and 3 days", | ||
"lay_comment": "Your child was born on their due date.", | ||
"clinician_comment": "Born Term. No correction has been made for gestation.", | ||
"age_error": null, | ||
"centile_band": "This body mass index measurement is on or near the 98th centile.", | ||
"observation_value_error": null | ||
}, | ||
"corrected_decimal_age_data": { | ||
"x": 16.484599589322382, | ||
"y": 36.3, | ||
"b": null, | ||
"centile": 97.7, | ||
"sds": 1.9929195642473767, | ||
"bone_age_label": null, | ||
"events_text": null, | ||
"bone_age_type": null, | ||
"bone_age_sds": null, | ||
"bone_age_centile": null, | ||
"observation_error": null, | ||
"age_type": "corrected_age", | ||
"calendar_age": "16 years, 5 months, 3 weeks and 3 days", | ||
"corrected_gestational_age": "", | ||
"lay_comment": "Your child was born on their due date.", | ||
"clinician_comment": "Born at term. No correction has been made for gestation.", | ||
"age_error": null, | ||
"centile_band": "This body mass index measurement is on or near the 98th centile.", | ||
"observation_value_error": null | ||
} | ||
}, | ||
"sds_data": { | ||
"chronological_decimal_age_data": { | ||
"x": 16.484599589322382, | ||
"y": 1.9929195642473767, | ||
"b": null, | ||
"centile": 97.7, | ||
"sds": null, | ||
"bone_age_label": null, | ||
"events_text": null, | ||
"bone_age_type": null, | ||
"bone_age_sds": null, | ||
"bone_age_centile": null, | ||
"observation_error": null, | ||
"age_type": "chronological_age", | ||
"calendar_age": "16 years, 5 months, 3 weeks and 3 days", | ||
"lay_comment": "Your child was born on their due date.", | ||
"clinician_comment": "Born Term. No correction has been made for gestation.", | ||
"age_error": null, | ||
"centile_band": "This body mass index measurement is on or near the 98th centile.", | ||
"observation_value_error": null | ||
}, | ||
"corrected_decimal_age_data": { | ||
"x": 16.484599589322382, | ||
"y": 1.9929195642473767, | ||
"b": null, | ||
"centile": 97.7, | ||
"sds": null, | ||
"bone_age_label": null, | ||
"events_text": null, | ||
"bone_age_type": null, | ||
"bone_age_sds": null, | ||
"bone_age_centile": null, | ||
"observation_error": null, | ||
"age_type": "corrected_age", | ||
"calendar_age": "16 years, 5 months, 3 weeks and 3 days", | ||
"corrected_gestational_age": "", | ||
"lay_comment": "Your child was born on their due date.", | ||
"clinician_comment": "Born at term. No correction has been made for gestation.", | ||
"age_error": null, | ||
"centile_band": "This body mass index measurement is on or near the 98th centile.", | ||
"observation_value_error": null | ||
} | ||
} | ||
}, | ||
"bone_age": { | ||
"bone_age": null, | ||
"bone_age_type": null, | ||
"bone_age_sds": null, | ||
"bone_age_centile": null, | ||
"bone_age_text": null | ||
}, | ||
"events_data": { | ||
"events_text": null | ||
} | ||
} | ||
] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was a bit confused how this works so added some logging and I think it relies on
d.y
beingnull
after the run of increasing values? So ultimately it resetshighestY
to then pick up a more reasonable value when processing the next points?My first thought was why not clamp with a
max
here but I guess this way the plot ends up scaled to fit the actual data.I'm wondering would this break if we lost the
nulls
in a future chart-coordinates update though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The presence of nulls allows us to plot values against x even when there is no reference data - this for example was a request from the neonatologists who wanted the facility to plot weights on preterm infants from 22 weeks gestation where there is no reference data. There I added extra null values to the reference data to allow this. I am afraid I forget now why extra nulls were added here, but not all datasets end at the same age - for example girls head circumference ends at 17y, while the boys ends at 18y and weight and height in UK90 go all the way up to 23 y.
I didn't actually write this code - @chvanlennep is the brain behind it - but I think the idea is to plot a measurement, even if it is higher than the visibile centile data. The extra lines I added were to filter out anything over 500 as this is pretty much impossible anyway and matches the thresholds (domains, as they are known in VictoryChart speak) already set by default.
If you are happy with this I will merge into live and push a patch - let me know and I will go ahead. I am happy to raise an issue in the internal dev chat about chart domains if you wish on the forum? I am not wedded to this methodology and am happy to change it if you feel there is a better approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool thanks for the explanation. Happy to merge this, I think we can go with a "three strikes" approach to this code - once we've added the third hack or special case we can look at how to make it more resilient based on the reports we get from users