Skip to content

Commit

Permalink
Merge pull request #121 from samply/feat/move-response-key-map-in-opt…
Browse files Browse the repository at this point in the history
…ions

feat(options): move catalog response key map
  • Loading branch information
MatsJohansen87 authored Sep 2, 2024
2 parents ea1df82 + 640fb99 commit 2cc93c6
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 163 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ services:

spot:
image: samply/rustyspot:main
platform: linux/amd64
ports:
- "8055:8055"
environment:
Expand Down Expand Up @@ -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}
Expand Down
60 changes: 30 additions & 30 deletions packages/demo/public/options-ccp-demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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"
]
]
}
]
Expand Down
60 changes: 30 additions & 30 deletions packages/demo/public/options-ccp-prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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"
]
]
}
]
Expand Down
96 changes: 33 additions & 63 deletions packages/demo/public/options-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -239,75 +269,15 @@
"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"
]
]
}
],
"blazes": [
{
"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"
}
]
}
}
}
14 changes: 13 additions & 1 deletion packages/lib/src/components/Options.wc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [];
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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.
Expand Down
Loading

0 comments on commit 2cc93c6

Please sign in to comment.