-
Notifications
You must be signed in to change notification settings - Fork 5
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
cdc #36
Merged
Merged
cdc #36
Conversation
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
… use the CDC adapted version
…ve the data fix three percent centiles to remove 5% and create five percent centiles
… create_data_point not default to UK_WHO
…sults matching cdc explainers
…dc is linearly interpolated so this added to global_functions. Single fail for CDC height in a 2.5y girl: assert 1.3882029662677624 == 1.3893 ± 1.0e-03
…D. This test therefore is amended erroneously to pass: { "birth_date": "2015-04-01", "observation_date": "2017-10-04", "gestation_weeks": 30, "gestation_days": 2, "sex": "female", "measurement_method": "height", "chronological_age": 2.5106, "corrected_age": 2.3244, "observation_value": 95.3, "corrected_sds": 1.8348, "chronological_sds": 1.2788, "age": 30.1273, "height": 95.3, "haz": 1.3893, "hap": 91.7623, "p50": 16.0277, "p95": 18.6016, "mod_haz": 1.3864, "z_score": 1.3893 },
…r, do not calculate CDC results for preterm babies and signpost to user
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
This PR includes the CDC reference data and integrates the calculations into the code base. It will be a minor version change.
A few things about this:
CDC is made up of WHO (0-2) and CDC (2+). The WHO version used by CDC though has been tweaked, presumably to make the disjunction between the references less marked. The effect is that the code base now has 2 versions of WHO - the WHO one and the US interpretation.
CDC BMI is included and for BMI measurements > 95th centile some clever maths is introduced to prevent some of the issues that have been detailed in conversations about the accuracy of z scores.
Note that there is no preterm data for the moment. The Canadian Fenton data is what is typically used, but this is licensed and conversations about the legals are ongoing. This means that for all corrected ages < 0 no values are returned, but a meaningful error is included.
There is also a fix to the confusing error raised when EDD has not yet been reached in a preterm baby.
There are also tests for the same test subjects used in UK-WHO, but recalculated for CDC using the excellent R package [cdcanthro] (https://github.com/CDC-DNPAO/CDCAnthro) by David Freedman, author of the CDC BMI reference.
Code changes
cdc.py
: selects the correct array for LMS values to pass to functions. Excludes Fenton for the time being and returns an empty string.chart_functions.py
: updatescreate_chart
to acceptcdc
and creates a new functions to generate the correct json object. Keys are 'cdc_infant' and 'cdc_child'age_constants.py
andreference_constants
: includes some new constants relevant to CDC cutoffs. Also includes values important for Fenton although not implemented yetdata_tables/
: the data filesglobal_functions
:measurement_from_sds
has extra code that inspects the array for thesigma
key that is found only in CDC BMI reference. This is used to calculate the correct SDS and centiles for BMI values > 95%measurement.py
: adds a conditional to not return any data in preterm babies and a suitable error messagetests/cdc/...
: test files and gold standardsDocumentation changes (done or required as a result of this PR)
Documentation will be added separately to the documentation repo
Please describe any changes to documentation here.
Related Issues
Closes #35