From dbb1d52b38a486c1f6617b1418218fb0302382bf Mon Sep 17 00:00:00 2001 From: Pedro Marques Date: Thu, 29 Aug 2024 15:52:29 -0300 Subject: [PATCH] feat: Returning Clinical Exams List --- .../mart_historico_clinico_app__episodio.sql | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/models/marts/historico_clinico_app/mart_historico_clinico_app__episodio.sql b/models/marts/historico_clinico_app/mart_historico_clinico_app__episodio.sql index 89eafbd0..d64e5324 100644 --- a/models/marts/historico_clinico_app/mart_historico_clinico_app__episodio.sql +++ b/models/marts/historico_clinico_app/mart_historico_clinico_app__episodio.sql @@ -64,6 +64,15 @@ with else 'default' end as string) as exhibition_type, + array( + select + struct( + tipo as type, + descricao as description + ) + from unnest(exames_realizados) + where tipo is not null + ) as clinical_exams, array( select descricao from unnest(condicoes) where descricao is not null ) as active_cids,