diff --git a/models/br_ms_cnes/br_ms_cnes__estabelecimento.sql b/models/br_ms_cnes/br_ms_cnes__estabelecimento.sql index 8bdd4a67..fb149afd 100644 --- a/models/br_ms_cnes/br_ms_cnes__estabelecimento.sql +++ b/models/br_ms_cnes/br_ms_cnes__estabelecimento.sql @@ -263,6 +263,7 @@ select safe_cast(ap07cv04 as int64) indicador_atendimento_regulacao_plano_seguro_terceiro, safe_cast(ap07cv05 as int64) indicador_atendimento_regulacao_plano_saude_publico, safe_cast(ap07cv06 as int64) indicador_atendimento_regulacao_plano_saude_privado +from cnes_add_muni {% if is_incremental() %} where diff --git a/models/br_ms_cnes/br_ms_cnes__estabelecimento_filantropico.sql b/models/br_ms_cnes/br_ms_cnes__estabelecimento_filantropico.sql index 3d7145d2..6755b719 100644 --- a/models/br_ms_cnes/br_ms_cnes__estabelecimento_filantropico.sql +++ b/models/br_ms_cnes/br_ms_cnes__estabelecimento_filantropico.sql @@ -62,6 +62,7 @@ select ) data_portaria, cast(substr(maportar, 1, 4) as int64) as ano_portaria, cast(substr(maportar, 5, 2) as int64) as mes_portaria, +from cnes_add_muni {% if is_incremental() %} where diff --git a/models/br_ms_cnes/br_ms_cnes__profissional.sql b/models/br_ms_cnes/br_ms_cnes__profissional.sql index 93b1d402..88ca48e1 100644 --- a/models/br_ms_cnes/br_ms_cnes__profissional.sql +++ b/models/br_ms_cnes/br_ms_cnes__profissional.sql @@ -32,7 +32,7 @@ with cast(ano as string) as ano1, cast(mes as string) as mes1, id_estabelecimento_cnes as iddd - from `basedosdados-staging.br_ms_cnes.estabelecimento` + from `basedosdados.br_ms_cnes.estabelecimento` ) as st on pf.cnes = st.iddd and pf.ano = st.ano1