Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuva Data Model Change: Add person_id #685

Merged
merged 41 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f198420
Add person_id to integration_tests
sarah-tuva Nov 15, 2024
97919f6
Add person_id to claims_preprocessing
sarah-tuva Nov 19, 2024
45ac825
Add person_id to doc blocks
sarah-tuva Nov 19, 2024
02453a8
Merge branch 'main' into add-person-id
sarah-tuva Nov 19, 2024
33878a0
Add file_name and ingest_datetime to doc blocks
sarah-tuva Nov 20, 2024
cbf0e89
Update integration_tests
sarah-tuva Nov 20, 2024
e0fbd72
Add person_id to core
sarah-tuva Nov 20, 2024
77310fc
Add patient_id back to claims sources in integration_tests
sarah-tuva Nov 22, 2024
9cf37d3
Revert "Add patient_id back to claims sources in integration_tests"
sarah-tuva Nov 22, 2024
2133b85
Remove source member and patient ids from core
sarah-tuva Dec 3, 2024
ab9f988
Add person_id to financial_pmpm
sarah-tuva Dec 3, 2024
5c82c49
Remove source member and patient ids from core docs
sarah-tuva Dec 3, 2024
4c8adf9
Add person_id to ahrq_measures
sarah-tuva Dec 3, 2024
cefc042
Add person_id to ccsr
sarah-tuva Dec 3, 2024
052397d
Add person_id to chronic_conditions
sarah-tuva Dec 3, 2024
ceecc9b
Add person_id to cms_hcc
sarah-tuva Dec 3, 2024
dd47e42
Add person_id to data_quality
sarah-tuva Dec 3, 2024
513f174
Add person_id to ed_classification
sarah-tuva Dec 3, 2024
7c10417
Add person_id to hcc_suspecting
sarah-tuva Dec 3, 2024
e56834d
Add person_id to pharmacy
sarah-tuva Dec 3, 2024
be3f82f
Add person_id to quality_measures
sarah-tuva Dec 3, 2024
ec2a36c
Add person_id to readmissions
sarah-tuva Dec 3, 2024
1e96cc0
Add phone to core patient
sarah-tuva Dec 4, 2024
e029d50
Add person_id tests to core
sarah-tuva Dec 4, 2024
a03618f
Add person_id tests to ci_testing
sarah-tuva Dec 4, 2024
20799d0
Revert back to patient_id for clinical data quality tests
sarah-tuva Dec 6, 2024
1edc204
Revert back to patient_id for clinical data quality tests
sarah-tuva Dec 6, 2024
fb36341
Revert back to patient_id for clinical data quality tests
sarah-tuva Dec 6, 2024
208349a
Add patient_crosswalk to core
sarah-tuva Dec 6, 2024
4ccdbc2
Add limit zero to ci testing and missing person ids
sarah-tuva Dec 10, 2024
8dda5da
Add source identifiers
sarah-tuva Dec 10, 2024
24039c1
Add phone to ci_testing/patient
sarah-tuva Dec 11, 2024
a312b58
Rename to person_id_crosswalk and add data types
sarah-tuva Dec 11, 2024
bb09e9f
Merge branch 'main' into add-person-id
sarah-tuva Dec 11, 2024
4bfe9e2
Fix empty table logic for Fabric
sarah-tuva Dec 11, 2024
b2ecc96
Fix provider attribution in ci_testing
sarah-tuva Dec 11, 2024
cfd9178
Fix person_id_crosswalk for clinical only sources
sarah-tuva Dec 11, 2024
c3cb456
Fix Fabric issues
sarah-tuva Dec 11, 2024
6edf1cb
Resolve conflicts from main
sarah-tuva Dec 12, 2024
bb4a912
Fix schemas in service category staging
sarah-tuva Dec 12, 2024
4c43426
Resolve merge conflicts from main
sarah-tuva Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 7 additions & 7 deletions ci_testing/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ vars:

## Update these vars to use your own data as input, do not comment out
# enabled logic has been added to the sources config
input_database: dev-ci-testing
input_database: dev_ci_testing
input_schema: input_layer

tuva_last_run: '{{ run_started_at.astimezone(modules.pytz.timezone("UTC")) }}'
Expand Down Expand Up @@ -62,14 +62,14 @@ dispatch:
seeds:
ci_testing:
eligibility_seed:
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/tuva_synthetic_data','eligibility.csv',headers=true) }}"
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.13.0','eligibility.csv',headers=true) }}"
lab_result_seed:
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/tuva_synthetic_data','lab_result.csv',headers=true) }}"
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.13.0','lab_result.csv',headers=true) }}"
medical_claim_seed:
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/tuva_synthetic_data','medical_claim.csv',headers=true) }}"
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.13.0','medical_claim.csv',headers=true) }}"
observation_seed:
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/tuva_synthetic_data','observation.csv',headers=true) }}"
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.13.0','observation.csv',headers=true) }}"
pharmacy_claim_seed:
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/tuva_synthetic_data','pharmacy_claim.csv',headers=true) }}"
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.13.0','pharmacy_claim.csv',headers=true) }}"
provider_attribution_seed:
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.12.0','provider_attribution.csv',headers=true) }}"
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.13.0','provider_attribution.csv',headers=true) }}"
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 %}
31 changes: 5 additions & 26 deletions ci_testing/models/condition.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% if target.type == 'fabric' %}
select top 0
select {% if target.type == 'fabric' %} top 0 {% else %}{% endif %}
cast(null as {{ dbt.type_string() }} ) as condition_id
, cast(null as {{ dbt.type_string() }} ) as person_id
, cast(null as {{ dbt.type_string() }} ) as patient_id
, cast(null as {{ dbt.type_string() }} ) as encounter_id
, cast(null as {{ dbt.type_string() }} ) as claim_id
Expand All @@ -19,28 +19,7 @@ select top 0
, cast(null as {{ dbt.type_string() }} ) as present_on_admit_code
, cast(null as {{ dbt.type_string() }} ) as present_on_admit_description
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_string() }} ) as file_name
, cast(null as {{ dbt.type_timestamp() }} ) as ingest_datetime
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
{% else %}
select
cast(null as {{ dbt.type_string() }} ) as condition_id
, cast(null as {{ dbt.type_string() }} ) as patient_id
, cast(null as {{ dbt.type_string() }} ) as encounter_id
, cast(null as {{ dbt.type_string() }} ) as claim_id
, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as recorded_date
, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as onset_date
, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as resolved_date
, cast(null as {{ dbt.type_string() }} ) as status
, cast(null as {{ dbt.type_string() }} ) as condition_type
, cast(null as {{ dbt.type_string() }} ) as source_code_type
, cast(null as {{ dbt.type_string() }} ) as source_code
, cast(null as {{ dbt.type_string() }} ) as source_description
, cast(null as {{ dbt.type_string() }} ) as normalized_code_type
, cast(null as {{ dbt.type_string() }} ) as normalized_code
, cast(null as {{ dbt.type_string() }} ) as normalized_description
, cast(null as {{ dbt.type_int() }} ) as condition_rank
, cast(null as {{ dbt.type_string() }} ) as present_on_admit_code
, cast(null as {{ dbt.type_string() }} ) as present_on_admit_description
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
limit 0
{% endif %}
{% if target.type == 'fabric' %} {% else %} limit 0 {% endif %}
39 changes: 5 additions & 34 deletions ci_testing/models/encounter.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% if target.type == 'fabric' %}
select top 0
select {% if target.type == 'fabric' %} top 0 {% else %}{% endif %}
cast(null as {{ dbt.type_string() }} ) as encounter_id
, cast(null as {{ dbt.type_string() }} ) as person_id
, cast(null as {{ dbt.type_string() }} ) as patient_id
, cast(null as {{ dbt.type_string() }} ) as encounter_type
, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as encounter_start_date
Expand All @@ -27,36 +27,7 @@ cast(null as {{ dbt.type_string() }} ) as encounter_id
, cast(null as {{ dbt.type_float() }} ) as allowed_amount
, cast(null as {{ dbt.type_float() }} ) as charge_amount
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_string() }} ) as file_name
, cast(null as {{ dbt.type_timestamp() }} ) as ingest_datetime
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
{% else %}
select
cast(null as {{ dbt.type_string() }} ) as encounter_id
, cast(null as {{ dbt.type_string() }} ) as patient_id
, cast(null as {{ dbt.type_string() }} ) as encounter_type
, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as encounter_start_date
, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as encounter_end_date
, cast(null as {{ dbt.type_int() }} ) as length_of_stay
, cast(null as {{ dbt.type_string() }} ) as admit_source_code
, cast(null as {{ dbt.type_string() }} ) as admit_source_description
, cast(null as {{ dbt.type_string() }} ) as admit_type_code
, cast(null as {{ dbt.type_string() }} ) as admit_type_description
, cast(null as {{ dbt.type_string() }} ) as discharge_disposition_code
, cast(null as {{ dbt.type_string() }} ) as discharge_disposition_description
, cast(null as {{ dbt.type_string() }} ) as attending_provider_id
, cast(null as {{ dbt.type_string() }} ) as attending_provider_name
, cast(null as {{ dbt.type_string() }} ) as facility_id
, cast(null as {{ dbt.type_string() }} ) as facility_name
, cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_code_type
, cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_code
, cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_description
, cast(null as {{ dbt.type_string() }} ) as ms_drg_code
, cast(null as {{ dbt.type_string() }} ) as ms_drg_description
, cast(null as {{ dbt.type_string() }} ) as apr_drg_code
, cast(null as {{ dbt.type_string() }} ) as apr_drg_description
, cast(null as {{ dbt.type_float() }} ) as paid_amount
, cast(null as {{ dbt.type_float() }} ) as allowed_amount
, cast(null as {{ dbt.type_float() }} ) as charge_amount
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
limit 0
{% endif %}
{% if target.type == 'fabric' %} {% else %} limit 0 {% endif %}
37 changes: 3 additions & 34 deletions ci_testing/models/lab_result.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ select * from {{ ref('lab_result_seed') }}

{%- else -%}

{% if target.type == 'fabric' %}
select top 0
select {% if target.type == 'fabric' %} top 0 {% else %}{% endif %}
cast(null as {{ dbt.type_string() }} ) as lab_result_id
, cast(null as {{ dbt.type_string() }} ) as person_id
, cast(null as {{ dbt.type_string() }} ) as patient_id
, cast(null as {{ dbt.type_string() }} ) as encounter_id
, cast(null as {{ dbt.type_string() }} ) as accession_number
Expand Down Expand Up @@ -36,37 +36,6 @@ select * from {{ ref('lab_result_seed') }}
, cast(null as {{ dbt.type_string() }} ) as ordering_practitioner_id
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
{% else %}
select
cast(null as {{ dbt.type_string() }} ) as lab_result_id
, cast(null as {{ dbt.type_string() }} ) as patient_id
, cast(null as {{ dbt.type_string() }} ) as encounter_id
, cast(null as {{ dbt.type_string() }} ) as accession_number
, cast(null as {{ dbt.type_string() }} ) as source_code_type
, cast(null as {{ dbt.type_string() }} ) as source_code
, cast(null as {{ dbt.type_string() }} ) as source_description
, cast(null as {{ dbt.type_string() }} ) as source_component
, cast(null as {{ dbt.type_string() }} ) as normalized_code_type
, cast(null as {{ dbt.type_string() }} ) as normalized_code
, cast(null as {{ dbt.type_string() }} ) as normalized_description
, cast(null as {{ dbt.type_string() }} ) as normalized_component
, cast(null as {{ dbt.type_string() }} ) as status
, cast(null as {{ dbt.type_string() }} ) as result
, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as result_date
, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as collection_date
, cast(null as {{ dbt.type_string() }} ) as source_units
, cast(null as {{ dbt.type_string() }} ) as normalized_units
, cast(null as {{ dbt.type_string() }} ) as source_reference_range_low
, cast(null as {{ dbt.type_string() }} ) as source_reference_range_high
, cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_low
, cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_high
, cast(null as {{ dbt.type_int() }} ) as source_abnormal_flag
, cast(null as {{ dbt.type_int() }} ) as normalized_abnormal_flag
, cast(null as {{ dbt.type_string() }} ) as specimen
, cast(null as {{ dbt.type_string() }} ) as ordering_practitioner_id
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
limit 0
{%- endif %}
{% if target.type == 'fabric' %} {% else %} limit 0 {% endif %}

{%- endif %}
21 changes: 2 additions & 19 deletions ci_testing/models/location.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% if target.type == 'fabric' %}
select top 0
select {% if target.type == 'fabric' %} top 0 {% else %}{% endif %}
cast(null as {{ dbt.type_string() }} ) as location_id
, cast(null as {{ dbt.type_string() }} ) as npi
, cast(null as {{ dbt.type_string() }} ) as name
Expand All @@ -13,20 +12,4 @@ cast(null as {{ dbt.type_string() }} ) as location_id
, cast(null as {{ dbt.type_float() }} ) as longitude
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
{% else %}
select
cast(null as {{ dbt.type_string() }} ) as location_id
, cast(null as {{ dbt.type_string() }} ) as npi
, cast(null as {{ dbt.type_string() }} ) as name
, cast(null as {{ dbt.type_string() }} ) as facility_type
, cast(null as {{ dbt.type_string() }} ) as parent_organization
, cast(null as {{ dbt.type_string() }} ) as address
, cast(null as {{ dbt.type_string() }} ) as city
, cast(null as {{ dbt.type_string() }} ) as state
, cast(null as {{ dbt.type_string() }} ) as zip_code
, cast(null as {{ dbt.type_float() }} ) as latitude
, cast(null as {{ dbt.type_float() }} ) as longitude
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
limit 0
{% endif %}
{% if target.type == 'fabric' %} {% else %} limit 0 {% endif %}
31 changes: 3 additions & 28 deletions ci_testing/models/medication.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% if target.type == 'fabric' %}
select top 0
select {% if target.type == 'fabric' %} top 0 {% else %}{% endif %}
cast(null as {{ dbt.type_string() }} ) as medication_id
, cast(null as {{ dbt.type_string() }} ) as person_id
, cast(null as {{ dbt.type_string() }} ) as patient_id
, cast(null as {{ dbt.type_string() }} ) as encounter_id
, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date
Expand All @@ -22,29 +22,4 @@ cast(null as {{ dbt.type_string() }} ) as medication_id
, cast(null as {{ dbt.type_string() }} ) as practitioner_id
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
{% else %}
select
cast(null as {{ dbt.type_string() }} ) as medication_id
, cast(null as {{ dbt.type_string() }} ) as patient_id
, cast(null as {{ dbt.type_string() }} ) as encounter_id
, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date
, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as prescribing_date
, cast(null as {{ dbt.type_string() }} ) as source_code_type
, cast(null as {{ dbt.type_string() }} ) as source_code
, cast(null as {{ dbt.type_string() }} ) as source_description
, cast(null as {{ dbt.type_string() }} ) as ndc_code
, cast(null as {{ dbt.type_string() }} ) as ndc_description
, cast(null as {{ dbt.type_string() }} ) as rxnorm_code
, cast(null as {{ dbt.type_string() }} ) as rxnorm_description
, cast(null as {{ dbt.type_string() }} ) as atc_code
, cast(null as {{ dbt.type_string() }} ) as atc_description
, cast(null as {{ dbt.type_string() }} ) as route
, cast(null as {{ dbt.type_string() }} ) as strength
, cast(null as {{ dbt.type_int() }} ) as quantity
, cast(null as {{ dbt.type_string() }} ) as quantity_unit
, cast(null as {{ dbt.type_int() }} ) as days_supply
, cast(null as {{ dbt.type_string() }} ) as practitioner_id
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
limit 0
{% endif %}
{% if target.type == 'fabric' %} {% else %} limit 0 {% endif %}
30 changes: 3 additions & 27 deletions ci_testing/models/observation.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ select * from {{ ref('observation_seed') }}

{%- else -%}

{% if target.type == 'fabric' %}
select top 0
select {% if target.type == 'fabric' %} top 0 {% else %}{% endif %}
cast(null as {{ dbt.type_string() }} ) as observation_id
, cast(null as {{ dbt.type_string() }} ) as person_id
, cast(null as {{ dbt.type_string() }} ) as patient_id
, cast(null as {{ dbt.type_string() }} ) as encounter_id
, cast(null as {{ dbt.type_string() }} ) as panel_id
Expand All @@ -29,30 +29,6 @@ select * from {{ ref('observation_seed') }}
, cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_high
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
{% else %}
select
cast(null as {{ dbt.type_string() }} ) as observation_id
, cast(null as {{ dbt.type_string() }} ) as patient_id
, cast(null as {{ dbt.type_string() }} ) as encounter_id
, cast(null as {{ dbt.type_string() }} ) as panel_id
, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as observation_date
, cast(null as {{ dbt.type_string() }} ) as observation_type
, cast(null as {{ dbt.type_string() }} ) as source_code_type
, cast(null as {{ dbt.type_string() }} ) as source_code
, cast(null as {{ dbt.type_string() }} ) as source_description
, cast(null as {{ dbt.type_string() }} ) as normalized_code_type
, cast(null as {{ dbt.type_string() }} ) as normalized_code
, cast(null as {{ dbt.type_string() }} ) as normalized_description
, cast(null as {{ dbt.type_string() }} ) as result
, cast(null as {{ dbt.type_string() }} ) as source_units
, cast(null as {{ dbt.type_string() }} ) as normalized_units
, cast(null as {{ dbt.type_string() }} ) as source_reference_range_low
, cast(null as {{ dbt.type_string() }} ) as source_reference_range_high
, cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_low
, cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_high
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
limit 0
{% endif %}
{% if target.type == 'fabric' %} {% else %} limit 0 {% endif %}

{%- endif %}
30 changes: 5 additions & 25 deletions ci_testing/models/patient.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% if target.type == 'fabric' %}
select top 0
cast(null as {{ dbt.type_string() }} ) as patient_id
select {% if target.type == 'fabric' %} top 0 {% else %}{% endif %}
cast(null as {{ dbt.type_string() }} ) as person_id
, cast(null as {{ dbt.type_string() }} ) as patient_id
, cast(null as {{ dbt.type_string() }} ) as first_name
, cast(null as {{ dbt.type_string() }} ) as last_name
, cast(null as {{ dbt.type_string() }} ) as sex
Expand All @@ -16,27 +16,7 @@ cast(null as {{ dbt.type_string() }} ) as patient_id
, cast(null as {{ dbt.type_string() }} ) as county
, cast(null as {{ dbt.type_float() }} ) as latitude
, cast(null as {{ dbt.type_float() }} ) as longitude
, cast(null as {{ dbt.type_string() }}) as phone
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
{% else %}
select
cast(null as {{ dbt.type_string() }} ) as patient_id
, cast(null as {{ dbt.type_string() }} ) as first_name
, cast(null as {{ dbt.type_string() }} ) as last_name
, cast(null as {{ dbt.type_string() }} ) as sex
, cast(null as {{ dbt.type_string() }} ) as race
, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as birth_date
, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as death_date
, cast(null as {{ dbt.type_int() }} ) as death_flag
, cast(null as {{ dbt.type_string() }} ) as social_security_number
, cast(null as {{ dbt.type_string() }} ) as address
, cast(null as {{ dbt.type_string() }} ) as city
, cast(null as {{ dbt.type_string() }} ) as state
, cast(null as {{ dbt.type_string() }} ) as zip_code
, cast(null as {{ dbt.type_string() }} ) as county
, cast(null as {{ dbt.type_float() }} ) as latitude
, cast(null as {{ dbt.type_float() }} ) as longitude
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
limit 0
{% endif %}
{% if target.type == 'fabric' %} {% else %} limit 0 {% endif %}
17 changes: 2 additions & 15 deletions ci_testing/models/practitioner.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% if target.type == 'fabric' %}
select top 0
select {% if target.type == 'fabric' %} top 0 {% else %}{% endif %}
cast(null as {{ dbt.type_string() }} ) as practitioner_id
, cast(null as {{ dbt.type_string() }} ) as npi
, cast(null as {{ dbt.type_string() }} ) as first_name
Expand All @@ -9,16 +8,4 @@ select top 0
, cast(null as {{ dbt.type_string() }} ) as sub_specialty
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
{% else %}
select
cast(null as {{ dbt.type_string() }} ) as practitioner_id
, cast(null as {{ dbt.type_string() }} ) as npi
, cast(null as {{ dbt.type_string() }} ) as first_name
, cast(null as {{ dbt.type_string() }} ) as last_name
, cast(null as {{ dbt.type_string() }} ) as practice_affiliation
, cast(null as {{ dbt.type_string() }} ) as specialty
, cast(null as {{ dbt.type_string() }} ) as sub_specialty
, cast(null as {{ dbt.type_string() }} ) as data_source
, cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run
limit 0
{% endif %}
{% if target.type == 'fabric' %} {% else %} limit 0 {% endif %}
Loading
Loading