import * as React from 'react'; import { normalizeLevel, mergeAlterations, getPositionalVariant, } from '../util/OncoKbUtils'; import Tooltip from 'rc-tooltip'; import _ from 'lodash'; import { defaultArraySortMethod, defaultSortMethod, LEVELS, } from '../util/OncoKbUtils'; import { OncoKbCardDataType } from '../model/OncoKB'; import LevelIcon from './icon/LevelIcon'; export default class OncoKbHelper { public static get TX_LEVELS(): string[] { return ['1', '2', '3A', '3B', '4', 'R1', 'R2']; } public static get DX_LEVELS(): string[] { return ['Dx1', 'Dx2', 'Dx3']; } public static get PX_LEVELS(): string[] { return ['Px1', 'Px2', 'Px3']; } public static get LEVELS(): string[] { return [...this.TX_LEVELS, ...this.DX_LEVELS, ...this.PX_LEVELS]; } public static getLevelsDesc(dataType: OncoKbCardDataType) { switch (dataType) { case OncoKbCardDataType.TXS: case OncoKbCardDataType.TXR: return _.pick(this.LEVEL_DESC, this.TX_LEVELS); case OncoKbCardDataType.DX: return _.pick(this.LEVEL_DESC, this.DX_LEVELS); case OncoKbCardDataType.PX: return _.pick(this.LEVEL_DESC, this.PX_LEVELS); default: return {}; } } public static get LEVEL_DESC(): { [level: string]: JSX.Element } { return { '1': ( FDA-recognized biomarker predictive of response to an{' '} FDA-approved drug in this indication ), '2': ( Standard care biomarker recommended by the NCCN or other expert panels predictive of response to an{' '} FDA-approved drug in this indication ), '3A': ( Compelling clinical evidence supports the biomarker as being predictive of response to a drug in this indication ), '3B': ( Standard care or investigational biomarker{' '} predictive of response to an FDA-approved or{' '} investigational drug in another indication ), '4': ( Compelling biological evidence supports the biomarker as being predictive of response to a drug ), R1: ( Standard care biomarker predictive of{' '} resistance to an FDA-approved drug{' '} in this indication ), R2: ( Compelling clinical evidence supports the biomarker as being predictive of resistance to a drug ), Dx1: ( FDA and/or professional guideline-recognized{' '} biomarker required for diagnosis in this indication ), Dx2: ( FDA and/or professional guideline-recognized{' '} biomarker that supports diagnosis in this indication ), Dx3: ( Biomarker that may assist disease diagnosis in this indication based on clinical evidence ), Px1: ( FDA and/or professional guideline-recognized{' '} biomarker prognostic in this indication based on{' '} well-powered studie(s) ), Px2: ( FDA and/or professional guideline-recognized{' '} biomarker prognostic in this indication based on{' '} a single or multiple small studies ), Px3: ( Biomarker is prognostic in this indication based on{' '} clinical evidence in well-powered studies ), }; } public static getDefaultColumnDefinition( columnKey: 'level' | 'alterations' ) { switch (columnKey) { case 'level': return { id: 'level', Header: