in clns-acuity-vahub/vahub/src/main/webapp/src/app/common/trellising/store/services/InitialTrellisService.ts [64:147]
static initialNonMandatorySeries(
currentTrellises: ITrellises[], series: ITrellises[], tabId: TabId,
isOngoing: boolean, allSeries: boolean, colorByForYAxis?: YAxisType): ITrellises[] {
const initial: ITrellises[] = [];
const trellisedBys = currentTrellises !== undefined ? currentTrellises.map(x => x.trellisedBy) : [];
if (allSeries) {
return initial;
}
if (currentTrellises === undefined || !this.inOptions(series, ...trellisedBys) ||
TabStoreUtils.isRequiredToSetDefaultColorByOnOptionChange(tabId)) {
switch (tabId) {
case TabId.AES_COUNTS_BARCHART:
this.findAndInsert(initial, series, 'MAX_SEVERITY_GRADE');
break;
case TabId.TL_DIAMETERS_PLOT:
case TabId.TL_DIAMETERS_PER_SUBJECT_PLOT:
this.findAndInsert(initial, series, YAxisType.BEST_RESPONSE);
break;
case TabId.TUMOUR_RESPONSE_WATERFALL_PLOT:
colorByForYAxis ?
this.findAndInsert(initial, series, colorByForYAxis) :
this.findAndInsert(initial, series, YAxisType.ASSESSMENT_RESPONSE, YAxisType.BEST_RESPONSE);
break;
case TabId.AES_OVER_TIME:
this.findAndInsert(initial, series, 'MAX_SEVERITY_GRADE', 'SEVERITY_GRADE');
break;
case TabId.CVOT_ENDPOINTS_OVER_TIME:
this.findAndInsert(initial, series, 'CATEGORY_1');
break;
case TabId.CEREBROVASCULAR_EVENTS_OVER_TIME:
this.findAndInsert(initial, series, 'EVENT_TYPE');
break;
case TabId.CI_EVENT_OVERTIME:
this.findAndInsert(initial, series, 'FINAL_DIAGNOSIS');
break;
case TabId.SINGLE_SUBJECT_RENAL_LINEPLOT:
case TabId.RENAL_CKD_BARCHART:
this.findAndInsert(initial, series, 'CKD_STAGE_NAME');
break;
case TabId.LAB_LINEPLOT:
if (!isOngoing) {
this.findAndInsert(initial, series, 'ARM');
} else {
this.findAndInsert(initial, series, 'SOURCE_TYPE');
}
break;
case TabId.SINGLE_SUBJECT_LAB_LINEPLOT:
if (isOngoing) {
this.findAndInsert(initial, series, 'SOURCE_TYPE');
}
break;
case TabId.EXACERBATIONS_GROUPED_COUNTS:
case TabId.EXACERBATIONS_COUNTS:
case TabId.EXACERBATIONS_OVER_TIME:
this.findAndInsert(initial, series, 'EXACERBATION_SEVERITY');
break;
case TabId.ANALYTE_CONCENTRATION:
// TODO: we need only initials here
this.findAndInsert(initial, series, ...Object.keys(AnalyteTrellises));
break;
case TabId.AES_CHORD_DIAGRAM:
this.findAndInsert(initial, series, ...Object.keys(TermLevelType));
break;
case TabId.CTDNA_PLOT:
this.findAndInsert(initial, series, 'SUBJECT');
break;
case TabId.POPULATION_BARCHART:
case TabId.POPULATION_TABLE:
this.findAndInsert(initial, series, 'COUNTRY', 'STUDY_CODE');
break;
case TabId.BIOMARKERS_HEATMAP_PLOT:
this.findAndInsert(initial, series, 'ALTERATION_TYPE');
break;
case TabId.QT_PROLONGATION:
this.findAndInsert(initial, series, 'ALERT_LEVEL');
break;
default:
break;
}
} else {
this.findAndInsert(initial, series, ...trellisedBys);
}
return initial;
}