From 9c3f010d9834ee9d479872e7a738a764ad15d94c Mon Sep 17 00:00:00 2001 From: Patrick Skowronek Date: Mon, 12 Aug 2024 11:34:35 +0200 Subject: [PATCH] feat: added dktk project based search --- .../public/catalogues/catalogue-dktk.json | 51 +++++++++++++++++++ .../ast-to-cql-translator.ts | 1 + .../cqlquery-mappings.ts | 5 ++ 3 files changed, 57 insertions(+) diff --git a/packages/demo/public/catalogues/catalogue-dktk.json b/packages/demo/public/catalogues/catalogue-dktk.json index 88e3c3a..0b98b1f 100644 --- a/packages/demo/public/catalogues/catalogue-dktk.json +++ b/packages/demo/public/catalogues/catalogue-dktk.json @@ -20354,5 +20354,56 @@ ] } ] + }, + { + "key": "project", + "name": "Forschungsprojekte", + "infoButtonText": ["Projekt-Übersicht"], + "childCategories": [ + { + "key": "pseudo_projects", + "name": "Projektname", + "fieldType": "single-select", + "type": "EQUALS", + "system": "", + "criteria": [ + { + "key": "DKTK000002089", + "name": "EXLIQUID", + "description": "" + }, + { + "key": "DKTK000001985", + "name": "RiskY-AML", + "description": "" + }, + { + "key": "DKTK000001986", + "name": "MASTER-Programm", + "description": "" + }, + { + "key": "DKTK000001950", + "name": "IRCC", + "description": "" + }, + { + "key": "DKTK000001951", + "name": "ARMANI", + "description": "" + }, + { + "key": "DKTK999999999", + "name": "Testprojekt", + "description": "" + }, + { + "key": "DKTK000000791", + "name": "ReKo", + "description": "" + } + ] + } + ] } ] \ No newline at end of file diff --git a/packages/lib/src/cql-translator-service/ast-to-cql-translator.ts b/packages/lib/src/cql-translator-service/ast-to-cql-translator.ts index 23e2917..f31cd03 100644 --- a/packages/lib/src/cql-translator-service/ast-to-cql-translator.ts +++ b/packages/lib/src/cql-translator-service/ast-to-cql-translator.ts @@ -111,6 +111,7 @@ const getSingleton = (criterion: AstBottomLayerValue): string => { if (myCQL) { switch (myCriterion.type) { case "gender": + case "pseudo_projects": case "BBMRI_gender": case "histology": case "conditionValue": diff --git a/packages/lib/src/cql-translator-service/cqlquery-mappings.ts b/packages/lib/src/cql-translator-service/cqlquery-mappings.ts index 12bcac6..2c0cc38 100644 --- a/packages/lib/src/cql-translator-service/cqlquery-mappings.ts +++ b/packages/lib/src/cql-translator-service/cqlquery-mappings.ts @@ -82,6 +82,10 @@ export const alias = new Map([ export const cqltemplate = new Map([ ["gender", "Patient.gender = '{{C}}'"], + [ + "pseudo_projects", + " exists ( Patient.extension E where E.url = 'http://dktk.dkfz.de/fhir/Projects/{{C}}')", + ], ["conditionValue", "exists [Condition: Code '{{C}}' from {{A1}}]"], [ "conditionBodySite", @@ -275,6 +279,7 @@ export const cqltemplate = new Map([ export const criterionMap = new Map( [ ["gender", { type: "gender" }], + ["pseudo_projects", { type: "pseudo_projects" }], ["histology", { type: "histology", alias: ["loinc"] }], ["diagnosis", { type: "conditionValue", alias: ["icd10"] }], ["bodySite", { type: "conditionBodySite", alias: ["bodySite"] }],