Skip to content

Commit

Permalink
Fix Fabric issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah-tuva committed Dec 11, 2024
1 parent cfd9178 commit c3cb456
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
7 changes: 7 additions & 0 deletions ci_testing/macros/quote_column.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% macro quote_column(column_name) %}
{%- if target.type == 'fabric' -%}
"{{ column_name }}"
{%- else -%}
{{ column_name }}
{%- endif -%}
{% endmacro %}
2 changes: 1 addition & 1 deletion ci_testing/models/provider_attribution.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ select {% if target.type == 'fabric' %} top 0 {% else %}{% endif %}
, cast(null as {{ dbt.type_string() }} ) as patient_id
, cast(null as {{ dbt.type_string() }} ) as year_month
, cast(null as {{ dbt.type_string() }} ) as payer
, cast(null as {{ dbt.type_string() }} ) as plan
, cast(null as {{ dbt.type_string() }} ) as {{ quote_column('plan') }}
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_string() }} ) as payer_attributed_provider
, cast(null as {{ dbt.type_string() }} ) as payer_attributed_provider_practice
Expand Down
2 changes: 1 addition & 1 deletion models/core/core_models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ models:
- patient_id
- member_id
- payer
- plan
- '{{ quote_column("plan") }}'
- data_source
columns:
- name: person_id
Expand Down
13 changes: 5 additions & 8 deletions models/core/final/core__condition.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ with all_conditions as (
{% if var('clinical_enabled', var('tuva_marts_enabled', False)) == true
and var('claims_enabled', var('tuva_marts_enabled', False)) == true -%}

{{ dbt_utils.union_relations(

relations=[
ref('core__stg_claims_condition'),
ref('core__stg_clinical_condition')
]

) }}
select *
from {{ ref('core__stg_claims_condition') }}
union all
select *
from {{ ref('core__stg_clinical_condition') }}

{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}

Expand Down

0 comments on commit c3cb456

Please sign in to comment.