Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for release v0.4.6 #230

Merged
merged 44 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
d6db41b
chore: remove problematic CQL line from patientsMeasure
timakro Feb 4, 2025
b9f497e
chore: fix vite warning
timakro Feb 5, 2025
e0e4b6d
fix: don't show beam error to user
timakro Feb 7, 2025
1a1df89
chore: restore old structure of the empty query
timakro Feb 7, 2025
4d04090
fix: fix that the query modified dialog was not shown when clearing t…
timakro Feb 7, 2025
d175d45
Merge pull request #204 from samply/chore/restore-old-empty-query
torbrenner Feb 10, 2025
0d48688
Merge pull request #203 from samply/fix/dont-show-beam-error-to-user
torbrenner Feb 10, 2025
910fcf1
Merge pull request #205 from samply/fix/query-modified-dialog-not-shown
patrickskowronekdkfz Feb 11, 2025
91c68c9
Merge pull request #200 from samply/chore/fix-vite-warning
patrickskowronekdkfz Feb 11, 2025
b6507d7
Merge pull request #192 from samply/chore/remove-cql-line
patrickskowronekdkfz Feb 11, 2025
2f69fc9
fix: add missing fields "site_id" and "collection_name" to negotiator…
timakro Feb 11, 2025
b787891
Merge pull request #212 from samply/fix/add-missing-negotiator-fields…
patrickskowronekdkfz Feb 11, 2025
42fe931
feat: also replace % in aggregatedValues
patrickskowronekdkfz Feb 11, 2025
a5d8942
feat: improve BBMRI negotiator error handling and do some cleanup
timakro Feb 11, 2025
d0fb1bf
fix: forgot to include a file in the commit
timakro Feb 11, 2025
dab5908
chore: remove unsed var criteria in ast2cql translator
patrickskowronekdkfz Feb 12, 2025
722a8d1
chore: deprecate getCriteriaAPI
timakro Feb 12, 2025
a358267
chore: remove fragment-development.css
timakro Feb 12, 2025
725ee4d
feat: add a close button to close error toasts
timakro Feb 12, 2025
8844a85
Merge pull request #218 from samply/chore/remove-fragment-development…
patrickskowronekdkfz Feb 13, 2025
5979ddf
Merge pull request #214 from samply/fix/search_in_subgroups_for_place…
patrickskowronekdkfz Feb 14, 2025
fc86808
fix: not clickable links fix
DenisKoether Feb 14, 2025
92d4b5f
Merge pull request #220 from samply/feat/allow-closing-error-toasts
patrickskowronekdkfz Feb 14, 2025
b6dc33c
feat: add getCatalogueAPI()
timakro Feb 14, 2025
d76fccd
feat!: make the negotiator Authorization header configurable in lens …
timakro Feb 14, 2025
cd8bd58
chore!: change the valid values of the "type" prop of the <lens-negot…
timakro Feb 14, 2025
8131daf
chore: log error to console if a site is missing from negotiateOption…
timakro Feb 14, 2025
ae3210e
Merge pull request #217 from samply/chore/deprecate-get-criteria-api
patrickskowronekdkfz Feb 14, 2025
d1fba27
Merge pull request #215 from samply/feat/improve-bbmri-negotiator-err…
patrickskowronekdkfz Feb 14, 2025
eff5622
chore!: turn Status into a tagged union
timakro Feb 3, 2025
7dc154d
fix: return 0 in getAggregatedPopulationForStratumCode if there are n…
timakro Feb 18, 2025
43571bc
Merge pull request #186 from samply/chore/improve-typing
patrickskowronekdkfz Feb 18, 2025
339138f
feat: add message for empty charts
valeriesauer Dec 18, 2024
f68ec46
chore: only show "No Data Available" when no responses are pending
timakro Feb 18, 2025
47cf0d1
chore: remove unused "label" property from ChartDataSets
timakro Feb 18, 2025
f75246a
chore: show "No Data Available" if all datapoints are 0
timakro Feb 19, 2025
e0907fe
Merge pull request #164 from samply/feat/chart-message
patrickskowronekdkfz Feb 19, 2025
eca08c3
chore: update/correct ccp catalogue
patrickskowronekdkfz Feb 24, 2025
538ae43
chore: remove nodeType from AST
timakro Feb 25, 2025
b7aecdd
chore: resolve some small issue around ccp-explorer
patrickskowronekdkfz Feb 25, 2025
6c4932e
chore: remove remaining mentions of nodeType
timakro Feb 25, 2025
0ce024b
Merge pull request #229 from samply/pr-revert-ast-structure2
patrickskowronekdkfz Feb 25, 2025
2cbe38f
Merge pull request #226 from samply/chore/ccp_icd_catalogue
patrickskowronekdkfz Feb 25, 2025
e4e95eb
build: release version 0.4.6
patrickskowronekdkfz Feb 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@samply/lens",
"description": "A web component library for clinical data search and visualisation",
"version": "0.4.5",
"version": "0.4.6",
"type": "module",
"module": "dist/lens.js",
"main": "dist/lens.umd.js",
Expand Down
2,372 changes: 1,510 additions & 862 deletions packages/demo/public/catalogues/catalogue-dktk.json

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions packages/demo/src/AppCCP.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
let catalogueUrl: string = "";
let optionsFilePath: string = "";

if (import.meta.env.VITE_TARGET_ENVIRONMENT === "production") {
let environment = import.meta.env.VITE_TARGET_ENVIRONMENT;

if (environment === "production") {
catalogueUrl = "catalogues/catalogue-dktk.json";
optionsFilePath = "options-ccp-prod.json";
} else {
Expand Down Expand Up @@ -158,10 +160,12 @@
<div class="charts">
<div class="chart-wrapper result-summary">
<lens-result-summary />
<lens-negotiate-button
type={"ccp"}
title={"Daten und Proben Anfragen"}
></lens-negotiate-button>
{#if environment !== "production"}
<lens-negotiate-button
type={"ProjectManager"}
title={"Daten und Proben Anfragen"}
></lens-negotiate-button>
{/if}
<lens-search-modified-display
>Diagramme repräsentieren nicht mehr die aktuelle Suche!</lens-search-modified-display
>
Expand Down Expand Up @@ -290,7 +294,7 @@
>
<a
class="privacy-policy"
href="https://hub.dkfz.de/s/M8Ldxd5GsfrQG9S"
href="https://hub.dkfz.de/s/5LPccy6fgRSoD65"
download="datenschutzerklaerung"
target="_blank">Datenschutz</a
>
Expand Down
29 changes: 0 additions & 29 deletions packages/demo/src/fragment-development.css

This file was deleted.

3 changes: 0 additions & 3 deletions packages/demo/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

import "../../lib";

// import "./fragment-development.css";
// import App from "./AppFragmentDevelopment.svelte";

import "./ccp.css";
import App from "./AppCCP.svelte";

Expand Down
1 change: 0 additions & 1 deletion packages/demo/src/measures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ First(

define AgeClass:
if (Patient.birthDate is null) then 'unknown' else ToString((AgeInYears() div 10) * 10)
if (PrimaryDiagnosis.onset is null) then 'unknown' else ToString((AgeInYearsAt(FHIRHelpers.ToDateTime(PrimaryDiagnosis.onset)) div 10) * 10)

define PatientDeceased:
First (from [Observation: Code '75186-7' from loinc] O return O.value.coding.where(system = 'http://dktk.dkfz.de/fhir/onco/core/CodeSystem/VitalstatusCS').code.first())
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export { default as DataPasser } from "./src/components/DataPasser.wc.svelte";
export { default as ModifiedSearchComponent } from "./src/components/informational/ModifiedSearchComponent.wc.svelte";
export { default as ErrorToasts } from "./src/components/ErrorToasts.wc.svelte";

export * from "./src/styles/index.css";
import "./src/styles/index.css";
2 changes: 1 addition & 1 deletion packages/lib/src/classes/blaze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class Blaze {
try {
let response: ResponseStore = new Map<string, Site>().set(
this.name,
{ status: "claimed", data: {} as SiteData },
{ status: "claimed" },
);

this.updateResponse(response);
Expand Down
11 changes: 2 additions & 9 deletions packages/lib/src/classes/spot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* TODO: document this class
*/

import type { SiteData, Status } from "../types/response";
import type { SiteData } from "../types/response";
import type { ResponseStore } from "../types/backend";
import type { BeamResult } from "../types/spot";
import { errorChannel } from "../stores/error-channel";
Expand Down Expand Up @@ -67,7 +67,7 @@ export class Spot {
const response: BeamResult = JSON.parse(message.data);
if (response.task !== this.currentTask) return;
const site: string = response.from.split(".")[1];
const status: Status = response.status;
const status = response.status;
const body: SiteData =
status === "succeeded"
? JSON.parse(atob(response.body))
Expand All @@ -80,13 +80,6 @@ export class Spot {
updateResponse(parsedResponse);
});

// read error events from beam
eventSource.addEventListener("error", (message) => {
console.error(`Beam returned error ${message}`);
errorChannel.set("Fehler von Beam erhalten"); // show user-facing error
eventSource.close();
});

// event source in javascript throws an error then the event source is closed by backend
eventSource.onerror = () => {
console.info(
Expand Down
11 changes: 11 additions & 0 deletions packages/lib/src/components/DataPasser.wc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<!-- This component offers an api to pass and get data from the stores -->
<script lang="ts">
import { get } from "svelte/store";
import { catalogue, getCriteria } from "../stores/catalogue";
import { responseStore, updateResponseStore } from "../stores/response";
import {
Expand All @@ -24,6 +25,7 @@
RemoveValueFromQueryAPIParams,
} from "../types/dataPasser";
import { buildQueryFromAst } from "../helpers/ast-transformer";
import type { Category } from "../types/treeData";

/**
* Getters
Expand Down Expand Up @@ -65,11 +67,20 @@
* returns the catalogue to the library user
* @param category the category name (e.g. "diagnosis")
* @returns array of strings containing the bottom level items' keys
* @deprecated Marked for deletion in v0.4.7. You may use getCatalogueAPI() and extract the criteria yourself.
*/
export const getCriteriaAPI = (category: string): string[] => {
return getCriteria(category);
};

/**
* Get the catalogue
* @returns The catalogue
*/
export const getCatalogueAPI = (): Category[] => {
return get(catalogue);
};

/**
* Setters
*/
Expand Down
38 changes: 32 additions & 6 deletions packages/lib/src/components/ErrorToasts.wc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,56 @@
import { fade } from "svelte/transition";
import { errorChannel } from "../stores/error-channel";

let toasts: { uuid: string; message: string }[] = [];
// Each toast has a unique id that maps to the error message
let toasts: Map<string, string> = new Map();

/**
* @param message user-facing error message
*/
function showToast(message: string): void {
toasts.push({ uuid: crypto.randomUUID(), message });
const uuid = crypto.randomUUID();
toasts.set(uuid, message);
toasts = toasts; // update

setTimeout(() => {
toasts.shift();
toasts.delete(uuid);
toasts = toasts; // update
}, 8000);
}

// subscribe to error channel
$: if ($errorChannel) {
$: if ($errorChannel !== "") {
showToast($errorChannel);
errorChannel.set("");
}
</script>

<div part="flex-container">
{#each toasts as toast (toast.uuid)}
<div out:fade part="toast">{toast.message}</div>
{#each toasts as [uuid, message] (uuid)}
<div out:fade part="toast">
<div part="message">{message}</div>
<button
part="close-button"
on:click={() => {
toasts.delete(uuid);
toasts = toasts; // update
}}
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
style="height: 24px; width: 24px; display: block;"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M6 18 18 6M6 6l12 12"
/>
</svg>
</button>
</div>
{/each}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script lang="ts">
import { datarequestsStore } from "../../stores/datarequests";
import { negotiate } from "../../services/ccpProjectManager";
import { bbmrinegotiate } from "../../services/bbmriNegotiate";
import { bbmriNegotiate } from "../../services/bbmriNegotiate";

export let title: string = "Negotiate with biobanks";
export let type: string;
Expand All @@ -16,9 +16,9 @@
*
*/
function exec(): void {
if (type == "bbmri") {
bbmrinegotiate($datarequestsStore);
} else if (type == "ccp") {
if (type == "Negotiator") {
bbmriNegotiate($datarequestsStore);
} else if (type == "ProjectManager") {
negotiate($datarequestsStore);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
} from "../../types/backend";
import type { BlazeOption } from "../../types/blaze";
import type { SpotOption } from "../../types/spot";
import type { AstTopLayer } from "../../types/ast";
import { isTopLayer, type AstTopLayer } from "../../types/ast";
import type { Site } from "../../types/response";

export let title: string = "Search";
Expand Down Expand Up @@ -54,12 +54,10 @@
// If one of the AND nodes has no children that means the corresponding search bar is empty.
if (
ast.children.some(
(child) =>
child.nodeType === "branch" && child.children.length === 0,
(child) => isTopLayer(child) && child.children.length === 0,
) &&
ast.children.some(
(child) =>
child.nodeType === "branch" && child.children.length !== 0,
(child) => isTopLayer(child) && child.children.length !== 0,
)
) {
console.error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
queryStore,
removeItemFromQuery,
removeValueFromQuery,
queryModified,
} from "../../stores/query";
import { iconStore } from "../../stores/icons";
import type { QueryItem } from "../../types/queryData";
Expand All @@ -23,6 +24,7 @@
dispatch("clear-search");

if (type === "group") {
queryModified.set(true);
queryStore.update((query) => {
query = query.filter((group, i) => i !== index);
if (query.length === 0) {
Expand Down
Loading
Loading