diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 761c9f4a1..d09d8c51a 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -74,7 +74,8 @@ seeds: raw_data__lab_result: +post-hook: "{{ the_tuva_project.load_versioned_synthetic_seed('lab_result') }}" raw_data__medical_claim: - +batch_size: 200 + +meta: + batch_size: 200 +post-hook: "{{ the_tuva_project.load_versioned_synthetic_seed('medical_claim') }}" raw_data__observation: +post-hook: "{{ the_tuva_project.load_versioned_synthetic_seed('observation') }}" diff --git a/integration_tests/macros/tuva_source.sql b/integration_tests/macros/tuva_source.sql new file mode 100644 index 000000000..b2abdcbed --- /dev/null +++ b/integration_tests/macros/tuva_source.sql @@ -0,0 +1,7 @@ +{% macro tuva_source(table_name) %} + {%- if var('use_synthetic_data', false) | as_bool -%} + {%- do return(ref('raw_data__' ~ table_name)) -%} + {%- else -%} + {%- do return(source('source_input', table_name)) -%} + {%- endif -%} +{% endmacro %} diff --git a/integration_tests/models/_sources.yml b/integration_tests/models/_sources.yml new file mode 100644 index 000000000..9dfda26e5 --- /dev/null +++ b/integration_tests/models/_sources.yml @@ -0,0 +1,28 @@ +version: 2 + +sources: + - name: source_input + database: "{{ var('input_database', target.database) }}" + schema: | + {%- if var('use_synthetic_data') == true -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_raw_data + {%- else -%}raw_data{%- endif -%} + {%- else -%} + {{ var('input_schema', target.schema) }} + {%- endif -%} + tables: + - name: appointment + - name: condition + - name: eligibility + - name: encounter + - name: immunization + - name: lab_result + - name: location + - name: medical_claim + - name: medication + - name: observation + - name: patient + - name: pharmacy_claim + - name: practitioner + - name: procedure + - name: provider_attribution diff --git a/integration_tests/models/appointment.sql b/integration_tests/models/appointment.sql index 9381b2af8..05aeb7253 100644 --- a/integration_tests/models/appointment.sql +++ b/integration_tests/models/appointment.sql @@ -4,7 +4,7 @@ ) }} -select +{%- set tuva_columns -%} appointment_id , person_id , patient_id @@ -39,5 +39,23 @@ select , normalized_cancellation_reason_code_type , normalized_cancellation_reason_code , normalized_cancellation_reason_description +{%- endset -%} + +{# Uncomment the columns below to test extension columns passthrough feature #} +{%- set tuva_extensions -%} + {# , source_appointment_type_code as x_temp_source_appointment_type_code #} + {# , start_datetime as x_temp_start_datetime #} + {# , reason as zzz_temp_reason #} +{%- endset -%} + +{%- set tuva_metadata -%} , data_source -from {{ ref('raw_data__appointment') }} + , file_name + , ingest_datetime +{%- endset -%} + +select + {{ tuva_columns }} + {{ tuva_extensions }} + {{ tuva_metadata }} +from {{ tuva_source('appointment') }} diff --git a/integration_tests/models/condition.sql b/integration_tests/models/condition.sql index 707c5cfc3..7067ea3b0 100644 --- a/integration_tests/models/condition.sql +++ b/integration_tests/models/condition.sql @@ -4,37 +4,45 @@ ) }} -{# Uncomment the synthetic extension columns below to test extension columns passthrough feature #} -{%- set tuva_synthetic_extensions -%} - {# , cast(null as {{ dbt.type_string() }}) as x_temp_status #} - {# , cast(null as {{ dbt.type_string() }}) as x_temp_condition_type #} - {# , cast(null as {{ dbt.type_string() }}) as x_temp_source_code #} - {# , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as zzz_temp_recorded_date #} +{%- set tuva_columns -%} + condition_id + , payer + , person_id + , patient_id + , encounter_id + , claim_id + , recorded_date + , onset_date + , resolved_date + , status + , condition_type + , source_code_type + , source_code + , source_description + , normalized_code_type + , normalized_code + , normalized_description + , condition_rank + , present_on_admit_code + , present_on_admit_description {%- endset -%} -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 payer -, 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 -, {{ 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 -{{ tuva_synthetic_extensions }} -, 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 -{{ limit_zero() }} +{# Uncomment the columns below to test extension columns passthrough feature #} +{%- set tuva_extensions -%} + {# , status as x_temp_status #} + {# , condition_type as x_temp_condition_type #} + {# , source_code as x_temp_source_code #} + {# , recorded_date as zzz_temp_recorded_date #} +{%- endset -%} + +{%- set tuva_metadata -%} + , data_source + , file_name + , ingest_datetime +{%- endset -%} + +select + {{ tuva_columns }} + {{ tuva_extensions }} + {{ tuva_metadata }} +from {{ tuva_source('condition') }} diff --git a/integration_tests/models/eligibility.sql b/integration_tests/models/eligibility.sql index d74507ed5..ec04fb437 100644 --- a/integration_tests/models/eligibility.sql +++ b/integration_tests/models/eligibility.sql @@ -71,4 +71,4 @@ select {{ tuva_columns }} {{ tuva_extensions }} {{ tuva_metadata }} -from {{ ref('raw_data__eligibility') }} +from {{ tuva_source('eligibility') }} diff --git a/integration_tests/models/encounter.sql b/integration_tests/models/encounter.sql index d42bc5b6e..9af787fe9 100644 --- a/integration_tests/models/encounter.sql +++ b/integration_tests/models/encounter.sql @@ -4,42 +4,50 @@ ) }} -{# Uncomment the synthetic extension columns below to test extension columns passthrough feature #} -{%- set tuva_synthetic_extensions -%} - {# , cast(null as {{ dbt.type_string() }}) as x_temp_encounter_type #} - {# , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as x_temp_encounter_start_date #} - {# , cast(null as {{ dbt.type_string() }}) as zzz_temp_facility_name #} +{%- set tuva_columns -%} + encounter_id + , person_id + , patient_id + , encounter_type + , encounter_start_date + , encounter_end_date + , length_of_stay + , admit_source_code + , admit_source_description + , admit_type_code + , admit_type_description + , discharge_disposition_code + , discharge_disposition_description + , attending_provider_id + , attending_provider_name + , facility_npi + , facility_name + , primary_diagnosis_code_type + , primary_diagnosis_code + , primary_diagnosis_description + , drg_code_type + , drg_code + , drg_description + , paid_amount + , allowed_amount + , charge_amount {%- endset -%} -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 -, {{ 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_npi -, 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 drg_code_type -, cast(null as {{ dbt.type_string() }}) as drg_code -, cast(null as {{ dbt.type_string() }}) as 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 -{{ tuva_synthetic_extensions }} -, 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 -{{ limit_zero() }} +{# Uncomment the columns below to test extension columns passthrough feature #} +{%- set tuva_extensions -%} + {# , encounter_type as x_temp_encounter_type #} + {# , encounter_start_date as x_temp_encounter_start_date #} + {# , facility_name as zzz_temp_facility_name #} +{%- endset -%} + +{%- set tuva_metadata -%} + , data_source + , file_name + , ingest_datetime +{%- endset -%} + +select + {{ tuva_columns }} + {{ tuva_extensions }} + {{ tuva_metadata }} +from {{ tuva_source('encounter') }} diff --git a/integration_tests/models/immunization.sql b/integration_tests/models/immunization.sql index 96ccc67bf..a64f0ac53 100644 --- a/integration_tests/models/immunization.sql +++ b/integration_tests/models/immunization.sql @@ -44,4 +44,4 @@ select {{ tuva_columns }} {{ tuva_extensions }} {{ tuva_metadata }} -from {{ ref('raw_data__immunization') }} +from {{ tuva_source('immunization') }} diff --git a/integration_tests/models/lab_result.sql b/integration_tests/models/lab_result.sql index 498a06f0a..0e5c6c26e 100644 --- a/integration_tests/models/lab_result.sql +++ b/integration_tests/models/lab_result.sql @@ -56,4 +56,4 @@ select {{ tuva_columns }} {{ tuva_extensions }} {{ tuva_metadata }} -from {{ ref('raw_data__lab_result') }} +from {{ tuva_source('lab_result') }} diff --git a/integration_tests/models/location.sql b/integration_tests/models/location.sql index aea90cf25..41e047d75 100644 --- a/integration_tests/models/location.sql +++ b/integration_tests/models/location.sql @@ -4,27 +4,35 @@ ) }} -{# Uncomment the synthetic extension columns below to test extension columns passthrough feature #} -{%- set tuva_synthetic_extensions -%} - {# , cast(null as {{ dbt.type_string() }}) as x_temp_state #} - {# , cast(null as {{ dbt.type_string() }}) as x_temp_parent_organization #} - {# , cast(null as {{ dbt.type_string() }}) as zzz_temp_facility_type #} +{%- set tuva_columns -%} + location_id + , npi + , name + , facility_type + , parent_organization + , address + , city + , state + , zip_code + , latitude + , longitude {%- endset -%} -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 -, 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 -{{ tuva_synthetic_extensions }} -, 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 -{{ limit_zero() }} +{# Uncomment the columns below to test extension columns passthrough feature #} +{%- set tuva_extensions -%} + {# , state as x_temp_state #} + {# , parent_organization as x_temp_parent_organization #} + {# , facility_type as zzz_temp_facility_type #} +{%- endset -%} + +{%- set tuva_metadata -%} + , data_source + , file_name + , ingest_datetime +{%- endset -%} + +select + {{ tuva_columns }} + {{ tuva_extensions }} + {{ tuva_metadata }} +from {{ tuva_source('location') }} diff --git a/integration_tests/models/medical_claim.sql b/integration_tests/models/medical_claim.sql index a02636ba9..3934cc7a6 100644 --- a/integration_tests/models/medical_claim.sql +++ b/integration_tests/models/medical_claim.sql @@ -168,4 +168,4 @@ select {{ tuva_columns }} {{ tuva_extensions }} {{ tuva_metadata }} -from {{ ref('raw_data__medical_claim') }} +from {{ tuva_source('medical_claim') }} diff --git a/integration_tests/models/medication.sql b/integration_tests/models/medication.sql index da6132ab3..02ffba83c 100644 --- a/integration_tests/models/medication.sql +++ b/integration_tests/models/medication.sql @@ -4,37 +4,45 @@ ) }} -{# Uncomment the synthetic extension columns below to test extension columns passthrough feature #} -{%- set tuva_synthetic_extensions -%} - {# , cast(null as {{ dbt.type_string() }}) as x_temp_rxnorm_code #} - {# , cast(null as {{ dbt.type_string() }}) as x_temp_source_code_type #} - {# , cast(null as {{ dbt.type_string() }}) as zzz_temp_source_code #} +{%- set tuva_columns -%} + medication_id + , person_id + , patient_id + , encounter_id + , dispensing_date + , prescribing_date + , source_code_type + , source_code + , source_description + , ndc_code + , ndc_description + , rxnorm_code + , rxnorm_description + , atc_code + , atc_description + , route + , strength + , quantity + , quantity_unit + , days_supply + , practitioner_id {%- endset -%} -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 -, {{ 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 -{{ tuva_synthetic_extensions }} -, 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 -{{ limit_zero() }} +{# Uncomment the columns below to test extension columns passthrough feature #} +{%- set tuva_extensions -%} + {# , rxnorm_code as x_temp_rxnorm_code #} + {# , source_code_type as x_temp_source_code_type #} + {# , source_code as zzz_temp_source_code #} +{%- endset -%} + +{%- set tuva_metadata -%} + , data_source + , file_name + , ingest_datetime +{%- endset -%} + +select + {{ tuva_columns }} + {{ tuva_extensions }} + {{ tuva_metadata }} +from {{ tuva_source('medication') }} diff --git a/integration_tests/models/observation.sql b/integration_tests/models/observation.sql index 662a09681..7ee093483 100644 --- a/integration_tests/models/observation.sql +++ b/integration_tests/models/observation.sql @@ -43,4 +43,4 @@ select {{ tuva_columns }} {{ tuva_extensions }} {{ tuva_metadata }} -from {{ ref('raw_data__observation') }} +from {{ tuva_source('observation') }} diff --git a/integration_tests/models/patient.sql b/integration_tests/models/patient.sql index b84f12884..b6a6dac07 100644 --- a/integration_tests/models/patient.sql +++ b/integration_tests/models/patient.sql @@ -45,20 +45,8 @@ , ingest_datetime {%- endset -%} -{% if var('use_synthetic_data') == true -%} - -select - {{ tuva_columns }} - {{ tuva_extensions }} - {{ tuva_metadata }} -from {{ ref('patient_seed') }} - -{%- else -%} - select {{ tuva_columns }} {{ tuva_extensions }} {{ tuva_metadata }} -from {{ source('source_input', 'patient') }} - -{%- endif %} +from {{ tuva_source('patient') }} diff --git a/integration_tests/models/pharmacy_claim.sql b/integration_tests/models/pharmacy_claim.sql index ebd088559..a33da76c4 100644 --- a/integration_tests/models/pharmacy_claim.sql +++ b/integration_tests/models/pharmacy_claim.sql @@ -44,4 +44,4 @@ select {{ tuva_columns }} {{ tuva_extensions }} {{ tuva_metadata }} -from {{ ref('raw_data__pharmacy_claim') }} +from {{ tuva_source('pharmacy_claim') }} diff --git a/integration_tests/models/practitioner.sql b/integration_tests/models/practitioner.sql index 85c3ff13e..b3d005dc9 100644 --- a/integration_tests/models/practitioner.sql +++ b/integration_tests/models/practitioner.sql @@ -4,24 +4,32 @@ ) }} -{# Uncomment the synthetic extension columns below to test extension columns passthrough feature #} -{%- set tuva_synthetic_extensions -%} - {# , cast(null as {{ dbt.type_string() }}) as x_temp_specialty #} - {# , cast(null as {{ dbt.type_string() }}) as x_temp_first_name #} - {# , cast(null as {{ dbt.type_string() }}) as x_temp_last_name #} - {# , cast(null as {{ dbt.type_string() }}) as zzz_temp_practice_affiliation #} +{%- set tuva_columns -%} + practitioner_id + , npi + , first_name + , last_name + , practice_affiliation + , specialty + , sub_specialty {%- endset -%} -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 -, 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 -{{ tuva_synthetic_extensions }} -, 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 -{{ limit_zero() }} +{# Uncomment the columns below to test extension columns passthrough feature #} +{%- set tuva_extensions -%} + {# , specialty as x_temp_specialty #} + {# , first_name as x_temp_first_name #} + {# , last_name as x_temp_last_name #} + {# , practice_affiliation as zzz_temp_practice_affiliation #} +{%- endset -%} + +{%- set tuva_metadata -%} + , data_source + , file_name + , ingest_datetime +{%- endset -%} + +select + {{ tuva_columns }} + {{ tuva_extensions }} + {{ tuva_metadata }} +from {{ tuva_source('practitioner') }} diff --git a/integration_tests/models/procedure.sql b/integration_tests/models/procedure.sql index 9cc262894..52b89dda7 100644 --- a/integration_tests/models/procedure.sql +++ b/integration_tests/models/procedure.sql @@ -4,34 +4,42 @@ ) }} -{# Uncomment the synthetic extension columns below to test extension columns passthrough feature #} -{%- set tuva_synthetic_extensions -%} - {# , cast(null as {{ dbt.type_string() }}) as x_temp_procedure_id #} - {# , cast(null as {{ dbt.type_string() }}) as x_temp_person_id #} - {# , cast(null as {{ dbt.type_string() }}) as zzz_temp_patient_id #} +{%- set tuva_columns -%} + procedure_id + , person_id + , patient_id + , encounter_id + , claim_id + , procedure_date + , source_code_type + , source_code + , source_description + , normalized_code_type + , normalized_code + , normalized_description + , modifier_1 + , modifier_2 + , modifier_3 + , modifier_4 + , modifier_5 + , practitioner_id {%- endset -%} -select {% if target.type == 'fabric' %} top 0 {% else %}{% endif %} - cast(null as {{ dbt.type_string() }}) as procedure_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 -, {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as procedure_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 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 modifier_1 -, cast(null as {{ dbt.type_string() }}) as modifier_2 -, cast(null as {{ dbt.type_string() }}) as modifier_3 -, cast(null as {{ dbt.type_string() }}) as modifier_4 -, cast(null as {{ dbt.type_string() }}) as modifier_5 -, cast(null as {{ dbt.type_string() }}) as practitioner_id -{{ tuva_synthetic_extensions }} -, 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 -{{ limit_zero() }} +{# Uncomment the columns below to test extension columns passthrough feature #} +{%- set tuva_extensions -%} + {# , procedure_id as x_temp_procedure_id #} + {# , person_id as x_temp_person_id #} + {# , patient_id as zzz_temp_patient_id #} +{%- endset -%} + +{%- set tuva_metadata -%} + , data_source + , file_name + , ingest_datetime +{%- endset -%} + +select + {{ tuva_columns }} + {{ tuva_extensions }} + {{ tuva_metadata }} +from {{ tuva_source('procedure') }} diff --git a/integration_tests/models/provider_attribution.sql b/integration_tests/models/provider_attribution.sql index d4290a1c4..ba9fd0b00 100644 --- a/integration_tests/models/provider_attribution.sql +++ b/integration_tests/models/provider_attribution.sql @@ -6,15 +6,7 @@ ) }} -{# Extension columns not supported for provider_attribution #} -{%- set tuva_extensions -%} -{%- endset -%} - -{%- set tuva_metadata -%} - , data_source -{%- endset -%} - -{%- set provider_attribution_relation = ref('raw_data__provider_attribution') -%} +{%- set provider_attribution_relation = tuva_source('provider_attribution') -%} {%- if execute -%} {%- set provider_attribution_columns = adapter.get_columns_in_relation(provider_attribution_relation) -%} @@ -31,7 +23,7 @@ {%- endif -%} {%- endset -%} -select +{%- set tuva_columns -%} person_id , {{ member_id_expr }} as member_id , patient_id @@ -46,6 +38,18 @@ select , custom_attributed_provider_practice , custom_attributed_provider_organization , custom_attributed_provider_lob +{%- endset -%} + +{# Extension columns not supported for provider_attribution #} +{%- set tuva_extensions -%} +{%- endset -%} + +{%- set tuva_metadata -%} + , data_source +{%- endset -%} + +select + {{ tuva_columns }} {{ tuva_extensions }} {{ tuva_metadata }} from {{ provider_attribution_relation }} diff --git a/integration_tests/seeds/_seeds.yml b/integration_tests/seeds/_seeds.yml index 2da8db533..4cc4d512b 100644 --- a/integration_tests/seeds/_seeds.yml +++ b/integration_tests/seeds/_seeds.yml @@ -1,219 +1,148 @@ version: 2 +anchors: + - &string | + {%- if target.type in ("bigquery", "databricks") -%} string + {%- else -%} varchar(255) + {%- endif -%} + - &datetime | + {%- if target.type == "fabric" -%} datetime2(0) + {%- elif target.type in ("athena", "databricks") -%} timestamp + {%- else -%} datetime + {%- endif -%} + - &float | + {%- if target.type in ("athena", "databricks") -%} real + {%- else -%} float + {%- endif -%} + seeds: - name: raw_data__appointment config: schema: raw_data - tags: - - clinical - - input_layer - enabled: true + alias: appointment + tags: [clinical, input_layer] + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - appointment_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - patient_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - encounter_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_appointment_type_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_appointment_type_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_appointment_type_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_appointment_type_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - start_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} - end_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} + appointment_id: *string + person_id: *string + patient_id: *string + encounter_id: *string + source_appointment_type_code: *string + source_appointment_type_description: *string + normalized_appointment_type_code: *string + normalized_appointment_type_description: *string + start_datetime: *datetime + end_datetime: *datetime duration: integer - location_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - practitioner_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_status: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_status: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - appointment_specialty: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - reason: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_reason_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_reason_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_reason_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_reason_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_reason_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_reason_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - cancellation_reason: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_cancellation_reason_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_cancellation_reason_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_cancellation_reason_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_cancellation_reason_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_cancellation_reason_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_cancellation_reason_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} + location_id: *string + practitioner_id: *string + source_status: *string + normalized_status: *string + appointment_specialty: *string + reason: *string + source_reason_code_type: *string + source_reason_code: *string + source_reason_description: *string + normalized_reason_code_type: *string + normalized_reason_code: *string + normalized_reason_description: *string + cancellation_reason: *string + source_cancellation_reason_code_type: *string + source_cancellation_reason_code: *string + source_cancellation_reason_description: *string + normalized_cancellation_reason_code_type: *string + normalized_cancellation_reason_code: *string + normalized_cancellation_reason_description: *string + data_source: *string + file_name: *string + ingest_datetime: *datetime - - name: patient_seed + - name: raw_data__patient config: schema: raw_data - tags: - - clinical - - input_layer + alias: patient + tags: [clinical, input_layer] enabled: | {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - patient_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - name_suffix: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - first_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - middle_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - last_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - sex: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - race: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + person_id: *string + patient_id: *string + name_suffix: *string + first_name: *string + middle_name: *string + last_name: *string + sex: *string + race: *string birth_date: date death_date: date death_flag: integer - social_security_number: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - address: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - city: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - state: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - zip_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - county: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + social_security_number: *string + address: *string + city: *string + state: *string + zip_code: *string + county: *string latitude: float longitude: float - phone: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - email: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - ethnicity: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} + phone: *string + email: *string + ethnicity: *string + data_source: *string + file_name: *string + ingest_datetime: *datetime - name: raw_data__eligibility config: schema: raw_data - tags: - - claims - - input_layer - enabled: true + alias: eligibility + tags: [claims, input_layer] + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - member_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - subscriber_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - gender: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - race: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + person_id: *string + member_id: *string + subscriber_id: *string + gender: *string + race: *string birth_date: date death_date: date death_flag: integer enrollment_start_date: date enrollment_end_date: date - payer: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - plan: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - original_reason_entitlement_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - dual_status_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - medicare_status_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - group_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - group_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - name_suffix: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - first_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - middle_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - last_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - social_security_number: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - subscriber_relation: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - address: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - city: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - state: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - zip_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - phone: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - email: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - ethnicity: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + payer: *string + payer_type: *string + plan: *string + original_reason_entitlement_code: *string + dual_status_code: *string + medicare_status_code: *string + group_id: *string + group_name: *string + name_suffix: *string + first_name: *string + middle_name: *string + last_name: *string + social_security_number: *string + subscriber_relation: *string + address: *string + city: *string + state: *string + zip_code: *string + phone: *string + email: *string + ethnicity: *string + data_source: *string + file_name: *string file_date: date - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} - enrollment_status: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + ingest_datetime: *datetime + enrollment_status: *string hospice_flag: integer - snp_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + snp_type: *string medicaid_indicator: integer long_term_institutional_flag: integer - part_d_raf_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + part_d_raf_type: *string low_income_subsidy_indicator: integer - metal_level: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + metal_level: *string csr_indicator: integer enrollment_duration_months: integer esrd_status: integer @@ -222,370 +151,204 @@ seeds: - name: raw_data__immunization config: schema: raw_data - tags: - - clinical - - input_layer - enabled: true + alias: immunization + tags: [clinical, input_layer] + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - immunization_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - patient_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - encounter_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - status: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - status_reason: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + immunization_id: *string + person_id: *string + patient_id: *string + encounter_id: *string + status: *string + status_reason: *string occurrence_date: date - source_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_dose: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_dose: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - lot_number: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - body_site: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - route: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - location_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - practitioner_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} - + source_code_type: *string + source_code: *string + source_description: *string + normalized_code_type: *string + normalized_code: *string + normalized_description: *string + source_dose: *string + normalized_dose: *string + lot_number: *string + body_site: *string + route: *string + location_id: *string + practitioner_id: *string + data_source: *string + file_name: *string + ingest_datetime: *datetime + - name: raw_data__lab_result config: schema: raw_data - tags: - - clinical - - input_layer - enabled: true + alias: lab_result + tags: [clinical, input_layer] + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - lab_result_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - patient_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - encounter_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - accession_number: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_order_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_order_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_order_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_component_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_component_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_component_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_order_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_order_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_order_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_component_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_component_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_component_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - status: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - result: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - result_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} - collection_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} - source_units: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_units: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_reference_range_low: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_reference_range_high: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_reference_range_low: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_reference_range_high: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + lab_result_id: *string + person_id: *string + patient_id: *string + encounter_id: *string + accession_number: *string + source_order_type: *string + source_order_code: *string + source_order_description: *string + source_component_type: *string + source_component_code: *string + source_component_description: *string + normalized_order_type: *string + normalized_order_code: *string + normalized_order_description: *string + normalized_component_type: *string + normalized_component_code: *string + normalized_component_description: *string + status: *string + result: *string + result_datetime: *datetime + collection_datetime: *datetime + source_units: *string + normalized_units: *string + source_reference_range_low: *string + source_reference_range_high: *string + normalized_reference_range_low: *string + normalized_reference_range_high: *string source_abnormal_flag: integer normalized_abnormal_flag: integer - specimen: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - ordering_practitioner_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} - tuva_last_run: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - + specimen: *string + ordering_practitioner_id: *string + data_source: *string + file_name: *string + ingest_datetime: *datetime - name: raw_data__medical_claim config: schema: raw_data - tags: - - claims - - input_layer - enabled: true + alias: medical_claim + tags: [claims, input_layer] + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - claim_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + claim_id: *string claim_line_number: integer - claim_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - member_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - plan: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + claim_type: *string + person_id: *string + member_id: *string + payer: *string + plan: *string claim_start_date: date claim_end_date: date claim_line_start_date: date claim_line_end_date: date admission_date: date discharge_date: date - admit_source_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - admit_type_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - discharge_disposition_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - place_of_service_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - bill_type_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - drg_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - drg_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - revenue_center_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + admit_source_code: *string + admit_type_code: *string + discharge_disposition_code: *string + place_of_service_code: *string + bill_type_code: *string + drg_code_type: *string + drg_code: *string + revenue_center_code: *string service_unit_quantity: integer - hcpcs_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - hcpcs_modifier_1: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - hcpcs_modifier_2: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - hcpcs_modifier_3: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - hcpcs_modifier_4: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - hcpcs_modifier_5: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - rendering_npi: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - rendering_tin: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - billing_npi: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - billing_tin: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - facility_npi: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + hcpcs_code: *string + hcpcs_modifier_1: *string + hcpcs_modifier_2: *string + hcpcs_modifier_3: *string + hcpcs_modifier_4: *string + hcpcs_modifier_5: *string + rendering_npi: *string + rendering_tin: *string + billing_npi: *string + billing_tin: *string + facility_npi: *string paid_date: date - paid_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - allowed_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - charge_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - coinsurance_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - copayment_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - deductible_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - total_cost_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - diagnosis_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_1: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_2: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_3: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_4: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_5: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_6: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_7: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_8: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_9: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_10: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_11: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_12: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_13: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_14: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_15: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_16: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_17: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_18: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_19: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_20: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_21: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_22: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_23: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_24: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_25: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_1: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_2: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_3: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_4: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_5: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_6: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_7: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_8: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_9: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_10: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_11: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_12: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_13: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_14: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_15: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_16: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_17: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_18: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_19: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_20: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_21: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_22: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_23: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_24: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_25: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_1: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_2: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_3: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_4: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_5: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_6: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_7: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_8: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_9: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_10: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_11: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_12: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_13: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_14: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_15: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_16: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_17: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_18: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_19: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_20: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_21: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_22: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_23: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_24: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_25: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + paid_amount: *float + allowed_amount: *float + charge_amount: *float + coinsurance_amount: *float + copayment_amount: *float + deductible_amount: *float + total_cost_amount: *float + diagnosis_code_type: *string + diagnosis_code_1: *string + diagnosis_code_2: *string + diagnosis_code_3: *string + diagnosis_code_4: *string + diagnosis_code_5: *string + diagnosis_code_6: *string + diagnosis_code_7: *string + diagnosis_code_8: *string + diagnosis_code_9: *string + diagnosis_code_10: *string + diagnosis_code_11: *string + diagnosis_code_12: *string + diagnosis_code_13: *string + diagnosis_code_14: *string + diagnosis_code_15: *string + diagnosis_code_16: *string + diagnosis_code_17: *string + diagnosis_code_18: *string + diagnosis_code_19: *string + diagnosis_code_20: *string + diagnosis_code_21: *string + diagnosis_code_22: *string + diagnosis_code_23: *string + diagnosis_code_24: *string + diagnosis_code_25: *string + diagnosis_poa_1: *string + diagnosis_poa_2: *string + diagnosis_poa_3: *string + diagnosis_poa_4: *string + diagnosis_poa_5: *string + diagnosis_poa_6: *string + diagnosis_poa_7: *string + diagnosis_poa_8: *string + diagnosis_poa_9: *string + diagnosis_poa_10: *string + diagnosis_poa_11: *string + diagnosis_poa_12: *string + diagnosis_poa_13: *string + diagnosis_poa_14: *string + diagnosis_poa_15: *string + diagnosis_poa_16: *string + diagnosis_poa_17: *string + diagnosis_poa_18: *string + diagnosis_poa_19: *string + diagnosis_poa_20: *string + diagnosis_poa_21: *string + diagnosis_poa_22: *string + diagnosis_poa_23: *string + diagnosis_poa_24: *string + diagnosis_poa_25: *string + procedure_code_type: *string + procedure_code_1: *string + procedure_code_2: *string + procedure_code_3: *string + procedure_code_4: *string + procedure_code_5: *string + procedure_code_6: *string + procedure_code_7: *string + procedure_code_8: *string + procedure_code_9: *string + procedure_code_10: *string + procedure_code_11: *string + procedure_code_12: *string + procedure_code_13: *string + procedure_code_14: *string + procedure_code_15: *string + procedure_code_16: *string + procedure_code_17: *string + procedure_code_18: *string + procedure_code_19: *string + procedure_code_20: *string + procedure_code_21: *string + procedure_code_22: *string + procedure_code_23: *string + procedure_code_24: *string + procedure_code_25: *string procedure_date_1: date procedure_date_2: date procedure_date_3: date @@ -612,152 +375,277 @@ seeds: procedure_date_24: date procedure_date_25: date in_network_flag: integer - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + data_source: *string + file_name: *string file_date: date - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} + ingest_datetime: *datetime - name: raw_data__observation config: schema: raw_data - tags: - - clinical - - input_layer - enabled: true + alias: observation + tags: [clinical, input_layer] + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - observation_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - patient_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - encounter_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - panel_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + observation_id: *string + person_id: *string + patient_id: *string + encounter_id: *string + panel_id: *string observation_date: date - observation_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - result: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_units: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_units: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_reference_range_low: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_reference_range_high: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_reference_range_low: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_reference_range_high: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} + observation_type: *string + source_code_type: *string + source_code: *string + source_description: *string + normalized_code_type: *string + normalized_code: *string + normalized_description: *string + result: *string + source_units: *string + normalized_units: *string + source_reference_range_low: *string + source_reference_range_high: *string + normalized_reference_range_low: *string + normalized_reference_range_high: *string + data_source: *string + file_name: *string + ingest_datetime: *datetime - name: raw_data__pharmacy_claim config: schema: raw_data - tags: - - claims - - input_layer - enabled: true + alias: pharmacy_claim + tags: [claims, input_layer] + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - claim_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + claim_id: *string claim_line_number: integer - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - member_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - plan: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - prescribing_provider_npi: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - dispensing_provider_npi: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + person_id: *string + member_id: *string + payer: *string + plan: *string + prescribing_provider_npi: *string + dispensing_provider_npi: *string dispensing_date: date - ndc_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + ndc_code: *string quantity: integer days_supply: integer refills: integer paid_date: date - paid_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - allowed_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - charge_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - coinsurance_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - copayment_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - deductible_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} + paid_amount: *float + allowed_amount: *float + charge_amount: *float + coinsurance_amount: *float + copayment_amount: *float + deductible_amount: *float in_network_flag: integer - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + data_source: *string + file_name: *string file_date: date - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} + ingest_datetime: *datetime - name: raw_data__provider_attribution config: schema: raw_data - tags: - - attribution - - input_layer - enabled: true + alias: provider_attribution + tags: [attribution, input_layer] + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} + column_types: + person_id: *string + patient_id: *string + year_month: *string + payer: *string + plan: *string + data_source: *string + payer_attributed_provider: *string + payer_attributed_provider_practice: *string + payer_attributed_provider_organization: *string + payer_attributed_provider_lob: *string + custom_attributed_provider: *string + custom_attributed_provider_practice: *string + custom_attributed_provider_organization: *string + custom_attributed_provider_lob: *string + + # ──────────────────────────────────────────────────────────────────────────── + # Placeholder synthetic seeds — header-only CSVs that materialize as empty + # tables when use_synthetic_data=true. Tuva does not ship synthetic data for + # these tables, so they remain empty. Users providing their own data should + # set use_synthetic_data=false and point input_schema at their tables. + # ──────────────────────────────────────────────────────────────────────────── + - name: raw_data__condition + config: + schema: raw_data + alias: condition + tags: [clinical, input_layer] + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} + column_types: + condition_id: *string + payer: *string + person_id: *string + patient_id: *string + encounter_id: *string + claim_id: *string + recorded_date: date + onset_date: date + resolved_date: date + status: *string + condition_type: *string + source_code_type: *string + source_code: *string + source_description: *string + normalized_code_type: *string + normalized_code: *string + normalized_description: *string + condition_rank: integer + present_on_admit_code: *string + present_on_admit_description: *string + data_source: *string + file_name: *string + ingest_datetime: *datetime + + - name: raw_data__encounter + config: + schema: raw_data + alias: encounter + tags: [clinical, input_layer] + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} + column_types: + encounter_id: *string + person_id: *string + patient_id: *string + encounter_type: *string + encounter_start_date: date + encounter_end_date: date + length_of_stay: integer + admit_source_code: *string + admit_source_description: *string + admit_type_code: *string + admit_type_description: *string + discharge_disposition_code: *string + discharge_disposition_description: *string + attending_provider_id: *string + attending_provider_name: *string + facility_npi: *string + facility_name: *string + primary_diagnosis_code_type: *string + primary_diagnosis_code: *string + primary_diagnosis_description: *string + drg_code_type: *string + drg_code: *string + drg_description: *string + paid_amount: *float + allowed_amount: *float + charge_amount: *float + data_source: *string + file_name: *string + ingest_datetime: *datetime + + - name: raw_data__location + config: + schema: raw_data + alias: location + tags: [clinical, input_layer] + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} + column_types: + location_id: *string + npi: *string + name: *string + facility_type: *string + parent_organization: *string + address: *string + city: *string + state: *string + zip_code: *string + latitude: float + longitude: float + data_source: *string + file_name: *string + ingest_datetime: *datetime + + - name: raw_data__medication + config: + schema: raw_data + alias: medication + tags: [clinical, input_layer] + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} + column_types: + medication_id: *string + person_id: *string + patient_id: *string + encounter_id: *string + dispensing_date: date + prescribing_date: date + source_code_type: *string + source_code: *string + source_description: *string + ndc_code: *string + ndc_description: *string + rxnorm_code: *string + rxnorm_description: *string + atc_code: *string + atc_description: *string + route: *string + strength: *string + quantity: integer + quantity_unit: *string + days_supply: integer + practitioner_id: *string + data_source: *string + file_name: *string + ingest_datetime: *datetime + + - name: raw_data__practitioner + config: + schema: raw_data + alias: practitioner + tags: [clinical, input_layer] + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} + column_types: + practitioner_id: *string + npi: *string + first_name: *string + last_name: *string + practice_affiliation: *string + specialty: *string + sub_specialty: *string + data_source: *string + file_name: *string + ingest_datetime: *datetime + + - name: raw_data__procedure + config: + schema: raw_data + alias: procedure + tags: [clinical, input_layer] + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - patient_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - year_month: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - plan: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer_attributed_provider: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer_attributed_provider_practice: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer_attributed_provider_organization: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer_attributed_provider_lob: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - custom_attributed_provider: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - custom_attributed_provider_practice: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - custom_attributed_provider_organization: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - custom_attributed_provider_lob: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + procedure_id: *string + person_id: *string + patient_id: *string + encounter_id: *string + claim_id: *string + procedure_date: date + source_code_type: *string + source_code: *string + source_description: *string + normalized_code_type: *string + normalized_code: *string + normalized_description: *string + modifier_1: *string + modifier_2: *string + modifier_3: *string + modifier_4: *string + modifier_5: *string + practitioner_id: *string + data_source: *string + file_name: *string + ingest_datetime: *datetime diff --git a/integration_tests/seeds/raw_data__condition.csv b/integration_tests/seeds/raw_data__condition.csv new file mode 100644 index 000000000..911f37eb0 --- /dev/null +++ b/integration_tests/seeds/raw_data__condition.csv @@ -0,0 +1 @@ +condition_id,payer,person_id,patient_id,encounter_id,claim_id,recorded_date,onset_date,resolved_date,status,condition_type,source_code_type,source_code,source_description,normalized_code_type,normalized_code,normalized_description,condition_rank,present_on_admit_code,present_on_admit_description,data_source,file_name,ingest_datetime diff --git a/integration_tests/seeds/raw_data__encounter.csv b/integration_tests/seeds/raw_data__encounter.csv new file mode 100644 index 000000000..704a34886 --- /dev/null +++ b/integration_tests/seeds/raw_data__encounter.csv @@ -0,0 +1 @@ +encounter_id,person_id,patient_id,encounter_type,encounter_start_date,encounter_end_date,length_of_stay,admit_source_code,admit_source_description,admit_type_code,admit_type_description,discharge_disposition_code,discharge_disposition_description,attending_provider_id,attending_provider_name,facility_npi,facility_name,primary_diagnosis_code_type,primary_diagnosis_code,primary_diagnosis_description,drg_code_type,drg_code,drg_description,paid_amount,allowed_amount,charge_amount,data_source,file_name,ingest_datetime diff --git a/integration_tests/seeds/raw_data__location.csv b/integration_tests/seeds/raw_data__location.csv new file mode 100644 index 000000000..49f753d59 --- /dev/null +++ b/integration_tests/seeds/raw_data__location.csv @@ -0,0 +1 @@ +location_id,npi,name,facility_type,parent_organization,address,city,state,zip_code,latitude,longitude,data_source,file_name,ingest_datetime diff --git a/integration_tests/seeds/raw_data__medication.csv b/integration_tests/seeds/raw_data__medication.csv new file mode 100644 index 000000000..95b13eb02 --- /dev/null +++ b/integration_tests/seeds/raw_data__medication.csv @@ -0,0 +1 @@ +medication_id,person_id,patient_id,encounter_id,dispensing_date,prescribing_date,source_code_type,source_code,source_description,ndc_code,ndc_description,rxnorm_code,rxnorm_description,atc_code,atc_description,route,strength,quantity,quantity_unit,days_supply,practitioner_id,data_source,file_name,ingest_datetime diff --git a/integration_tests/seeds/patient_seed.csv b/integration_tests/seeds/raw_data__patient.csv similarity index 100% rename from integration_tests/seeds/patient_seed.csv rename to integration_tests/seeds/raw_data__patient.csv diff --git a/integration_tests/seeds/raw_data__practitioner.csv b/integration_tests/seeds/raw_data__practitioner.csv new file mode 100644 index 000000000..7f4cc4567 --- /dev/null +++ b/integration_tests/seeds/raw_data__practitioner.csv @@ -0,0 +1 @@ +practitioner_id,npi,first_name,last_name,practice_affiliation,specialty,sub_specialty,data_source,file_name,ingest_datetime diff --git a/integration_tests/seeds/raw_data__procedure.csv b/integration_tests/seeds/raw_data__procedure.csv new file mode 100644 index 000000000..69e9c87b7 --- /dev/null +++ b/integration_tests/seeds/raw_data__procedure.csv @@ -0,0 +1 @@ +procedure_id,person_id,patient_id,encounter_id,claim_id,procedure_date,source_code_type,source_code,source_description,normalized_code_type,normalized_code,normalized_description,modifier_1,modifier_2,modifier_3,modifier_4,modifier_5,practitioner_id,data_source,file_name,ingest_datetime diff --git a/integration_tests/tests/check_extension_columns_in_core_eligibility.sql b/integration_tests/tests/check_extension_columns_in_core_eligibility.sql index de63e9f3a..b36e6f294 100644 --- a/integration_tests/tests/check_extension_columns_in_core_eligibility.sql +++ b/integration_tests/tests/check_extension_columns_in_core_eligibility.sql @@ -41,7 +41,7 @@ select eligibility_id , 'x_temp_person_id does not match person_id' as failure_reason from {{ ref('core__eligibility') }} -where cast(x_temp_person_id as {{ string_type }}) <> cast(person_id as {{ string_type }}) +where cast(x_temp_person_id as {{ dbt.type_string() }}) <> cast(person_id as {{ dbt.type_string() }}) or (x_temp_person_id is null and person_id is not null) or (x_temp_person_id is not null and person_id is null) diff --git a/integration_tests/tests/check_extension_columns_in_core_medical_claim.sql b/integration_tests/tests/check_extension_columns_in_core_medical_claim.sql index 84b81bf09..57a986fbe 100644 --- a/integration_tests/tests/check_extension_columns_in_core_medical_claim.sql +++ b/integration_tests/tests/check_extension_columns_in_core_medical_claim.sql @@ -49,7 +49,7 @@ select , claim_line_number , 'x_temp_claim_id does not match claim_id' as failure_reason from {{ ref('core__medical_claim') }} -where cast(x_temp_claim_id as {{ string_type }}) <> cast(claim_id as {{ string_type }}) +where cast(x_temp_claim_id as {{ dbt.type_string() }}) <> cast(claim_id as {{ dbt.type_string() }}) or (x_temp_claim_id is null and claim_id is not null) or (x_temp_claim_id is not null and claim_id is null) @@ -72,7 +72,7 @@ select , claim_line_number , 'x_temp_payer does not match payer' as failure_reason from {{ ref('core__medical_claim') }} -where cast(x_temp_payer as {{ string_type }}) <> cast(payer as {{ string_type }}) +where cast(x_temp_payer as {{ dbt.type_string() }}) <> cast(payer as {{ dbt.type_string() }}) or (x_temp_payer is null and payer is not null) or (x_temp_payer is not null and payer is null) diff --git a/integration_tests/tests/check_extension_columns_in_core_member_months.sql b/integration_tests/tests/check_extension_columns_in_core_member_months.sql index 094e4c00e..d77ffc6a5 100644 --- a/integration_tests/tests/check_extension_columns_in_core_member_months.sql +++ b/integration_tests/tests/check_extension_columns_in_core_member_months.sql @@ -47,7 +47,7 @@ select member_month_key , 'x_temp_person_id does not match person_id' as failure_reason from {{ ref('core__member_months') }} -where cast(x_temp_person_id as {{ string_type }}) <> cast(person_id as {{ string_type }}) +where cast(x_temp_person_id as {{ dbt.type_string() }}) <> cast(person_id as {{ dbt.type_string() }}) or (x_temp_person_id is null and person_id is not null) or (x_temp_person_id is not null and person_id is null) diff --git a/integration_tests/tests/check_extension_columns_in_core_pharmacy_claim.sql b/integration_tests/tests/check_extension_columns_in_core_pharmacy_claim.sql index e91ac968e..706ed4ea2 100644 --- a/integration_tests/tests/check_extension_columns_in_core_pharmacy_claim.sql +++ b/integration_tests/tests/check_extension_columns_in_core_pharmacy_claim.sql @@ -47,7 +47,7 @@ select , claim_line_number , 'x_temp_ndc_code does not match ndc_code' as failure_reason from {{ ref('core__pharmacy_claim') }} -where cast(x_temp_ndc_code as {{ string_type }}) <> cast(ndc_code as {{ string_type }}) +where cast(x_temp_ndc_code as {{ dbt.type_string() }}) <> cast(ndc_code as {{ dbt.type_string() }}) or (x_temp_ndc_code is null and ndc_code is not null) or (x_temp_ndc_code is not null and ndc_code is null) diff --git a/models/data_marts/hcc_recapture/final_models.yml b/models/data_marts/hcc_recapture/final_models.yml index 2e35ada89..84ed1d11e 100644 --- a/models/data_marts/hcc_recapture/final_models.yml +++ b/models/data_marts/hcc_recapture/final_models.yml @@ -12,9 +12,10 @@ models: materialized: table tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - payer - - payment_year + arguments: + combination_of_columns: + - payer + - payment_year columns: - name: payer description: The name of the person (i.e. beneficiary) insurance provider. @@ -42,10 +43,11 @@ models: materialized: table tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - payer - - payment_year - - payment_year_month + arguments: + combination_of_columns: + - payer + - payment_year + - payment_year_month columns: - name: payer description: The name of the person (i.e. beneficiary) insurance provider. @@ -77,10 +79,11 @@ models: materialized: table tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - payer - - payment_year - - payment_year_month + arguments: + combination_of_columns: + - payer + - payment_year + - payment_year_month columns: - name: payer description: The name of the person (i.e. beneficiary) insurance provider. @@ -120,18 +123,19 @@ models: materialized: table tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - person_id - - payer - - data_source - - payment_year - - recorded_date - - claim_id - - hcc_code - - rendering_npi - - model_version - - hcc_hierarchy_group - - hcc_hierarchy_group_rank + arguments: + combination_of_columns: + - person_id + - payer + - data_source + - payment_year + - recorded_date + - claim_id + - hcc_code + - rendering_npi + - model_version + - hcc_hierarchy_group + - hcc_hierarchy_group_rank columns: - name: person_id description: A unique identifier for a person. @@ -205,13 +209,14 @@ models: materialized: table tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - person_id - - hcc_code - - payer - - model_version - - payment_year - - suspect_hcc_flag + arguments: + combination_of_columns: + - person_id + - hcc_code + - payer + - model_version + - payment_year + - suspect_hcc_flag columns: - name: person_id description: A unique identifier for a person. diff --git a/models/data_marts/hcc_recapture/intermediate_models.yml b/models/data_marts/hcc_recapture/intermediate_models.yml index fe1dde6dd..7c695ee06 100644 --- a/models/data_marts/hcc_recapture/intermediate_models.yml +++ b/models/data_marts/hcc_recapture/intermediate_models.yml @@ -12,19 +12,20 @@ models: materialized: table tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - person_id - - hcc_code - - data_source - - payer - - model_version - - collection_year - - hcc_hierarchy_group - - recorded_date - - rendering_npi - - claim_id - - condition_type - - reason + arguments: + combination_of_columns: + - person_id + - hcc_code + - data_source + - payer + - model_version + - collection_year + - hcc_hierarchy_group + - recorded_date + - rendering_npi + - claim_id + - condition_type + - reason columns: - name: person_id description: A unique identifier for a person. @@ -85,19 +86,20 @@ models: materialized: table tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - person_id - - hcc_code - - data_source - - payer - - model_version - - collection_year - - hcc_hierarchy_group - - recorded_date - - rendering_npi - - claim_id - - condition_type - - suspect_hcc_flag + arguments: + combination_of_columns: + - person_id + - hcc_code + - data_source + - payer + - model_version + - collection_year + - hcc_hierarchy_group + - recorded_date + - rendering_npi + - claim_id + - condition_type + - suspect_hcc_flag columns: - name: person_id description: A unique identifier for a person. @@ -160,14 +162,15 @@ models: materialized: table tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - person_id - - hcc_code - - payer - - model_version - - payment_year - - hcc_hierarchy_group - - suspect_hcc_flag + arguments: + combination_of_columns: + - person_id + - hcc_code + - payer + - model_version + - payment_year + - hcc_hierarchy_group + - suspect_hcc_flag columns: - name: person_id description: A unique identifier for a person. diff --git a/models/data_marts/hcc_recapture/staging_models.yml b/models/data_marts/hcc_recapture/staging_models.yml index 91664e7dd..0f659e3f8 100644 --- a/models/data_marts/hcc_recapture/staging_models.yml +++ b/models/data_marts/hcc_recapture/staging_models.yml @@ -14,12 +14,13 @@ models: materialized: table tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - model_version - - hcc_code - - hcc_hierarchy_group - - hcc_hierarchy_group_rank - - risk_model_code + arguments: + combination_of_columns: + - model_version + - hcc_code + - hcc_hierarchy_group + - hcc_hierarchy_group_rank + - risk_model_code columns: - name: model_version description: > @@ -54,10 +55,11 @@ models: materialized: table tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - person_id - - collection_year - - payer + arguments: + combination_of_columns: + - person_id + - collection_year + - payer columns: - name: person_id description: A unique identifier for a person. diff --git a/seeds/synthetic_data/synthetic_data_seeds.yml b/seeds/synthetic_data/synthetic_data_seeds.yml index 9bcef603d..4afad7cdf 100644 --- a/seeds/synthetic_data/synthetic_data_seeds.yml +++ b/seeds/synthetic_data/synthetic_data_seeds.yml @@ -1,5 +1,20 @@ version: 2 +anchors: + - &string | + {%- if target.type in ("bigquery", "databricks") -%} string + {%- else -%} varchar(255) + {%- endif -%} + - &datetime | + {%- if target.type == "fabric" -%} datetime2(0) + {%- elif target.type in ("athena", "databricks") -%} timestamp + {%- else -%} datetime + {%- endif -%} + - &float | + {%- if target.type in ("athena", "databricks") -%} real + {%- else -%} float + {%- endif -%} + seeds: - name: synthetic_data__appointment config: @@ -9,73 +24,42 @@ seeds: tags: - synthetic_data - clinical - enabled: true + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - appointment_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - patient_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - encounter_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_appointment_type_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_appointment_type_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_appointment_type_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_appointment_type_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - start_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} - end_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} + appointment_id: *string + person_id: *string + patient_id: *string + encounter_id: *string + source_appointment_type_code: *string + source_appointment_type_description: *string + normalized_appointment_type_code: *string + normalized_appointment_type_description: *string + start_datetime: *datetime + end_datetime: *datetime duration: integer - location_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - practitioner_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_status: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_status: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - appointment_specialty: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - reason: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_reason_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_reason_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_reason_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_reason_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_reason_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_reason_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - cancellation_reason: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_cancellation_reason_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_cancellation_reason_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_cancellation_reason_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_cancellation_reason_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_cancellation_reason_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_cancellation_reason_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} + location_id: *string + practitioner_id: *string + source_status: *string + normalized_status: *string + appointment_specialty: *string + reason: *string + source_reason_code_type: *string + source_reason_code: *string + source_reason_description: *string + normalized_reason_code_type: *string + normalized_reason_code: *string + normalized_reason_description: *string + cancellation_reason: *string + source_cancellation_reason_code_type: *string + source_cancellation_reason_code: *string + source_cancellation_reason_description: *string + normalized_cancellation_reason_code_type: *string + normalized_cancellation_reason_code: *string + normalized_cancellation_reason_description: *string + data_source: *string + file_name: *string + ingest_datetime: *datetime - name: synthetic_data__eligibility config: @@ -85,84 +69,52 @@ seeds: tags: - synthetic_data - claims - enabled: true + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - member_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - subscriber_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - gender: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - race: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + person_id: *string + member_id: *string + subscriber_id: *string + gender: *string + race: *string birth_date: date death_date: date death_flag: integer enrollment_start_date: date enrollment_end_date: date - payer: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - plan: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - original_reason_entitlement_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - dual_status_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - medicare_status_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - group_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - group_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - name_suffix: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - first_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - middle_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - last_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - social_security_number: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - subscriber_relation: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - address: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - city: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - state: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - zip_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - phone: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - email: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - ethnicity: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + payer: *string + payer_type: *string + plan: *string + original_reason_entitlement_code: *string + dual_status_code: *string + medicare_status_code: *string + group_id: *string + group_name: *string + name_suffix: *string + first_name: *string + middle_name: *string + last_name: *string + social_security_number: *string + subscriber_relation: *string + address: *string + city: *string + state: *string + zip_code: *string + phone: *string + email: *string + ethnicity: *string + data_source: *string + file_name: *string file_date: date - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} - enrollment_status: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + ingest_datetime: *datetime + enrollment_status: *string hospice_flag: integer - snp_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + snp_type: *string medicaid_indicator: integer long_term_institutional_flag: integer - part_d_raf_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + part_d_raf_type: *string low_income_subsidy_indicator: integer - metal_level: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + metal_level: *string csr_indicator: integer enrollment_duration_months: integer esrd_status: integer @@ -176,53 +128,32 @@ seeds: tags: - synthetic_data - clinical - enabled: true + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - immunization_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - patient_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - encounter_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - status: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - status_reason: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + immunization_id: *string + person_id: *string + patient_id: *string + encounter_id: *string + status: *string + status_reason: *string occurrence_date: date - source_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_dose: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_dose: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - lot_number: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - body_site: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - route: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - location_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - practitioner_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} + source_code_type: *string + source_code: *string + source_description: *string + normalized_code_type: *string + normalized_code: *string + normalized_description: *string + source_dose: *string + normalized_dose: *string + lot_number: *string + body_site: *string + route: *string + location_id: *string + practitioner_id: *string + data_source: *string + file_name: *string + ingest_datetime: *datetime - name: synthetic_data__lab_result config: @@ -232,74 +163,43 @@ seeds: tags: - synthetic_data - clinical - enabled: true + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - lab_result_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - patient_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - encounter_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - accession_number: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_order_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_order_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_order_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_component_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_component_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_component_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_order_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_order_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_order_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_component_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_component_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_component_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - status: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - result: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - result_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} - collection_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} - source_units: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_units: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_reference_range_low: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_reference_range_high: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_reference_range_low: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_reference_range_high: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + lab_result_id: *string + person_id: *string + patient_id: *string + encounter_id: *string + accession_number: *string + source_order_type: *string + source_order_code: *string + source_order_description: *string + source_component_type: *string + source_component_code: *string + source_component_description: *string + normalized_order_type: *string + normalized_order_code: *string + normalized_order_description: *string + normalized_component_type: *string + normalized_component_code: *string + normalized_component_description: *string + status: *string + result: *string + result_datetime: *datetime + collection_datetime: *datetime + source_units: *string + normalized_units: *string + source_reference_range_low: *string + source_reference_range_high: *string + normalized_reference_range_low: *string + normalized_reference_range_high: *string source_abnormal_flag: integer normalized_abnormal_flag: integer - specimen: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - ordering_practitioner_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} + specimen: *string + ordering_practitioner_id: *string + data_source: *string + file_name: *string + ingest_datetime: *datetime - name: synthetic_data__medical_claim config: schema: | @@ -308,235 +208,127 @@ seeds: tags: - synthetic_data - claims - enabled: true + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - claim_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + claim_id: *string claim_line_number: integer - claim_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - member_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - plan: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + claim_type: *string + person_id: *string + member_id: *string + payer: *string + plan: *string claim_start_date: date claim_end_date: date claim_line_start_date: date claim_line_end_date: date admission_date: date discharge_date: date - admit_source_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - admit_type_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - discharge_disposition_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - place_of_service_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - bill_type_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - drg_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - drg_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - revenue_center_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + admit_source_code: *string + admit_type_code: *string + discharge_disposition_code: *string + place_of_service_code: *string + bill_type_code: *string + drg_code_type: *string + drg_code: *string + revenue_center_code: *string service_unit_quantity: integer - hcpcs_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - hcpcs_modifier_1: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - hcpcs_modifier_2: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - hcpcs_modifier_3: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - hcpcs_modifier_4: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - hcpcs_modifier_5: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - rendering_npi: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - rendering_tin: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - billing_npi: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - billing_tin: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - facility_npi: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + hcpcs_code: *string + hcpcs_modifier_1: *string + hcpcs_modifier_2: *string + hcpcs_modifier_3: *string + hcpcs_modifier_4: *string + hcpcs_modifier_5: *string + rendering_npi: *string + rendering_tin: *string + billing_npi: *string + billing_tin: *string + facility_npi: *string paid_date: date - paid_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - allowed_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - charge_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - coinsurance_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - copayment_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - deductible_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - total_cost_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - diagnosis_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_1: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_2: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_3: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_4: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_5: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_6: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_7: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_8: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_9: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_10: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_11: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_12: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_13: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_14: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_15: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_16: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_17: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_18: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_19: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_20: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_21: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_22: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_23: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_24: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_code_25: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_1: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_2: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_3: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_4: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_5: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_6: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_7: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_8: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_9: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_10: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_11: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_12: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_13: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_14: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_15: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_16: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_17: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_18: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_19: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_20: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_21: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_22: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_23: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_24: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - diagnosis_poa_25: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_1: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_2: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_3: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_4: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_5: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_6: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_7: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_8: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_9: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_10: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_11: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_12: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_13: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_14: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_15: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_16: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_17: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_18: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_19: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_20: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_21: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_22: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_23: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_24: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - procedure_code_25: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + paid_amount: *float + allowed_amount: *float + charge_amount: *float + coinsurance_amount: *float + copayment_amount: *float + deductible_amount: *float + total_cost_amount: *float + diagnosis_code_type: *string + diagnosis_code_1: *string + diagnosis_code_2: *string + diagnosis_code_3: *string + diagnosis_code_4: *string + diagnosis_code_5: *string + diagnosis_code_6: *string + diagnosis_code_7: *string + diagnosis_code_8: *string + diagnosis_code_9: *string + diagnosis_code_10: *string + diagnosis_code_11: *string + diagnosis_code_12: *string + diagnosis_code_13: *string + diagnosis_code_14: *string + diagnosis_code_15: *string + diagnosis_code_16: *string + diagnosis_code_17: *string + diagnosis_code_18: *string + diagnosis_code_19: *string + diagnosis_code_20: *string + diagnosis_code_21: *string + diagnosis_code_22: *string + diagnosis_code_23: *string + diagnosis_code_24: *string + diagnosis_code_25: *string + diagnosis_poa_1: *string + diagnosis_poa_2: *string + diagnosis_poa_3: *string + diagnosis_poa_4: *string + diagnosis_poa_5: *string + diagnosis_poa_6: *string + diagnosis_poa_7: *string + diagnosis_poa_8: *string + diagnosis_poa_9: *string + diagnosis_poa_10: *string + diagnosis_poa_11: *string + diagnosis_poa_12: *string + diagnosis_poa_13: *string + diagnosis_poa_14: *string + diagnosis_poa_15: *string + diagnosis_poa_16: *string + diagnosis_poa_17: *string + diagnosis_poa_18: *string + diagnosis_poa_19: *string + diagnosis_poa_20: *string + diagnosis_poa_21: *string + diagnosis_poa_22: *string + diagnosis_poa_23: *string + diagnosis_poa_24: *string + diagnosis_poa_25: *string + procedure_code_type: *string + procedure_code_1: *string + procedure_code_2: *string + procedure_code_3: *string + procedure_code_4: *string + procedure_code_5: *string + procedure_code_6: *string + procedure_code_7: *string + procedure_code_8: *string + procedure_code_9: *string + procedure_code_10: *string + procedure_code_11: *string + procedure_code_12: *string + procedure_code_13: *string + procedure_code_14: *string + procedure_code_15: *string + procedure_code_16: *string + procedure_code_17: *string + procedure_code_18: *string + procedure_code_19: *string + procedure_code_20: *string + procedure_code_21: *string + procedure_code_22: *string + procedure_code_23: *string + procedure_code_24: *string + procedure_code_25: *string procedure_date_1: date procedure_date_2: date procedure_date_3: date @@ -563,13 +355,10 @@ seeds: procedure_date_24: date procedure_date_25: date in_network_flag: integer - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + data_source: *string + file_name: *string file_date: date - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} + ingest_datetime: *datetime - name: synthetic_data__observation config: @@ -579,53 +368,32 @@ seeds: tags: - synthetic_data - clinical - enabled: true + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - observation_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - patient_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - encounter_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - panel_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + observation_id: *string + person_id: *string + patient_id: *string + encounter_id: *string + panel_id: *string observation_date: date - observation_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_code_type: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_description: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - result: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_units: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_units: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_reference_range_low: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - source_reference_range_high: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_reference_range_low: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - normalized_reference_range_high: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} + observation_type: *string + source_code_type: *string + source_code: *string + source_description: *string + normalized_code_type: *string + normalized_code: *string + normalized_description: *string + result: *string + source_units: *string + normalized_units: *string + source_reference_range_low: *string + source_reference_range_high: *string + normalized_reference_range_low: *string + normalized_reference_range_high: *string + data_source: *string + file_name: *string + ingest_datetime: *datetime - name: synthetic_data__pharmacy_claim config: @@ -635,50 +403,34 @@ seeds: tags: - synthetic_data - claims - enabled: true + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - claim_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + claim_id: *string claim_line_number: integer - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - member_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - plan: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - prescribing_provider_npi: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - dispensing_provider_npi: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + person_id: *string + member_id: *string + payer: *string + plan: *string + prescribing_provider_npi: *string + dispensing_provider_npi: *string dispensing_date: date - ndc_code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + ndc_code: *string quantity: integer days_supply: integer refills: integer paid_date: date - paid_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - allowed_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - charge_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - coinsurance_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - copayment_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} - deductible_amount: | - {%- if target.type in ("athena", "databricks") -%} real {%- else -%} float {%- endif -%} + paid_amount: *float + allowed_amount: *float + charge_amount: *float + coinsurance_amount: *float + copayment_amount: *float + deductible_amount: *float in_network_flag: integer - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - file_name: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + data_source: *string + file_name: *string file_date: date - ingest_datetime: | - {%- if target.type in ("fabric") -%} datetime2(0) {%- elif target.type in ("athena", "databricks") -%} timestamp {%- else -%} datetime {%- endif -%} + ingest_datetime: *datetime - name: synthetic_data__provider_attribution config: @@ -688,33 +440,20 @@ seeds: tags: - synthetic_data - provider_attribution - enabled: true + enabled: | + {% if var('use_synthetic_data') == true -%} {{ true|as_bool }} {%- else -%} {{ false|as_bool }} {%- endif -%} column_types: - person_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - patient_id: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - year_month: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - plan: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - data_source: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer_attributed_provider: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer_attributed_provider_practice: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer_attributed_provider_organization: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - payer_attributed_provider_lob: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - custom_attributed_provider: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - custom_attributed_provider_practice: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - custom_attributed_provider_organization: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} - custom_attributed_provider_lob: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%} + person_id: *string + patient_id: *string + year_month: *string + payer: *string + plan: *string + data_source: *string + payer_attributed_provider: *string + payer_attributed_provider_practice: *string + payer_attributed_provider_organization: *string + payer_attributed_provider_lob: *string + custom_attributed_provider: *string + custom_attributed_provider_practice: *string + custom_attributed_provider_organization: *string + custom_attributed_provider_lob: *string