Skip to content

Commit e9f7200

Browse files
jfkonecncalvinlu3
andauthored
Update news 4.22 (#1177)
* Update news 4.22 * Fix CDx date for Trusight and display utc time --------- Co-authored-by: Calvin Lu <[email protected]>
1 parent 51b04d7 commit e9f7200

File tree

15 files changed

+9597
-7942
lines changed

15 files changed

+9597
-7942
lines changed

src/main/webapp/app/components/SimpleTable.tsx

+41-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import * as React from 'react';
22
import { Table } from 'react-bootstrap';
33

44
export type ElementType = JSX.Element | string;
5-
export type SimpleTableCell = { key: string; content: ElementType };
5+
export type SimpleTableCell = {
6+
key: string;
7+
content: ElementType | ElementType[];
8+
};
69
export type SimpleTableRow = { key: string; content: SimpleTableCell[] };
710
export type SimpleTableRows = SimpleTableRow[];
811
export type SimpleTableColumn = {
@@ -21,8 +24,8 @@ export type SimpleTableProps = {
2124
export const SimpleTable = (props: SimpleTableProps) => {
2225
const getRow = (row: SimpleTableRow) => {
2326
return row.content
24-
? row.content.map(cell => {
25-
return <td key={cell.key}>{cell.content}</td>;
27+
? row.content.map(({ key, content }) => {
28+
return <td key={key}>{content}</td>;
2629
})
2730
: null;
2831
};
@@ -44,9 +47,41 @@ export const SimpleTable = (props: SimpleTableProps) => {
4447
</thead>
4548
)}
4649
<tbody className={props.tbodyClassName}>
47-
{props.rows.map(row => (
48-
<tr key={row.key}>{getRow(row)}</tr>
49-
))}
50+
{props.rows.flatMap(({ key, content }) => {
51+
let maxContentSize = 1;
52+
for (const cur of content) {
53+
maxContentSize = Array.isArray(cur.content)
54+
? Math.max(cur.content.length, maxContentSize)
55+
: maxContentSize;
56+
}
57+
const elements: JSX.Element[] = [];
58+
for (let i = 0; i < maxContentSize; i++) {
59+
const element = (
60+
<tr key={`${key}_${i}`}>
61+
{content.map(({ content: innerContent, key: innerKey }) => {
62+
if (Array.isArray(innerContent)) {
63+
return <td key={innerKey}>{innerContent[i]}</td>;
64+
} else if (i === 0) {
65+
return (
66+
<td
67+
key={innerKey}
68+
rowSpan={
69+
maxContentSize > 1 ? maxContentSize : undefined
70+
}
71+
>
72+
{innerContent}
73+
</td>
74+
);
75+
} else {
76+
return <></>;
77+
}
78+
})}
79+
</tr>
80+
);
81+
elements.push(element);
82+
}
83+
return elements;
84+
})}
5085
</tbody>
5186
</Table>
5287
</div>

src/main/webapp/app/config/constants.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,7 @@ export type DataRelease = {
821821
};
822822

823823
export const DATA_RELEASES: DataRelease[] = [
824+
{ date: '10242024', version: 'v4.22' },
824825
{ date: '09252024', version: 'v4.21' },
825826
{ date: '08152024', version: 'v4.20' },
826827
{ date: '07042024', version: 'v4.19' },
@@ -948,6 +949,7 @@ export const DEFAULT_FEEDBACK_ANNOTATION: Feedback = {
948949
type: FeedbackType.ANNOTATION,
949950
};
950951

952+
export type FdaSubmissionType = 'PMA' | 'PMN' | 'HDE' | 'DEN';
951953
export const FDA_SUBMISSION_URL_SUFFIX = {
952954
PMA: 'cfpma/pma.cfm',
953955
PMN: 'cfpmn/pmn.cfm',

src/main/webapp/app/pages/companionDiagnosticDevicesPage/companionDiagnosticDevicePage.tsx

+69-12
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,52 @@ interface ICancerType {
8787
tumorForm: 'SOLID' | 'LIQUID' | 'MIXED';
8888
}
8989

90+
interface IRule {
91+
id: number;
92+
entity: string;
93+
rule: string;
94+
name: string | null;
95+
association: IAssociation | null;
96+
}
97+
98+
interface IAssociation {
99+
id: number;
100+
name: string | null;
101+
rules: IRule[] | null;
102+
alterations: IAlteration[] | null;
103+
cancerTypes: ICancerType[] | null;
104+
drugs: IDrug[] | null;
105+
fdaSubmissions: IFdaSubmission[] | null;
106+
}
107+
108+
interface IDrug {
109+
id: number;
110+
uuid: string;
111+
name: string;
112+
associations: IAssociation[] | null;
113+
}
114+
115+
interface IAlteration {
116+
id: number;
117+
name: string;
118+
alteration: string;
119+
proteinChange: string;
120+
start: number | null;
121+
end: number | null;
122+
refResidues: string | null;
123+
variantResidues: string | null;
124+
genes: IGene[] | null;
125+
associations: IAssociation[] | null;
126+
}
127+
128+
interface IGene {
129+
id: number;
130+
entrezGeneId: number;
131+
hugoSymbol: string;
132+
hgncId: string | null;
133+
alterations: IAlteration[] | null;
134+
}
135+
90136
type SelectOption = {
91137
value: string;
92138
label: string;
@@ -99,6 +145,27 @@ const referenceColumnInfo = (
99145
</div>
100146
);
101147

148+
const getDrugName = (drugs: IDrug[], rules: IRule[]) => {
149+
// Create a map of drug ids to drug names for quick lookup
150+
const drugMap = new Map();
151+
drugs.forEach((drug: any) => {
152+
drugMap.set(drug.id, drug.name);
153+
});
154+
155+
const drugRule = rules.filter((rule: IRule) => rule.entity === 'DRUG')[0];
156+
157+
if (!drugRule) {
158+
return drugs[0].name;
159+
}
160+
return drugRule.rule
161+
.split(/([+,])/)
162+
.map((part: any) => {
163+
const id = parseInt(part, 10);
164+
return isNaN(id) ? part : drugMap.get(id) || part;
165+
})
166+
.join('');
167+
};
168+
102169
const parseCDx = () => {
103170
const parsedCompanionDiagnosticDevices: ICompanionDiagnosticDevice[] = [];
104171
for (const cdx of companionDiagnosticDevices) {
@@ -131,18 +198,8 @@ const parseCDx = () => {
131198
).map((gene: any) => ({
132199
gene,
133200
alterations: uniq(assoc.alterations.map((a: any) => a.name)).sort(),
134-
drugs: assoc.treatments
135-
.map((treatment: any) =>
136-
treatment.drugs.map((drug: any) => drug.name).join(' + ')
137-
)
138-
.join(', '),
139-
cancerTypes: assoc.associationCancerTypes.reduce(
140-
(ctAcc: any[], act: any) => {
141-
ctAcc.push(act.cancerType);
142-
return ctAcc;
143-
},
144-
[]
145-
),
201+
drugs: getDrugName(assoc.drugs, assoc.rules),
202+
cancerTypes: assoc.cancerTypes,
146203
fdaSubmissions: assoc.fdaSubmissions,
147204
}));
148205
})

src/main/webapp/app/pages/newsPage/ChangedAnnotationListItem.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export const ChangedAnnotationListItem = (props: {
117117
case AnnotationColumnHeaderType.UPDATED_SAME_LEVEL_DRUG:
118118
annotationColumnHeader = CHANGED_ANNOTATION_UPDATED_DRUG_SAME_HIGHEST_LEVEL_COLUMNS;
119119
defaultTitle =
120-
"Addition of drug(s) associated with a tumor type-specific leveled alteration(s) currently in OncoKB™ (without changing the alteration's highest level of evidence)";
120+
"Updated therapeutic implications - Addition of drug(s) associated with a tumor type-specific leveled alteration(s) currently in OncoKB™ (without changing the alteration's highest level of evidence)";
121121
useOneLineRowClass = true;
122122
break;
123123
case AnnotationColumnHeaderType.LEVEL:

src/main/webapp/app/pages/newsPage/NewsPage.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export default class NewsPage extends React.Component<{
8787
<CitationText />
8888
</div>
8989
<div className="mt-2">
90+
<NewsList date={'10242024'} />
9091
<NewsList date={'09252024'} />
9192
<NewsList date={'08152024'} />
9293
<NewsList date={'07042024'} />

0 commit comments

Comments
 (0)