Skip to content

Commit

Permalink
Merge pull request #17 from samply/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
MatsJohansen87 authored Oct 26, 2023
2 parents bfbb358 + b2e20e5 commit 1cadd49
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/demo/src/AppCCP.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
title="Ergebnisse"
resultSummaryDataTypes={JSON.stringify(resultSummaryConfig)}
/>
<lens-search-modified-display>Diagramme repräsentieren nicht mehr die aktuelle Suche!</lens-search-modified-display>
</div>
<div class="chart-wrapper">
<lens-chart
Expand Down Expand Up @@ -303,6 +304,7 @@
chartType="bar"
headers={therapyHeaders}
tooltips={therapyTooltips}
xAxisTitle="Art der Therapie"
yAxisTitle="Anzahl der Therapien"
/>
</div>
Expand All @@ -312,6 +314,7 @@
catalogueGroupCode="medicationStatements"
chartType="bar"
tooltips={systemicTherapyTooltips}
xAxisTitle="Art der Therapie"
yAxisTitle="Anzahl der Therapien"
/>
</div>
Expand Down
1 change: 1 addition & 0 deletions packages/demo/src/ccp.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@import url('./styles/default/result-chart.css');
@import url('./styles/default/negotiate-button.css');
@import url('./styles/default/info-button.css');
@import url('./styles/default/search-modified-display.css');

@font-face {
font-family: 'Open Sans';
Expand Down
8 changes: 8 additions & 0 deletions packages/demo/src/styles/default/search-modified-display.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
lens-search-modified-display::part(display-wrapper){
border: solid var(--light-orange) 1px;
border-radius: var(--border-radius-small);
padding: var(--gap-xxs) var(--gap-xs);
text-align: center;
width: max-content;
margin: var(--gap-xs) auto;
}
3 changes: 2 additions & 1 deletion packages/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export { default as ResultTableComponent } from './src/components/results/Result
export { default as SearchBarMultipleComponent } from './src/components/search-bar/SearchBarMultipleComponent.wc.svelte'
export { default as NegotiateButtonComponent } from './src/components/buttons/NegotiateButtonComponent.wc.svelte'
export { default as InfoButton } from './src/components/buttons/InfoButtonComponent.wc.svelte'
export { default as lensOptions } from './src/components/Options.wc.svelte'
export { default as lensOptions } from './src/components/Options.wc.svelte'
export { default as ModifiedSearchComponent } from './src/components/informational/ModifiedSearchComponent.wc.svelte'
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<script lang="ts">
import { buildAstFromQuery } from "../../helpers/ast-transformer";
import { queryStore } from "../../stores/query";
import { queryModified, queryStore } from "../../stores/query";
import { measureStore } from "../../stores/measures";
import {translateAstToCql} from "../../cql-translator-service/ast-to-cql-translator";
import { buildLibrary, buildMeasure } from "../../helpers/cql-measure";
Expand Down Expand Up @@ -86,6 +86,8 @@
controller
)
queryModified.set(false);
};
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<svelte:options
customElement={{
tag: "lens-search-modified-display",
}}
/>

<script lang="ts">
import { queryModified } from "../../stores/query";
console.log('asdf');
$: console.log($queryModified);
</script>

{#if $queryModified}
<div part='display-wrapper'>
<slot></slot>
</div>
{/if}
2 changes: 1 addition & 1 deletion packages/lib/src/stores/negotiate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const buildHumanReadableRecursively = (queryLayer: AstElement, humanReadableQuer
if(index === queryLayer.children.length - 1){
}
if(index < queryLayer.children.length - 1){
humanReadableQuery += queryLayer.operand
humanReadableQuery += ` ${queryLayer.operand} `
}

})
Expand Down
8 changes: 8 additions & 0 deletions packages/lib/src/stores/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ import type { QueryItem, QueryValue } from "../types/queryData";
import { writable } from "svelte/store";
import { v4 as uuidv4 } from "uuid";



export const queryStore = writable<QueryItem[][]>([[]]);

export const activeQueryGroupIndex = writable(0);

export const queryModified = writable(false);

/**
* Adds an item to the query
* If the item already exists in the query, the value will be added to the existing item
Expand All @@ -20,6 +24,8 @@ export const activeQueryGroupIndex = writable(0);
* @param queryGroupIndex
*/
export const addItemToQuery = (queryObject: QueryItem, queryGroupIndex: number) => {
queryModified.set(true);

/**
* prevent mutation of the original object
* otherwise the queryStore will not update properly with live changes inside the catalogue
Expand Down Expand Up @@ -101,6 +107,7 @@ export const addItemToQuery = (queryObject: QueryItem, queryGroupIndex: number)
* @param queryGroupIndex
*/
export const removeValueFromQuery = (queryObject: QueryItem, queryGroupIndex: number) => {
queryModified.set(true);
/**
* prevent mutation of the original object
* otherwise the queryStore will not update properly with live changes inside the catalogue
Expand All @@ -127,6 +134,7 @@ export const removeValueFromQuery = (queryObject: QueryItem, queryGroupIndex: nu


export const removeItemFromQuery = (queryObject: QueryItem, queryGroupIndex: number) => {
queryModified.set(true);
/**
* prevent mutation of the original object
* otherwise the queryStore will not update properly with live changes inside the catalogue
Expand Down

0 comments on commit 1cadd49

Please sign in to comment.