growth_standards 5.5.0
growth_standards: ^5.5.0 copied to clipboard
A Dart implementation of various growth standards, WHO, CDC, Fenton, Intergrowth, etc.
5.5.0 #
- INTERGROWTH-21st Anthropometric Features:
- Added Estimated Fetal Weight (EFW) standards with full SVG chart & JSON support:
IntergrowthHadlockEstimatedFetalWeightForAge(Stirnemann et al., UOG 2020; 18+0–41+0 weeks GA) with Hadlock 3-parameterestimateWeight(HC, AC, FL)andestimatedFetalWeightHadlock/estimatedFetalWeightHadlockFromBiometry.IntergrowthEstimatedFetalWeightForAge(Stirnemann et al., UOG 2017; 22+0–40+0 weeks GA) with IG-21stestimateWeight(HC, AC)andestimatedFetalWeight/estimatedFetalWeightFromBiometry.
- Added direct Ultrasound Pregnancy Dating (GA & EDD) calculators (
IntergrowthPregnancyDatingEstimatewithexactDays,exactWeeks,gestationalAge,sdDays,predictionInterval95, andestimatedDueDate):estimateGestationalAgeByCRL(15–100 mm; Papageorghiou et al., UOG 2014).estimateGestationalAgeByHCAndFLandestimateGestationalAgeByHC(late pregnancy; Papageorghiou et al., UOG 2016).
- Extended INTERGROWTH-21st fetal biometry tables (
HC,AC,FL,BPD,OFD) through week 41 per Oxford's October 2025 extrapolated gestational age limits policy. - Added 6
GrowthTrajectoryfactories:intergrowthFetalOccipitofrontalDiameter,intergrowthFetalCrownRumpLength,intergrowthSymphysisFundalHeight,intergrowthGestationalWeightGain,intergrowthEstimatedFetalWeightHadlock, andintergrowthEstimatedFetalWeight.
- Added Estimated Fetal Weight (EFW) standards with full SVG chart & JSON support:
- Whole-Codebase Bug Fixes:
- CDC 2022 Extended BMI-for-Age Charts: Implemented
LMSContext.valueAtZScoreon_CDCBodyMassIndexForAgeLMSusing CDC's extendedsigmaformula above the 95th percentile so+2/+3 SDcurves render accurately (~43 kg/m² instead of exploding to ~147 kg/m² under negative Box-CoxL). - Signed
DateArithmetic & GA/PMA Guards: MadeDate.difference/differenceWithDateTimesigned, fixedDate +/-for negativeDuration, and added runtimeArgumentErrorguards onGestationalAge.fromLMP/fromDatesandPostmenstrualAge.fromLMP/fromDates/fromGestationalAge. - Input Validation: Rejected non-positive length/weight in
BodyMassIndex.valueandNewbornWeightLengthRatioMeasurement.fromMeasurementinstead of returningInfinityor negative values. - WHO Oedema & Velocity Safety: Checked oedema before scoring in
WHOGrowthStandardsWeightVelocityForAge, guarded nullablemeasurementPositioninWHOGrowthStandardsLengthVelocityForAge, exposed optionaloedemaExistonWHOGrowthStandardfactory methods, and formatted non-finite Z-scores/percentiles cleanly asN/Ain SVGs without emittingNaN. - Math
NaNCoercion & Undefined Box-Cox Tail Rendering: Fixedpnorm,qnorm,standardDeviationCalculation,zScoreCalculation, andadjustedZScoreCalculationsoNaN/Infinityinputs are no longer coerced to0(pnorm(NaN) == 0.5) andadjustedZScoreCalculationfalls back to exact unadjustedzScorewhen Box-Cox SD3 tails are undefined; filtered non-finite curve points inGrowthChartModel(eliminatingNaNSVG paths inWHO Length/HC VelocityandCDC Weight-for-Stature). - Calendar Parsing & Age Helpers: Rejected invalid ISO dates (
2024-02-31,2024-13-01) and zero-year dates (0000-01-01) inExtendedDateUtils.tryParse, fixed single-pass token formatting inDateFormatExtension.format(preventing'March'/'May'corruption to'3arch'/'5ay'), guarded_monthFromNumberwithRangeErrorandparseIncrementwithArgumentError, normalized overflow inTimeDifferenceExtension.add, respectedobservedDateinAgeComparisonExtension.isOlderThan/isYoungerThan, and fixed DST/leap-day handling inTimeIntervalCount.timeUntilNextBirthday. - Chart Standards Detection, Velocity Plotting & Trajectories: Replaced fragile Freezed private
runtimeTypestring checks inGrowthChartModelwith explicit type checks so CDC (BMI,Stature,Infant Length,Infant Head Circumference) and INTERGROWTH charts receive proper titles, standard percentile bands ([3, 10, 25, 50, 75, 90, 97]/[3, 10, 50, 90, 97]), curve colors, and legend labels; inverted WHOadjustedZScoreaccurately when plotting extreme velocity gains (|z| > 3); sorted observation points by X and guarded empty result lists inGrowthChartModel.fromResults; aligned monthly X-axis ticks to exact year boundaries on WHO 5–19y charts; preserved fractional weeks in_extractXValue; and accepted typed BMI measurements andLengthMassObservationinGrowthTrajectory.who5To18BmiForAgeandcdcBmiForAge.
- CDC 2022 Extended BMI-for-Age Charts: Implemented
5.4.3 #
- CDC Infant Recumbent Length Adjustment Fix:
- Added optional
chartIsRecumbenttoadjustedLengthHeightand wiredCDCInfantLengthForAge/CDCInfantWeightForLength(chartIsRecumbent: true) andCDCStatureForAge/CDCWeightForStature(chartIsRecumbent: false) so 0–36 month recumbent infant charts no longer subtract0.8 cmwhen measured recumbent at 24–36 months.
- Added optional
- SVG Chart Model & INTERGROWTH Visualization Fixes:
- Generated weekly X-axis ticks (
9w..15w) forIntergrowthFetalCrownRumpLengthForAge(58..105days) and guarded against emptyxTicksinGrowthChartModel. - Formatted weekly
AgeBasedResultX-values (IntergrowthFetal*,IntergrowthSymphysisFundalHeightForAge,IntergrowthGestationalWeightGainForAge, andIntergrowthPretermInfantsPostnatalGrowth*) in weeks (wks) instead of months (mo). - Added specific SVG chart titles and Y-axis labels for skinfolds, weight-to-length ratio, fetal biometric indicators, symphysis-fundal height, and gestational weight gain, omitting the sex suffix on sex-neutral pregnancy charts.
- Generated weekly X-axis ticks (
5.4.2 #
- Trajectory Fixes:
- Normalized multi-week
PostmenstrualAgeday accumulation (weeks+days) inGrowthTrajectory.fentonWeightForAge,fentonLengthForAge, andfentonHeadCircumferenceForAge. - Added optional
gestationalAgeAtBirthtoGrowthTrajectory.intergrowthPretermPostnatalWeight,intergrowthPretermPostnatalLength, andintergrowthPretermPostnatalHeadCircumferenceto convert postnatal age into postmenstrual age (27–64 weeks PMA).
- Normalized multi-week
- WHO Velocity & Reference Fixes:
- Fixed WHO velocity interval resolution (
resolveVelocityMonths) when a valid day-window pair (~28–31 days) falls within a single 31-day calendar month. - Subtracted the Box-Cox
deltaoffset when rendering WHO Weight Velocity curves and observation points inGrowthChartModel. - Wired
measure(LengthHeightMeasurementPosition) throughadjustedLengthHeightinWHOGrowthReference.heightForAge.
- Fixed WHO velocity interval resolution (
- Calendar & Math Edge Cases:
- Fixed month-length borrowing and cross-year/leap-day calculations in
DateTimeUtils.timeDifference, and madeExtendedDateUtils.doRangesOverlapinclusive of touching endpoints. - Added
y <= 0validation toadjustedZScoreCalculationand preserved linear (L = 1) zero/negative weight-change support forIntergrowthGestationalWeightGainForAge. - Fixed unit conversion (
toMillimeter) inIntergrowthEarlyPregnancyDatingForCRL,36-month upper bound clamping inCDCInfantLengthForAge, and PMA/GA/fetal indicator labels inGrowthChartModel.
- Fixed month-length borrowing and cross-year/leap-day calculations in
5.4.1 #
- Fix: Removed accidentally tracked test
build/assets from the published package to reduce package size.
5.4.0 #
- SVG Compatibility: Restructured SVG code generation to completely eliminate
<style>blocks and CSS classes. All styles are now generated natively via inline standard SVG presentation attributes (fill=,stroke=,font-family=, etc.). This guarantees 100% out-of-the-box compatibility with strict SVG renderers likeflutter_svg, standard email clients, and document generators without the need for manual regex parsing. - Customizable SVG Headers/Watermarks: Added
patientInfoandwatermarkTexttoGrowthChartConfig.patientInfoneatly anchors to the top right of the SVG (auto-adjusting vertically to prevent overlap with extremely long chart titles).watermarkTextrenders as a large, 48pt, diagonal, translucent watermark embedded deeply behind the chart data.
- Security Check: Custom text parameters (
title,subtitle,patientInfo,watermarkText) are strictly escaped (_escapeXml()) to prevent any SVG/XML injection vulnerabilities.
5.3.0 #
- SVG export restructuring: Revamped SVG generation scripts. Outputs are now meticulously categorized into nested directories for each standard and measurement, producing both standard Z-score curves and percentile-based curves (
dev/generate_all_svg.dart). - LMS curve correctness: Corrected the statistical calculations for rendering smooth
ChartCurvepoints in graphical outputs to honor standard deviation limits (especially mapping age variables explicitly in equations). - Intergrowth CRL fixes: Corrected
earlyPregnancyCRLgestational age reverse lookup. It now evaluates the exact gestational age derived from fetal crown-rump length ultrasound data properly. - Unit normalization constraints: Confirmed flawless abstraction mapping in measurement defaults; Fenton strictly uses grams vs WHO kg; Intergrowth ultrasound enforces millimeters.
5.2.0 #
- Math precision upgrade: Fully migrated internal statistical equations (SD and Z-score calculations) to use the
Rationalclass underneath, strictly preventing any floating-point precision loss during intermediate algebraic steps. - Normal distribution accuracy: Improved probability implementations (
pnormandqnorm) utilizingRationalobjects for enhanced exactness. - Dependency upgrade: Added support for
@freezedsealedclasses toGestationalAgeandPostmenstrualAgeallowing exhaustive pattern matching.
5.1.1 #
- Fix: Remove redundant sex badge in svg output
5.1.0 #
- Official calibration tests: Added comprehensive validation tests against official WHO 2006 reference data with exact LMS calculations
- Precision documentation: Documented official floating-point precision requirements for all growth standards (WHO, CDC, Fenton, INTERGROWTH-21st)
- Test tolerance: Implemented WHO-documented acceptable tolerance of ≤0.01 for z-score calculations
- REFERENCES.md: Added comprehensive reference documentation with all official documentation, scientific papers, and data sources for all growth standards
- LMS formula documentation: Documented the Box-Cox power transformation method used across all standards
- Comparison tables: Added detailed comparisons between growth standards (WHO vs CDC, WHO 2006 vs 2007, Fenton vs WHO, INTERGROWTH vs WHO)
- Implementation guidelines: Added when-to-use guidelines, age calculation methods, measurement units, and extreme value flagging limits
- Quality control documentation: Documented validation protocols for WHO MGRS, INTERGROWTH-21st, and CDC NHANES studies
- FAQ section: Added frequently asked questions about growth standards, z-scores, and implementation differences
- Glossary: Added comprehensive glossary of key terms (BCPE, BMI, LMS, MGRS, PMA, SD, TEM, Z-Score)
- Calculation examples: Added step-by-step z-score calculation examples for WHO and Fenton standards
- Citation formats: Added proper citation formats for all growth standards
- License information: Documented licensing terms for each growth standard
5.0.0 #
- BREAKING — SVG-only chart output: Removed the PNG renderer and all PNG APIs (
toPng(),savePng(),toPngList(),savePngList(),renderVelocityPng(),saveVelocityPng()). Charts are now rendered exclusively as SVG; convert to raster formats externally (e.g.rsvg-convert, Inkscape, or a browser). - BREAKING — dropped
imagedependency: The package no longer depends onpackage:image. - Redesigned chart legend: Legend items are now dynamically measured, evenly spaced, and horizontally centered on a dedicated bottom row, eliminating text overlap with the x-axis title and between entries.
- Legend labels adapt to the display mode (
0 SD (Median)/±1 SD/±2 / ±3 SDfor Z-scores;50th (Median)/15th / 85th/3rd / 97thfor percentiles). - A
Trajectorylegend entry is shown automatically for multi-point longitudinal charts. - The x-axis title now sits at a fixed offset below the tick labels with dedicated space reserved for the legend row.
- Legend labels adapt to the display mode (
- X-axis tick label overlap guard: Tick labels that would collide with the previous label (e.g. dense velocity interval labels like
10–12m) are automatically skipped.
4.6.0 #
- Growth Chart Visualizer Engine: Pure Dart rendering engine generating vector SVG and high-resolution PNG growth charts.
- Supports WHO (0-5y & 5-18y), CDC (2-20y & 0-36m), Fenton 2013 Preterm, and WHO Growth Velocity charts.
- Pixel-perfect layout alignment between SVG and PNG renderers.
- Includes custom themes (
GrowthChartTheme.boy(),GrowthChartTheme.girl()), display modes (Z-scores vs. Percentiles), legend rows, grid lines, and top-right callout result banners. - Direct extension methods on
Result,List<Result>,VelocityBasedResult, andGrowthTrajectory(toSvg(),toPng(),saveSvg(),savePng()).
- Core
GrowthTrajectoryAPI: Decoupled longitudinal child growth tracking helper available at core library level (lib/src/common/trajectory.dart).- Added 24 trajectory factory constructors covering WHO, CDC, Fenton, and INTERGROWTH-21st standards.
- Accepts
LengthMassObservationpaired visit measurements and returnsResultcalculations onadd(). - Added trajectory analytic getters (
zScores,percentiles,latestResult,firstResult).
- WHO Growth Velocity Visualization: Render interval growth velocity charts for weight, length, and head circumference gain across 1, 2, 3, 4, and 6-month increments.
- Pediatric Age & Sex Semantics: Standardized sex labels (
BOY/GIRLandBoys/Girlsfor pediatric age < 18y;MALE/FEMALEandMales/Femalesfor adult age ≥ 18y). - Expanded Modular Example Suite: Added dedicated, runnable scripts under
example/for every growth measurement type.
4.5.0 #
- Add sex-specific Fenton 2013 LMS datasets for boys and girls (
wfa,lfa,hcfa) - Require typed
PostmenstrualAgefor Fenton andGestationalAgefor INTERGROWTH newborn models - Fix WHO growth velocity month classification for day-based clinical visit gaps (
days / 30.4375) - Fix CDC Agemos mid-month
n + 0.5grid lookups across endpoint months - Add WHO WFL (≤730 days) and WFH (>730 days) runtime age gates
- Implement LMS $L=0$ limit form ($Z = \ln(y/M)/S$) and non-positive measurement guards in math core
- Fix
DateFormatExtension.formatmonth name (MMM) token replacement order and export from package root - Fix
ageAtPastDateDOB handling and standing/recumbent length adjustments - Add mathematical golden vector test suite (
test/golden_vectors_test.dart)
4.4.1 #
- Fix bug in growth velocity data parser
- Add conversion unit symbol in length based growth measurement assertion
4.4.0 #
- Set default value for
countObservationDatetotrueinAge - Improve performance by change source data to map literal instead of
jsonstring
4.3.1 #
- Add latest Symphisis-Fundal Height score update
4.3.0 #
- Fix intergrowth source data error
4.2.1 #
- Dependencies bump
4.2.0 #
- Add
countObservationDatetoAgewith default value tofalse
4.1.5 #
- Same as previous version, but support for
freezedv2
4.1.4 #
- Set default decimal
PrecisiontoPrecision.two
4.1.3 #
- Same as previous version, but support for
freezedv2
4.1.2 #
- Minor performance improvements
4.1.1 #
- Exportinng
pnormandqnorm
4.1.0 #
- Add missing
TimeUnit
4.0.0 #
- Remove
Sex.bothenum. - Remove
Sexparameter fromFentonmeasurement. - Add
Intergrowth-21measurements.
3.0.6 #
- Same as previous version
- Use this version if your dependencies has not supported
freezedversion 3
3.0.5 #
- Remove data sorting as the data is sorted by default
3.0.4 #
- Same as previous version
- Use this version if your dependencies has not supported
freezedversion 3
3.0.2 #
- Exporting
TimeUnit
3.0.1 #
- Same as previous version
- Use this version if your dependencies has not supported
freezedversion 3
3.0.0 #
- Add
Sex.bothto replace for sex-agnostic data - Exposing
contextDatafor directly accessing statistical data - Unified assertion for non velocity measurement
- Removing
observationDateon Length-based measurement - Move
observationDateintoAgeobservedDatefield
2.2.1 #
- Same as previous version
- Use this version if your dependencies has not supported
freezedversion 3
2.2.0 #
- Unified
ageDataandlengthDataintolmsData
2.1.5 #
- Export additional typedef
2.1.4 #
- Fix measurement conversion in
WHOGrowthStandardsTricepsSkinfoldForAgeandWHOGrowthStandardsSubscapularSkinfoldForAge
2.1.3 #
- Expose
lengthAtObservationDatefor length based measurement - Use this version if your dependencies has supported
freezedversion 3
2.1.2 #
- Expose
lengthAtObservationDatefor length based measurement - Use this version if your dependencies has not supported
freezedversion 3
2.1.1 #
- Simplify
LMS - Fix bug at measurement of
WHOGrowthStandardsArmCircumferenceForAge - Update dependencies
- Expose
measurementResultInDefaultUnit - Use this version if your dependencies has supported
freezedversion 3
2.1.0 #
- Simplify
LMS - Fix bug at measurement of
WHOGrowthStandardsArmCircumferenceForAge - Update dependencies
- Expose
measurementResultInDefaultUnit - Use this version if your dependencies has not supported
freezedversion 3
2.0.1 #
- Exposing ageAtObservationDate field for age based measurement
- Add various base class
- Use this version if your dependencies has supported
freezedversion 3
2.0.0 #
- Exposing ageAtObservationDate field for age based measurement
- Add various base class
- Use this version if your dependencies has not supported
freezedversion 3
1.5.1 #
- Exposing
ageDatafor more easy access - Use this version if your dependencies has supported
freezedversion 3
1.5.0 #
- Exposing
ageDatafor more easy access - Use this version if your dependencies has not supported
freezedversion 3
1.4.3 #
- Fix pub static analysis issues
1.4.2 #
- Bump
freezedversion. - Use this version if your dependencies has supported
freezedversion 3
1.4.1 #
- Lowering
freezedversion. - Use this version if your dependencies has not supported
freezedversion 3
1.4.0 #
- Bump
super_measurement - Removed
Precision.none
1.3.0 #
- Bump
freezed
1.2.2 #
- Bump Dart SDK
1.2.1 #
1.1.4 #
- Dependency update
- Some measurement API changes
1.1.3 #
- Bug fix
- Minor refractor
1.1.2 #
- Dependencies update
1.1.1 #
- Various bug fix
1.1.0 #
- Refactoring
- Bug fix
- Improved API
1.0.7 #
- API fix
- Remove some unused code
- More test
1.0.6 #
- Several Bug fix
- Add WHO Growth Velocity
1.0.5 #
- Add Fenton preterm growth standards
1.0.4 #
- Add CDC measurement
1.0.3 #
- Exposing additional types
1.0.2 #
- Exposing data API
1.0.1 #
- Some minor refactoring
1.0.0 #
- Initial version.