From b2a8300872ffc0c76f8c2014daa5c0670258310d Mon Sep 17 00:00:00 2001 From: ruhanga Date: Thu, 16 May 2024 14:11:26 +0300 Subject: [PATCH] KH-502: Concept mappings to be properly concatenated in the concepts query --- analytics/dsl/flattening/queries/concepts.sql | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/analytics/dsl/flattening/queries/concepts.sql b/analytics/dsl/flattening/queries/concepts.sql index 5002990..13a6a10 100755 --- a/analytics/dsl/flattening/queries/concepts.sql +++ b/analytics/dsl/flattening/queries/concepts.sql @@ -1,7 +1,11 @@ SELECT DISTINCT concept.concept_id AS concept_id, LISTAGG( - CONCAT_WS(': ', concept_reference_source.name, concept_reference_term.code), ', ' - ) AS concept_mappings_source_Codes, + CASE + WHEN concept_reference_source.name <> '' AND concept_reference_term.code <> '' + THEN CONCAT_WS(': ', concept_reference_source.name, concept_reference_term.code) + END + , ', ' + ) AS concept_mappings_source_Codes, concept_name.name AS name, concept_name.locale AS locale, concept_name.locale_preferred AS locale_preferred,