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,