Skip to content

Commit

Permalink
Merge pull request #443 from bcgsc/feat/DEVSU-2244-cd8t-percentile-vi…
Browse files Browse the repository at this point in the history
…sibility-toggle

DEVSU-2244 CD8+ T Cell Percentile Visibility Toggle
  • Loading branch information
bnguyen-bcgsc authored Mar 28, 2024
2 parents df83ea3 + 4f6af23 commit d8929c8
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 9 deletions.
1 change: 1 addition & 0 deletions app/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ type ImmuneType = {
pedsPercentile: number | null;
pedsScore: number | null;
pedsScoreComment: string | null;
percentileHidden: boolean;
} & RecordDefaults;

type MicrobialType = {
Expand Down
7 changes: 6 additions & 1 deletion app/components/TumourSummaryEdit/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

&__check-box {
color: gray;
padding-top: 2px;
margin-top: -12px;
font-size: 2;
}
}

.checkbox-label {
font-size: 10pt;
}
36 changes: 34 additions & 2 deletions app/components/TumourSummaryEdit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const TumourSummaryEdit = ({
setNewTCellCd8Data({
score: tCellCd8.score,
percentile: tCellCd8.percentile,
percentileHidden: tCellCd8.percentileHidden,
pedsScore: tCellCd8.pedsScore,
pedsPercentile: tCellCd8.pedsPercentile,
pedsScoreComment: tCellCd8.pedsScoreComment,
Expand Down Expand Up @@ -129,6 +130,14 @@ const TumourSummaryEdit = ({
setTCellCd8Dirty(true);
}, []);

const handleTCellCd8PercentileVisibleChange = useCallback(({ target: { checked, name } }) => {
setNewTCellCd8Data((prevVal) => ({
...prevVal,
[name]: checked,
}));
setTCellCd8Dirty(true);
}, []);

const handlePedsCd8tChange = useCallback(({ target: { value, name } }) => {
setNewTCellCd8Data((cd8t) => ({
...cd8t,
Expand Down Expand Up @@ -454,6 +463,27 @@ const TumourSummaryEdit = ({
fullWidth
type="number"
/>
<FormControlLabel
className="tumour-dialog__check-box"
control={(
<Checkbox
size="small"
icon={<Visibility />}
checkedIcon={<VisibilityOff />}
checked={newTCellCd8Data?.percentileHidden}
name="percentileHidden"
onChange={handleTCellCd8PercentileVisibleChange}
sx={{
color: 'default',
'&.Mui-checked': {
color: pink[800],
},
marginLeft: 1,
}}
/>
)}
label={<div className="checkbox-label">Show/Hide CD8+ Percentile</div>}
/>
<TextField
className="tumour-dialog__text-field"
label="Pediatric CD8+ T Cell Score"
Expand Down Expand Up @@ -489,7 +519,7 @@ const TumourSummaryEdit = ({
type="text"
/>
</>
), [newTCellCd8Data?.score, newTCellCd8Data?.percentile, newTCellCd8Data?.pedsScore, newTCellCd8Data?.pedsPercentile, newTCellCd8Data?.pedsScoreComment, handleTCellCd8Change, report.patientInformation.caseType, handlePedsCd8tChange, handlePedsCd8tCommentChange]);
), [newTCellCd8Data?.score, newTCellCd8Data?.percentile, newTCellCd8Data?.percentileHidden, newTCellCd8Data?.pedsScore, newTCellCd8Data?.pedsPercentile, newTCellCd8Data?.pedsScoreComment, handleTCellCd8Change, handleTCellCd8PercentileVisibleChange, report.patientInformation.caseType, handlePedsCd8tChange, handlePedsCd8tCommentChange]);

const mutBurDataSection = useMemo(() => (
<>
Expand Down Expand Up @@ -564,6 +594,7 @@ const TumourSummaryEdit = ({
className="tumour-dialog__check-box"
control={(
<Checkbox
size="small"
icon={<Visibility />}
checkedIcon={<VisibilityOff />}
checked={newTmburMutData?.tmbHidden}
Expand All @@ -574,10 +605,11 @@ const TumourSummaryEdit = ({
'&.Mui-checked': {
color: pink[800],
},
marginLeft: 1,
}}
/>
)}
label="Show/Hide TMB Score"
label={<div className="checkbox-label">Show/Hide TMB Information</div>}
/>
</>
), [newTmburMutData?.genomeSnvTmb, newTmburMutData?.genomeIndelTmb, newTmburMutData?.adjustedTmb, newTmburMutData?.adjustedTmbComment, newTmburMutData?.tmbHidden, handleTmburChange, handleAdjustedTmbCommentChange, handleAdjustedTmbVisibleChange]);
Expand Down
4 changes: 2 additions & 2 deletions app/views/ReportView/components/GenomicSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ const GenomicSummary = ({
let tCell: null | string;
if (tCellCd8 && typeof tCellCd8.score === 'number') {
if (tCellCd8.pedsScore) {
tCell = `${tCellCd8.pedsScore} ${tCellCd8.pedsPercentile ? `(${tCellCd8.pedsPercentile}%)` : ''}`;
tCell = `${tCellCd8.pedsScore} ${tCellCd8.pedsPercentile && !tCellCd8.percentileHidden ? `(${tCellCd8.pedsPercentile}%)` : ''}`;
} else {
tCell = `${tCellCd8.score} ${tCellCd8.percentile ? `(${tCellCd8.percentile}%)` : ''}`;
tCell = `${tCellCd8.score} ${tCellCd8.percentile && !tCellCd8.percentileHidden ? `(${tCellCd8.percentile}%)` : ''}`;
}
} else {
tCell = null;
Expand Down
19 changes: 15 additions & 4 deletions app/views/ReportView/components/RapidSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,11 @@ const RapidSummary = ({

let tCell: null | string;
if (tCellCd8 && typeof tCellCd8.score === 'number') {
if (!!tCellCd8.pedsScore && !!tCellCd8.pedsPercentile) {
tCell = `${tCellCd8.pedsScore} ${tCellCd8.pedsPercentile ? `(${tCellCd8.pedsPercentile}%)` : ''}`;
if (tCellCd8.pedsScore) {
tCell = `${tCellCd8.pedsScore} ${tCellCd8.pedsPercentile && !tCellCd8.percentileHidden ? `(${tCellCd8.pedsPercentile}%)` : ''}`;
} else {
tCell = `${tCellCd8.score} ${tCellCd8.percentile && !tCellCd8.percentileHidden ? `(${tCellCd8.percentile}%)` : ''}`;
}
tCell = `${tCellCd8.score} ${tCellCd8.percentile ? `(${tCellCd8.percentile}%)` : ''}`;
} else {
tCell = null;
}
Expand Down Expand Up @@ -356,6 +357,15 @@ const RapidSummary = ({
tCellCd8?.pedsScore ? 'Pediatric CD8+ T Cell Score' : 'CD8+ T Cell Score',
value: tCell,
},
{
term: 'Pediatric CD8+ T Cell Comment',
value:
tCellCd8?.pedsScoreComment ? tCellCd8?.pedsScoreComment : null,
},
{
term: 'Mutation Burden',
value: primaryBurden && primaryBurden.totalMutationsPerMb !== null && (!tmburMutBur?.adjustedTmb || tmburMutBur.tmbHidden === true) ? `${primaryBurden.totalMutationsPerMb} Mut/Mb` : null,
},
{
term: 'SV Burden (POG Average)',
value: svBurden,
Expand All @@ -376,7 +386,8 @@ const RapidSummary = ({
value: msiStatus,
},
]);
}, [microbial, primaryBurden, tmburMutBur, report.m1m2Score, report.sampleInfo, report.tumourContent, report.captiv8Score, tCellCd8]);
}, [microbial, primaryBurden, tmburMutBur, report.m1m2Score, report.sampleInfo, report.tumourContent, tCellCd8.percentile, tCellCd8.score, report.captiv8Score,
tCellCd8.percentileHidden, tCellCd8, tCellCd8.pedsScoreComment, tmburMutBur.adjustedTmb, tmburMutBur.tmbHidden, tCellCd8.pedsScore, tCellCd8.pedsPercentile]);

const handlePatientEditClose = useCallback((
newPatientData: PatientInformationType,
Expand Down

0 comments on commit d8929c8

Please sign in to comment.