diff --git a/server/dataset/termdb.test.ts b/server/dataset/termdb.test.ts index edb5deff50..dc460a70e4 100644 --- a/server/dataset/termdb.test.ts +++ b/server/dataset/termdb.test.ts @@ -261,8 +261,8 @@ export default function (): Mds3 { }, { name: 'Assay Availability', - //keys: ['yes'], type: 'categorical', + categoryKeys: ['1'], termIds: ['assayavailability_cnv', 'assayavailability_fusion', 'assayavailability_germline'], branchIds: [''], propsByTermId: {} diff --git a/shared/types/src/dataset.ts b/shared/types/src/dataset.ts index c61ae23f2b..388e3a427e 100644 --- a/shared/types/src/dataset.ts +++ b/shared/types/src/dataset.ts @@ -1619,17 +1619,9 @@ keep this setting here for reason of: termCollections?: TermCollection[] } -type TermCollection = { +type TermCollectionBase = { /** human readable name as well as unique identifier for this collection */ name: string - /** collection term type. - numeric: - - all member terms must be either integer or float type - categorical: - - all member terms must be categorical terms with same set of categories - */ - type: 'numeric' | 'categorical' - // TODO: add categoryKey field for categorical collections to specify which category attribute to use /** array of dictionary term ids belonging to this collection */ termIds: string[] /** array of branch term ids belonging to this collection, @@ -1647,6 +1639,17 @@ type TermCollection = { }[] } +type NumericTermCollection = TermCollectionBase & { + type: 'numeric' +} + +type CategoricalTermCollection = TermCollectionBase & { + type: 'categorical' + categoryKeys: string[] +} + +type TermCollection = NumericTermCollection | CategoricalTermCollection + type SampleType = { name: string plural_name: string