Skip to content

Commit d901491

Browse files
authored
Merge pull request #125 from rcpch/eatyourpeas/issue124
Trisomy21-AAP
2 parents 7305c2c + 3487a1e commit d901491

22 files changed

+59036
-33
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rcpch/digital-growth-charts-react-component-library",
3-
"version": "7.1.4",
3+
"version": "7.2.0",
44
"description": "A React component library for the RCPCH digital growth charts using Rollup, TypeScript and Styled-Components",
55
"main": "build/index.js",
66
"module": "build/esm.index.js",

src/CentileChart/CentileChart.stories.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { Tanner3Styles } from '../testParameters/styles/tanner3Styles';
88
import { traditionalBoysStyles } from '../testParameters/styles/traditionalBoysStyles';
99
import { traditionalGirlsStyles } from '../testParameters/styles/traditionalGirlsStyles';
1010
import { termGirlWithSingleHeightMeasurementAndBoneAgeAndEvent } from '../testParameters/measurements/termGirlWithSingleHeightMeasurementAndBoneAgeAndEvent';
11-
import { twoWeightMeasurements } from '../testParameters/measurements/twoWeightMeasurements';
1211
import { twoToEight } from '../testParameters/measurements/twoToEight';
1312
import { twoToEightWeight } from '../testParameters/measurements/twoToEightWeight';
1413
import { twoToEightOFC } from '../testParameters/measurements/twoToEightOFC';

src/CentileChart/CentileChart.tsx

+15-15
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function CentileChart({
9393
enableExport,
9494
exportChartCallback,
9595
clinicianFocus,
96-
logoVariant
96+
logoVariant,
9797
}: CentileChartProps) {
9898
const [userDomains, setUserDomains] = useState(null);
9999

@@ -160,8 +160,8 @@ function CentileChart({
160160
if (reference === 'uk-who' && measurementMethod === 'height') {
161161
pubertyThresholds = makePubertyThresholds(domains, sex);
162162
}
163-
if (reference === 'uk-who') {
164-
nondisjunctionThresholds = makeNonDisjunctionThresholds(domains, sex);
163+
if (reference === 'uk-who' || reference === 'cdc') {
164+
nondisjunctionThresholds = makeNonDisjunctionThresholds(domains, sex, reference);
165165
}
166166

167167
const filteredMidParentalHeightData = useMemo(
@@ -251,21 +251,17 @@ function CentileChart({
251251

252252
return (
253253
<MainContainer>
254-
255254
{logoVariant === 'top' && (
256255
<TopContainer>
257256
<LogoContainer>
258257
<IndividualLogoContainer>
259258
<img src={icon} width={24} height={24} />
260259
</IndividualLogoContainer>
261-
<VersionLabel
262-
fontFamily={styles.chartTitle.fontFamily}
263-
>{chartsVersion}</VersionLabel>
260+
<VersionLabel fontFamily={styles.chartTitle.fontFamily}>{chartsVersion}</VersionLabel>
264261
<IndividualLogoContainer>
265-
<img src={ukca} width={18} height={18}/>
262+
<img src={ukca} width={18} height={18} />
266263
</IndividualLogoContainer>
267264
</LogoContainer>
268-
269265
</TopContainer>
270266
)}
271267

@@ -754,9 +750,10 @@ function CentileChart({
754750
{/* If data points are close together, reduce the size of the point */}
755751

756752
{childMeasurements.map((childMeasurement: Measurement, index) => {
757-
const [observationYear, observationMonth, observationDay] = childMeasurement.measurement_dates.observation_date.split('-');
753+
const [observationYear, observationMonth, observationDay] =
754+
childMeasurement.measurement_dates.observation_date.split('-');
758755
const observationDate = `${observationDay}/${observationMonth}/${observationYear}`;
759-
756+
760757
const chronData: any = {
761758
age_type: 'chronological_age',
762759
age_error: childMeasurement.measurement_dates.chronological_decimal_age_error,
@@ -976,7 +973,9 @@ function CentileChart({
976973
color={styles.referenceTextStyle.color}
977974
fontWeight={styles.referenceTextStyle.fontWeight}
978975
fontStyle={styles.referenceTextStyle.fontStyle}
979-
>{referenceText(reference)}</ChartTitle>
976+
>
977+
{referenceText(reference)}
978+
</ChartTitle>
980979

981980
{logoVariant === 'legend' && (
982981
<ChartTitle
@@ -985,7 +984,9 @@ function CentileChart({
985984
color={styles.referenceTextStyle.color}
986985
fontWeight={styles.referenceTextStyle.fontWeight}
987986
fontStyle={styles.referenceTextStyle.fontStyle}
988-
>Powered by RCPCH Digital Growth Charts - {chartsVersion}</ChartTitle>
987+
>
988+
Powered by RCPCH Digital Growth Charts - {chartsVersion}
989+
</ChartTitle>
989990
)}
990991

991992
{logoVariant === 'bottom' && (
@@ -996,12 +997,11 @@ function CentileChart({
996997
</IndividualLogoContainer>
997998
<VersionLabel fontFamily={styles.chartTitle.fontFamily}>{chartsVersion}</VersionLabel>
998999
<IndividualLogoContainer>
999-
<img src={ukca} width={18} height={18}/>
1000+
<img src={ukca} width={18} height={18} />
10001001
</IndividualLogoContainer>
10011002
</BottomLogoContainer>
10021003
</BottomContainer>
10031004
)}
1004-
10051005
</ChartContainer>
10061006

10071007
{(showToggle || allowZooming || enableExport || childMeasurements.length > 0) && (

src/CentileChart/CentileChart.types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export type Results = {
1919
};
2020
export interface CentileChartProps {
2121
chartsVersion?: string;
22-
reference: 'uk-who' | 'turner' | 'trisomy-21' | 'cdc';
22+
reference: 'uk-who' | 'turner' | 'trisomy-21' | 'cdc' | 'trisomy-21-aap';
2323
title: string;
2424
subtitle: string;
2525
measurementMethod: 'height' | 'weight' | 'ofc' | 'bmi';

src/RCPCHChart/RCPCHChart.stories.tsx

+168
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,174 @@ export const CentileChartUKWHOGirlMidparentalHeight: Story = {
467467
},
468468
};
469469

470+
export const CentileChartTrisomy21AAPBoysHeight: Story = {
471+
args: {
472+
title: 'Patient Name - Hospital Number',
473+
measurementMethod: 'height',
474+
reference: 'trisomy-21-aap',
475+
sex: 'male',
476+
measurements: {
477+
height: [],
478+
},
479+
midParentalHeightData: {},
480+
enableZoom: true,
481+
chartType: 'centile',
482+
enableExport: false,
483+
exportChartCallback: () => {},
484+
theme: 'tanner3',
485+
customThemeStyles: {},
486+
clinicianFocus: true,
487+
logoVariant: 'bottom',
488+
},
489+
};
490+
491+
export const CentileChartTrisomy21AAPGirlsHeight: Story = {
492+
args: {
493+
title: 'Patient Name - Hospital Number',
494+
measurementMethod: 'height',
495+
reference: 'trisomy-21-aap',
496+
sex: 'female',
497+
measurements: {
498+
height: [],
499+
},
500+
midParentalHeightData: {},
501+
enableZoom: true,
502+
chartType: 'centile',
503+
enableExport: false,
504+
exportChartCallback: () => {},
505+
theme: 'tanner3',
506+
customThemeStyles: {},
507+
clinicianFocus: true,
508+
logoVariant: 'bottom',
509+
},
510+
};
511+
512+
export const CentileChartTrisomy21AAPGirlsWeight: Story = {
513+
args: {
514+
title: 'Patient Name - Hospital Number',
515+
measurementMethod: 'weight',
516+
reference: 'trisomy-21-aap',
517+
sex: 'female',
518+
measurements: {
519+
weight: [],
520+
},
521+
midParentalHeightData: {},
522+
enableZoom: true,
523+
chartType: 'centile',
524+
enableExport: false,
525+
exportChartCallback: () => {},
526+
theme: 'tanner3',
527+
customThemeStyles: {},
528+
clinicianFocus: true,
529+
logoVariant: 'bottom',
530+
},
531+
};
532+
533+
export const CentileChartTrisomy21AAPBoysWeight: Story = {
534+
args: {
535+
title: 'Patient Name - Hospital Number',
536+
measurementMethod: 'weight',
537+
reference: 'trisomy-21-aap',
538+
sex: 'female',
539+
measurements: {
540+
weight: [],
541+
},
542+
midParentalHeightData: {},
543+
enableZoom: true,
544+
chartType: 'centile',
545+
enableExport: false,
546+
exportChartCallback: () => {},
547+
theme: 'tanner1',
548+
customThemeStyles: {},
549+
clinicianFocus: true,
550+
logoVariant: 'bottom',
551+
},
552+
};
553+
554+
export const CentileChartTrisomy21AAPGirlsBMI: Story = {
555+
args: {
556+
title: 'Patient Name - Hospital Number',
557+
measurementMethod: 'bmi',
558+
reference: 'trisomy-21-aap',
559+
sex: 'female',
560+
measurements: {
561+
bmi: [],
562+
},
563+
midParentalHeightData: {},
564+
enableZoom: true,
565+
chartType: 'centile',
566+
enableExport: false,
567+
exportChartCallback: () => {},
568+
theme: 'tanner3',
569+
customThemeStyles: {},
570+
clinicianFocus: true,
571+
logoVariant: 'bottom',
572+
},
573+
};
574+
575+
export const CentileChartTrisomy21AAPGBoysBMI: Story = {
576+
args: {
577+
title: 'Patient Name - Hospital Number',
578+
measurementMethod: 'bmi',
579+
reference: 'trisomy-21-aap',
580+
sex: 'male',
581+
measurements: {
582+
bmi: [],
583+
},
584+
midParentalHeightData: {},
585+
enableZoom: true,
586+
chartType: 'centile',
587+
enableExport: false,
588+
exportChartCallback: () => {},
589+
theme: 'tanner1',
590+
customThemeStyles: {},
591+
clinicianFocus: true,
592+
logoVariant: 'bottom',
593+
},
594+
};
595+
596+
export const CentileChartTrisomy21AAPGirlsHeadCircumference: Story = {
597+
args: {
598+
title: 'Patient Name - Hospital Number',
599+
measurementMethod: 'ofc',
600+
reference: 'trisomy-21-aap',
601+
sex: 'female',
602+
measurements: {
603+
ofc: [],
604+
},
605+
midParentalHeightData: {},
606+
enableZoom: true,
607+
chartType: 'centile',
608+
enableExport: false,
609+
exportChartCallback: () => {},
610+
theme: 'tanner3',
611+
customThemeStyles: {},
612+
clinicianFocus: true,
613+
logoVariant: 'bottom',
614+
},
615+
};
616+
617+
export const CentileChartTrisomy21AAPBoysHeadCircumference: Story = {
618+
args: {
619+
title: 'Patient Name - Hospital Number',
620+
measurementMethod: 'ofc',
621+
reference: 'trisomy-21-aap',
622+
sex: 'male',
623+
measurements: {
624+
ofc: [],
625+
},
626+
midParentalHeightData: {},
627+
enableZoom: true,
628+
chartType: 'centile',
629+
enableExport: false,
630+
exportChartCallback: () => {},
631+
theme: 'tanner1',
632+
customThemeStyles: {},
633+
clinicianFocus: true,
634+
logoVariant: 'bottom',
635+
},
636+
};
637+
470638
export const TomatoCentileChart: Story = {
471639
args: {
472640
title: 'Patient Name - Hospital Number',

src/RCPCHChart/RCPCHChart.types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { ClientMeasurementObject } from '../interfaces/ClientMeasurementObject';
1414
export interface RCPCHChartProps {
1515
title: string;
1616
measurementMethod: 'height' | 'weight' | 'ofc' | 'bmi';
17-
reference: 'uk-who' | 'turner' | 'trisomy-21' | 'cdc';
17+
reference: 'uk-who' | 'turner' | 'trisomy-21' | 'cdc' | 'trisomy-21-aap';
1818
sex: 'male' | 'female';
1919
measurements: ClientMeasurementObject;
2020
midParentalHeightData?: MidParentalHeightObject | undefined;

src/SDSChart/SDSChart.types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ClientMeasurementObject } from '../interfaces/ClientMeasurementObject';
22
import { MidParentalHeightObject } from '../interfaces/MidParentalHeightObject';
33
export interface SDSChartProps {
44
chartsVersion: string;
5-
reference: 'uk-who' | 'turner' | 'trisomy-21' | 'cdc';
5+
reference: 'uk-who' | 'turner' | 'trisomy-21' | 'cdc' | 'trisomy-21-aap';
66
title: string;
77
subtitle: string;
88
measurementMethod: 'height' | 'weight' | 'ofc' | 'bmi';

0 commit comments

Comments
 (0)