;
+
@Input()
filterType: string;
@@ -28,6 +32,7 @@ export class EditValueFilterComponent implements OnInit, AfterViewInit {
@Input()
criterion: Criterion;
+ resetQuantityDisabled = true;
OperatorOptions: typeof OperatorOptions = OperatorOptions;
@@ -43,7 +48,7 @@ export class EditValueFilterComponent implements OnInit, AfterViewInit {
constructor() {}
ngOnInit(): void {
- this.filter?.selectedConcepts?.forEach((concept) => {
+ this.filter?.selectedConcepts.forEach((concept) => {
// bring the object into the right order for stringify
const temp = {
code: concept.code,
@@ -85,6 +90,9 @@ export class EditValueFilterComponent implements OnInit, AfterViewInit {
ngAfterViewInit(): void {
// timeout required to avoid the dreaded 'ExpressionChangedAfterItHasBeenCheckedError'
setTimeout(() => (this.disableAnimation = false));
+ if (this.filter.maxValue || this.filter.minValue || this.filter.value) {
+ this.resetQuantityDisabled = false;
+ }
}
getQuantityFilterOption(): string {
@@ -194,7 +202,7 @@ export class EditValueFilterComponent implements OnInit, AfterViewInit {
}
}
- getSelectedCriterion(termcode: TerminologyCode): Criterion {
+ getSelectedCriterion(termcode?: TerminologyCode): Criterion {
let crit: Criterion;
for (const inex of ['inclusion', 'exclusion']) {
this.query.groups[0][inex + 'Criteria'].forEach((disj) => {
@@ -245,9 +253,51 @@ export class EditValueFilterComponent implements OnInit, AfterViewInit {
});
});
}
-
return isLinked;
}
+
+ doSelectAllCheckboxes() {
+ this.checkboxes.forEach((checkbox, index) => {
+ if (checkbox.checked) {
+ checkbox.checked = false;
+ checkbox.checkedControlForm.patchValue(['checkedControl', false]);
+ if (this.filter.attributeDefinition.type === ValueType.CONCEPT) {
+ this.selectedConceptsAsJson = new Set();
+ this.filter.selectedConcepts = [];
+ } else {
+ this.doSelectConcept(checkbox.concept);
+ }
+ }
+ });
+ }
+
+ resetQuantity() {
+ if (this.filter.maxValue || this.filter.minValue || this.filter.value) {
+ this.resetQuantityDisabled = false;
+ this.filter.maxValue = 0;
+ this.filter.minValue = 0;
+ this.filter.value = 0;
+ }
+ this.resetQuantityDisabled = true;
+ }
+
+ resetButtonDisabled() {
+ if (this.filter.attributeDefinition.type === ValueType.CONCEPT) {
+ if (this.filter.selectedConcepts?.length > 0) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ if (this.filter.attributeDefinition.type === ValueType.REFERENCE) {
+ if (this.criterion.linkedCriteria.length > 0) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ }
+
public isActionDisabled(): boolean {
if (this.filter?.attributeDefinition) {
if (this.filter?.attributeDefinition?.optional) {
diff --git a/src/app/modules/querybuilder/controller/TermEntry2CriterionTranslator.ts b/src/app/modules/querybuilder/controller/TermEntry2CriterionTranslator.ts
index 3069939e..b00db928 100644
--- a/src/app/modules/querybuilder/controller/TermEntry2CriterionTranslator.ts
+++ b/src/app/modules/querybuilder/controller/TermEntry2CriterionTranslator.ts
@@ -41,7 +41,7 @@ export class TermEntry2CriterionTranslator {
return criterion;
}
- public addAttributeAndValueFilterToCrit(
+ public translateCrit(
crit: Criterion,
valueDefinition: ValueDefinition,
attributeDefinitions: AttributeDefinition[]
@@ -54,6 +54,13 @@ export class TermEntry2CriterionTranslator {
crit.attributeFilters.push(this.createAttributeFilter(attributeDefinition));
});
+ /*termEntry.attributeDefinitions?.forEach((attributeDefinition) => {
+ criterion.attributeFilters.push(this.createAttributeFilter(attributeDefinition));
+ });*/
+
+ // criterion.timeRestriction = this.createTimeRestriction(termEntry);
+ //criterion.optional = termEntry.optional;
+
return crit;
}
diff --git a/src/app/modules/querybuilder/model/api/query/attributeFilter.ts b/src/app/modules/querybuilder/model/api/query/attributeFilter.ts
index 19c3dad3..a4802436 100644
--- a/src/app/modules/querybuilder/model/api/query/attributeFilter.ts
+++ b/src/app/modules/querybuilder/model/api/query/attributeFilter.ts
@@ -1,6 +1,6 @@
import { TerminologyCode } from '../terminology/terminology';
-import { ValueFilter } from './valueFilter';
import { Criterion } from './criterion';
+import { ValueFilter } from './valueFilter';
export class AttributeFilter extends ValueFilter {
attributeCode: TerminologyCode;
diff --git a/src/app/modules/querybuilder/service/query-provider.service.ts b/src/app/modules/querybuilder/service/query-provider.service.ts
index 7ec50294..708b72b5 100644
--- a/src/app/modules/querybuilder/service/query-provider.service.ts
+++ b/src/app/modules/querybuilder/service/query-provider.service.ts
@@ -94,7 +94,6 @@ export class QueryProviderService {
},
],
display: 'Alter',
- isLinked: false,
valueFilters: [
{
type: OperatorOptions.QUANTITY_COMPARATOR,
@@ -118,7 +117,6 @@ export class QueryProviderService {
},
],
display: 'F00',
- isLinked: false,
valueFilters: [],
},
{
@@ -130,7 +128,6 @@ export class QueryProviderService {
},
],
display: 'F09',
- isLinked: false,
valueFilters: [],
},
],
@@ -146,7 +143,6 @@ export class QueryProviderService {
},
],
display: 'Geschlecht',
- isLinked: false,
valueFilters: [
{
type: OperatorOptions.CONCEPT,
@@ -172,7 +168,6 @@ export class QueryProviderService {
},
],
display: 'Alter',
- isLinked: false,
valueFilters: [
{
type: OperatorOptions.QUANTITY_COMPARATOR,
@@ -196,7 +191,6 @@ export class QueryProviderService {
},
],
display: 'F00.9',
- isLinked: false,
valueFilters: [],
},
{
@@ -208,7 +202,6 @@ export class QueryProviderService {
},
],
display: 'Körpertemperatur',
- isLinked: false,
valueFilters: [
{
type: OperatorOptions.QUANTITY_RANGE,
diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json
index 0b2114c9..ae676776 100644
--- a/src/assets/i18n/de.json
+++ b/src/assets/i18n/de.json
@@ -237,8 +237,7 @@
},
"LEGAL": {
"DISCLOSURE": "Impressum",
- "DATAPROTECTION": "Datenschutz",
- "CONTACT": "Kontakt"
+ "DATAPROTECTION": "Datenschutz"
},
"BUTTON": {
"SAVE": "Speichern",
diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json
index bc462676..81cccfb0 100644
--- a/src/assets/i18n/en.json
+++ b/src/assets/i18n/en.json
@@ -237,8 +237,7 @@
},
"LEGAL": {
"DISCLOSURE": "Disclosure",
- "DATAPROTECTION": "Data Protection",
- "CONTACT": "Contact"
+ "DATAPROTECTION": "Data Protection"
},
"BUTTON": {
"SAVE": "Save",