diff --git a/docker-compose.yml b/docker-compose.yml index 146da34..68a0509 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -58,6 +58,7 @@ services: spot: image: samply/rustyspot:main + platform: linux/amd64 ports: - "8055:8055" environment: @@ -93,6 +94,7 @@ services: beam-proxy: image: docker.verbis.dkfz.de/cache/samply/beam-proxy:develop + platform: linux/amd64 environment: BROKER_URL: https://${BROKER_HOST} PROXY_ID: ${LOCAL_BEAM_ID}.${BROKER_HOST} diff --git a/packages/demo/public/options-ccp-demo.json b/packages/demo/public/options-ccp-demo.json index f57e95c..0122c8f 100644 --- a/packages/demo/public/options-ccp-demo.json +++ b/packages/demo/public/options-ccp-demo.json @@ -24,6 +24,36 @@ "dktk-test": "DKTK-Test", "hamburg": "Hamburg" }, + "catalogueKeyToResponseKeyMap": [ + [ + "gender", + "Gender" + ], + [ + "age_at_diagnosis", + "Age" + ], + [ + "diagnosis", + "diagnosis" + ], + [ + "medicationStatements", + "MedicationType" + ], + [ + "sample_kind", + "sample_kind" + ], + [ + "therapy_of_tumor", + "ProcedureType" + ], + [ + "75186-7", + "75186-7" + ] + ], "chartOptions": { "patients": { "legendMapping": { @@ -237,36 +267,6 @@ "wuerzburg", "mannheim", "hamburg" - ], - "catalogueKeyToResponseKeyMap": [ - [ - "gender", - "Gender" - ], - [ - "age_at_diagnosis", - "Age" - ], - [ - "diagnosis", - "diagnosis" - ], - [ - "medicationStatements", - "MedicationType" - ], - [ - "sample_kind", - "sample_kind" - ], - [ - "therapy_of_tumor", - "ProcedureType" - ], - [ - "75186-7", - "75186-7" - ] ] } ] diff --git a/packages/demo/public/options-ccp-prod.json b/packages/demo/public/options-ccp-prod.json index 9b30387..77f517c 100644 --- a/packages/demo/public/options-ccp-prod.json +++ b/packages/demo/public/options-ccp-prod.json @@ -25,6 +25,36 @@ "dktk-test": "DKTK-Test", "hamburg": "Hamburg" }, + "catalogueKeyToResponseKeyMap": [ + [ + "gender", + "Gender" + ], + [ + "age_at_diagnosis", + "Age" + ], + [ + "diagnosis", + "diagnosis" + ], + [ + "medicationStatements", + "MedicationType" + ], + [ + "sample_kind", + "sample_kind" + ], + [ + "therapy_of_tumor", + "ProcedureType" + ], + [ + "75186-7", + "75186-7" + ] + ], "chartOptions": { "patients": { "legendMapping": { @@ -232,36 +262,6 @@ "wuerzburg", "mannheim", "hamburg" - ], - "catalogueKeyToResponseKeyMap": [ - [ - "gender", - "Gender" - ], - [ - "age_at_diagnosis", - "Age" - ], - [ - "diagnosis", - "diagnosis" - ], - [ - "medicationStatements", - "MedicationType" - ], - [ - "sample_kind", - "sample_kind" - ], - [ - "therapy_of_tumor", - "ProcedureType" - ], - [ - "75186-7", - "75186-7" - ] ] } ] diff --git a/packages/demo/public/options-dev.json b/packages/demo/public/options-dev.json index 7b5f296..96226d4 100644 --- a/packages/demo/public/options-dev.json +++ b/packages/demo/public/options-dev.json @@ -23,6 +23,36 @@ "dktk-test": "DKTK-Test", "hamburg": "Hamburg" }, + "catalogueKeyToResponseKeyMap": [ + [ + "gender", + "Gender" + ], + [ + "age_at_diagnosis", + "Age" + ], + [ + "diagnosis", + "diagnosis" + ], + [ + "medicationStatements", + "MedicationType" + ], + [ + "sample_kind", + "sample_kind" + ], + [ + "therapy_of_tumor", + "ProcedureType" + ], + [ + "75186-7", + "75186-7" + ] + ], "chartOptions": { "patients": { "legendMapping": { @@ -149,7 +179,7 @@ "rna": "RNA", "derivative-other": "Derivat, Andere" }, - "legendMapping":{ + "legendMapping": { "ffpe-tissue": "Gewebe FFPE", "frozen-tissue": "Gewebe schockgefroren", "tissue-other": "Gewebe, Andere Konservierungsart", @@ -239,36 +269,6 @@ "wuerzburg", "mannheim", "hamburg" - ], - "catalogueKeyToResponseKeyMap": [ - [ - "gender", - "Gender" - ], - [ - "age_at_diagnosis", - "Age" - ], - [ - "diagnosis", - "diagnosis" - ], - [ - "medicationStatements", - "MedicationType" - ], - [ - "sample_kind", - "sample_kind" - ], - [ - "therapy_of_tumor", - "ProcedureType" - ], - [ - "75186-7", - "75186-7" - ] ] } ], @@ -276,38 +276,8 @@ { "name": "DKTK", "backendMeasures": "DKTK_STRAT_DEF_IN_INITIAL_POPULATION", - "url": "http://localhost:8080", - "catalogueKeyToResponseKeyMap": [ - [ - "gender", - "Gender" - ], - [ - "age_at_diagnosis", - "Age" - ], - [ - "diagnosis", - "diagnosis" - ], - [ - "medicationStatements", - "MedicationType" - ], - [ - "sample_kind", - "sample_kind" - ], - [ - "therapy_of_tumor", - "ProcedureType" - ], - [ - "75186-7", - "75186-7" - ] - ] + "url": "http://localhost:8080" } ] } -} +} \ No newline at end of file diff --git a/packages/lib/src/components/Options.wc.svelte b/packages/lib/src/components/Options.wc.svelte index 600ac08..5c0a663 100644 --- a/packages/lib/src/components/Options.wc.svelte +++ b/packages/lib/src/components/Options.wc.svelte @@ -23,7 +23,10 @@ import catalogueSchema from "../types/catalogue.schema.json"; import { parser } from "@exodus/schemasafe"; import type { LensOptions } from "../types/options"; - import { uiSiteMappingsStore } from "../stores/mappings"; + import { + catalogueKeyToResponseKeyMap, + uiSiteMappingsStore, + } from "../stores/mappings"; export let options: LensOptions = {}; export let catalogueData: Criteria[] = []; @@ -123,6 +126,15 @@ return mappings; }); + $: catalogueKeyToResponseKeyMap.update((mappings) => { + if (!options?.catalogueKeyToResponseKeyMap) return mappings; + + options.catalogueKeyToResponseKeyMap.forEach((mapping) => { + mappings.set(mapping[0], mapping[1]); + }); + return mappings; + }); + $: $lensOptions = options; $: updateIconStore(options); $: $catalogue = catalogueData; diff --git a/packages/lib/src/components/buttons/SearchButtonComponenet.wc.svelte b/packages/lib/src/components/buttons/SearchButtonComponenet.wc.svelte index c84ddf1..ec4624f 100644 --- a/packages/lib/src/components/buttons/SearchButtonComponenet.wc.svelte +++ b/packages/lib/src/components/buttons/SearchButtonComponenet.wc.svelte @@ -17,17 +17,16 @@ import { buildLibrary, buildMeasure } from "../../helpers/cql-measure"; import { Spot } from "../../classes/spot"; import { Blaze } from "../../classes/blaze"; - import { catalogueKeyToResponseKeyMap } from "../../stores/mappings"; import { responseStore, updateResponseStore } from "../../stores/response"; import { lensOptions } from "../../stores/options"; import type { BackendOptions, - BlazeOption, Measure, MeasureItem, MeasureOption, - SpotOption, } from "../../types/backend"; + import type { BlazeOption } from "../../types/blaze"; + import type { SpotOption } from "../../types/spot"; import type { AstTopLayer } from "../../types/ast"; import type { Site } from "../../types/response"; @@ -39,20 +38,6 @@ let controller: AbortController = new AbortController(); - $: catalogueKeyToResponseKeyMap.update((mappings) => { - options?.spots?.forEach((spot) => { - spot.catalogueKeyToResponseKeyMap.forEach((mapping) => { - mappings.set(mapping[0], mapping[1]); - }); - }); - options?.blazes?.forEach((blaze: BlazeOption) => { - blaze.catalogueKeyToResponseKeyMap.forEach((mapping) => { - mappings.set(mapping[0], mapping[1]); - }); - }); - return mappings; - }); - /** * Triggers a request to the backend. * Multiple spots and blazes can be configured in lens options. diff --git a/packages/lib/src/types/options.schema.json b/packages/lib/src/types/options.schema.json index 42bdfc2..8bedab4 100644 --- a/packages/lib/src/types/options.schema.json +++ b/packages/lib/src/types/options.schema.json @@ -47,6 +47,17 @@ "unevaluatedProperties": false, "required": [] }, + "catalogueKeyToResponseKeyMap": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "pattern": "^.+$", + "description": "The mapping of the catalogue key to the response key" + } + } + }, "chartOptions": { "type": "object", "patternProperties": { @@ -286,17 +297,6 @@ "pattern": "^.+$", "description": "The sites of the spot" } - }, - "catalogueKeyToResponseKeyMap": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "pattern": "^.+$", - "description": "The mapping of the catalogue key to the response key" - } - } } }, "additionalProperties": false, @@ -323,17 +323,6 @@ "type": "string", "pattern": "^.+$", "description": "The URL of the blaze" - }, - "catalogueKeyToResponseKeyMap": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "pattern": "^.+$", - "description": "The mapping of the catalogue key to the response key" - } - } } }, "additionalProperties": false, diff --git a/packages/lib/src/types/options.ts b/packages/lib/src/types/options.ts index 965cc9f..493f005 100644 --- a/packages/lib/src/types/options.ts +++ b/packages/lib/src/types/options.ts @@ -1,6 +1,7 @@ export type LensOptions = { [key: string]: unknown; chartOptions?: ChartOptions; + catalogueKeyToResponseKeyMap?: string[][]; }; export type ChartOptions = {